@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;800;900&family=Rajdhani:wght@600;700&display=swap');

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

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #040508;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #f0f4f8;
}

#game-canvas {
    width: 100vw;
    height: 100vh;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Cyberpunk Vignette & Glow */
#vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 2;
    background: radial-gradient(circle at 50% 50%, transparent 55%, rgba(4, 5, 10, 0.6) 85%, rgba(2, 3, 6, 0.95) 100%);
}

/* Floating Screen Flash on Level Up */
#screen-flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 5;
    background: radial-gradient(circle, rgba(0, 245, 255, 0.5) 0%, transparent 80%);
    opacity: 0;
    transition: opacity 0.25s ease-out;
}

/* Top HUD Container */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 10;
    pointer-events: none;
}

/* Level & Progress Bar */
.level-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 240px;
}

.level-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.level-badge {
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 2px;
    color: #00f5ff;
    text-shadow: 0 0 10px rgba(0, 245, 255, 0.8);
    font-family: 'Rajdhani', sans-serif;
}

.level-name {
    font-size: 11px;
    font-weight: 600;
    color: #a0aec0;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.progress-track {
    width: 100%;
    height: 14px;
    background: rgba(15, 20, 30, 0.85);
    border: 1.5px solid rgba(0, 245, 255, 0.35);
    border-radius: 8px;
    padding: 2px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.8), inset 0 0 8px rgba(0, 245, 255, 0.1);
    overflow: hidden;
    position: relative;
}

.progress-fill {
    width: 0%;
    height: 100%;
    border-radius: 5px;
    background: linear-gradient(90deg, #00f5ff 0%, #ff007f 100%);
    box-shadow: 0 0 12px rgba(255, 0, 127, 0.8);
    transition: width 0.12s ease-out;
}

/* Center Combo & Score Widget */
.center-widget {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-display {
    font-size: 32px;
    font-weight: 900;
    font-family: 'Rajdhani', sans-serif;
    color: #ffffff;
    text-shadow: 0 0 12px rgba(0, 245, 255, 0.9), 0 2px 4px #000;
    letter-spacing: 2px;
    line-height: 1.1;
    transform-origin: center;
    transition: transform 0.08s ease;
}

.score-display.bump {
    transform: scale(1.18);
}

.combo-banner {
    margin-top: 4px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #ff007f;
    text-shadow: 0 0 10px #ff007f;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.2s, transform 0.2s;
}

.combo-banner.active {
    opacity: 1;
    transform: scale(1.05);
}

/* Right Timer / Mode Badge */
.timer-container {
    background: rgba(12, 16, 26, 0.85);
    border: 1.5px solid rgba(255, 180, 0, 0.4);
    border-radius: 8px;
    padding: 6px 16px;
    text-align: right;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.8);
}

.timer-label {
    font-size: 10px;
    font-weight: 700;
    color: #ffb400;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.timer-value {
    font-size: 24px;
    font-weight: 900;
    font-family: 'Rajdhani', sans-serif;
    color: #fff;
    letter-spacing: 1px;
}

/* Floating DEVOUR Prompt (Tutorial) */
#tutorial-hint {
    position: absolute;
    bottom: 22%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    pointer-events: none;
    text-align: center;
    transition: opacity 0.5s ease;
}

.hint-pill {
    background: rgba(10, 14, 22, 0.85);
    border: 1.5px solid #00f5ff;
    border-radius: 30px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #00f5ff;
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.4);
    animation: pulseHint 1.8s infinite ease-in-out;
}

@keyframes pulseHint {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.05); opacity: 1; }
}

/* Floating Score Particles in DOM */
.float-text {
    position: absolute;
    pointer-events: none;
    z-index: 40;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 900;
    font-size: 20px;
    color: #00f5ff;
    text-shadow: 0 0 8px rgba(0, 245, 255, 0.9), 1px 1px 2px #000;
    animation: floatUp 0.75s forwards cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes floatUp {
    0% { transform: translate(-50%, -50%) scale(0.6); opacity: 0; }
    30% { transform: translate(-50%, -90%) scale(1.25); opacity: 1; }
    100% { transform: translate(-50%, -160%) scale(1.0); opacity: 0; }
}

/* Game Over / Summary Modal */
#modal-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(3, 4, 8, 0.94);
    z-index: 100;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 24px;
    text-align: center;
}

#modal-title {
    font-size: 44px;
    font-weight: 900;
    letter-spacing: 5px;
    color: #ff007f;
    text-shadow: 0 0 25px rgba(255, 0, 127, 0.9);
    font-family: 'Rajdhani', sans-serif;
}

.modal-stats-box {
    background: rgba(15, 20, 32, 0.8);
    border: 1.5px solid rgba(0, 245, 255, 0.3);
    border-radius: 12px;
    padding: 20px 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 280px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 16px;
    color: #a0aec0;
}

.stat-val {
    font-weight: 900;
    color: #00f5ff;
    font-family: 'Rajdhani', sans-serif;
    font-size: 20px;
}

.restart-btn {
    padding: 16px 48px;
    font-size: 18px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 900;
    letter-spacing: 3px;
    color: #040508;
    background: linear-gradient(90deg, #00f5ff 0%, #ff007f 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 0 25px rgba(0, 245, 255, 0.6);
    transition: transform 0.1s ease, filter 0.1s ease;
}

.restart-btn:active {
    transform: scale(0.95);
    filter: brightness(1.2);
}

/* Mobile responsive adjustments */
@media (max-width: 600px) {
    #hud {
        padding: 12px 14px;
    }
    .level-container {
        width: 140px;
    }
    .score-display {
        font-size: 24px;
    }
    .timer-value {
        font-size: 18px;
    }
    .timer-container {
        padding: 4px 10px;
    }
}
