/* 기본 레이아웃 */
#gameContainer {
    width: 100%; max-width: 900px; margin: 50px auto; padding:30px 0; position: relative;
    background: #0f172a; border-radius: 15px; overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    background: linear-gradient(rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.7)),
    url('/game/img/bg_image1.png') no-repeat center center;
    background-size: cover;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: auto;
    /* 배경 이미지 위에 검은 반투명 레이어를 씌운 효과 */
    background-blend-mode: multiply;
    background-color: rgba(0, 0, 0, 0.4);
    transition: background-image 0.5s ease-in-out; /* 배경 교체 시 부드럽게 */
}

/* HUD 영역 */
.hud {
    position: absolute; top: 0; left: 0; width: 100%; height: 80px;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 25px; z-index: 100;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);

    background: rgba(0, 0, 0, 0.6); /* HUD 배경을 더 어둡게 하여 정보 강조 */
    border-radius: 10px;
    padding: 10px 20px;
}

.score-label { font-size: 0.9rem; color: #fff; font-weight: bold; margin-right: 8px; }
#score { font-size: 2.2rem; color: #fbbf24; font-family: 'Orbitron', sans-serif; text-shadow: 0 0 10px rgba(251, 191, 36, 0.6); }

.action-group { display: flex; align-items: center; gap: 10px; }
.life-box { background: rgba(0, 0, 0, 0.3); padding: 5px 15px; border-radius: 20px; display: flex; align-items: center; }
#life { font-size: 1.5rem; font-weight: bold; color: #ef4444; margin-left: 8px; }

.icon-btn { background: none; border: none; color: white; font-size: 1.2rem; cursor: pointer; transition: 0.2s; padding: 5px; }
.icon-btn:hover { color: #fbbf24; transform: scale(1.2); }

/* 문제 박스 */
.mini-question-box {
    position: absolute; top: 15px; left: 50%; transform: translateX(-50%);
    background: rgba(30, 41, 59, 0.9); backdrop-filter: blur(8px);
    border: 1px solid rgba(56, 189, 248, 0.5); border-radius: 12px;
    padding: 8px 25px; display: flex; align-items: center; gap: 15px;
    z-index: 120; box-shadow: 0 0 20px rgba(0,0,0,0.5);
}
#questText { color: #cbd5e1; font-size: 0.9rem; }
#probCode { color: #38bdf8; font-weight: bold; font-size: 1.2rem; font-family: monospace; }

/* 하단 스테이지 표시 */
.stage-bottom-right {
    position: absolute; bottom: 20px; right: 20px; z-index: 100;
    background: rgba(15, 23, 42, 0.8); padding: 5px 15px; border-radius: 8px;
    border: 1px solid rgba(56, 189, 248, 0.4);
}
#stageName { color: #38bdf8; font-weight: bold; letter-spacing: 2px; }

/* 입력창 */
.input-area { position: absolute; bottom: 25px; left: 50%; transform: translateX(-50%); width: 60%; z-index: 110; }
#ansInput {
    width: 100%; padding: 12px; border-radius: 25px; border: 2px solid #fbbf24;
    text-align: center; background: rgba(255,255,255,0.95); font-weight: bold; font-size: 1.2rem;
}
#ansInput:focus { outline: none; border-color: #38bdf8; box-shadow: 0 0 15px rgba(56, 189, 248, 0.5); }

/* 오버레이 (인트로) */
.game-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle, rgba(15, 23, 42, 1) 0%, rgba(2, 6, 23, 1) 100%);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    z-index: 1000; text-align: center;
}

/* 오버레이 내부 콘텐츠 배치 수정 */
.overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 10px; /* 요소들 사이의 기본 간격 설정 */
}

/* 타이틀 컨테이너: 내부 글자들 정렬 */
.title-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px; /* 설명 문구와의 거리 확보 */
}

.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: 1.9rem; 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: #fbbf24; 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); background: #fff; box-shadow: 0 0 50px rgba(251, 191, 36, 0.8); }*/

.key-cap { background: #475569; padding: 2px 8px; border-radius: 4px; font-family: monospace; color: white; }

/* 애니메이션 */
@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; }