/**
 * ============================================================================
 * TTEUM orb-split: 480x360 콤팩트 아케이드 네온 스타일시트 (orb-split.css) - v1.3.0
 * ============================================================================
 */

:root {
    --bg-dark: #05070e;
    --card-bg: #0d1322;
    --border-color: #1e293b;
    --neon-cyan: #00f5d4;
    --neon-magenta: #f72585;
    --neon-yellow: #fee440;
    --neon-blue: #4cc9f0;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'NeoDonggeunmo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* ========================================================
   헤더 영역
   ======================================================== */
.game-header {
    width: 100%;
    max-width: 520px;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge-tag {
    background: linear-gradient(135deg, var(--neon-cyan) 0%, var(--neon-blue) 100%);
    color: #080c16;
    font-size: 10px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.game-title-text {
    font-size: 13.5px;
    font-weight: 800;
    color: #ffffff;
}

.btn-hub-back {
    background: #1e293b;
    border: 1px solid #334155;
    color: var(--text-main);
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-hub-back:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

/* ========================================================
   메인 게임 래퍼 (480x360 아담한 레트로 핏)
   ======================================================== */
.game-viewport-container {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0 8px 20px;
}

/* 상단 인게임 HUD 바 */
.game-hud-bar {
    width: 100%;
    max-width: 480px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.hud-group {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
}

.hud-stage-badge {
    color: var(--neon-cyan);
    font-weight: 900;
}

.hud-stage-title {
    color: #ffffff;
    font-size: 11px;
}

.hud-time-val {
    color: var(--neon-yellow);
    font-weight: 900;
    font-family: monospace;
    font-size: 13px;
}

.hud-lives-val {
    font-size: 12px;
    letter-spacing: 1px;
}

.btn-hud-tool {
    background: #1e293b;
    border: 1px solid #334155;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 800;
    padding: 3px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-hud-tool:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

/* ========================================================
   캔버스 아레나 프레임 (480x360)
   ======================================================== */
.canvas-frame-box {
    position: relative;
    width: 480px;
    height: 360px;
    background: #05070e;
    border: 2px solid #1e293b;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 25px rgba(0, 245, 212, 0.12), 0 10px 30px rgba(0, 0, 0, 0.8);
}

.game-canvas {
    display: block;
    width: 480px;
    height: 360px;
    background: transparent;
}

/* 하단 상태 서브 바 */
.game-sub-bar {
    width: 100%;
    max-width: 480px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10.5px;
    color: var(--text-muted);
    padding: 2px 4px;
}

/* ========================================================
   오버레이 모달 공통 및 스무스 애니메이션
   ======================================================== */
@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes cardPopIn {
    from {
        opacity: 0;
        transform: scale(0.88) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.game-overlay {
    position: absolute;
    inset: 0;
    background: rgba(4, 7, 14, 0.88);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    animation: overlayFadeIn 0.35s ease forwards;
}

.overlay-content-card {
    background: var(--card-bg);
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 16px 20px;
    text-align: center;
    max-width: 320px;
    width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8);
    animation: cardPopIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.overlay-title {
    font-size: 17px;
    font-weight: 900;
    letter-spacing: -0.5px;
}

.ready-countdown-number {
    font-size: 44px;
    font-weight: 900;
    color: var(--neon-cyan);
    text-shadow: 0 0 16px rgba(0, 245, 212, 0.8);
    line-height: 1;
    margin: 6px 0;
}

.clear-stars-row {
    font-size: 22px;
    letter-spacing: 4px;
    margin: 2px 0;
}

.btn-overlay-action-main {
    width: 100%;
    padding: 8px;
    background: linear-gradient(135deg, var(--neon-cyan) 0%, var(--neon-blue) 100%);
    color: #080c16;
    font-size: 12px;
    font-weight: 900;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-overlay-action-main:hover {
    filter: brightness(1.15);
    transform: scale(1.02);
}

.btn-overlay-action-sub {
    width: 100%;
    padding: 6px;
    background: #1e293b;
    border: 1px solid #334155;
    color: var(--text-main);
    font-size: 11px;
    font-weight: 800;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-overlay-action-sub:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

/* ========================================================
   스테이지 선택 맵 모달 (480x360 최적화)
   ======================================================== */
.stage-select-modal-box {
    background: var(--card-bg);
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 14px 16px;
    width: 460px;
    max-height: 330px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stage-select-modal-box::-webkit-scrollbar {
    width: 6px;
}

.stage-select-modal-box::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 3px;
}

.stage-select-modal-box::-webkit-scrollbar-thumb:hover {
    background: var(--neon-cyan);
}

.stage-grid-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

.stage-map-card {
    background: #05070e;
    border: 1px solid #1e293b;
    border-radius: 6px;
    padding: 6px 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.stage-map-card.unlocked:hover {
    border-color: var(--neon-cyan);
    background: #0d1527;
    transform: translateY(-2px);
    box-shadow: 0 0 10px rgba(0, 245, 212, 0.4);
}

.stage-map-card.locked {
    opacity: 0.35;
    cursor: not-allowed;
    filter: grayscale(0.8);
}

.stage-num-badge {
    font-size: 9px;
    font-weight: 800;
    color: var(--neon-cyan);
}

.stage-card-title {
    font-size: 10px;
    font-weight: 800;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}

.stage-card-sub {
    font-size: 8.5px;
    color: var(--text-muted);
}

.stage-card-stars {
    font-size: 9.5px;
    letter-spacing: 1px;
    min-height: 12px;
}

/* ========================================================
   하단 PC 전용 조작 가이드 HUD
   ======================================================== */
.pc-controls-guide-card {
    width: 100%;
    max-width: 480px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    font-size: 10.5px;
    color: var(--text-muted);
}

.guide-key-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.key-cap {
    background: #1e293b;
    border: 1px solid #334155;
    color: var(--neon-cyan);
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 900;
    font-size: 10px;
    font-family: monospace;
}
