* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: none;
}

body, html {
    color: #e2e8f0 !important;
}

#game-container {
    position: relative;
    /* height: 90vh; */
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #0a0f1d 0%, #020408 100%);
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.1);
}

.ui-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    box-sizing: border-box;
    z-index: 10;
}

.interactive {
    pointer-events: auto;
}

/* Overlay modal screens */
.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(3, 7, 18, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
    opacity: 1;
    transition: opacity 0.25s ease-in-out;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.panel {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 16px;
    padding: 32px;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 20px rgba(56, 189, 248, 0.2);
    text-align: center;
}

h1.title {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.subtitle {
    font-size: 0.95rem;
    color: #94a3b8;
    margin-bottom: 24px;
}

.btn2 {
    display: inline-block;
    width: 100%;
    padding: 14px 24px;
    margin: 8px 0;
    background: linear-gradient(135deg, #0284c7 0%, #4338ca 100%);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
    transition: all 0.15s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn2:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.6);
    background: linear-gradient(135deg, #0369a1 0%, #3730a3 100%);
}

.btn2:active {
    transform: translateY(1px);
}

.btn-secondary2 {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: none;
}

.btn-secondary2:hover {
    background: rgba(51, 65, 85, 0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* HUD elements */
.hud-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}

.stat-box {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 8px;
    backdrop-filter: blur(4px);
}

.stat-label {
    font-size: 0.7rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: #f8fafc;
    font-family: monospace;
}

/* Boss Health Bar */
#boss-health-container {
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    max-width: 500px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid #ef4444;
    border-radius: 20px;
    padding: 4px;
    display: none;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

#boss-health-bar {
    height: 12px;
    background: linear-gradient(90deg, #ef4444, #f97316);
    border-radius: 16px;
    width: 100%;
    transition: width 0.1s linear;
}

#boss-label {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: #ef4444;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 0 5px rgba(0,0,0,0.8);
}

/* Controls guide */
.controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 16px 0;
    text-align: left;
    font-size: 0.85rem;
    color: #cbd5e1;
    background: rgba(2, 6, 23, 0.5);
    padding: 12px;
    border-radius: 8px;
}

.kbd {
    background: #334155;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: monospace;
    border: 1px solid #475569;
}

/* Mobile controls overlay */
.touch-controls {
    display: none;
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 15;
}

@media (pointer: coarse) {
    .touch-controls { display: block; }
}

#joystick-zone {
    position: absolute;
    bottom: 30px;
    left: 30px;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    pointer-events: auto;
}

#joystick-knob {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    margin-top: -25px;
    margin-left: -25px;
    background: rgba(56, 189, 248, 0.4);
    border: 2px solid #38bdf8;
    border-radius: 50%;
    pointer-events: none;
}

.action-btn {
    position: absolute;
    pointer-events: auto;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

#btn-mobile-fire {
    bottom: 40px;
    right: 30px;
    width: 70px;
    height: 70px;
    background: rgba(239, 68, 68, 0.6);
    border: 2px solid #ef4444;
}

#btn-mobile-bomb {
    bottom: 120px;
    right: 40px;
    width: 55px;
    height: 55px;
    background: rgba(168, 85, 247, 0.6);
    border: 2px solid #a855f7;
    font-size: 0.75rem;
}

.diff-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.diff-opt {
    flex: 1;
    padding: 8px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    font-size: 0.8rem;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
}

.diff-opt.active {
    background: #0284c7;
    color: #ffffff;
    border-color: #38bdf8;
    font-weight: bold;
}

/* Top Bar Options */
.top-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
}

/* Banner Notifications */
#banner {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: 900;
    color: #f59e0b;
    text-transform: uppercase;
    letter-spacing: 4px;
    text-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 12;
    white-space: nowrap;
}