/* =========================================================
   NEON RACER ARCADE - STYLESHEET
   ========================================================= */

:root {
    --font-display: 'Baloo 2', 'Nunito', system-ui, sans-serif;
    --font-main: 'Nunito', system-ui, sans-serif;

    --bg-dark: #050714;
    --card-bg: rgba(15, 23, 42, 0.8);
    --card-border: rgba(255, 255, 255, 0.12);

    --neon-cyan: #00f0ff;
    --neon-pink: #ff007f;
    --neon-yellow: #ffd700;
    --neon-green: #39ff14;
    --neon-orange: #ff6b00;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: #ffffff;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bg-shimmer {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: radial-gradient(circle at 50% 50%, rgba(255, 0, 127, 0.15), #050714 80%);
}

.app-wrapper {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Header Navbar */
.unified-nav {
    height: 60px;
    width: 100%;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 14, 29, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--card-border);
    z-index: 10;
}

.unified-nav .btn-home {
    background: linear-gradient(135deg, #00f0ff, #0072ff);
    border-color: #00f0ff;
    color: #050515;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.unified-nav .btn-home:hover {
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.5);
    color: #ffffff;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    font-size: 1.8rem;
    color: var(--neon-yellow);
}

.brand-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--neon-yellow), var(--neon-pink));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Buttons */
.btn {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Trạng thái đã tắt tiếng, giống các game khác */
.btn.muted { opacity: 0.55; }

.btn-primary {
    background: linear-gradient(135deg, var(--neon-pink), #e6005c);
    border-color: var(--neon-pink);
    box-shadow: 0 4px 15px rgba(255, 0, 127, 0.4);
}

.btn-cyber {
    background: linear-gradient(135deg, var(--neon-yellow), #ff9900);
    color: #000;
    font-weight: 800;
}

/* Main Canvas Viewport */
.game-viewport {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#game-canvas {
    display: block;
    background: #090d1f;
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.2);
}

/* HUD Overlay */
.hud-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    padding: 20px 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 5;
}

.hud-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.hud-box {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 12px 20px;
    pointer-events: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.speedometer {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.speed-val {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--neon-cyan);
    text-shadow: 0 0 12px rgba(0, 240, 255, 0.6);
}

.speed-lbl {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
}

.nitro-bar-container {
    width: 220px;
}

.nitro-header {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 4px;
    color: var(--neon-orange);
}

.nitro-track {
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nitro-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff6b00, #ffd700);
    border-radius: 6px;
    transition: width 0.15s linear;
    box-shadow: 0 0 12px rgba(255, 107, 0, 0.8);
}

/* Touch Controls */
.touch-controls {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 6;
}

.touch-btn {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    color: white;
    pointer-events: auto;
    touch-action: none;
}

.touch-btn-nitro {
    width: 85px;
    height: 85px;
    background: linear-gradient(135deg, var(--neon-orange), var(--neon-yellow));
    color: #000;
    border-color: var(--neon-yellow);
    box-shadow: 0 0 20px rgba(255, 107, 0, 0.6);
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 7, 16, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.modal-card {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--card-border);
    border-radius: 28px;
    padding: 32px;
    max-width: 600px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.car-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin: 20px 0;
}

.car-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 16px 12px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.car-card:hover, .car-card.selected {
    background: rgba(255, 215, 0, 0.15);
    border-color: var(--neon-yellow);
    transform: translateY(-4px);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.car-icon {
    font-size: 2.8rem;
    margin-bottom: 8px;
}

.car-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 800;
}

.toast-msg {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--neon-yellow);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    padding: 10px 24px;
    border-radius: 30px;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    z-index: 200;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.toast-msg.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
