/* ==================================================================
   NEON VELOCITY — Cyberpunk racing game styles
   ================================================================== */

/* Wrapper */
.nv-wrapper {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    background: #0a0a1a;
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
        0 0 40px rgba(0,229,255,.15),
        0 0 80px rgba(0,229,255,.05),
        inset 0 1px 0 rgba(255,255,255,.06);
    border: 1px solid rgba(0,229,255,.2);
}

.nv-canvas {
    display: block;
    width: 100%;
    height: 500px;
    background: #0a0a1a;
    cursor: default;
}
.nv-canvas-active {
    cursor: none;
}

/* ==================================================================
   HUD
   ================================================================== */
.nv-hud {
    position: absolute;
    top: 0; left: 0; right: 0;
    padding: 10px 16px;
    z-index: 10;
    pointer-events: none;
}
.nv-hud-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}
.nv-hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(0,229,255,.25);
    border-radius: 10px;
    padding: 4px 14px;
    min-width: 70px;
}
.nv-hud-label {
    font-size: .6rem;
    font-weight: 600;
    color: rgba(0,229,255,.8);
    letter-spacing: 2px;
    text-transform: uppercase;
}
.nv-hud-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 8px rgba(0,229,255,.5);
}

/* Nitro bar */
.nv-nitro-bar {
    position: relative;
    margin-top: 8px;
    height: 10px;
    background: rgba(0,0,0,.4);
    border: 1px solid rgba(255,102,0,.3);
    border-radius: 5px;
    overflow: hidden;
}
.nv-nitro-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff6600, #ff3d00);
    border-radius: 5px;
    transition: width .3s ease;
}
.nv-nitro-fill.nv-nitro-ready {
    background: linear-gradient(90deg, #ff6600, #ffe600);
    box-shadow: 0 0 10px rgba(255,230,0,.5);
    animation: nv-nitro-pulse 1s ease-in-out infinite;
}
.nv-nitro-label {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: .55rem;
    font-weight: 700;
    color: rgba(255,255,255,.7);
    letter-spacing: 2px;
}
@keyframes nv-nitro-pulse {
    0%, 100% { opacity: .8; }
    50% { opacity: 1; }
}

/* ==================================================================
   MENU
   ================================================================== */
.nv-menu {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    padding: 20px;
}
.nv-menu.hidden { display: none; }

.nv-menu-inner {
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.nv-logo {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    color: #fff;
    text-shadow: 0 0 30px rgba(0,229,255,.5), 0 0 60px rgba(0,229,255,.2);
    margin-bottom: 4px;
    letter-spacing: -1px;
}
.nv-logo-accent {
    background: linear-gradient(135deg, #00e5ff, #ff00e5, #ffe600);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 12px rgba(0,229,255,.4));
}
.nv-tagline {
    color: rgba(255,255,255,.5);
    font-size: .85rem;
    margin-bottom: 24px;
}

/* Track cards */
.nv-section-title {
    color: rgba(0,229,255,.7);
    font-size: .7rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.nv-track-cards {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.nv-track-card {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 12px;
    padding: 12px 18px;
    cursor: pointer;
    transition: all .25s ease;
    min-width: 120px;
    text-align: center;
    color: #fff;
    font-family: 'Outfit', sans-serif;
}
.nv-track-card:hover {
    background: rgba(0,229,255,.08);
    border-color: rgba(0,229,255,.3);
    transform: translateY(-2px);
}
.nv-track-card.active {
    background: rgba(0,229,255,.12);
    border-color: rgba(0,229,255,.6);
    box-shadow: 0 0 20px rgba(0,229,255,.15);
}
.nv-tc-name {
    font-size: .9rem;
    font-weight: 600;
    margin-bottom: 4px;
}
.nv-tc-diff {
    font-size: .7rem;
    color: rgba(255,255,255,.5);
}
.nv-tc-laps {
    font-size: .65rem;
    color: rgba(0,229,255,.6);
    margin-top: 2px;
}

/* Mode buttons */
.nv-mode-select {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.nv-btn {
    font-family: 'Outfit', sans-serif;
    font-size: .95rem;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all .25s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    letter-spacing: .5px;
}
.nv-btn-icon {
    font-size: 1.1rem;
}
.nv-btn-primary {
    background: linear-gradient(135deg, #00e5ff, #0088cc);
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,229,255,.3);
}
.nv-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0,229,255,.4);
}
.nv-btn-glow {
    animation: nv-btn-glow 2s ease-in-out infinite;
}
@keyframes nv-btn-glow {
    0%, 100% { box-shadow: 0 4px 16px rgba(0,229,255,.3); }
    50% { box-shadow: 0 4px 30px rgba(0,229,255,.5), 0 0 40px rgba(0,229,255,.15); }
}
.nv-btn-secondary {
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.8);
    border: 1px solid rgba(255,255,255,.15);
}
.nv-btn-secondary:hover {
    background: rgba(255,255,255,.1);
    border-color: rgba(255,255,255,.3);
    transform: translateY(-1px);
}

/* Best scores */
.nv-best-scores {
    margin-top: 8px;
}
.nv-no-scores {
    color: rgba(255,255,255,.35);
    font-size: .8rem;
    font-style: italic;
}
.nv-bs-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    font-size: .85rem;
    color: rgba(255,255,255,.7);
    padding: 3px 0;
}

/* ==================================================================
   COUNTDOWN
   ================================================================== */
.nv-countdown {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 25;
    pointer-events: none;
}
.nv-countdown.hidden { display: none; }

.nv-cd-text {
    font-family: 'Outfit', sans-serif;
    font-size: 5rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 0 40px rgba(0,229,255,.6), 0 0 80px rgba(0,229,255,.3);
    opacity: 0.9;
    transition: transform .15s ease, opacity .15s ease;
}
.nv-cd-pop {
    transform: scale(1.3);
    opacity: 1;
}
.nv-cd-go {
    color: #76ff03;
    text-shadow: 0 0 40px rgba(118,255,3,.6), 0 0 80px rgba(118,255,3,.3);
    transform: scale(1.5);
}

/* ==================================================================
   RESULTS
   ================================================================== */
.nv-results {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    background: rgba(10,10,26,.85);
    backdrop-filter: blur(8px);
    padding: 20px;
}
.nv-results.hidden { display: none; }

.nv-results-inner {
    text-align: center;
    max-width: 400px;
    width: 100%;
}
.nv-results-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 20px rgba(0,229,255,.4);
    margin-bottom: 16px;
}

.nv-results-table {
    margin-bottom: 20px;
}
.nv-res-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    border-radius: 8px;
    margin-bottom: 4px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.06);
}
.nv-res-player {
    background: rgba(0,229,255,.08);
    border-color: rgba(0,229,255,.25);
    box-shadow: 0 0 12px rgba(0,229,255,.1);
}
.nv-res-pos {
    font-size: 1.2rem;
    min-width: 36px;
}
.nv-res-name {
    flex: 1;
    font-weight: 600;
    text-align: left;
    margin-left: 8px;
}
.nv-res-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: .85rem;
    color: rgba(255,255,255,.6);
}

.nv-score-breakdown {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 12px;
}
.nv-sb-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: .85rem;
    color: rgba(255,255,255,.6);
}
.nv-sb-total {
    display: flex;
    justify-content: space-between;
    padding: 8px 0 4px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    border-top: 1px solid rgba(255,255,255,.1);
    margin-top: 4px;
}
.nv-new-record {
    color: #ffe600;
    font-weight: 600;
    font-size: .95rem;
    margin-bottom: 16px;
    text-shadow: 0 0 10px rgba(255,230,0,.4);
    animation: nv-record-pulse 1.5s ease-in-out infinite;
}
@keyframes nv-record-pulse {
    0%, 100% { opacity: .8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.03); }
}

.nv-results-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ==================================================================
   LOBBY
   ================================================================== */
.nv-lobby {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    background: rgba(10,10,26,.9);
    backdrop-filter: blur(8px);
    padding: 20px;
}
.nv-lobby.hidden { display: none; }

.nv-lobby-inner {
    text-align: center;
    max-width: 420px;
    width: 100%;
}
.nv-lobby-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(255,0,229,.3);
}

.nv-lobby-room {
    margin-bottom: 20px;
}
.nv-lobby-or {
    color: rgba(255,255,255,.3);
    font-size: .8rem;
    margin: 12px 0;
}
.nv-lobby-join {
    display: flex;
    gap: 8px;
    justify-content: center;
}
.nv-lobby-input {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.15);
    background: rgba(255,255,255,.05);
    color: #fff;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 4px;
    width: 160px;
    outline: none;
}
.nv-lobby-input:focus {
    border-color: rgba(0,229,255,.5);
    box-shadow: 0 0 12px rgba(0,229,255,.15);
}

.nv-lobby-waiting {
    margin-top: 20px;
    padding: 16px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
}
.nv-lobby-waiting.hidden { display: none; }

.nv-lobby-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.4rem;
    color: #ffe600;
    letter-spacing: 6px;
    margin-bottom: 16px;
    text-shadow: 0 0 12px rgba(255,230,0,.3);
}
.nv-lobby-players {
    margin-bottom: 12px;
}
.nv-lobby-player {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 6px 0;
    font-size: .9rem;
    color: rgba(255,255,255,.8);
}
.nv-lp-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.nv-lp-status {
    font-size: .75rem;
    color: rgba(255,255,255,.5);
}
.nv-lobby-hint {
    color: rgba(255,255,255,.35);
    font-size: .75rem;
    margin-bottom: 14px;
    animation: nv-lobby-dots 1.5s infinite;
}
@keyframes nv-lobby-dots {
    0%, 100% { opacity: .3; }
    50% { opacity: .7; }
}
.nv-lobby-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}
.nv-lobby-back-btn {
    margin-top: 16px;
}

/* ==================================================================
   MOBILE TOUCH CONTROLS
   ================================================================== */
.nv-touch {
    position: absolute;
    bottom: 12px; left: 12px; right: 12px;
    display: flex;
    justify-content: space-between;
    z-index: 15;
    pointer-events: none;
}
.nv-touch.hidden { display: none; }

.nv-touch-left, .nv-touch-right {
    display: flex;
    gap: 8px;
    pointer-events: auto;
}
.nv-touch-btn {
    width: 52px; height: 52px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.2);
    background: rgba(0,0,0,.45);
    color: #fff;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.nv-touch-btn:active {
    background: rgba(0,229,255,.25);
    border-color: rgba(0,229,255,.6);
    transform: scale(.92);
}
.nv-touch-gas { border-color: rgba(0,229,255,.3); }
.nv-touch-gas:active { background: rgba(0,229,255,.3); }
.nv-touch-brake { border-color: rgba(255,61,113,.3); }
.nv-touch-brake:active { background: rgba(255,61,113,.3); }
.nv-touch-nitro { border-color: rgba(255,102,0,.3); }
.nv-touch-nitro:active { background: rgba(255,102,0,.4); border-color: rgba(255,102,0,.8); }

/* ==================================================================
   RESPONSIVE
   ================================================================== */
@media (max-width: 640px) {
    .nv-canvas { height: 400px; }
    .nv-logo { font-size: clamp(1.6rem, 8vw, 2.5rem); }
    .nv-tagline { font-size: .75rem; }
    .nv-track-cards { gap: 6px; }
    .nv-track-card { padding: 8px 12px; min-width: 90px; }
    .nv-tc-name { font-size: .8rem; }
    .nv-btn { font-size: .85rem; padding: 10px 20px; }
    .nv-hud-item { padding: 3px 8px; min-width: 55px; }
    .nv-hud-val { font-size: .85rem; }
    .nv-touch-btn { width: 46px; height: 46px; font-size: 1rem; }
    .nv-cd-text { font-size: 3.5rem; }
    .nv-results-title { font-size: 1.4rem; }
}

/* ==================================================================
   DARK/LIGHT THEME ADAPTATION
   ================================================================== */
[data-theme="light"] .nv-wrapper {
    box-shadow:
        0 4px 30px rgba(0,0,0,.15),
        0 0 40px rgba(0,229,255,.08);
    border-color: rgba(0,0,0,.08);
}
