/* ==========================================
   게임 및 테스트 공통 오버레이
   ========================================== */
.game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--overlay-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: none; /* 평소에는 완전히 걷어내어 마우스 호버 이벤트를 차단하지 않도록 함 */
    align-items: center;
    justify-content: center;
    z-index: 1100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.game-overlay.active {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.game-box {
    width: 90%;
    max-width: 550px;
    padding: 2.5rem 2rem;
    border-radius: 12px;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    transform: scale(0.9) translateY(15px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.game-overlay.active .game-box {
    transform: scale(1) translateY(0);
}

/* ==========================================
   올림포스 성향 테스트 (MBTI)
   ========================================== */
.mbti-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.mbti-progress-bar {
    height: 100%;
    width: 0;
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-glow);
    transition: width 0.3s ease;
}

.mbti-question {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    line-height: 1.5;
}

.mbti-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mbti-option-btn {
    width: 100%;
    text-align: left;
    padding: 1.25rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1.4;
    transition: all 0.3s ease;
}

.mbti-option-btn:hover {
    background: rgba(212, 175, 55, 0.08);
    border-color: var(--primary-color);
    transform: translateX(5px);
}

/* MBTI 매칭 결과 UI */
.mbti-result-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 1rem;
}

.mbti-result-image {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 20px var(--primary-glow);
}

.mbti-result-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.25rem;
}

.mbti-result-god {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.mbti-result-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.share-action-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* ==========================================
   헤르메스의 OX 퀴즈
   ========================================== */
.quiz-character-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.hermes-avatar {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--primary-color);
}

.hermes-bubble {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    border-bottom-left-radius: 2px;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: left;
    max-width: 250px;
}

.quiz-question-box {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.quiz-question-text {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.5;
}

.quiz-btn-row {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.quiz-choice-btn {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-color);
    font-size: 2rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.quiz-choice-btn.btn-o:hover {
    background: rgba(40, 167, 69, 0.15);
    border-color: #28a745;
    color: #28a745;
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.3);
    transform: scale(1.1);
}

.quiz-choice-btn.btn-x:hover {
    background: rgba(220, 53, 69, 0.15);
    border-color: #dc3545;
    color: #dc3545;
    box-shadow: 0 0 20px rgba(220, 53, 69, 0.3);
    transform: scale(1.1);
}

.quiz-feedback {
    min-height: 25px;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.quiz-feedback.correct {
    color: #28a745;
}

.quiz-feedback.incorrect {
    color: #dc3545;
}

/* ==========================================
   닫기용 기본 헤더/버튼 스타일
   ========================================== */
.game-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    transition: color 0.3s ease;
}
.game-close-btn:hover {
    color: var(--primary-color);
}

/* ==========================================
   올림포스 가상 아레나 (Divine Battle)
   ========================================== */
.arena-box {
    max-width: 650px !important;
}

.arena-setup {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    gap: 1rem;
}

.fighter-select {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
}

.fighter-select label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: bold;
    text-transform: uppercase;
}

.fighter-select select {
    background: rgba(13, 17, 23, 0.9);
    border: 1px solid var(--card-border);
    color: var(--text-color);
    padding: 0.75rem;
    border-radius: 6px;
    outline: none;
    font-family: var(--font-body);
    font-size: 0.95rem;
    cursor: pointer;
    width: 100%;
}

.fighter-preview {
    width: 100%;
    height: 180px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background-color: rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    margin-top: 0.5rem;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
}

.fighter-tag {
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(13, 17, 23, 0.85);
    border: 1px solid var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: bold;
}

.vs-divider {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-glow);
    padding: 0 0.5rem;
    margin-top: 2rem;
}

.arena-battle-area {
    margin-bottom: 2rem;
}

.arena-fighters-stage {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 180px;
    position: relative;
    margin-bottom: 1.5rem;
}

.fighter-card {
    width: 120px;
    height: 160px;
    border-radius: 8px;
    border: 2px solid var(--card-border);
    background-size: cover;
    background-position: center;
    position: relative;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease, filter 0.5s ease;
}

.arena-card-label {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 0.3rem 0;
    text-align: center;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}

.battle-clash-effect {
    font-size: 3rem;
    opacity: 0;
    position: absolute;
    z-index: 10;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 화면 떨림 애니메이션 정의 */
@keyframes clashShake {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    10% { transform: translate(-5px, -5px) rotate(-1deg); }
    30% { transform: translate(5px, 5px) rotate(1deg); }
    50% { transform: translate(-5px, 5px) rotate(-1deg); }
    70% { transform: translate(5px, -5px) rotate(1deg); }
    90% { transform: translate(-5px, -2px) rotate(0deg); }
}

.arena-rounds-score {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.score-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.score-dot.win {
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-glow);
    border-color: var(--primary-color);
}

.score-vs {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: bold;
    color: var(--text-muted);
    margin: 0 0.5rem;
}

.arena-log-board {
    height: 120px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    overflow-y: auto;
    font-size: 0.8rem;
    line-height: 1.6;
    text-align: left;
    color: var(--text-muted);
}

.arena-log-board p {
    margin: 0 0 0.4rem 0;
}

.arena-log-board p:last-child {
    margin-bottom: 0;
}

.battle-start-msg { color: var(--primary-color); font-weight: bold; text-align: center; }
.round-header { color: #fff; font-weight: bold; border-bottom: 1px solid rgba(255, 255, 255, 0.05); padding-bottom: 0.15rem; margin-top: 0.5rem !important; }
.battle-log-win { color: var(--primary-color); }
.battle-log-loss { color: var(--accent-color); }
.battle-log-draw { color: var(--text-muted); }
.battle-final-win { color: #28a745; font-weight: bold; text-align: center; font-size: 0.85rem; }
.battle-final-loss { color: #dc3545; font-weight: bold; text-align: center; font-size: 0.85rem; }

.winner-crown {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.8rem;
    animation: bounceCrown 1s infinite alternate;
}

@keyframes bounceCrown {
    to { transform: translateX(-50%) translateY(-5px); }
}

.action-btn {
    background: var(--primary-color);
    color: var(--bg-color);
    border: 1px solid var(--primary-color);
    padding: 0.8rem 2.2rem;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px var(--primary-glow);
}

.action-btn:hover {
    background: transparent;
    color: var(--primary-color);
    box-shadow: 0 0 15px var(--primary-glow);
}

/* ==========================================
   델포이 신전의 운명 카드 (Oracle Deck)
   ========================================== */
.oracle-box {
    max-width: 580px !important;
}

.oracle-cards-deck {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 2.5rem;
}

/* 3D 카드 플립 */
.card-3d {
    width: 110px;
    height: 165px;
    perspective: 1000px;
    cursor: pointer;
    transition: opacity 0.4s ease, transform 0.3s ease;
}

.card-3d:hover {
    transform: translateY(-8px);
}

/* 둥실둥실 공중부유 모션 */
.oracle-cards-deck .card-3d:nth-child(1) { animation: cardFloat 3s infinite ease-in-out; }
.oracle-cards-deck .card-3d:nth-child(2) { animation: cardFloat 3s infinite ease-in-out 0.5s; }
.oracle-cards-deck .card-3d:nth-child(3) { animation: cardFloat 3s infinite ease-in-out 1s; }

@keyframes cardFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

.card-3d.revealed .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

/* 카드 뒷면 (선택 전) */
.card-front {
    background: #161b22;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 20px rgba(212, 175, 55, 0.15);
}

/* 카드 앞면 (선택 후 반전) */
.card-back {
    background-color: #0d1117;
    border: 2px solid var(--primary-color);
    transform: rotateY(180deg);
    position: relative;
}

.oracle-back-label {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0,0,0,0.8);
    color: var(--primary-color);
    font-size: 0.7rem;
    font-weight: bold;
    padding: 0.25rem 0;
    text-align: center;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}

.oracle-result-zone {
    background: rgba(212, 175, 55, 0.04);
    border: 1px dashed rgba(212, 175, 55, 0.2);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    min-height: 90px;
    text-align: left;
}

.oracle-prophecy-text {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-color);
    font-weight: 500;
}

@media (max-width: 520px) {
    .oracle-cards-deck {
        gap: 0.8rem;
    }
    .card-3d {
        width: 85px;
        height: 128px;
    }
    .card-front {
        font-size: 1.8rem;
    }
    .arena-setup {
        flex-direction: column;
        gap: 1.5rem;
    }
    .vs-divider {
        margin-top: 0;
    }
}

/* ==========================================
   업데이트 예정 (Upcoming Gods)
   ========================================== */
.upcoming-box {
    max-width: 680px !important;
}

.upcoming-deck {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

/* 실루엣 물음표 카드 */
.upcoming-card .card-front {
    background: #0f141c;
    border: 2px solid #58a6ff;
    color: #58a6ff;
    font-size: 2.2rem;
    box-shadow: inset 0 0 15px rgba(88, 166, 255, 0.1);
}

.upcoming-detail-box {
    background: rgba(88, 166, 255, 0.03);
    border: 1px dashed rgba(88, 166, 255, 0.2);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
    text-align: left;
    transition: all 0.5s ease;
}

.upcoming-detail-name {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: #58a6ff;
    margin-bottom: 0.25rem;
}

.upcoming-detail-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.upcoming-detail-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 1rem;
}

.upcoming-stat-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.upcoming-stat-row span {
    width: 80px;
}

.upcoming-stat-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.upcoming-stat-fill {
    height: 100%;
    width: 0;
    background: #58a6ff;
    box-shadow: 0 0 8px rgba(88, 166, 255, 0.6);
    border-radius: 3px;
    transition: width 1.2s cubic-bezier(0.1, 0.8, 0.2, 1);
}

.upcoming-detail-info {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-color);
}

.upcoming-detail-info p {
    margin-bottom: 0.5rem;
}

.upcoming-detail-info strong {
    color: #58a6ff;
}

.upcoming-detail-bio {
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 0.75rem;
    margin-top: 0.75rem;
}

/* ==========================================
   미니게임 3단 반응형 최적화 (768px 이하)
   ========================================== */
@media (max-width: 768px) {
    .game-box {
        width: 95%;
        padding: 2rem 1.25rem;
    }
    
    .game-title {
        font-size: 1.3rem;
    }
    
    .game-desc {
        font-size: 0.8rem;
        margin-bottom: 1.5rem;
    }

    /* MBTI 결과 창 모바일 */
    .mbti-result-image {
        width: 90px;
        height: 90px;
        font-size: 2.2rem;
    }
    .mbti-result-god {
        font-size: 1.4rem;
    }
    .mbti-result-desc {
        font-size: 0.85rem;
        padding: 0;
    }
    .share-action-group {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    .share-action-group .btn {
        width: 100%;
    }

    /* OX 퀴즈 모바일 */
    .quiz-question-text {
        font-size: 1.1rem;
    }
    .quiz-choice-btn {
        width: 80px;
        height: 80px;
        font-size: 1.6rem;
    }
    .quiz-feedback {
        font-size: 0.85rem;
    }

    /* 아레나 모바일 결투장 */
    .arena-setup {
        flex-direction: column;
        gap: 1.25rem;
        margin-bottom: 1.5rem;
    }
    .vs-divider {
        margin-top: 0;
        font-size: 1.2rem;
    }
    .fighter-preview {
        height: 140px;
    }
    .arena-fighters-stage {
        height: 130px;
        margin-bottom: 1rem;
    }
    .fighter-card {
        width: 90px;
        height: 120px;
    }
    .arena-card-label {
        font-size: 0.65rem;
        padding: 0.2rem 0;
    }
    .battle-clash-effect {
        font-size: 2.2rem;
    }
    .winner-crown {
        top: -18px;
        font-size: 1.3rem;
    }
    .arena-log-board {
        height: 100px;
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }
    
    /* 델포이 카드 모바일 */
    .oracle-cards-deck {
        gap: 0.5rem;
        margin-bottom: 1.5rem;
    }
    .oracle-box .card-3d {
        width: 80px;
        height: 120px;
    }
    .oracle-box .card-front {
        font-size: 1.6rem;
    }
    .oracle-result-zone {
        padding: 1rem;
        min-height: 80px;
    }
    .oracle-prophecy-text {
        font-size: 0.8rem;
    }

    /* 업데이트 예정 모달 모바일 */
    .upcoming-deck {
        gap: 0.5rem;
        margin-bottom: 1.5rem;
    }
    .upcoming-card {
        width: 70px;
        height: 105px;
    }
    .upcoming-card .card-front {
        font-size: 1.5rem;
    }
    .upcoming-detail-box {
        padding: 1rem;
    }
    .upcoming-detail-name {
        font-size: 1.2rem;
    }
    .upcoming-detail-info {
        font-size: 0.8rem;
    }
}

/* ==========================================
   ☀️ 아폴론 낮 테마 (Light Theme) 게임 시인성 오버라이딩 패치
   ========================================== */
body.theme-apollon .fighter-select select {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(212, 175, 55, 0.3) !important;
    color: #1f2937 !important;
}

body.theme-apollon .fighter-select select option {
    background: #ffffff !important;
    color: #1f2937 !important;
}

body.theme-apollon .vs-divider {
    color: #b8860b !important;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.25) !important;
}

body.theme-apollon .fighter-tag {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid #b8860b !important;
    color: #b8860b !important;
}

body.theme-apollon .arena-log-board {
    background: rgba(255, 255, 255, 0.85) !important;
    border: 1px solid rgba(212, 175, 55, 0.25) !important;
    color: #1f2937 !important;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.02) !important;
}

body.theme-apollon .arena-log-board p {
    color: #2b303a !important;
}

body.theme-apollon .arena-rounds-score .score-vs {
    color: #1f2937 !important;
}
