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

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

body {
    background-color: #03030b;
    color: #fff;
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #0a0a2a 0%, #03030b 100%);
}

canvas {
    display: block;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.1);
    z-index: 1;
}

#flashOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    opacity: 0;
    pointer-events: none;
    z-index: 4;
    transition: opacity 0.1s;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 3, 11, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    backdrop-filter: blur(8px);
}

.hidden {
    display: none !important;
}

h1 {
    font-size: 5rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 10px #0ff, 0 0 20px #0ff, 0 0 40px #0ff, 0 0 80px #00aaff;
    margin-bottom: 10px;
    text-align: center;
    letter-spacing: 4px;
    font-style: italic;
}

h2 {
    font-size: 4rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 15px #f0f, 0 0 30px #f0f;
    margin-bottom: 30px;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1.5rem;
    font-weight: 700;
    color: #aae;
    margin-bottom: 40px;
    text-shadow: 0 0 10px #aae;
    letter-spacing: 1px;
}

.neon-btn {
    background: transparent;
    border: 2px solid #0ff;
    color: #0ff;
    padding: 15px 40px;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    margin: 10px;
    border-radius: 8px;
    text-transform: uppercase;
    transition: all 0.2s;
    box-shadow: 0 0 15px inset rgba(0,255,255,0.4), 0 0 15px rgba(0,255,255,0.4);
    letter-spacing: 1px;
}

.neon-btn:hover {
    background: #0ff;
    color: #000;
    box-shadow: 0 0 30px inset rgba(0,255,255,0.8), 0 0 30px rgba(0,255,255,0.8);
    transform: scale(1.05);
}

.small-btn {
    padding: 10px 20px;
    font-size: 1rem;
    border-color: #f0f;
    color: #f0f;
    box-shadow: 0 0 10px inset rgba(255,0,255,0.4), 0 0 10px rgba(255,0,255,0.4);
    margin-top: 40px;
}

.small-btn:hover {
    background: #f0f;
    color: #000;
    box-shadow: 0 0 20px inset rgba(255,0,255,0.8), 0 0 20px rgba(255,0,255,0.8);
}

.controls {
    margin-bottom: 40px;
    text-align: center;
    background: rgba(0, 20, 40, 0.6);
    padding: 25px 40px;
    border-radius: 12px;
    border: 1px solid rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.controls ul {
    list-style: none;
    margin-top: 15px;
    font-size: 1.2rem;
    line-height: 1.8;
    color: #ddd;
}

.controls strong {
    color: #0ff;
}

#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hud-top {
    display: flex;
    justify-content: space-between;
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 0 0 8px #fff;
}

.hud-item {
    background: rgba(0, 10, 20, 0.7);
    padding: 8px 20px;
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 255, 0.5);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
    margin-bottom: 15px;
    color: #eef;
}

.hud-item span {
    color: #0ff;
    text-shadow: 0 0 10px #0ff;
}

.hud-nitro {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.4rem;
    font-weight: 700;
    background: rgba(20, 0, 20, 0.7);
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 0, 255, 0.5);
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.2);
    align-self: flex-start;
    margin-top: auto;
    color: #f0f;
    text-shadow: 0 0 8px #f0f;
}

.nitro-bar-container {
    width: 250px;
    height: 24px;
    background: rgba(0,0,0,0.8);
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #333;
    box-shadow: inset 0 0 10px #000;
}

.nitro-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #aa00ff, #ff00ff, #ff88ff);
    box-shadow: 0 0 15px #ff00ff;
    transition: width 0.1s linear;
}

.message-display {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    font-weight: 900;
    font-style: italic;
    color: #ff0;
    text-shadow: 0 0 10px #ff0, 0 0 30px #ffaa00;
    opacity: 0;
    transition: opacity 0.3s;
    text-align: center;
    pointer-events: none;
    z-index: 6;
    letter-spacing: 2px;
}

.countdown-text {
    font-size: 10rem;
    font-weight: 900;
    font-style: italic;
    color: #0ff;
    text-shadow: 0 0 20px #0ff, 0 0 50px #0ff, 0 0 100px #00aaff;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.crashed-text {
    color: #ff3333;
    text-shadow: 0 0 15px #ff0000, 0 0 40px #ff0000;
    font-size: 5rem;
}

.stats {
    text-align: center;
    font-size: 1.6rem;
    margin-bottom: 40px;
    line-height: 2;
    background: rgba(0,0,0,0.5);
    padding: 30px 50px;
    border-radius: 10px;
    border: 1px solid #444;
}

.stats span {
    color: #0ff;
    font-weight: 700;
    text-shadow: 0 0 8px #0ff;
}

.new-high-score {
    font-size: 2.5rem;
    font-weight: 900;
    color: #ffdd00;
    text-shadow: 0 0 15px #ffdd00, 0 0 30px #ff9900;
    margin-bottom: 25px;
    animation: blink 0.8s infinite alternate;
    font-style: italic;
}

@keyframes blink {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0.6; transform: scale(0.95); }
}
