/* base.css */
:root {
    /* Colors */
    --primary-color: #ff4081;
    --primary-hover: #e91e63;
    --secondary-color: #3f51b5;
    --text-color: #333;
    --light-gray: #f0f0f0;
    --bg-color: #ffffff;
    --white: #ffffff;
    --overlay-bg: rgba(255, 255, 255, 0.7);
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --dropdown-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);

    /* Layout */
    --header-height: 60px;
    --max-width: 1200px;
    --idol-min-height: 700px;
    --content-min-height: 500px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.hidden {
    display: none !important;
}

*:focus {
    outline: none !important;
}

body {
    font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    word-break: break-word;
}

img {
    user-select: none;
    -webkit-user-drag: none;
}

.lang-switch-container {
    position: relative;
    width: 100%;
    height: 70px;
    margin-bottom: 0.5rem;
    flex-shrink: 0;
    /* Prevent header from shrinking when timeline expands */
}

.lang-select-wrap {
    position: absolute;
    left: 50%;
    top: 20px;
    margin-left: 60px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 6px 0 8px;
    height: 20px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--idol-theme-color, var(--primary-color));
    box-shadow: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
    z-index: 110;
    white-space: nowrap; /* 텍스트 줄바꿈 방지 */
    flex-shrink: 0; /* 컨테이너 내에서 줄어들지 않도록 설정 */
}

.lang-select-wrap:hover {
    border-color: var(--idol-theme-color, var(--primary-color));
    box-shadow: none;
    transform: none;
}

.lang-select-label {
    font-size: 0.55rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    color: rgba(60, 60, 60, 0.62);
}

.lang-dropdown {
    position: relative;
}

.lang-select {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: color-mix(in srgb, var(--idol-theme-color, var(--primary-color)) 60%, white);
    color: #222;
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1;
    padding: 0 4px;
    height: 15px;
    min-width: 24px;
    text-align: center;
    cursor: pointer;
    outline: none;
    border-radius: 999px;
    flex-shrink: 0; /* 버튼 너비 유지 */
}

.lang-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 32px;
    padding: 2px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--idol-theme-color, var(--primary-color));
    z-index: 120;
}

.lang-option {
    border: none;
    background: transparent;
    color: #222;
    font-family: inherit;
    font-size: 0.64rem;
    font-weight: 700;
    padding: 3px 5px;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
}

.lang-option:hover,
.lang-option.active {
    background: rgba(0, 0, 0, 0.06);
}

/* PC 화면 전용 스타일 */
@media (min-width: 769px) {
    .lang-switch-container {
        height: 85px;
        /* PC height increased */
    }

    .lang-select-wrap {
        top: 30px;
        margin-left: 240px;
        padding: 5px 12px;
        gap: 10px;
        height: auto;
        min-width: 100px; /* PC에서 최소 너비 보장 */
    }

    .lang-select-label {
        font-size: 0.6rem;
    }

    .lang-select {
        font-size: 0.86rem;
        min-width: 42px; /* 살짝 여유 있게 조정 */
        height: auto;
        padding: 4px 8px;
    }

    .lang-options {
        min-width: 58px;
    }

    .lang-option {
        font-size: 0.84rem;
    }
}

main {
    max-width: var(--max-width);
    margin: 1rem auto 0;
    /* 하단 auto를 0으로 변경하여 여백 제거 */
    padding: 0 1rem;
}

#idol {
    text-align: center;
    padding: 1.5rem 1rem 0;
    border-radius: 15px;
    position: relative;
    height: 85vh;
    /* 80vh에서 85vh로 늘려 컨텐츠 영역 확대 */
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

#content-area {
    position: relative;
    flex: 1;
    width: 100%;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.main-logo-h1 {
    margin: 2.8rem 0 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.main-logo-img {
    position: absolute;
    left: 50%;
    margin-left: -340px;
    /* Symmetry: Toggle starts at 240px, width 100px. Box is 50%+240px to 50%+340px. Logo should be 50%-340px to 50%-240px. */
    top: 30px;
    /* Match lang-toggle top on PC */
    width: 100px;
    height: auto;
    object-fit: contain;
    opacity: 0.9;
    z-index: 100;
}

.main-logo-sub {
    font-size: 2.22rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    background: var(--idol-theme-color, var(--primary-color));
    padding: 0.1rem 0.8rem;
    border-radius: 0;
    line-height: 1.1;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    #fixed-bg {
        -webkit-mask-size: 300px;
        /* 모바일용 배경 크기 */
        mask-size: 300px;
    }

    .main-logo-img {
        top: 20px;
        /* Match lang-toggle top on Mobile */
        margin-left: -125px;
        /* Symmetry: Toggle starts at 60px, width 65px. Box is 50%+60px to 50%+125px. Logo should be 50%-125px to 50%-60px. */
        width: 65px;
    }

    .main-logo-sub {
        font-size: 1.5rem;
        margin-top: -5px;
        padding: 0.15rem 0.6rem;
    }
}

#fixed-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    z-index: -1;
    -webkit-mask-repeat: repeat;
    mask-repeat: repeat;
    -webkit-mask-position: top left;
    mask-position: top left;
    -webkit-mask-size: 500px;
    mask-size: 500px;
    pointer-events: none;
}

footer {
    text-align: center;
    padding: 2rem;
    padding-bottom: 60px;
    /* 120px에서 60px로 축소 */
    color: #777;
}

.primary-btn {
    padding: 1rem 2.5rem;
    min-width: 180px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    background-color: var(--primary-color);
    color: var(--white);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.primary-btn:disabled {
    background-color: #ccc;
    color: #888;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.button-group.horizontal {
    display: flex;
    justify-content: center;
    align-items: center; /* flex-start -> center로 수직 중앙 정렬 */

    gap: 0.8rem; /* PC는 다시 여유 있게 */

    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    transform: none;
    z-index: 10000;
    padding: 12px 0; /* 위아래 여백을 12px씩 균등하게 배분 */

    /* 배경 설정을 직접 추가 */
    background: rgba(255, 255, 255, 0.95);
    border-top: none;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.05);
}

.button-group.horizontal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--idol-theme-color, #ffe0ea);
    opacity: 0.4;
    z-index: 1;
}

.menu-btn {
    background-color: transparent;
    color: var(--text-color);
    border: none;
    padding: 0.6rem 0.3rem;
    font-size: 0.65rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    max-width: 85px; /* PC는 다시 여유 있게 */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    transform-origin: center top;
    transform: scale(var(--sc, 1));
}

.menu-btn:hover {
    --sc: 1.1;
    z-index: 10;
}

.btn-icon {
    width: 32px; /* 36px -> 32px 조절 */
    height: 32px;
    object-fit: contain;
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.6rem;
    }

    #idol {
        height: 80vh;
        padding: 0;
        /* 모든 여백 제거 (좌우 패딩 포함) */
        overflow-y: auto;
    }

    #content-area {
        min-height: 35vh;
        height: 100%;
    }

    .button-group.horizontal {
        width: 100%;
        height: 80px;
    }

    .button-group.horizontal {
        gap: 0.35rem; /* 모바일 간격 살짝 확대 */
    }

    .menu-btn {
        max-width: 65px; /* 모바일 간격 살짝 확대 */
        font-size: 0.65rem;
        gap: 5px;
    }

    .btn-icon {
        width: 26px; /* 모바일은 큼직하게 유지 */
        height: 26px;
    }
}

/* Scrollbar Style */
#idol::-webkit-scrollbar {
    width: 6px;
}

#idol::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

#idol::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

#idol::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Log Button Style */
.log-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 200;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ccc;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.75rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.log-btn:hover {
    background: #fff;
    transform: scale(1.05);
}

.reset-btn {
    left: 110px;
}

@media (max-width: 768px) {
    .log-btn {
        padding: 3px 6px;
        font-size: 0.65rem;
        top: 5px;
        left: 5px;
    }

    .reset-btn {
        left: 75px;
    }
}

/* Disclaimer Style - Extremely Small */
.disclaimer-container {
    margin-top: 1.5rem;
    padding: 0.5rem;
    background: transparent;
    font-size: 0.65rem;
    color: #bbb;
    line-height: 1.2;
    text-align: center;
}

/* 가챠 결과 화면에서 하단 메뉴만 숨김 */
body.gacha-result-active .button-group.horizontal {
    display: none !important;
}

.disclaimer-container p {
    margin: 1px 0;
}

@media (max-width: 768px) {
    .disclaimer-container {
        font-size: 0.38rem;
        margin-top: 0.8rem;
        color: #ccc;
    }
}

/* Video Modal Styles */
.video-modal-content {
    position: relative;
    width: 80%;
    max-width: 850px;
    background: transparent;
    border-radius: 0;
    /* 테두리를 각지게 설정 */
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin: 60px auto;
    border: 1px solid #ff4d8d;
    padding: 10px;
}

.video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
    border: 1px solid #ff4d8d;
    box-sizing: border-box;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

@media (max-width: 768px) {
    .video-modal-content {
        width: 92%;
        margin: 40px auto;
    }
}

/* SEO Intro Styles */
#seo-intro {
    padding: 40px 20px;
    text-align: center;
    font-family: sans-serif;
    color: #fcfcfc;
}
#seo-intro h1 {
    font-size: 1.8rem;
    color: #fcfcfc;
    margin-bottom: 10px;
}
#seo-intro > p {
    font-size: 1rem;
    color: #fcfcfc;
    margin-bottom: 20px;
}
#seo-intro .seo-desc {
    display: inline-block;
    text-align: left;
    max-width: 500px;
    color: #fcfcfc;
    line-height: 1.6;
    padding: 20px;
    border-radius: 12px;
}
#seo-intro .seo-desc p {
    margin: 5px 0;
}

@media (max-width: 768px) {
    #seo-intro {
        padding: 15px 10px;
    }
    #seo-intro h1 {
        font-size: 1.3rem;
        margin-bottom: 5px;
    }
    #seo-intro > p {
        font-size: 0.8rem;
        margin-bottom: 10px;
    }
    #seo-intro .seo-desc {
        padding: 10px;
        font-size: 0.75rem;
        line-height: 1.4;
    }
    #seo-intro .seo-desc p {
        margin: 3px 0;
    }
}
