/* -------------------------------------------------------------
   Anesthesia Briefs Laryngoscope Launcher Game Stylesheet
   Premium Glassmorphic Arcade UI
   ------------------------------------------------------------- */

/* Game specific variables */
:root {
    --game-bg: #090F1E;
    --panel-bg: rgba(13, 27, 46, 0.7);
    --panel-border: rgba(194, 162, 103, 0.2);
    --text-gold-light: #FCD34D;
}

/* Game Wrapper Layout */
.game-section {
    padding: 120px 0 60px 0;
    min-height: calc(100vh - 100px);
    background: radial-gradient(circle at 50% 50%, #172B4D 0%, #090F1E 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-card-wrapper {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    width: 100%;
    max-width: 960px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.game-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-white) !important;
}

.game-title span {
    color: var(--accent-gold);
}

.game-actions-hud {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hud-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-white);
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition-smooth);
}

.hud-btn:hover {
    background: var(--accent-gold);
    color: var(--primary-color);
    border-color: var(--accent-gold);
    transform: translateY(-2px);
}

/* Canvas Area Container */
.game-viewport-wrapper {
    position: relative;
    width: 100%;
}

.canvas-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--game-bg);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8);
}

#gameCanvas2D, #gameCanvas3D {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
}

/* Overlay Screens (Start, Game Over, Pause) */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(9, 15, 30, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: opacity 0.4s ease;
    padding: 15px;
    text-align: center;
    box-sizing: border-box;
}

.overlay-panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(194, 162, 103, 0.05);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    max-width: 520px;
    width: 100%;
    transform: translateY(0);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-sizing: border-box;
}

.overlay-title {
    font-size: 24px;
    font-weight: 800;
    color: #FFFFFF;
    margin-bottom: 8px;
    font-family: var(--font-heading);
}

.overlay-subtitle {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 12px;
}

.overlay-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.stat-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-md);
    padding: 12px;
}

.stat-label {
    font-size: 12px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-val {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-gold);
}

.btn-game-primary {
    background: linear-gradient(135deg, var(--accent-gold) 0%, #D97706 100%);
    color: var(--primary-color);
    border: none;
    padding: 14px 28px;
    border-radius: var(--border-radius-md);
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(217, 119, 6 0.3);
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-game-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(217, 119, 6, 0.5);
    filter: brightness(1.1);
}

.btn-game-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-white);
    padding: 12px 24px;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-game-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

/* Control Settings Panel below Canvas */
.game-controls-panel {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 30px;
    margin-top: 24px;
    align-items: center;
}

.controls-sliders {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.slider-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

.slider-header span:last-child {
    color: var(--accent-gold);
}

/* Styled Range Sliders */
.game-range {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.game-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-gold);
    cursor: pointer;
    box-shadow: 0 0 10px var(--accent-gold);
    transition: transform 0.1s ease;
}

.game-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.fire-btn-area {
    display: flex;
    align-items: center;
}

.btn-fire {
    background: linear-gradient(135deg, var(--accent-red) 0%, #DC2626 100%);
    color: #FFFFFF;
    border: none;
    padding: 16px 40px;
    border-radius: var(--border-radius-md);
    font-weight: 800;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(220, 38, 38, 0.3);
    transition: var(--transition-smooth);
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
}

.btn-fire:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(220, 38, 38, 0.5);
    filter: brightness(1.15);
}

/* Hidden elements */
.d-none {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

/* Custom Instruction Panel styling inside overlay */
.instructions-list {
    text-align: left;
    margin: 12px 0;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 12px;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.instructions-list li {
    list-style-type: none;
    position: relative;
    padding-left: 15px;
    line-height: 1.3;
}

.instructions-list li::before {
    content: "⚡";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent-gold);
}

/* Responsive adjustment */
@media (max-width: 768px) {
    .game-section {
        padding: 80px 0 40px 0; /* Reduced top padding for mobile header compatibility */
    }

    .game-card-wrapper {
        padding: 12px;
        border-radius: var(--border-radius-md);
    }
    
    .game-header {
        flex-direction: column;
        gap: 10px;
        align-items: center;
        text-align: center;
        padding-bottom: 12px;
        margin-bottom: 15px;
    }
    
    .game-title {
        font-size: 20px;
    }
    
    .game-actions-hud {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        width: 100%;
    }
    
    .badge-new {
        font-size: 10.5px;
        padding: 4px 8px;
    }
    
    .hud-btn {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
    
    /* Full screen scrollable overlay for mobile to prevent clipping inside the 16:9 canvas container */
    .game-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        z-index: 9999;
        overflow-y: auto;
        padding: 16px 8px;
        background: rgba(9, 15, 30, 0.95);
        display: flex;
        flex-direction: column;
        justify-content: flex-start; /* Start from top to allow scrolling */
        align-items: center; /* Center horizontally */
    }
    
    .overlay-panel {
        margin: 10px auto;
        padding: 15px;
        width: 95%;
        max-width: 440px;
        transform: none; /* No translation offset needed */
        border-radius: var(--border-radius-md);
    }
    
    .overlay-title {
        font-size: 18px;
        margin-bottom: 6px;
    }
    
    .overlay-subtitle {
        font-size: 11px;
        line-height: 1.4;
        margin-bottom: 10px;
    }
    
    .instructions-list {
        grid-template-columns: 1fr; /* Single column to prevent text clipping */
        font-size: 10px;
        gap: 4px;
        padding: 8px 10px;
        margin: 10px 0;
    }
    
    .instructions-list li {
        padding-left: 14px;
    }
    
    #nick-input-container {
        margin-bottom: 10px;
    }
    
    #nick-input-container label {
        font-size: 11.5px !important;
    }
    
    #player-nick {
        width: 120px;
        font-size: 12px;
        padding: 5px 8px;
    }
    
    #player-country {
        width: 75px;
        font-size: 12px;
        padding: 5px 6px;
    }
    
    .overlay-stats {
        gap: 8px;
        margin-bottom: 15px;
    }
    
    .stat-box {
        padding: 8px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    .stat-val {
        font-size: 16px;
    }
    
    #leaderboard-container {
        padding: 6px 8px;
        margin-top: 6px;
        margin-bottom: 12px;
    }
    
    #leaderboard-list {
        max-height: 90px;
        font-size: 10px;
    }
    
    .btn-game-primary {
        padding: 10px 20px;
        font-size: 14px;
        width: 100%;
        justify-content: center;
    }
    
    .game-controls-panel {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-top: 15px;
    }
    
    .controls-sliders {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .slider-header {
        font-size: 12px;
    }
    
    .btn-fire {
        width: 100%;
        padding: 12px;
        font-size: 16px;
    }
}

/* Player Nickname & Country Inputs */
#player-nick {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--border-radius-sm);
    color: white;
    padding: 6px 12px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    width: 140px;
    text-align: center;
    transition: all 0.3s ease;
}

#player-nick:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 10px rgba(194, 162, 103, 0.2);
}

#player-country {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--border-radius-sm);
    color: white;
    padding: 6px 8px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    width: 85px;
    transition: all 0.3s ease;
}

#player-country:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 10px rgba(194, 162, 103, 0.2);
}

#player-country option {
    background-color: #0b0f1e;
    color: white;
}

