/* /game2/style.css */
:root {
    --pion-green: #10b981;
    --pion-blue: #38bdf8;
    --pion-red: #ef4444;
    --bg-dark: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
}

/* 1. 게임 컨테이너 (900x550 고정) */
#gameContainer {
    position: relative;
    width: 1000px !important;
    height: 620px !important;
    background: var(--bg-dark);
    border-radius: 12px;
    overflow: hidden;
    color: white;
    font-family: 'Pretendard', sans-serif;
    margin: 0 auto;
    border: 1px solid var(--card-border);
}

/* 2. HUD 영역 */
.hud {
    position: absolute;
    top: 0; left: 0; width: 100%;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(5px);
    z-index: 10;
}

.hud-left, .hud-right { display: flex; align-items: center; gap: 15px; }
.stage-top-left { font-family: 'Orbitron'; color: var(--pion-green); font-weight: 900; font-size: 1.1rem; }
.score-group { font-family: 'Orbitron'; font-size: 1rem; color: #94a3b8; }
#score { color: var(--pion-blue); }

.action-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn { order: 1; background: none; border: none; color: #94a3b8; cursor: pointer; font-size: 1.1rem; transition: 0.3s; }
.icon-btn:hover { color: white; transform: rotate(180deg); }
.life-box { order: 2; background: rgba(0,0,0,0.3); padding: 5px 12px; border-radius: 15px; font-family: 'Orbitron'; }

/* 3. 플레이 영역 (여백 30px 아래로 조정) */
.play-area {
    display: flex;
    padding: 80px 25px 25px; /* 문제 시작 위치를 아래로 조정 */
    height: 100%;
    gap: 20px;
    box-sizing: border-box;
    align-items: flex-start;
}

/* 4. 컬럼 및 스크롤 설정 */
.match-column {
    display: flex;
    flex-direction: column;
    gap: 0px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    transition: all 0.3s ease; /* 문제 삭제 시 리스트 이동 애니메이션 */
    margin-top: 0;
    align-self: flex-start;
}
.match-column::-webkit-scrollbar { display: none; }

#leftCol { width: 70%; }
#rightCol { width: 28%; } /* 오른쪽 문항 영역 최소화 */

/* 5. 카드 공통 스타일 */
.m-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    padding: 12px 18px;
    min-height: 55px; /* 세로 높이 조절 */
    position: relative;
    margin-bottom: 10px;
}

.m-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--pion-blue);
    transform: translateX(5px);
}

/* 문제 카드 (왼쪽) */
#leftCol .m-card {
    font-size: 1rem;
    justify-content: flex-start;
}

.q-hint {
    margin-left: 15px;
    font-size: 0.8rem;
    color: #94a3b8;
    background: rgba(0,0,0,0.3);
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
}
.q-hint code { color: #fbbf24; font-family: 'Consolas', monospace; }

/* 문항 카드 (오른쪽) */
#rightCol .m-card {
    min-height: 45px;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--pion-blue);
    text-align: center;
    animation: slideInRight 0.3s ease-out; /* 클릭 시 보기가 슥 나타남 */
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* 6. 상태 스타일 및 터짐 효과 */
.m-card.selected {
    border-color: var(--pion-blue);
    background: rgba(56, 189, 248, 0.15);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
}

.m-card.correct {
    animation: explode 0.5s forwards;
    pointer-events: none;
    z-index: 99; /* 다른 카드보다 위에서 터지도록 */
    /* 애니메이션 도중 레이아웃 흔들림 방지 */
    overflow: hidden;
}

/* 정답 카드에 번쩍이는 광원 효과 추가 */
.m-card.correct::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: flash 0.4s ease-out forwards;
}


/* 타이머 박스 스타일 */
.timer-box {
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    color: #38bdf8; /* 파이온 테마 하늘색 */
    font-family: 'Orbitron', sans-serif;
    font-weight: bold;
    min-width: 80px;
    justify-content: center;
}

.timer-box i {
    font-size: 1.1rem;
}

/* 10초 미만 경고 애니메이션 */
.time-warning {
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.2) !important;
    animation: pulse-red 1s infinite;
}

@keyframes explode {
    0% {
        transform: scale(1);
        opacity: 1;
        height: 55px; /* 현재 높이 유지 */
        margin-bottom: 10px;
        border-color: var(--pion-green);
        box-shadow: 0 0 0px var(--pion-green);
    }
    20% {
        transform: scale(1.08);
        background: var(--pion-green);
        box-shadow: 0 0 30px var(--pion-green);
        color: white;
    }
    50% {
        transform: scale(1.15) translateY(-5px);
        opacity: 0.8;
        height: 55px; /* 50%까지는 공간 유지 (그래야 효과가 보임) */
        margin-bottom: 10px;
        padding: 12px 18px;
    }
    /* 핵심: 50% 이후부터 100%까지 급격하게 높이를 0으로 만듦 */
    100% {
        transform: scale(0.5);
        opacity: 0;
        height: 0;           /* 실제 공간 제거 */
        margin-bottom: 0;    /* 여백 제거 */
        padding-top: 0;      /* 패딩 제거 */
        padding-bottom: 0;
        border-width: 0;     /* 테두리 제거 */
    }
}

@keyframes flash {
    0% { width: 0; height: 0; opacity: 1; }
    100% { width: 300px; height: 300px; opacity: 0; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.m-card.wrong { animation: shake 0.4s; border-color: var(--pion-red); }

/* 7. 오버레이 */
.game-overlay {
    position: absolute; inset: 0;
    background: rgba(15, 23, 42, 0.98);
    display: flex; justify-content: center; align-items: center;
    z-index: 100;
}

.main-logo-text { font-size: 5rem; font-weight: 900; color: #fff; margin: 0; text-shadow: 0 0 20px rgba(56, 189, 248, 0.8); transform: skew(-5deg); }
.main-logo-sub { font-size: 2.5rem; font-weight: 900; color: #fbbf24; margin-top: -10px; letter-spacing: 3px; text-shadow: 0 0 30px rgba(251, 191, 36, 0.6); }

.btn-ultra-start {
    padding: 15px 50px; font-size: 1.8rem; font-weight: 900; color: #1e293b;
    background: linear-gradient(45deg, var(--pion-green), #059669); border: none; border-radius: 50px; cursor: pointer;
    transition: 0.3s; box-shadow: 0 0 30px rgba(251, 191, 36, 0.4);
    margin-bottom: 10px;
}
.btn-ultra-start:hover { transform: scale(1.1); box-shadow: 0 0 20px rgba(16, 185, 129, 0.5); }

/* 애니메이션 */
@keyframes badge-pulse { 0%, 100% { opacity: 0.6; transform: scale(0.9); } 50% { opacity: 1; transform: scale(1); } }
.animate-pulse { animation: badge-pulse 1.5s infinite; }

@keyframes pulse-border {
    0% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(251, 191, 36, 0); }
    100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); }
}

.start-pulse { animation: pulse-border 1.5s infinite; }
.animate-pulse { animation: badge-pulse 1.5s infinite; }