/* Base Reset & Variables */
:root {
    --primary-color: #ff9d00;
    --primary-glow: rgba(255, 157, 0, 0.4);
    --secondary-color: #00e1ff;
    --danger-color: #ff3b30;
    --bg-glass: rgba(18, 22, 34, 0.75);
    --border-glass: rgba(255, 255, 255, 0.18);
    --text-main: #ffffff;
    --text-muted: #b0c2de;
    --font-family: 'Outfit', sans-serif;
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #0b0e14;
    font-family: var(--font-family);
    color: var(--text-main);
}

#app-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

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

/* Speed Vignette Effect */
.vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    background: radial-gradient(circle, transparent 60%, rgba(255, 120, 0, 0.0) 100%);
    transition: background 0.3s ease;
}

.vignette.intense {
    background: radial-gradient(circle, transparent 40%, rgba(255, 90, 0, 0.25) 100%);
    box-shadow: inset 0 0 80px rgba(255, 150, 0, 0.4);
}

/* HUD Overlay */
.hud-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
}

.hud-top-bar {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.hud-card {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    padding: 10px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.coin-card {
    flex-direction: row;
    gap: 8px;
    align-items: center;
    padding: 12px 24px;
}

.coin-icon {
    font-size: 1.5rem;
    animation: spin 3s linear infinite;
}

.hud-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 1px;

}

.hud-value {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-glow);
}

.hud-subvalue {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--secondary-color);
    margin-top: 4px;
}

.speed-card {
    min-width: 140px;
}

.speed-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 6px;
}

.speed-bar-fill {
    width: 20%;
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    border-radius: 4px;
    transition: width 0.2s ease;
}

/* Touch Controls */
.touch-controls {
    pointer-events: auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: 10px;
}

.touch-center-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.touch-btn {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-family: var(--font-family);
    font-weight: 800;
    border-radius: 50%;
    width: 65px;
    height: 65px;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s ease, background 0.1s ease;
}

.touch-btn:active {
    transform: scale(0.9);
    background: var(--primary-glow);
}

.action-btn {
    border-radius: 25px;
    width: 140px;
    height: 50px;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* Overlay Screens */
.overlay-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 14, 23, 0.65);
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.overlay-screen.active {
    opacity: 1;
    pointer-events: auto;
}

.menu-glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 40px;
    width: 90%;
    max-width: 480px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.overlay-screen.active .menu-glass-panel {
    transform: translateY(0);
}

.game-title {
    font-size: 2.2rem;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: 1px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.title-highlight {
    color: var(--primary-color);
    text-shadow: 0 0 20px var(--primary-glow);
}

.game-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 30px;
}

.controls-guide {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    padding: 18px;
    border-radius: 16px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.guide-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-muted);
}

kbd {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 4px 8px;
    font-family: inherit;
    font-weight: 800;
    color: white;
    font-size: 0.85rem;
}

/* Buttons */
.primary-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #ff9d00 0%, #ff5500 100%);
    border: none;
    border-radius: 16px;
    color: white;
    font-family: var(--font-family);
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 8px 25px var(--primary-glow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(255, 120, 0, 0.6);
}

.primary-btn:active {
    transform: translateY(0);
}

.secondary-btn {
    width: 100%;
    padding: 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    color: white;
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.2s ease;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.menu-heading {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 25px;
}

.danger-text {
    color: var(--danger-color);
    text-shadow: 0 0 15px rgba(255, 59, 48, 0.5);
}

.menu-btn-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Game Over Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 30px;
}

.stat-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 900;
    color: white;
}

.highlight-box {
    border-color: rgba(255, 157, 0, 0.4);
    background: rgba(255, 157, 0, 0.1);
}

.highlight-box .stat-value {
    color: var(--primary-color);
}

/* Animations */
.pulse-anim {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); box-shadow: 0 12px 35px var(--primary-glow); }
    100% { transform: scale(1); }
}

@keyframes spin {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}

.hidden {
    display: none !important;
}
