:root {
    --bg-canvas: #666666;
    --card-border-gold: #cca370;
    --card-top-bg: #333333;
    --card-bottom-bg: #ffffff;
    --text-dark: #1a1a1a;
    --btn-brown-bg: #8c7152;
    --btn-brown-hover: #a38563;
    --btn-disabled-bg: #a6a6a6;
    --btn-text-white: #ffffff;

    --bg-outer: #beae9a;
    --bg-card: #221c17;
    --header-tag-bg: #806f60;
    --header-title-bg: #cbbba5;
    --header-tag-color: #ffffff;
    --header-title-color: #826e5a;
    --section-banner-bg: #8c7152;
    --item-card-bg: #ffffff;
    --item-card-border: #caa97f;
    --badge-dark-bg: #2d2a26;
    --text-muted: #554a41;
    --img-placeholder-bg: #d8d8d8;

    --font-main: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
    --ease-hover: cubic-bezier(0.25, 1, 0.3, 1);
}

#section-1 {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 0 0 3cqw;
    width: 100%;
    height: auto;
    align-items: center;
}

#section-2,
#section-3 {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: auto;
}

#section-3 {
    padding: 9cqw 0;
}

.ti-s3 {
    margin-bottom: 1cqw;
}


.step-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75cqw;
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    font-size: 1.0rem;
    line-height: 1.3;
}

.step-badge {
    color: var(--step-badge-gold);
    font-weight: 600;
    letter-spacing: 1px;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: Arial, var(--font-main);
}

.step-divider {
    color: var(--step-divider-color);
    font-weight: 300;
    user-select: none;
    flex-shrink: 0;
    opacity: 0.85;
}

.step-text {
    color: #fff;
    flex: 1;
    letter-spacing: 0.3px;
    text-align: justify;
    word-break: break-word;
}


.activity-rules {
    display: flex;
    flex-direction: column;
    gap: 0.5cqw;
}
.rule-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5cqw;
    font-size: 1.02rem;
    line-height: 1.7;
}
.rule-label {
    color: var(--label-gold);
    font-weight: 500;
    letter-spacing: 1.5px;
    white-space: nowrap;
    flex-shrink: 0;
}
.rule-divider {
    color: var(--divider-color);
    font-weight: 300;
    user-select: none;
    flex-shrink: 0;
    opacity: 0.8;
}

.rule-subtext {
    display: block;
    margin-top: 4px;
    opacity: 0.9;
}

.is-warning {
    transition: 0.2s ease;
}


.is-warning:hover {
    text-decoration: none;
        color: #fadfc5;
}


.rule-content {
    color: #fff;
    flex: 1;
    letter-spacing: 0.3px;
}
.rule-steps {
    list-style: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5cqw;
    padding-left: 1cqw;
}
.rule-steps li {
    text-align: justify;
    word-break: break-word;
}



.boss-event-container {
    width: 63%;
    display: flex;
    flex-direction: column;
    gap: 3cqw;
}

.boss-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3cqw;
    width: 100%;
}

.boss-card {
    background-color: var(--card-bottom-bg);
    border: 2px solid var(--card-border-gold);
    display: flex;
    flex-direction: column;
}

.boss-img-box {
    width: 100%;
    height: auto;
    background-color: var(--card-top-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: 2px;
    overflow: hidden;
    position: relative;
}

.boss-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
    user-select: none;
}

.boss-info-box {
    padding: 1.5cqw;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1cqw;
    background-color: var(--card-bottom-bg);
}

.boss-title {
    color: #42372c;
    font-size: 1.15rem;
    font-weight: 500;
    text-align: center;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.boss-btn-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1cqw;
}

.boss-btn {
    width: 100%;
    padding: 0.6cqw 0;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 1px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    appearance: none;
    -webkit-appearance: none;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.boss-btn.btn-active {
    background-color: var(--btn-brown-bg);
    color: var(--btn-text-white);
}

.boss-btn.btn-active:hover {
    background-color: var(--btn-brown-hover);
}

.boss-btn.btn-disabled {
    background-color: var(--btn-disabled-bg);
    color: var(--btn-text-white);
    cursor: not-allowed;
    opacity: 0.9;
}


.bottom-action-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5cqw;
    width: 90%;
    margin: 0 auto;
}

.action-link-btn {
    width: 100%;
    background-color: var(--btn-brown-bg);
    color: var(--btn-text-white);
    height: 4cqw;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: 400;
    letter-spacing: 1px;
    border-bottom: 4px solid #6f5236;
    transition: background-color 0.2s ease, transform 0.2s ease;
    box-sizing: border-box;
}

.action-link-btn:hover {
    background-color: var(--btn-brown-hover);
    transform: translateY(-2px);
    text-decoration: none;
}

.action-link-btn .arrow-icon {
    font-family: Arial, sans-serif;
    font-size: 1.1rem;
    transition: transform 0.2s ease;
}

.action-link-btn:hover .arrow-icon {
    transform: translateX(4px);
}


.directory-card-s3 {
    width: 63%;
    margin: 0;
}

.directory-body.p3event {
    padding: 3cqw;
}

.section-banner {
    background-color: var(--section-banner-bg);
    color: #ffffff;
    font-weight: 600;
    padding: 0.6cqw 0;
    font-size: 1.4rem;
    letter-spacing: 1.5px;
    text-align: center;
}

.section-banner span.sub-note {
    font-size: 1rem;
    font-weight: 400;
    margin-left: 6px;
}

.white-card {
    background-color: var(--item-card-bg);
    border: 2px solid var(--item-card-border);
    position: relative;
    transition: transform 0.25s var(--ease-hover), box-shadow 0.25s ease;
    transform: translateZ(0);
}

.white-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), 0 0 12px rgba(202, 169, 127, 0.4);
}

.first-rewards-section {
    display: flex;
    gap: 20px;
    position: relative;
}

.first-rewards-main {
    width: 67%;
    display: flex;
    flex-direction: column;
    gap: 1.5cqw;
    margin-bottom: 2cqw;
    z-index: 2;
}

.first-cards-flex {
    display: flex;
    gap: 2cqw;
}

.card-first-large {
    flex: 1;
    padding: 1.2cqw;
    display: flex;
    gap: 1cqw;
    align-items: flex-start;
}

.card-first-large .img-placeholder-lg {
    width: 7.297cqw;
    height: auto;
    flex-shrink: 0;
}

.card-first-large .info-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card-first-large .item-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.3;
}

.card-first-large .badge-account {
    display: inline-block;
    background-color: #493d2d;
    color: #ffffff;
    font-size: 0.95rem;
    line-height: 1.5;
    padding: 0.1cqw 0.4cqw;
    align-self: flex-start;
    letter-spacing: 0.5px;
}

.card-first-large .item-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.5;
    text-align: justify;
    margin-top: 0.3cqw;
}

.card-first-square {
    width: 9cqw;
    flex-shrink: 0;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
}

.card-first-square .img-placeholder-sm {
    width: 5cqw;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5cqw;
}

.card-first-square .item-name {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-dark);
    line-height: 1.3;
}

.character-png-wrapper {
    position: absolute;
    right: -3.75cqw;
    bottom: -1cqw;
    width: 21.313cqw;
    height: auto;
    z-index: 1;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.character-png-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: right center;
}

.bottom-rewards-section {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 2cqw;
    width: 100%;
}

.reward-sub-group {
    display: flex;
    flex-direction: column;
    gap: 1.5cqw;
    z-index: 2;
}

.grid-3-items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2cqw;
    list-style: none;
}

.grid-2-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2cqw;
    list-style: none;
}

.reward-item-card {
    padding: 32px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
}

.reward-item-card .icon-box {
    width: 5cqw;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5cqw;
}

.reward-item-card .item-name {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-dark);
    line-height: 1.35;
    word-break: break-word;
}

@media (max-width: 900px) {
    .boss-card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 860px) {
    .first-rewards-main {
        width: 100%;
    }
    .character-png-wrapper {
        position: relative;
        right: auto;
        top: auto;
        width: 100%;
        height: 180px;
        margin-top: 10px;
    }
    .first-rewards-section {
        flex-direction: column;
    }
    .bottom-rewards-section {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 768px) {
    .boss-event-container,
    .directory-card-s3 {
        width: 90%;
        margin: 4vw 0;
        gap: 5vw;
    }

    #section-1 {
        padding-bottom: 5vw;
    }
    #section-3 {
        padding: 8vw 0;
    }
    .directory-body.p3event {
        padding: 7vw;
    }

    .step-list {
        gap: 12px;
    }
    .step-item {
        display: flex !important;
        flex-direction: row !important;
        align-items: flex-start !important;
        gap: 10px !important;
        font-size: 0.88rem;
        line-height: 1.55;
    }

    .step-badge {
        font-size: 0.9rem !important;
        white-space: nowrap !important;
        width: auto !important;
        border-bottom: none !important;
        padding-bottom: 0 !important;
        flex-shrink: 0 !important;
    }

    .step-divider {
        display: inline-block !important;
        flex-shrink: 0 !important;
    }

    .step-text {
        font-size: 0.88rem;
        padding-bottom: 4px;
        width: 100%;
        flex: 1 !important;
        min-width: 0 !important;
        word-break: break-word !important;
    }

    .boss-card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .boss-img-box {
        height: auto;
    }
    .boss-info-box {
        padding: 3vw 2.5vw;
        gap: 8px;
    }
    .boss-title {
        font-size: 0.9rem;
        white-space: normal;
        line-height: 1.35;
    }
    .boss-btn-group {
        gap: 6px;
    }
    .boss-btn {
        height: 38px;
        padding: 0;
        font-size: 0.85rem;
    }


    .activity-rules {
        gap: 12px;
    }
    .rule-row {
        display: flex !important;
        flex-direction: row !important;
        align-items: flex-start !important;
        gap: 10px !important;
        font-size: 0.88rem;
    }
    .rule-label {
        font-size: 0.88rem !important;
        white-space: nowrap !important;
        width: auto !important;
        border-bottom: none !important;
        padding-bottom: 0 !important;
        flex-shrink: 0 !important;
    }
    .rule-divider {
        display: inline-block !important;
        flex-shrink: 0 !important;
    }
    .rule-content {
        flex: 1 !important;
        min-width: 0 !important;
        word-break: break-word !important;
    }
    .rule-steps {
        gap: 8px;
        padding-left: 18px;
    }







    .bottom-action-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        width: 100%;
        gap: 4vw;
    }

    .action-link-btn {
        width: 100%;
        height: 44px;
        font-size: 0.95rem;
        border-bottom-width: 3px;
    }

    .bottom-action-grid .action-link-btn:nth-child(3) {
        grid-column: 1 / -1;
        justify-self: center;
        width: calc(50% - 5px);
    }

    .section-banner {
        font-size: 1.05rem;
        padding: 2vw 0;
        letter-spacing: 1px;
    }
    .section-banner span.sub-note {
        font-size: 0.8rem;
    }

    .first-rewards-section {
        flex-direction: column;
        gap: 0;
    }
    .first-rewards-main {
        width: 100%;
        gap: 4vw;
        margin-bottom: 0;
    }
    .first-cards-flex {
        flex-direction: column;
        gap: 3vw;
    }
    .card-first-large {
        padding: 3.5vw;
        gap: 3vw;
    }
    .card-first-large .img-placeholder-lg {
        width: 17vw;
        height: auto;
    }
    .card-first-large .item-title {
        font-size: 1rem;
    }
    .card-first-large .badge-account {
        font-size: 0.8rem;
        padding: 2px 6px;
    }
    .card-first-large .item-desc {
        font-size: 0.8rem;
        line-height: 1.45;
    }

    .card-first-square {
        width: 100%;
        padding: 3vw 4vw;
        box-sizing: border-box;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
    }

    .card-first-square .img-placeholder-sm {
        width: 17vw;
        height: auto;
        margin-bottom: 0;
    }
    .card-first-square .item-name {
        font-size: 0.85rem;
        text-align: left;
    }
    .character-png-wrapper {
        display: none;
    }

    .bottom-rewards-section {
        grid-template-columns: 1fr;
        gap: 7vw;
        margin-top: 7vw;
    }
    .reward-sub-group {
        gap: 4vw;
    }
    .grid-2-items,
    .grid-3-items {
        grid-template-columns: repeat(2, 1fr);
        gap: 3vw;
    }
    .reward-item-card {
        padding: 5vw 0;
    }
    .reward-item-card .icon-box {
        width: 17vw;
        height: auto;
        margin-bottom: 2vw;
    }
    .reward-item-card .item-name {
        font-size: 0.78rem;
        line-height: 1.35;
    }
}

@media (max-width: 580px) {
    .boss-title {
        font-size: 0.9rem;
    }
}

@media (max-width: 520px) {
    .first-cards-flex {
        flex-direction: column;
    }
    .card-first-square {
        width: 100%;
    }
    .grid-3-items {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 480px) {
    .step-item {
        flex-direction: column !important;
        gap: 6px !important;
    }
    .step-divider {
        display: none !important;
    }
    .step-badge {
        width: 100% !important;
        border-bottom: 1px solid rgba(212, 163, 115, 0.4) !important;
        padding-bottom: 4px !important;
    }


    .rule-row {
        flex-direction: column !important;
        gap: 6px !important;
    }
    .rule-divider {
        display: none !important;
    }
    .rule-label {
        width: 100% !important;
        border-bottom: 1px solid rgba(212, 163, 115, 0.4) !important;
        padding-bottom: 4px !important;
    }

}


@supports (-webkit-touch-callout: none) {
    .action-link-btn,
    .boss-btn,
    .white-card {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
    }

    .action-link-btn,
    .boss-card {
        -webkit-transform: translateZ(0);
    }
}
