/* Global Styles & Design System */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;800;900&display=swap');

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

body {
    background-color: #0b0e14;
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Game Container */
#gameContainer {
    position: relative;
    width: 100%;
    max-width: 480px;
    height: 100vh;
    background: #141824;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8), 0 0 100px rgba(0, 229, 255, 0.1);
    overflow: hidden;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Glassmorphism Overlays */
.overlay-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 14, 20, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 24px;
    z-index: 10;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

/* Titles & Headers */
.game-title {
    font-size: 3rem;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #00e5ff 0%, #3d5af1 50%, #d500f9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(0, 229, 255, 0.4);
    margin-bottom: 8px;
}

.subtitle {
    font-size: 1.1rem;
    color: #90a4ae;
    margin-bottom: 28px;
    font-weight: 400;
}

/* UI Cards & Boxes */
.stats-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px 30px;
    margin-bottom: 30px;
    width: 100%;
    max-width: 320px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    margin: 10px 0;
}

.stat-label {
    color: #b0bec5;
}

.stat-value {
    font-weight: 800;
    color: #00e5ff;
    font-size: 1.3rem;
}

/* Modern Glowing Buttons */
.btn-primary {
    background: linear-gradient(135deg, #00e5ff 0%, #2979ff 100%);
    color: #0b0e14;
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    padding: 16px 48px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    box-shadow: 0 8px 25px rgba(0, 229, 255, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 10px;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 35px rgba(0, 229, 255, 0.6);
}

.btn-primary:active {
    transform: translateY(1px) scale(0.98);
}

/* Loader Bar */
.loader-bar {
    width: 80%;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 20px;
}

.loader-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00e5ff, #3d5af1);
    transition: width 0.2s ease;
}

/* HUD Overlay */
#hudOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
    z-index: 5;
}

#hudOverlay.hidden {
    display: none;
}

.hud-group {
    background: rgba(11, 14, 20, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 8px 16px;
    display: flex;
    flex-direction: column;
}

.hud-title {
    font-size: 0.75rem;
    color: #90a4ae;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hud-val {
    font-size: 1.4rem;
    font-weight: 800;
    color: #ffffff;
}

#hudScore {
    color: #ffeb3b;
}

#hudSpeed {
    color: #00e5ff;
}

#hudMultiplier {
    color: #ff3d00;
    font-size: 1.1rem;
    font-weight: 900;
}

.icon-btn {
    pointer-events: auto;
    background: rgba(11, 14, 20, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    backdrop-filter: blur(8px);
    margin-left: 8px;
}

/* Mobile Touch Controls */
#mobileControls {
    position: absolute;
    bottom: 24px;
    left: 0;
    width: 100%;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    z-index: 6;
}

.ctrl-btn {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.6rem;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.ctrl-btn:active {
    background: rgba(0, 229, 255, 0.4);
    transform: scale(0.92);
}

.btn-nitro {
    background: linear-gradient(135deg, #ff3d00, #ff9100);
    border: none;
    box-shadow: 0 4px 20px rgba(255, 61, 0, 0.5);
}

/* Keyboard Guide */
.key-hint {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-family: monospace;
    color: #00e5ff;
}
