/* ----------------------------------------------------
   DESIGN SYSTEM & VARIABLES
   ---------------------------------------------------- */
:root {
    --neon-cyan: #00f3ff;
    --neon-pink: #ff007f;
    --neon-purple: #9d00ff;
    --neon-green: #39ff14;
    --neon-yellow: #fffb00;
    --bg-dark: #08090f;
    --bg-cabinet: #10121e;
    --panel-bg: rgba(16, 18, 30, 0.85);
    --panel-border: rgba(0, 243, 255, 0.25);
    --panel-border-pink: rgba(255, 0, 127, 0.25);
    --font-orbitron: 'Orbitron', 'Noto Sans KR', 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
    --font-arcade: 'Press Start 2P', monospace;
    
    --shadow-cyan: 0 0 10px rgba(0, 243, 255, 0.5), 0 0 20px rgba(0, 243, 255, 0.2);
    --shadow-pink: 0 0 10px rgba(255, 0, 127, 0.5), 0 0 20px rgba(255, 0, 127, 0.2);
    --shadow-green: 0 0 10px rgba(57, 255, 20, 0.5), 0 0 20px rgba(57, 255, 20, 0.2);
}

/* ----------------------------------------------------
   RESET & BASE STYLES
   ---------------------------------------------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

body {
    background-color: var(--bg-dark);
    color: #ffffff;
    font-family: var(--font-orbitron);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    overflow-x: hidden;
    position: relative;
    padding: 20px 0;
}

/* Moving Cyberpunk Grid Background */
.cyber-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 243, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 243, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center top;
    z-index: -1;
    transform: perspective(500px) rotateX(60deg);
    transform-origin: top center;
    opacity: 0.8;
}

/* 게임 시작 시 그리드 애니메이션 정지 (CPU 절약) */
body:has(#overlay-start.hidden) .cyber-grid {
    animation: none;
}

@keyframes grid-scroll {
    0% { background-position-y: 0px; }
    100% { background-position-y: 800px; }
}

/* ----------------------------------------------------
   HEADER & FOOTER
   ---------------------------------------------------- */
.main-header {
    text-align: center;
    margin-bottom: 10px;
    z-index: 10;
}

.glow-text {
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: 5px;
    color: #ffffff;
    text-shadow: 
        0 0 5px #fff,
        0 0 10px var(--neon-cyan),
        0 0 25px var(--neon-cyan),
        0 0 40px var(--neon-cyan);
    animation: text-pulse 2s ease-in-out infinite alternate;
}

.subtitle {
    font-size: 0.85rem;
    letter-spacing: 6px;
    color: var(--neon-pink);
    text-shadow: 0 0 5px var(--neon-pink);
    text-transform: uppercase;
    margin-top: 5px;
}

.main-footer, .main-header {
    width: 100%;
    max-width: 1200px;
    padding: 10px;
    text-align: center;
}

.main-footer p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
}

/* ----------------------------------------------------
   LAYOUT: ARCADE WRAPPER
   ---------------------------------------------------- */
.arcade-wrapper {
    display: flex;
    gap: 24px;
    max-width: 1100px;
    width: 100%;
    justify-content: center;
    align-items: stretch;
    padding: 10px;
    z-index: 5;
    flex-grow: 1;
}

/* ----------------------------------------------------
   ARCADE CABINET (CENTER)
   ---------------------------------------------------- */
.arcade-cabinet {
    position: relative;
    background-color: var(--bg-cabinet);
    border: 4px solid #1a1e36;
    border-radius: 16px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 
        0 0 30px rgba(0, 0, 0, 0.8),
        inset 0 0 20px rgba(0, 243, 255, 0.15);
    background-image: 
        linear-gradient(to bottom, rgba(16, 18, 30, 0.8), rgba(8, 9, 15, 0.95));
}

.arcade-cabinet::before {
    content: '';
    position: absolute;
    top: -4px; left: -4px; right: -4px; bottom: -4px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple), var(--neon-pink));
    z-index: -1;
    opacity: 0.4;
    filter: blur(2px);
}

.cabinet-top-neon {
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), var(--neon-pink), var(--neon-cyan), transparent);
    box-shadow: 0 0 10px var(--neon-cyan);
    margin-bottom: 12px;
    border-radius: 3px;
}

/* ----------------------------------------------------
   CANVAS CONTAINER & OVERLAYS
   ---------------------------------------------------- */
.canvas-container {
    position: relative;
    width: 450px;
    height: 750px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(0, 243, 255, 0.4);
    box-shadow: 
        0 0 20px rgba(0, 243, 255, 0.2),
        inset 0 0 30px rgba(0, 0, 0, 0.9);
    background-color: #000;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    background-color: #000;
}

/* CRT Screen Effect Curve Simulation */
.canvas-container::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    z-index: 8;
    background-size: 100% 3px, 6px 100%;
    pointer-events: none;
}

/* Game overlays (Start, Game Over, Paused, Level Up) */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 9, 15, 0.95); /* 블러 효과 대신 불투명도 조절로 성능 확보 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.overlay-content {
    width: 85%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    animation: scale-up 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scale-up {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.arcade-title {
    font-family: var(--font-arcade);
    font-size: 1.5rem;
    line-height: 1.6;
    letter-spacing: 2px;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.6);
}

.overlay-desc {
    font-size: 0.85rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
}

.score-summary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px 25px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.95rem;
    font-family: var(--font-arcade);
    line-height: 1.5;
}

.new-record {
    color: var(--neon-yellow);
    font-family: var(--font-arcade);
    font-size: 0.9rem;
    animation: blink 0.8s infinite alternate;
}

/* Cabinet details */
.cabinet-speaker-grille {
    width: 80%;
    height: 12px;
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    opacity: 0.4;
}

.cabinet-speaker-grille span {
    width: 3px;
    height: 100%;
    background-color: #2b304d;
    border-radius: 1.5px;
}

/* ----------------------------------------------------
   ARCADE SIDEBARS (LEFT & RIGHT)
   ---------------------------------------------------- */
.arcade-sidebar {
    width: 250px;
    background-color: var(--panel-bg);
    border: 2px solid var(--panel-border);
    border-radius: 12px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5),
        inset 0 0 15px rgba(0, 243, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.right-panel {
    border-color: var(--panel-border-pink);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5),
        inset 0 0 15px rgba(255, 0, 127, 0.05);
}

.panel-header {
    background: linear-gradient(90deg, rgba(0, 243, 255, 0.15), transparent);
    border-bottom: 2px solid var(--panel-border);
    padding: 12px 16px;
    font-family: var(--font-orbitron);
    font-weight: 700;
    letter-spacing: 3px;
    font-size: 0.95rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 5px rgba(0, 243, 255, 0.3);
}

.right-panel .panel-header {
    background: linear-gradient(90deg, rgba(255, 0, 127, 0.15), transparent);
    border-bottom: 2px solid var(--panel-border-pink);
    color: var(--neon-pink);
    text-shadow: 0 0 5px rgba(255, 0, 127, 0.3);
}

.panel-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.flex-grow {
    flex-grow: 1;
}

/* Status Elements */
.status-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-item .label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 2px;
}

.status-item .value {
    font-family: var(--font-arcade);
    font-size: 1.4rem;
    letter-spacing: 1px;
}

.small-value {
    font-size: 0.85rem !important;
    color: rgba(255, 255, 255, 0.8);
}

/* HP / Shield Bar */
.bar-container {
    height: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 243, 255, 0.2);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
}

.bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.1s ease-out;
}

.shield-fill {
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
    box-shadow: 0 0 8px var(--neon-cyan);
}

/* Survival Level Progress Timer */
.time-progress-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.time-progress-bar {
    height: 6px;
    background: linear-gradient(90deg, var(--neon-green), #00ff73);
    box-shadow: 0 0 6px var(--neon-green);
    border-radius: 3px;
    transition: width 0.05s linear;
}

.status-divider {
    height: 2px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    margin: 10px 0;
}

/* Radar Animation Widget */
.radar-box {
    margin-top: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    border-top: 1px solid rgba(0, 243, 255, 0.1);
    background: rgba(0, 0, 0, 0.15);
}

.radar-circle {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 1px solid rgba(0, 243, 255, 0.3);
    position: relative;
    overflow: hidden;
    background: 
        radial-gradient(circle, transparent 20%, rgba(0, 243, 255, 0.02) 20%, rgba(0, 243, 255, 0.02) 40%, transparent 40%, transparent 60%, rgba(0, 243, 255, 0.02) 60%, rgba(0, 243, 255, 0.02) 80%, transparent 80%),
        linear-gradient(rgba(0, 243, 255, 0.05) 1px, transparent 1px) 50% 50% / 100% 10px,
        linear-gradient(90deg, rgba(0, 243, 255, 0.05) 1px, transparent 1px) 50% 50% / 10px 100%;
}

.radar-sweep {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0; left: 0;
    background: conic-gradient(from 0deg, rgba(0, 243, 255, 0.15) 0deg, rgba(0, 243, 255, 0.05) 90deg, transparent 180deg);
    border-radius: 50%;
    animation: radar-rotate 4s linear infinite;
    transform-origin: center;
}

.radar-dot {
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: var(--neon-pink);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--neon-pink);
    animation: radar-ping 2s infinite ease-out;
}

.radar-player {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background-color: var(--neon-green);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 6px var(--neon-green);
}

@keyframes radar-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes radar-ping {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

.radar-text {
    font-size: 0.55rem;
    color: var(--neon-cyan);
    letter-spacing: 2px;
}

/* ----------------------------------------------------
   CONTROLS & SETTINGS (RIGHT)
   ---------------------------------------------------- */
.control-toggle-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-toggle-box .label {
    font-size: 0.75rem;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.4);
}

.toggle-buttons {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 127, 0.2);
    border-radius: 6px;
    padding: 3px;
}

.toggle-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-family: var(--font-orbitron);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 8px 0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-btn.active {
    background-color: var(--neon-pink);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(255, 0, 127, 0.4);
}

/* Keycap styling */
.help-card {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.help-item {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.key-cap {
    width: 26px;
    height: 26px;
    background: #1f2235;
    border: 2px solid #363c5a;
    border-bottom: 4px solid #363c5a;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    color: var(--neon-cyan);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.1);
}

.key-cap-wide {
    height: 26px;
    min-width: 26px;
    padding: 0 6px;
    background: #1f2235;
    border: 2px solid #363c5a;
    border-bottom: 4px solid #363c5a;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--neon-cyan);
}

.mouse-icon {
    font-size: 1.5rem;
    animation: bounce-x 1.5s infinite alternate;
}

@keyframes bounce-x {
    0% { transform: translateX(-5px); }
    100% { transform: translateX(5px); }
}

.help-desc {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
}

.settings-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 24px; /* 스마트폰 홈버튼 영역과 격치지 않도록 여백 업시치 */
}

.settings-box .label {
    font-size: 0.75rem;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.4);
}

.credits-box {
    margin-top: auto;
    padding: 15px 15px 30px 15px; /* 하단 여백 확장 */
    border-top: 1px solid rgba(255, 0, 127, 0.1);
    background: rgba(0, 0, 0, 0.15);
    text-align: center;
    font-size: 0.48rem;
    line-height: 1.6;
    color: var(--neon-pink);
    letter-spacing: 1px;
}

/* ----------------------------------------------------
   BUTTON STYLES (NEON GLOW)
   ---------------------------------------------------- */
.neon-btn {
    background: transparent;
    border: 2px solid var(--neon-cyan);
    color: #ffffff;
    padding: 12px 30px;
    font-size: 0.9rem;
    font-weight: bold;
    letter-spacing: 3px;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 243, 255, 0.2);
    transition: all 0.25s ease-out;
    position: relative;
    overflow: hidden;
}

.neon-btn::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.5s;
}

.neon-btn:hover::after {
    left: 100%;
}

.neon-btn:hover {
    background-color: var(--neon-cyan);
    color: #000000;
    box-shadow: var(--shadow-cyan);
    text-shadow: none;
}

.btn-pink {
    border-color: var(--neon-pink);
    box-shadow: 0 0 5px rgba(255, 0, 127, 0.2);
}

.btn-pink:hover {
    background-color: var(--neon-pink);
    color: #ffffff;
    box-shadow: var(--shadow-pink);
}

.neon-btn-small {
    background: transparent;
    border: 1px solid var(--neon-pink);
    color: var(--neon-pink);
    padding: 8px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.neon-btn-small:hover {
    background-color: var(--neon-pink);
    color: #ffffff;
    box-shadow: var(--shadow-pink);
}

/* ----------------------------------------------------
   UTILITIES / CORE ANIMATIONS
   ---------------------------------------------------- */
.hidden {
    display: none !important;
}

.text-cyan { color: var(--neon-cyan) !important; }
.text-pink { color: var(--neon-pink) !important; }
.text-yellow { color: var(--neon-yellow) !important; }
.text-green { color: var(--neon-green) !important; }

.font-arcade {
    font-family: var(--font-arcade) !important;
}

.font-orbitron {
    font-family: var(--font-orbitron) !important;
}

@keyframes text-pulse {
    from { text-shadow: 0 0 5px #fff, 0 0 10px var(--neon-cyan), 0 0 20px var(--neon-cyan); }
    to { text-shadow: 0 0 5px #fff, 0 0 15px var(--neon-cyan), 0 0 35px var(--neon-cyan), 0 0 45px var(--neon-cyan); }
}

.pulse-glow {
    animation: text-pulse-pink 1.5s ease-in-out infinite alternate;
}

@keyframes text-pulse-pink {
    from { text-shadow: 0 0 5px #fff, 0 0 10px var(--neon-pink), 0 0 20px var(--neon-pink); }
    to { text-shadow: 0 0 5px #fff, 0 0 15px var(--neon-pink), 0 0 30px var(--neon-pink); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.blink-fast {
    animation: blink 0.4s infinite;
}

/* Level warp transition bar */
.level-transition-meter {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    margin-top: 10px;
}

.warp-beam {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--neon-green), transparent);
    position: absolute;
    left: -100%;
    animation: warp-charge 2.0s infinite linear;
}

@keyframes warp-charge {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ----------------------------------------------------
   RESPONSIVE DESIGN
   ---------------------------------------------------- */
/* 좁은 데스크톱 창(801px ~ 1040px)에서도 3단 날개 배치를 예쁘게 유지하기 위한 최적화 */
@media (min-width: 801px) and (max-width: 1040px) {
    .arcade-wrapper {
        gap: 12px;
        padding: 5px;
    }
    .arcade-sidebar {
        width: 180px; /* 날개 너비를 줄여 가로 폭을 확보 */
    }
    .panel-header {
        padding: 8px 10px;
        font-size: 0.8rem;
        letter-spacing: 1px;
    }
    .status-item {
        font-size: 0.65rem;
    }
    .status-item .value {
        font-size: 0.85rem;
    }
    .toggle-buttons {
        gap: 4px;
    }
    .toggle-btn {
        font-size: 0.55rem;
        padding: 4px 6px;
    }
    .key-cap, .key-cap-wide {
        font-size: 0.55rem;
        padding: 2px 4px;
    }
}

/* 태블릿 세로 및 모바일 환경(800px 이하)에서만 아래로 순차 배치 */
@media (max-width: 800px) {
    .arcade-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .arcade-sidebar {
        width: 450px;
        order: 2;
    }
    
    .left-panel {
        order: 2;
    }
    
    .right-panel {
        order: 3;
    }
    
    .arcade-cabinet {
        order: 1;
    }
    
    .radar-box, .credits-box {
        display: none;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px 0;
    }
    
    .glow-text {
        font-size: 2rem;
    }
    
    .arcade-sidebar {
        width: 100%;
        max-width: 350px;
    }
    
    .arcade-cabinet {
        width: 100%;
        max-width: 380px;
        padding: 10px;
    }
    
    .canvas-container {
        width: 100%;
        height: 550px; /* scaled down vertically on mobile */
    }
}

/* ----------------------------------------------------
   LEADERBOARD & PILOT REGISTRATION STYLES
   ---------------------------------------------------- */
.leaderboard-table-container {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(0, 243, 255, 0.15);
    border-radius: 6px;
    padding: 8px;
    margin-top: 5px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.58rem;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.85);
}

.leaderboard-table tr {
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}

.leaderboard-table tr:last-child {
    border-bottom: none;
}

.leaderboard-table td {
    padding: 6px 4px;
    vertical-align: middle;
}

/* Rank Highlights */
.rank-row-1 {
    color: var(--neon-yellow) !important;
    text-shadow: 0 0 4px rgba(255, 251, 0, 0.4);
    font-weight: bold;
}

.rank-row-2 {
    color: var(--neon-cyan) !important;
    text-shadow: 0 0 4px rgba(0, 243, 255, 0.4);
}

.rank-row-3 {
    color: var(--neon-pink) !important;
    text-shadow: 0 0 4px rgba(255, 0, 127, 0.4);
}

/* GameOver Input form */
.ranking-input-box {
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px dashed rgba(0, 243, 255, 0.3);
    border-radius: 8px;
    padding: 18px 25px;
    width: 100%;
}

.ranking-prompt {
    font-size: 0.72rem;
    letter-spacing: 1.5px;
    font-weight: 700;
    text-shadow: 0 0 5px rgba(0, 243, 255, 0.3);
    animation: text-pulse 1.5s infinite alternate;
}

.cyber-input {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid var(--neon-cyan);
    box-shadow: 
        inset 0 0 8px rgba(0, 243, 255, 0.2),
        0 0 6px rgba(0, 243, 255, 0.1);
    color: #ffffff;
    font-family: var(--font-orbitron);
    font-weight: 700;
    font-size: 1.15rem;
    padding: 8px 12px;
    width: 200px;
    text-align: center;
    letter-spacing: 4px;
    outline: none;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.cyber-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 2px;
}

.cyber-input:focus {
    border-color: var(--neon-pink);
    box-shadow: 
        inset 0 0 8px rgba(255, 0, 127, 0.2),
        0 0 12px rgba(255, 0, 127, 0.4);
}

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

.btn-cyan:hover {
    background-color: var(--neon-cyan);
    color: #000000;
    box-shadow: var(--shadow-cyan);
}

/* ----------------------------------------------------
   V2 SHOP / HANGAR STYLES
   ---------------------------------------------------- */
.shop-credits {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 0 8px rgba(255, 251, 0, 0.4);
    background: rgba(255, 251, 0, 0.05);
    border: 1px solid rgba(255, 251, 0, 0.2);
    padding: 6px 20px;
    border-radius: 20px;
    margin-bottom: 2px;
}

.ship-select-container {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden !important;
    gap: 10px;
    width: 100%;
    margin-bottom: 8px;
    padding: 5px 2px 12px 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--neon-cyan) rgba(8, 9, 15, 0.5);
}

.ship-card {
    flex: 0 0 145px;
    min-height: 140px;
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px solid rgba(0, 243, 255, 0.15);
    border-radius: 8px;
    padding: 10px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    gap: 5px;
}

.ship-card:hover {
    border-color: rgba(0, 243, 255, 0.4);
    background: rgba(0, 243, 255, 0.03);
}

.ship-card.active {
    border-color: var(--neon-cyan);
    background: rgba(0, 243, 255, 0.1);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.25);
}

.ship-card[data-ship-id="magnet"].active {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.25);
}

.ship-card[data-ship-id="aegis"].active {
    border-color: var(--neon-purple);
    background: rgba(157, 0, 255, 0.1);
    box-shadow: 0 0 10px rgba(157, 0, 255, 0.25);
}

.ship-card[data-ship-id="swift"].active {
    border-color: var(--neon-pink);
    background: rgba(255, 0, 127, 0.1);
    box-shadow: 0 0 10px rgba(255, 0, 127, 0.25);
}

.ship-name {
    font-family: var(--font-orbitron);
    font-weight: 900;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
}

.ship-desc {
    font-size: 0.55rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.3;
}

.ship-specs {
    font-family: var(--font-orbitron);
    font-size: 0.52rem;
    color: var(--neon-green);
    letter-spacing: 0.2px;
}

.btn-ship-action {
    width: 100%;
    font-size: 0.58rem !important;
    padding: 5px 0 !important;
}

/* Upgrade rows */
.upgrades-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px;
}

.upgrade-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.up-label {
    font-size: 0.58rem;
    color: rgba(255, 255, 255, 0.75);
    width: 42%;
}

.up-status {
    font-size: 0.65rem;
    letter-spacing: 1.5px;
    width: 28%;
}

.btn-upgrade {
    width: 30%;
    font-size: 0.56rem !important;
    padding: 4px 0 !important;
    border-color: var(--neon-green) !important;
    color: var(--neon-green) !important;
}

.btn-upgrade:hover {
    background-color: var(--neon-green) !important;
    color: #000000 !important;
    box-shadow: var(--shadow-green) !important;
}

/* ----------------------------------------------------
   V2 AD SCREEN ANIMATION
   ---------------------------------------------------- */
.ad-screen {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 30px;
    background: radial-gradient(circle, #101525 0%, #030508 100%);
    overflow: hidden;
}

.ad-tv-lines {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.3) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.05), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.05));
    background-size: 100% 4px, 8px 100%;
    z-index: 5;
    pointer-events: none;
}

.ad-header {
    font-size: 0.65rem;
    color: var(--neon-yellow);
    letter-spacing: 2px;
    margin-bottom: 25px;
}

.ad-desc {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 30px;
    font-style: italic;
    line-height: 1.5;
}

.ad-progress-bar-container {
    width: 80%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 15px;
}

.ad-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--neon-pink), var(--neon-purple));
    box-shadow: 0 0 10px var(--neon-pink);
    transition: width 0.1s linear;
}

.ad-timer {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
}

/* Glitch text effect for AD */
.ad-glitch-text {
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 4px;
    color: #ffffff;
    text-shadow: 0 0 10px var(--neon-cyan);
    position: relative;
    margin-bottom: 15px;
}

.ad-glitch-text::before,
.ad-glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: transparent;
}

.ad-glitch-text::before {
    left: 2px;
    text-shadow: -1px 0 var(--neon-pink);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.ad-glitch-text::after {
    left: -2px;
    text-shadow: -1px 0 var(--neon-cyan), 0 1px var(--neon-cyan);
    clip: rect(85px, 450px, 140px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(15px, 9999px, 66px, 0); }
    100% { clip: rect(34px, 9999px, 55px, 0); }
}

@keyframes glitch-anim2 {
    0% { clip: rect(70px, 9999px, 105px, 0); }
    100% { clip: rect(12px, 9999px, 85px, 0); }
}

/* Scrollbar and size limits for Hangar overlay */
#overlay-hangar .overlay-content {
    max-height: 95%;
    overflow-y: auto;
    padding-right: 5px;
}

#overlay-hangar .overlay-content::-webkit-scrollbar {
    width: 4px;
}
#overlay-hangar .overlay-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
#overlay-hangar .overlay-content::-webkit-scrollbar-thumb {
    background: var(--neon-pink);
    border-radius: 2px;
}

/* Credit Refill Shop Container (네온 아케이드 테두리 및 그림자) */
.coin-shop-container {
    width: 100%;
    background: rgba(16, 9, 28, 0.6);
    border: 2px solid var(--neon-pink);
    border-radius: 12px;
    padding: 14px 10px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
    box-shadow: 0 0 15px rgba(255, 0, 127, 0.2), inset 0 0 15px rgba(255, 0, 127, 0.15);
    position: relative;
}

.shop-title {
    font-size: 0.62rem;
    letter-spacing: 2px;
    text-align: center;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(255, 0, 127, 0.5);
}

.package-list {
    display: flex;
    gap: 12px;
    width: 100%;
    margin-top: 4px;
}

/* 패키지 카드 기본 개선 스타일 */
.package-card {
    flex: 1;
    background: rgba(8, 9, 15, 0.75);
    border: 2px solid rgba(255, 0, 127, 0.3);
    border-radius: 8px;
    padding: 14px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    overflow: visible; /* 뱃지가 영역 밖으로 튀어나올 수 있도록 */
}

.package-card:hover {
    border-color: var(--neon-cyan);
    background: rgba(0, 243, 255, 0.05);
    transform: translateY(-4px);
    box-shadow: 0 5px 15px rgba(0, 243, 255, 0.3);
}

.package-card.active {
    border-color: var(--neon-cyan);
    background: rgba(0, 243, 255, 0.15);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.4), inset 0 0 5px rgba(0, 243, 255, 0.2);
}

/* 🌟 1달러 패키지 (STARTER) 전용 네온 글로우 스타일 */
.package-card.pack-starter {
    border: 2px solid var(--neon-yellow);
    box-shadow: 0 0 10px rgba(255, 251, 0, 0.3), inset 0 0 5px rgba(255, 251, 0, 0.1);
    animation: neon-pulse-yellow 2.0s infinite alternate;
}

.package-card.pack-starter:hover {
    border-color: #ffffff;
    box-shadow: 0 0 20px var(--neon-yellow), 0 0 25px var(--neon-pink);
    transform: scale(1.05) translateY(-5px);
}

.package-card.pack-starter.active {
    border-color: var(--neon-yellow);
    background: rgba(255, 251, 0, 0.15);
    box-shadow: 0 0 20px var(--neon-yellow), inset 0 0 10px rgba(255, 251, 0, 0.2);
}

/* 1달러 스페셜 뱃지 스타일 */
.pack-badge {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(90deg, var(--neon-pink), var(--neon-purple));
    color: #ffffff;
    font-size: 0.45rem;
    font-weight: 900;
    padding: 2px 7px;
    border-radius: 10px;
    border: 1px solid #ffffff;
    box-shadow: 0 0 8px var(--neon-pink);
    white-space: nowrap;
    z-index: 5;
    letter-spacing: 0.5px;
}

.pack-name {
    font-size: 0.52rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.8px;
}

.pack-amount {
    font-family: var(--font-orbitron);
    font-size: 0.85rem;
    font-weight: bold;
}

.pack-price {
    font-family: var(--font-orbitron);
    font-size: 0.6rem;
    color: #ffffff;
    font-weight: 700;
}

/* PayPal 버튼 영역 홀로그래픽 감싸기 */
#paypal-button-container {
    width: 100%;
    margin-top: 6px;
    padding: 4px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
    transition: all 0.3s ease;
}

#paypal-button-container:hover {
    box-shadow: 0 0 12px rgba(255, 251, 0, 0.2);
    border-color: rgba(255, 251, 0, 0.15);
}

/* 1달러 전용 펄스 애니메이션 */
@keyframes neon-pulse-yellow {
    0% {
        box-shadow: 0 0 8px rgba(255, 251, 0, 0.3), inset 0 0 4px rgba(255, 251, 0, 0.1);
    }
    100% {
        box-shadow: 0 0 16px rgba(255, 251, 0, 0.6), inset 0 0 8px rgba(255, 251, 0, 0.2), 0 0 10px rgba(255, 0, 127, 0.15);
    }
}

/* 🐕 격납고 기체 선택 영역 가로 스크롤 오버라이드 */
.ship-select-container {
    max-height: 190px;  /* 가로 스크롤바 높이를 고려하여 넉넉히 확장해 뭉개짐 및 세로 스크롤 방지 */
    overflow-x: auto;   /* 가로 스크롤 활성화 */
    overflow-y: hidden !important;
    margin-bottom: 6px;
    scrollbar-width: thin;
    scrollbar-color: var(--neon-cyan) rgba(8, 9, 15, 0.5);
}

/* 스크롤바 레트로 디자인 최적화 (가로) */
.ship-select-container::-webkit-scrollbar {
    height: 6px;
}
.ship-select-container::-webkit-scrollbar-track {
    background: rgba(8, 9, 15, 0.5);
    border-radius: 3px;
}
.ship-select-container::-webkit-scrollbar-thumb {
    background: var(--neon-cyan);
    border-radius: 3px;
    box-shadow: 0 0 6px var(--neon-cyan);
}
.ship-select-container::-webkit-scrollbar-thumb:hover {
    background: var(--neon-pink);
    box-shadow: 0 0 10px var(--neon-pink);
}

/* ----------------------------------------------------
   V3 USER AUTH & LOGIN MODAL STYLES
   ---------------------------------------------------- */
.pilot-profile-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(0, 243, 255, 0.15);
    border-radius: 8px;
    padding: 8px 10px;
    margin-top: 5px;
}

.pilot-avatar-default {
    width: 28px;
    height: 28px;
    background: #1f2235;
    border: 1.5px solid var(--neon-cyan);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    box-shadow: 0 0 5px rgba(0, 243, 255, 0.3);
}

.pilot-avatar-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid var(--neon-cyan);
    object-fit: cover;
    box-shadow: 0 0 5px rgba(0, 243, 255, 0.3);
}

.pilot-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pilot-status-text {
    font-size: 0.48rem;
    color: rgba(255, 255, 255, 0.4);
    font-family: var(--font-arcade);
    letter-spacing: 0.5px;
}

.pilot-status-text.online {
    color: var(--neon-green);
    text-shadow: 0 0 4px rgba(57, 255, 20, 0.3);
}

/* Modal Overlay */
.login-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 6, 10, 0.85);
    backdrop-filter: blur(10px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.login-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Modal Content */
.login-modal-content {
    width: 90%;
    max-width: 360px;
    background-color: var(--bg-cabinet);
    border: 3px solid var(--neon-cyan);
    border-radius: 16px;
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.25), inset 0 0 20px rgba(0, 0, 0, 0.8);
    padding: 20px;
    position: relative;
    animation: scale-up 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(0, 243, 255, 0.2);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.btn-close-x {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.btn-close-x:hover {
    color: var(--neon-pink);
    text-shadow: 0 0 8px var(--neon-pink);
}

.login-modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.cyber-input-field {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid var(--neon-cyan);
    box-shadow: inset 0 0 8px rgba(0, 243, 255, 0.2);
    color: #ffffff;
    font-family: var(--font-orbitron);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 10px 12px;
    width: 100%;
    outline: none;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.cyber-input-field:focus {
    border-color: var(--neon-pink);
    box-shadow: inset 0 0 8px rgba(255, 0, 127, 0.2), 0 0 10px rgba(255, 0, 127, 0.3);
}

/* 모바일 및 터치 유저용 일시정지 버튼 */
.btn-pause-trigger {
    position: absolute;
    top: 55px;
    right: 15px;
    width: 38px;
    height: 38px;
    background: rgba(16, 18, 30, 0.6);
    border: 1.5px solid var(--neon-cyan);
    border-radius: 50%;
    color: var(--neon-cyan);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 16;
    box-shadow: 0 0 8px rgba(0, 243, 255, 0.2);
    transition: all 0.2s ease;
    outline: none;
}

.btn-pause-trigger:hover {
    background: var(--neon-cyan);
    color: #000000;
    box-shadow: var(--shadow-cyan);
}

.btn-pause-trigger:active {
    transform: scale(0.9);
}

/* 오버레이가 활성화되면 일시정지 버튼을 가리기 */
.canvas-container:has(.game-overlay.active) .btn-pause-trigger {
    opacity: 0;
    pointer-events: none;
}

/* ============================
   🎮 모바일 인게임 HUD 스타일
   ============================ */
.mobile-game-hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;  /* 캔버스 위, 오버레이(100) 아래 */
    display: none; /* 기본 숨김 - JS로 게임 중에만 표시 */
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    padding: 6px 10px;
    background: linear-gradient(180deg, rgba(5, 8, 20, 0.85) 0%, rgba(5, 8, 20, 0) 100%);
    pointer-events: none; /* 터치 이벤트 통과 */
    font-family: 'Orbitron', monospace;
}

.hud-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 8px;
    padding: 3px 8px;
}

.hud-label {
    font-size: 0.6rem;
    color: rgba(0, 255, 255, 0.7);
    letter-spacing: 0.05em;
}

.hud-value {
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.05em;
}

.hud-level .hud-value { color: #ffd700; }
.hud-shield .hud-value { color: #00ffff; }
.hud-time .hud-value   { color: #ff6fff; }

/* 오버레이 활성화 시 HUD 숨기기 */
.canvas-container:has(.game-overlay.active) .mobile-game-hud {
    display: none !important;
}

@media (max-width: 480px) {
    .btn-pause-trigger {
        top: 50px;
        right: 12px;
        width: 44px;
        height: 44px;
        font-size: 0.9rem;
        background-color: transparent;
        box-shadow: none;
    }
    .mobile-game-hud {
        max-width: calc(100% - 70px);
    }

    /* 🐕 모바일 환경 상점/격납고 오버레이 극한 최적화 (짤림 방지 및 터치 스크롤 복구) */
    #overlay-hangar .overlay-content {
        gap: 6px !important;       /* 요소 간 간격 극대화 축소 */
        padding: 10px 5px !important;
        max-height: 98% !important; /* 가용 공간 극대화 */
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important; /* iOS 모바일 부드러운 스크롤 강제 */
    }

    #overlay-hangar .arcade-title {
        font-size: 0.95rem !important;
        margin-bottom: 0px !important;
    }

    #overlay-hangar .shop-credits {
        font-size: 0.75rem !important;
        padding: 3px 12px !important;
        margin-bottom: 0px !important;
    }

    /* 기체 선택 가로 스크롤 영역 모바일 축소 */
    .ship-select-container {
        max-height: 110px !important; /* 모바일에서는 높이를 대폭 줄여서 상하 공간 확보 */
        margin-bottom: 4px !important;
    }

    .ship-card {
        flex: 0 0 115px !important; /* 카드 너비를 115px로 더 콤팩트하게 */
        min-height: 100px !important;
        padding: 6px 4px !important;
        gap: 3px !important;
    }

    .ship-name {
        font-size: 0.6rem !important;
    }

    .ship-desc {
        font-size: 0.45rem !important;
        line-height: 1.1 !important;
    }

    .ship-specs {
        font-size: 0.42rem !important;
    }

    .btn-ship-action {
        font-size: 0.5rem !important;
        padding: 3px 0 !important;
    }

    /* 업그레이드 슬롯 모바일 축소 */
    .upgrades-container {
        gap: 4px !important;
        padding: 6px !important;
    }

    .upgrade-row {
        gap: 4px !important;
    }

    .up-label {
        font-size: 0.48rem !important;
    }

    .up-status {
        font-size: 0.52rem !important;
        letter-spacing: 0.5px !important;
    }

    .btn-upgrade {
        font-size: 0.48rem !important;
        padding: 2px 0 !important;
    }

    /* 결제 충전소 모바일 축소 */
    .coin-shop-container {
        padding: 8px 6px 6px 6px !important;
        gap: 6px !important;
        margin-top: 4px !important;
        border-radius: 8px !important;
    }

    .shop-title {
        font-size: 0.52rem !important;
    }

    .package-list {
        gap: 6px !important;
    }

    .package-card {
        padding: 8px 4px !important;
        gap: 2px !important;
        border-radius: 6px !important;
    }

    .pack-badge {
        font-size: 0.38rem !important;
        padding: 1px 4px !important;
    }

    .pack-name {
        font-size: 0.45rem !important;
    }

    .pack-amount {
        font-size: 0.7rem !important;
    }

    .pack-price {
        font-size: 0.5rem !important;
    }

    #btn-portone-pay {
        font-size: 0.62rem !important;
        padding: 6px 0 !important;
        margin-top: 2px !important;
    }

    #paypal-button-container {
        margin-top: 2px !important;
        padding: 2px !important;
    }

    #btn-close-hangar {
        padding: 6px 0 !important;
        font-size: 0.7rem !important;
        margin-top: 2px !important;
    }
}

/* 로비 광고/배너 컨테이너 (정밀 가운데 정렬 및 네온 보더) */
.lobby-ad-container {
    width: 300px;
    height: 100px;
    margin: 15px auto 0 auto;
    background-color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid rgba(0, 243, 255, 0.35); /* 점선 제거 -> 세련된 실선 네온 블루 */
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    align-self: center; /* 플렉스 부모 기준 확실한 수평 정렬 */
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.15);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* 정방형 크기 스케일 전환 애니메이션 */
}

/* 🐕 골디 보이저 스킨 장착 시 정방형 골드 네온 액자 오버라이드 */
.lobby-ad-container.skin-frame-goldie {
    width: 120px;
    height: 120px;
    border-color: var(--neon-yellow);
    box-shadow: 0 0 15px rgba(255, 251, 0, 0.45), inset 0 0 5px rgba(255, 251, 0, 0.2);
    border-radius: 12px;
}

/* 🐕 사이버 버디 스킨 장착 시 정방형 네온 그린 액자 오버라이드 */
.lobby-ad-container.skin-frame-buddy {
    width: 120px;
    height: 120px;
    border-color: var(--neon-green);
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.45), inset 0 0 5px rgba(57, 255, 20, 0.2);
    border-radius: 12px;
}

.adsense-fallback-text {
    position: absolute;
    color: #2b304d;
    font-size: 9px;
    z-index: 1;
    pointer-events: none;
}

/* 🐕 댕댕이 스킨 배너 전용 (스킨 적용 시 cover로 꽉 차서 큼직하게 연출) */
.lobby-skin-banner {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 정방형 액자가 되므로 꽉 채워서 크게 묘사 */
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%); /* 강제 가로 중앙 정렬 */
    z-index: 10;
    background-color: #000000;
    pointer-events: none;
}

/* 기본 비행선 배너만 가로형 contain 유지 */
#lobby-skin-banner-default {
    object-fit: contain;
}

/* ----------------------------------------------------
   V4 IN-GAME HUD STYLES
   ---------------------------------------------------- */
.in-game-hud {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    display: flex;
    justify-content: space-between;
    z-index: 15; /* 캔버스 및 CRT 필터(8)보다 위에 오도록 배치 */
    background: rgba(8, 9, 15, 0.75);
    border: 1.5px solid rgba(0, 243, 255, 0.25);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.15), inset 0 0 5px rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    padding: 6px 15px;
    pointer-events: none; /* 터치 방해 금지 */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.in-game-hud.active {
    opacity: 1;
}

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

.hud-label {
    font-size: 0.55rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
}

.hud-value {
    font-family: var(--font-orbitron);
    font-weight: 900;
    font-size: 0.82rem;
    letter-spacing: 0.5px;
}

/* 실드 컨테이너 */
.hud-shield-wrapper {
    flex-grow: 1;
    max-width: 45%;
    margin: 0 10px;
}

.hud-shield-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 243, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 0 3px rgba(0,0,0,0.5);
}

.hud-shield-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
    border-radius: 4px;
    box-shadow: 0 0 6px var(--neon-cyan);
    transition: width 0.1s ease-out;
}

/* 모바일 뷰포트에서 HUD 패딩 및 top 위치 콤팩트화 */
@media (max-width: 480px) {
    .in-game-hud {
        top: 10px;
        width: 86%;
        padding: 4px 12px;
    }
    .hud-value {
        font-size: 0.75rem;
    }
}


/* ----------------------------------------------------
   MOBILE PERFORMANCE OPTIMIZATIONS (ADDED V2.1)
   ---------------------------------------------------- */
@media (max-width: 768px) {
    /* Disable heavy blur/gradients on mobile WebView */
    .arcade-cabinet::before {
        display: none !important;
    }
    
    /* Disable heavy 3D animated grid */
    .cyber-grid {
        display: none !important;
    }
    
    /* Disable CRT overlay */
    .canvas-container::after {
        display: none !important;
    }
}
