@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;600;700;800&display=swap");

:root {
    --btn-bg: #4a2914;
    --text-dark: #29180c;
    --text-red: #d75e5e;
    --text-popup: #686868;

    --form-bg: #ffffff;
    --label-color: #5e5853;
    --input-bg: #e3d8ce;
    --placeholder-color: #ffffff;
    --active-green: #73e852;
    --border-radius-pill: 999px;
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft JhengHei", sans-serif;

    --border-dark: #191411;
    --header-bg: #8d7156;
    --cell-bg: #ffffff;
    --text-header: #ffffff;
    --text-main: #1f1f1f;
    --text-highlight: #ff8a38;
}

.popup-overlay {
    display: flex;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000e3;
    z-index: 98;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(2px);
}

.popup-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.popup-close {
    position: absolute;
    width: 2.813cqw;
    height: auto;
    top: 1cqw;
    right: 1cqw;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 99;
    transform: skew(0deg);
    transition: 0.3s;
}

.popup-close:hover {
    filter: brightness(1.2);
    transform: scale(0.95);
}

.popup-box {
    position: relative;
    width: auto;
    height: auto;
    color: aliceblue;
    display: flex;
    align-items: center;
    justify-content: center;
}

#popup_box.animate__animated {
    animation-duration: 0.7s;
}

.popup_main {
    display: flex;
    flex-direction: column;
    position: relative;
    width: auto;
    height: auto;
    margin: 0;
    color: #464141;
    overflow: hidden;
    justify-content: center;
    align-items: center;
}

.popup-title {
    width: 100%;
    padding: 1.5cqw 0;
    background-color: #862e00cc;
    background-image: url("../img/wood.jpg");
    background-size: auto;
    background-repeat: repeat;
    color: #fff;
    font-weight: 900;
    letter-spacing: 0.156cqw;
    font-size: 1.458cqw;
    text-align: center;
}

.popup-text01 {
    position: relative;
    width: auto;
    margin-top: 2cqw;
    padding: 1.5% 18%;
    font-size: 1.083cqw;
    line-height: 1.5;
    letter-spacing: 0.052cqw;
    color: #fff;
    background-color: var(--btn-bg);
    border-radius: 50cqw;
}


#popup-content-bio::-webkit-scrollbar,
#popup-content-gift::-webkit-scrollbar,
#popup-content-notice2::-webkit-scrollbar,
#popup-content-notice::-webkit-scrollbar,
#popup-content-yt::-webkit-scrollbar {
    width: 1.2cqw;
}

#popup-content-bio::-webkit-scrollbar-track,
#popup-content-gift::-webkit-scrollbar-track,
#popup-content-notice2::-webkit-scrollbar-track,
#popup-content-notice::-webkit-scrollbar-track,
#popup-content-yt::-webkit-scrollbar-track {
    background: transparent;
    margin: 1.5cqw 0;
}

#popup-content-bio::-webkit-scrollbar-thumb,
#popup-content-gift::-webkit-scrollbar-thumb,
#popup-content-notice2::-webkit-scrollbar-thumb,
#popup-content-notice::-webkit-scrollbar-thumb,
#popup-content-yt::-webkit-scrollbar-thumb {
    background-color: #937558;
    border: 0.5cqw solid transparent;
    background-clip: padding-box;
    transition: background-color 0.2s ease;
}

#popup-content-bio::-webkit-scrollbar-thumb:hover,
#popup-content-gift::-webkit-scrollbar-thumb:hover,
#popup-content-notice2::-webkit-scrollbar-thumb:hover,
#popup-content-notice::-webkit-scrollbar-thumb:hover,
#popup-content-yt::-webkit-scrollbar-thumb:hover {
    background-color: #a88462;
}

#popup-content-yt {
    position: relative;
    display: flex;
    height: auto;
    max-height: 63vh;
    background-color: #2e251c;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2cqw;
    align-items: center;
    width: 46cqw;
}

#popup-content-notice {
    position: relative;
    display: flex;
    height: auto;
    max-height: 60vh;
    background-color: #2e251c;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2cqw;
    align-items: flex-start;
    width: 40cqw;
    flex-direction: column;
}

#popup-content-notice2 {
    position: relative;
    display: flex;
    height: auto;
    max-height: 60vh;
    background-color: #2e251c;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2cqw;
    align-items: flex-start;
    width: 36.746cqw;
    flex-direction: column;
}

#popup-content-gift {
    position: relative;
    display: flex;
    height: auto;
    max-height: 60vh;
    background-color: #2e251c;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2cqw;
    align-items: flex-start;
    width: 33cqw;
}

#popup-content-bio {
    position: relative;
    width: 50cqw;
    height: auto;
    max-height: 60vh;
    background-color: #2e251c;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2cqw;
    container-type: inline-size;
}

.bio-box {
    position: relative;
    width: 100%;
    display: grid;
    grid-template-columns: 37cqw 1fr;
    gap: 3.5cqw;
    align-items: flex-start;
}

.bio-img {
    width: 100%;
}

.bio-img img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.bio-text {
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: #ffffff;
    min-width: 0;
}

.bio-title {
    color: #dbba9a;
    font-size: 1.3rem;
    font-weight: 600;
}

.notice-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: notice-counter;
}

.notice-list li {
    counter-increment: notice-counter;
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.2cqw;
    font-size: clamp(0.729cqw, 1.2cqw, 0.833cqw);
    line-height: 1.65;
    color: #ffffff;
    padding: 0.208cqw 0.416cqw;
    border-radius: 0.416cqw;
    transition: background-color 0.2s ease;
}

.notice-list li:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.notice-list li::before {
    content: counter(notice-counter) ".";
    flex-shrink: 0;
    width: 1.8em;
    margin-right: 0.208cqw;
    text-align: left;
}

.notice-list li p {
    margin: 0;
    flex: 1;
    word-break: break-word;
}

.is-warning,
.notice-list li.is-warning,
.notice-list li.is-warning::before {
    color: #e9c8a8;
    font-weight: bold;
}

.text-qa {
    color: var(--text-red);
    font-weight: 500;
    text-decoration: none;
    font-size: 0.916cqw;
}

.text-qa:hover {
    color: #e77474;
}

.ex-card {
    width: 99.93%;
    margin-top: 1.5cqw;
    /* margin-bottom: 1.5cqw; */
    font-size: 1.15rem;
    line-height: 3;
}

.notice02-text1 {
    color: #e9c8a8;
}

.notice02-text2 {
    color: #fff;
}

.history-log-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5cqw;
}

.record-card {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 2px solid var(--border-dark);
    background-color: var(--border-dark);
    gap: 2px;
}

.log-header {
    background-color: var(--header-bg);
    color: var(--text-header);
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 2px;
    text-align: center;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.log-cell {
    background-color: var(--cell-bg);
    color: var(--text-main);
    font-size: 0.98rem;
    font-weight: 400;
    text-align: center;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.5;
    word-break: break-word;
}

.span-full {
    grid-column: 1 / -1;
}

.highlight-item {
    color: var(--text-highlight);
    font-weight: 700;
}

.popup-video-content {
    background-color: #221c17;
    padding: 24px 28px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.video-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000000;
    position: relative;
    overflow: hidden;
}

.video-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.video-caption-box {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
    user-select: none;
}

.video-boss-name {
    color: #ebd1ab;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.video-conquest-time {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.8px;
}

@media screen and (max-width: 768px) {
    .popup-overlay {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.88);
        z-index: 98;
        justify-content: center;
        align-items: center;
        padding: 16px 10px;
        box-sizing: border-box;
    }

    .popup-close {
        position: absolute;
        width: 36px;
        height: 36px;
        top: 10px;
        right: 10px;
        z-index: 100;
        background: none;
        border: none;
        cursor: pointer;
        transform: skew(0deg);
        padding: 0;
    }

    .popup-box {
        width: 92vw;
        max-width: 500px;
        position: relative;
        margin: 0 auto;
        height: auto;
        color: aliceblue;
    }

    .popup_main {
        display: flex;
        padding: 0;
        flex-direction: column;
        position: relative;
        width: 100%;
        height: auto;
        margin: 0 auto;
        color: #fff;
        overflow: hidden;
        justify-content: center;
        align-items: center;
    }

    #popup-content-bio,
    #popup-content-gift,
    #popup-content-notice,
    #popup-content-notice2,
    #popup-content-yt {
        width: 100%;
        max-height: 55vh;
        box-sizing: border-box;
        padding: 4vw 3.5vw;
        -webkit-overflow-scrolling: touch;
    }

    #popup-content-gift,
    #popup-content-notice {
        max-height: 65vh;
    }

    .bio-box {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .bio-title {
        font-size: 1.15rem;
    }

    .notice-list li {
        font-size: 0.85rem;
        line-height: 1.6;
        margin-bottom: 6px;
        padding: 2px 4px;
    }

    .notice-list li::before {
        width: 1.5em;
        margin-right: 2px;
    }

    .text-qa {
        font-size: 0.85rem;
    }

    .history-log-wrapper {
        gap: 12px;
    }

    .record-card {
        border-width: 1px;
    }

    .log-header {
        font-size: 0.85rem;
        padding: 8px 10px;
        letter-spacing: 1px;
    }

    .log-cell {
        font-size: 0.82rem;
        padding: 8px;
        line-height: 1.45;
    }

    .popup-video-content {
        padding: 16px 12px;
        gap: 12px;
    }

    .video-boss-name {
        font-size: 1rem;
    }

    .video-conquest-time {
        font-size: 0.82rem;
    }

    #popup-content-bio::-webkit-scrollbar,
    #popup-content-gift::-webkit-scrollbar,
    #popup-content-notice2::-webkit-scrollbar,
    #popup-content-notice::-webkit-scrollbar,
    #popup-content-yt::-webkit-scrollbar {
        width: 6px;
    }

    #popup-content-bio::-webkit-scrollbar-thumb,
    #popup-content-gift::-webkit-scrollbar-thumb,
    #popup-content-notice2::-webkit-scrollbar-thumb,
    #popup-content-notice::-webkit-scrollbar-thumb,
    #popup-content-yt::-webkit-scrollbar-thumb {
        border-width: 1px;
        border-radius: 99px;
    }
}

@media screen and (min-aspect-ratio: 19/9) and (max-aspect-ratio: 26/9) {
    .popup_main {
        transform: scale(0.8);
        transform-origin: center;
    }
}

@media screen and (min-aspect-ratio: 35/10) and (max-aspect-ratio: 36/10) and (min-width: 2200px) {
    .popup_main {
        transform: scale(0.6);
        transform-origin: center;
    }
}

@supports (-webkit-touch-callout: none) {
    #popup-content-bio,
    #popup-content-gift,
    #popup-content-notice,
    #popup-content-notice2,
    #popup-content-yt {
        -webkit-overflow-scrolling: touch;
    }

    .popup-close {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
    }
}
