/* Urban Bounty - Award-Winning Modern UI Design */
/* Premium Gaming Interface - 2024 Edition */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Orbitron:wght@400;500;600;700;800;900&family=Exo+2:wght@300;400;500;600;700&display=swap');

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

:root {
    /* Premium Color Palette */
    --primary: #00f0ff;
    --primary-dark: #00a8b3;
    --primary-glow: rgba(0, 240, 255, 0.4);
    --secondary: #ff6b35;
    --secondary-glow: rgba(255, 107, 53, 0.4);
    --accent: #a855f7;
    --accent-glow: rgba(168, 85, 247, 0.4);
    --success: #22c55e;
    --success-glow: rgba(34, 197, 94, 0.3);
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.3);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.4);

    /* Background Colors */
    --bg-dark: #030308;
    --bg-panel: rgba(8, 12, 20, 0.85);
    --bg-panel-solid: #080c14;
    --bg-card: rgba(15, 20, 35, 0.9);
    --bg-hover: rgba(0, 240, 255, 0.1);

    /* Glass Effect */
    --glass-bg: rgba(10, 15, 25, 0.75);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);

    /* Text Colors */
    --text-bright: #ffffff;
    --text-normal: #e2e8f0;
    --text-dim: #64748b;
    --text-muted: #475569;

    /* Borders */
    --border-color: rgba(0, 240, 255, 0.2);
    --border-hover: rgba(0, 240, 255, 0.5);

    /* Fonts */
    --font-display: 'Orbitron', sans-serif;
    --font-ui: 'Rajdhani', sans-serif;
    --font-body: 'Exo 2', sans-serif;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: var(--font-body);
    background: var(--bg-dark);
    color: var(--text-normal);
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    letter-spacing: 0.02em;
}

/* Allow scrolling on overlay screens */
.overlay-screen:not(.hidden) {
    touch-action: pan-y;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ========================== */
/* LANDING PAGE               */
/* ========================== */

#landing-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #030308 0%, #0a1628 50%, #030308 100%);
    overflow: hidden;
}

#landing-page.hidden {
    display: none;
}

.landing-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Particle effects container */
.particle-container {
    position: absolute;
    width: 100%;
    height: 100%;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0;
    animation: particle-float 8s infinite;
    box-shadow: 0 0 10px var(--primary), 0 0 20px var(--primary-glow);
}

@keyframes particle-float {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(1);
    }
}

/* Radial glow effect */
.radial-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 800px;
    height: 800px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(0, 240, 255, 0.15) 0%, rgba(168, 85, 247, 0.1) 30%, transparent 70%);
    animation: glow-pulse 4s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
}

/* Scan line effect */
.scan-line {
    position: absolute;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.3;
    animation: scan-move 3s linear infinite;
}

@keyframes scan-move {
    0% {
        top: -10%;
    }
    100% {
        top: 110%;
    }
}

/* Grid overlay */
.grid-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: grid-move 20s linear infinite;
}

@keyframes grid-move {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 50px 50px;
    }
}

/* Corner accents */
.corner-accent {
    position: absolute;
    width: 100px;
    height: 100px;
    pointer-events: none;
}

.corner-accent::before,
.corner-accent::after {
    content: '';
    position: absolute;
    background: var(--primary);
    opacity: 0.5;
}

.corner-accent::before {
    width: 60px;
    height: 2px;
}

.corner-accent::after {
    width: 2px;
    height: 60px;
}

.corner-accent.top-left {
    top: 30px;
    left: 30px;
}
.corner-accent.top-left::before { top: 0; left: 0; }
.corner-accent.top-left::after { top: 0; left: 0; }

.corner-accent.top-right {
    top: 30px;
    right: 30px;
}
.corner-accent.top-right::before { top: 0; right: 0; }
.corner-accent.top-right::after { top: 0; right: 0; }

.corner-accent.bottom-left {
    bottom: 30px;
    left: 30px;
}
.corner-accent.bottom-left::before { bottom: 0; left: 0; }
.corner-accent.bottom-left::after { bottom: 0; left: 0; }

.corner-accent.bottom-right {
    bottom: 30px;
    right: 30px;
}
.corner-accent.bottom-right::before { bottom: 0; right: 0; }
.corner-accent.bottom-right::after { bottom: 0; right: 0; }

/* Landing content */
.landing-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    padding: 40px;
    text-align: center;
}

/* Logo container */
.logo-container {
    position: relative;
    animation: logo-entrance 1s ease-out;
}

@keyframes logo-entrance {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(-30px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.game-logo {
    width: clamp(280px, 50vw, 500px);
    height: auto;
    border-radius: 40px;
    filter: drop-shadow(0 0 30px rgba(0, 240, 255, 0.5)) drop-shadow(0 0 60px rgba(255, 107, 53, 0.3));
    animation: logo-float 4s ease-in-out infinite;
    transition: transform 0.3s ease;
}

.game-logo:hover {
    transform: scale(1.02);
}

@keyframes logo-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.logo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    transform: translate(-50%, -50%);
    background: radial-gradient(ellipse, rgba(255, 107, 53, 0.3) 0%, transparent 60%);
    filter: blur(40px);
    z-index: -1;
    animation: logo-glow-pulse 3s ease-in-out infinite alternate;
}

@keyframes logo-glow-pulse {
    0% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* Tagline */
.tagline {
    animation: tagline-entrance 1s ease-out 0.3s both;
}

@keyframes tagline-entrance {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.tagline-text {
    font-family: var(--font-display);
    font-size: clamp(1rem, 3vw, 1.5rem);
    font-weight: 600;
    letter-spacing: 0.5em;
    color: var(--text-dim);
    text-shadow: 0 0 20px var(--primary-glow);
    background: linear-gradient(90deg, var(--text-dim), var(--primary), var(--text-dim));
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer-text 3s linear infinite;
}

@keyframes shimmer-text {
    0% {
        background-position: 200% center;
    }
    100% {
        background-position: -200% center;
    }
}

/* Play Button */
.play-button {
    position: relative;
    padding: 20px 80px;
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--bg-dark);
    background: none;
    border: none;
    cursor: pointer;
    overflow: hidden;
    animation: button-entrance 1s ease-out 0.6s both;
    transition: transform 0.2s ease, filter 0.2s ease;
}

@keyframes button-entrance {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.play-button .btn-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c5a 50%, #ffab35 100%);
    border-radius: 60px;
    z-index: 1;
    transition: transform 0.3s ease;
    box-shadow:
        0 5px 30px rgba(255, 107, 53, 0.5),
        0 10px 60px rgba(255, 107, 53, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.play-button .btn-text {
    position: relative;
    z-index: 3;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.play-button .btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    z-index: 2;
    transform: skewX(-20deg);
    animation: button-shine 3s ease-in-out infinite;
}

@keyframes button-shine {
    0%, 100% {
        left: -100%;
    }
    50% {
        left: 150%;
    }
}

.play-button:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.play-button:hover .btn-bg {
    transform: scale(1.02);
    box-shadow:
        0 8px 40px rgba(255, 107, 53, 0.6),
        0 15px 80px rgba(255, 107, 53, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.play-button:active {
    transform: scale(0.98);
}

.play-button:active .btn-bg {
    box-shadow:
        0 2px 15px rgba(255, 107, 53, 0.5),
        0 5px 30px rgba(255, 107, 53, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Features bar */
.features-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 15px 30px;
    background: rgba(10, 15, 25, 0.6);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 50px;
    animation: features-entrance 1s ease-out 0.9s both;
}

@keyframes features-entrance {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.feature-icon {
    font-size: 1.2rem;
    color: var(--secondary);
    text-shadow: 0 0 10px var(--secondary-glow);
}

.feature-label {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.feature-divider {
    width: 1px;
    height: 20px;
    background: linear-gradient(to bottom, transparent, var(--primary), transparent);
    opacity: 0.5;
}

@media (max-width: 768px) {
    .features-bar {
        flex-direction: column;
        gap: 10px;
        padding: 15px 25px;
        border-radius: 20px;
    }

    .feature-divider {
        width: 50px;
        height: 1px;
        background: linear-gradient(to right, transparent, var(--primary), transparent);
    }
}

/* Landing footer */
.landing-footer {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    animation: footer-entrance 1s ease-out 0.9s both;
}

@keyframes footer-entrance {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.version-text {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.copyright {
    font-family: var(--font-ui);
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.6;
}

/* Landing page transition */
#landing-page.fade-out {
    animation: landing-fade-out 0.8s ease-in-out forwards;
}

@keyframes landing-fade-out {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        visibility: hidden;
    }
}

/* Mobile responsiveness for landing */
@media (max-width: 768px) {
    .game-logo {
        width: clamp(200px, 70vw, 350px);
        border-radius: 25px;
    }

    .play-button {
        padding: 16px 50px;
    }

    .tagline-text {
        letter-spacing: 0.3em;
    }
}

#game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
}

#game-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* ========================== */
/* UI OVERLAY SYSTEM          */
/* ========================== */

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#ui-overlay > * {
    pointer-events: auto;
}

.overlay-screen,
.overlay-screen * {
    pointer-events: auto;
}

.menu-btn,
.tab-btn,
.skill-tab-btn,
.warrant-card,
.store-item,
.skill-node,
select,
input {
    pointer-events: auto !important;
    cursor: pointer;
}

.hidden {
    display: none !important;
}

/* ========================== */
/* MODERN HUD PANELS          */
/* ========================== */

.hud-panel {
    position: absolute;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255,255,255,0.05);
    font-family: var(--font-ui);
    transition: all var(--transition-normal);
}

.hud-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.5;
    border-radius: 12px 12px 0 0;
}

/* Panel Positions */
.top-center {
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.top-right {
    top: 60px;
    right: 15px;
}

.top-left {
    top: 15px;
    left: 15px;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    text-shadow: 0 0 20px var(--primary-glow);
    letter-spacing: 1px;
}

.bottom-left {
    bottom: 20px;
    left: 15px;
}

.bottom-right {
    bottom: 20px;
    right: 15px;
    text-align: right;
}

.bottom-center {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    min-width: 220px;
}

/* ========================== */
/* TARGET INFO PANEL          */
/* ========================== */

#target-info {
    min-width: 240px;
    background: linear-gradient(135deg, var(--glass-bg), rgba(255, 107, 53, 0.1));
    border-color: rgba(255, 107, 53, 0.3);
}

#target-info::before {
    background: linear-gradient(90deg, transparent, var(--secondary), transparent);
}

.target-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.target-name {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--secondary);
    text-shadow: 0 0 15px var(--secondary-glow);
    letter-spacing: 0.5px;
}

.threat-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.threat-badge.low {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.1));
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.threat-badge.medium {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(245, 158, 11, 0.1));
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.threat-badge.high {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3), rgba(239, 68, 68, 0.1));
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.threat-badge.extreme {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.4), rgba(239, 68, 68, 0.3));
    color: #e879f9;
    border: 1px solid rgba(168, 85, 247, 0.5);
    animation: extremePulse 1s ease-in-out infinite;
}

@keyframes extremePulse {
    0%, 100% { box-shadow: 0 0 10px var(--accent-glow); }
    50% { box-shadow: 0 0 20px var(--accent-glow), 0 0 30px var(--danger-glow); }
}

.target-status, .target-reward {
    font-size: 13px;
    margin-top: 6px;
    color: var(--text-dim);
}

.target-reward {
    color: var(--warning);
    font-weight: 600;
}

/* ========================== */
/* MINIMAP                    */
/* ========================== */

#minimap-container {
    padding: 8px;
    background: linear-gradient(145deg, rgba(0,0,0,0.9), rgba(15,20,35,0.8));
    border-radius: 8px;
    border: 2px solid var(--border-color);
}

#minimap-canvas {
    display: block;
    border-radius: 4px;
    border: 1px solid rgba(0, 240, 255, 0.3);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

/* ========================== */
/* MODERN STAT BARS           */
/* ========================== */

.stat-bar {
    display: flex;
    align-items: center;
    margin: 8px 0;
    font-size: 11px;
    font-family: var(--font-ui);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-label {
    width: 40px;
    color: var(--text-dim);
}

.bar-container {
    position: relative;
    width: 120px;
    height: 8px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 0 10px;
}

.bar-container.large {
    width: 180px;
    height: 14px;
    border-radius: 7px;
}

.bar-container.small {
    width: 80px;
    height: 6px;
}

.bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
    position: relative;
}

.bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.3), transparent);
    border-radius: 3px 3px 0 0;
}

.health-bar .bar-fill {
    background: linear-gradient(90deg, #dc2626, #ef4444, #f87171);
    box-shadow: 0 0 15px var(--danger-glow);
    width: 100%;
}

.stamina-bar .bar-fill {
    background: linear-gradient(90deg, #16a34a, #22c55e, #4ade80);
    box-shadow: 0 0 15px var(--success-glow);
    width: 100%;
}

.armor-bar .bar-fill {
    background: linear-gradient(90deg, #2563eb, #3b82f6, #60a5fa);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
    width: 0%;
}

.stat-value {
    min-width: 35px;
    text-align: right;
    color: var(--text-bright);
    font-weight: 700;
}

/* ========================== */
/* WEAPON INFO                */
/* ========================== */

#weapon-info {
    min-width: 140px;
    background: linear-gradient(135deg, var(--glass-bg), rgba(0, 240, 255, 0.05));
}

.weapon-name {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    text-shadow: 0 0 15px var(--primary-glow);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.ammo-info {
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-normal);
}

.cooldown-bar {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 2px;
    overflow: hidden;
}

#cooldown-fill {
    background: linear-gradient(90deg, var(--primary-dark), var(--primary));
    box-shadow: 0 0 10px var(--primary-glow);
    width: 0%;
    height: 100%;
    transition: width 0.1s linear;
}

/* ========================== */
/* CENTER PROMPTS             */
/* ========================== */

#center-prompts {
    font-family: var(--font-ui);
    font-size: 18px;
    font-weight: 600;
    padding: 16px 30px;
    top: 80px !important;
    transform: translateX(-50%) !important;
    max-width: 500px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(0, 240, 255, 0.1));
    border: 2px solid var(--primary);
    border-radius: 16px;
    box-shadow: 0 0 30px var(--primary-glow), inset 0 0 30px rgba(0, 240, 255, 0.05);
    animation: promptGlow 2s ease-in-out infinite;
}

@keyframes promptGlow {
    0%, 100% { box-shadow: 0 0 20px var(--primary-glow); }
    50% { box-shadow: 0 0 40px var(--primary-glow); }
}

#prompt-text {
    margin-bottom: 12px;
    color: var(--text-bright);
    text-shadow: 0 0 10px rgba(255,255,255,0.3);
}

.progress-bar {
    width: 220px;
    height: 8px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto;
}

#prompt-progress-fill {
    background: linear-gradient(90deg, var(--primary-dark), var(--primary));
    box-shadow: 0 0 15px var(--primary-glow);
    width: 0%;
    height: 100%;
    transition: width 0.1s linear;
}

/* ========================== */
/* MONEY DISPLAY              */
/* ========================== */

.money-icon {
    color: var(--warning);
    font-size: 18px;
    margin-right: 5px;
    text-shadow: 0 0 10px var(--warning-glow);
}

#money-amount {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--warning);
    text-shadow: 0 0 15px var(--warning-glow);
}

/* ========================== */
/* VEHICLE HUD                */
/* ========================== */

#vehicle-hud {
    display: flex;
    gap: 25px;
    font-size: 13px;
    font-family: var(--font-ui);
}

.vehicle-speed, .vehicle-damage, .vehicle-prisoners {
    display: flex;
    align-items: center;
    gap: 8px;
}

.label {
    color: var(--text-dim);
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 1px;
}

#vehicle-speed-value {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    text-shadow: 0 0 15px var(--primary-glow);
}

#vehicle-damage-fill {
    background: linear-gradient(90deg, var(--success), var(--warning), var(--danger));
    width: 0%;
}

/* ========================== */
/* OVERLAY SCREENS            */
/* ========================== */

.overlay-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ========================== */
/* MAIN MENU                  */
/* ========================== */

.menu-screen {
    background: linear-gradient(135deg, #030308 0%, #0a1020 50%, #050510 100%);
}

.menu-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, var(--primary-glow) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, var(--secondary-glow) 0%, transparent 40%);
    opacity: 0.3;
    pointer-events: none;
}

.menu-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.game-title {
    font-family: var(--font-display);
    font-size: 80px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), #00ff88, var(--primary));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleGradient 3s ease infinite;
    text-shadow: none;
    filter: drop-shadow(0 0 30px var(--primary-glow));
    margin-bottom: 10px;
    letter-spacing: 4px;
}

@keyframes titleGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.game-subtitle {
    font-family: var(--font-ui);
    font-size: 22px;
    font-weight: 500;
    color: var(--text-dim);
    letter-spacing: 8px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.game-version {
    font-family: var(--font-body);
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 50px;
    letter-spacing: 2px;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

/* Modern Button Design */
.menu-btn {
    position: relative;
    padding: 16px 50px;
    font-family: var(--font-ui);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-bright);
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.1), rgba(0, 240, 255, 0.05));
    border: 2px solid var(--primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-normal);
    min-width: 240px;
    overflow: hidden;
}

.menu-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.3), transparent);
    transition: left var(--transition-smooth);
}

.menu-btn:hover {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--bg-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px var(--primary-glow);
}

.menu-btn:hover::before {
    left: 100%;
}

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

.menu-btn.small {
    padding: 10px 24px;
    font-size: 13px;
    min-width: auto;
}

.menu-btn.danger {
    border-color: var(--danger);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
}

.menu-btn.danger:hover {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    box-shadow: 0 10px 30px var(--danger-glow);
}

.menu-btn.secondary {
    border-color: var(--text-dim);
    background: linear-gradient(135deg, rgba(100, 116, 139, 0.1), rgba(100, 116, 139, 0.05));
}

.menu-btn.secondary:hover {
    background: var(--text-dim);
    border-color: var(--text-dim);
}

/* ========================== */
/* CHARACTER SELECTION        */
/* ========================== */

.select-title {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
    text-shadow: 0 0 30px var(--primary-glow);
    margin-bottom: 40px;
    text-transform: uppercase;
    letter-spacing: 6px;
}

.character-grid {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 40px;
    margin-bottom: 40px;
    flex-wrap: nowrap;
}

.character-card {
    background: linear-gradient(145deg, var(--bg-card), rgba(0, 0, 0, 0.8));
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    padding: 25px;
    width: 320px;
    min-width: 300px;
    cursor: pointer;
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.character-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.character-card:hover {
    border-color: var(--primary);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 30px var(--primary-glow);
}

.character-card:hover::before {
    opacity: 1;
}

.character-card.selected {
    border-color: var(--primary);
    box-shadow: 0 0 40px var(--primary-glow), inset 0 0 30px rgba(0, 240, 255, 0.1);
}

.character-card.selected::before {
    opacity: 1;
}

.char-preview {
    width: 220px;
    height: 280px;
    margin: 0 auto 15px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

/* ===== JESSE TUCKER PORTRAIT ===== */
.jesse-preview {
    background: url('assets/jesse-portrait.png') center top / contain no-repeat;
    background-color: #1a2a3a;
}

/* Jesse - No pseudo head needed with real image */
.jesse-preview::before {
    display: none;
}

/* Jesse - Name label overlay */
.jesse-preview::after {
    content: 'JESSE';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    color: var(--primary);
    font-weight: 700;
    font-size: 18px;
    text-shadow: 0 0 20px var(--primary-glow), 0 2px 4px rgba(0,0,0,0.8);
    letter-spacing: 3px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
}

/* ===== BEN FOX PORTRAIT ===== */
.ben-preview {
    background: url('assets/ben-portrait.png') center top / contain no-repeat;
    background-color: #2a1a1a;
}

/* Ben - No pseudo head needed with real image */
.ben-preview::before {
    display: none;
}

/* Ben - Name label overlay */
.ben-preview::after {
    content: 'BEN';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    color: var(--secondary);
    font-weight: 700;
    font-size: 18px;
    text-shadow: 0 0 20px var(--secondary-glow), 0 2px 4px rgba(0,0,0,0.8);
    letter-spacing: 3px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
}

.char-info {
    text-align: center;
}

.char-name {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.char-desc {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.6;
}

.char-select-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* ========================== */
/* PANEL STYLES               */
/* ========================== */

.board-panel, .store-panel, .skill-panel, .booking-panel,
.pause-panel, .settings-panel, .gameover-panel, .map-panel, .faq-panel {
    background: linear-gradient(145deg, var(--bg-panel-solid), rgba(0, 0, 0, 0.95));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow), 0 0 60px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.board-panel::before, .store-panel::before, .skill-panel::before,
.booking-panel::before, .pause-panel::before, .settings-panel::before,
.gameover-panel::before, .map-panel::before, .faq-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.board-panel h2, .store-panel h2, .skill-panel h2,
.booking-panel h2, .pause-panel h2, .map-panel h2, .faq-panel h2 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 25px;
    text-align: center;
}

/* Wanted Board */
.board-panel {
    max-width: 850px;
    max-height: 85vh;
    overflow-y: auto;
}

.board-panel h2 {
    color: var(--primary);
    text-shadow: 0 0 20px var(--primary-glow);
}

.board-panel::before {
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.filters {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
}

.filters select {
    padding: 10px 16px;
    background: var(--bg-dark);
    color: var(--text-normal);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-ui);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filters select:hover {
    border-color: var(--primary);
}

.warrants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 25px;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 8px;
}

.warrant-card {
    background: linear-gradient(145deg, rgba(20, 25, 40, 0.9), rgba(10, 15, 25, 0.95));
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 18px;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.warrant-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 12px 0 0 12px;
}

.warrant-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.warrant-card.threat-low::before {
    background: linear-gradient(180deg, #22c55e, #16a34a);
    box-shadow: 0 0 15px var(--success-glow);
}

.warrant-card.threat-medium::before {
    background: linear-gradient(180deg, #f59e0b, #d97706);
    box-shadow: 0 0 15px var(--warning-glow);
}

.warrant-card.threat-high::before {
    background: linear-gradient(180deg, #ef4444, #dc2626);
    box-shadow: 0 0 15px var(--danger-glow);
}

.warrant-name {
    font-family: var(--font-ui);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.warrant-crimes {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 10px;
    line-height: 1.4;
}

.warrant-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.warrant-reward {
    font-family: var(--font-display);
    color: var(--warning);
    font-weight: 700;
    text-shadow: 0 0 10px var(--warning-glow);
}

.warrant-district {
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Store Panel */
.store-panel {
    min-width: 650px;
    max-height: 85vh;
}

.store-panel h2 {
    color: var(--secondary);
    text-shadow: 0 0 20px var(--secondary-glow);
}

.store-panel::before {
    background: linear-gradient(90deg, transparent, var(--secondary), transparent);
}

.store-tabs, .skill-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.tab-btn, .skill-tab-btn {
    padding: 12px 20px;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-dim);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab-btn:hover, .tab-btn.active {
    background: linear-gradient(135deg, var(--secondary), #e55a2b);
    border-color: var(--secondary);
    color: var(--bg-dark);
    box-shadow: 0 5px 20px var(--secondary-glow);
}

.skill-tab-btn:hover, .skill-tab-btn.active {
    background: linear-gradient(135deg, var(--accent), #9333ea);
    border-color: var(--accent);
    color: var(--bg-dark);
    box-shadow: 0 5px 20px var(--accent-glow);
}

.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    max-height: 380px;
    overflow-y: auto;
    margin-bottom: 25px;
    padding-right: 8px;
}

.store-item {
    background: linear-gradient(145deg, rgba(20, 25, 40, 0.9), rgba(10, 15, 25, 0.95));
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 18px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.store-item:hover {
    border-color: var(--secondary);
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.store-item.owned {
    border-color: var(--success);
    background: linear-gradient(145deg, rgba(34, 197, 94, 0.1), rgba(10, 15, 25, 0.95));
}

.store-item-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.store-item-name {
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--text-bright);
}

.store-item-price {
    font-family: var(--font-display);
    color: var(--warning);
    font-size: 14px;
    font-weight: 700;
}

.store-item-owned {
    color: var(--success);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.store-footer, .skill-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
}

/* Skill Tree */
.skill-panel {
    min-width: 650px;
    max-height: 85vh;
}

.skill-panel h2 {
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
}

.skill-panel::before {
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.skill-tree {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-height: 380px;
    overflow-y: auto;
    margin-bottom: 25px;
    padding-right: 8px;
}

.skill-node {
    background: linear-gradient(145deg, rgba(20, 25, 40, 0.9), rgba(10, 15, 25, 0.95));
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    padding: 18px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.skill-node:hover {
    border-color: var(--accent);
    transform: scale(1.03);
}

.skill-node.unlocked {
    border-color: var(--success);
    background: linear-gradient(145deg, rgba(34, 197, 94, 0.15), rgba(10, 15, 25, 0.95));
    box-shadow: 0 0 20px var(--success-glow);
}

.skill-node.available {
    border-color: var(--accent);
    animation: skillPulse 2s ease-in-out infinite;
}

@keyframes skillPulse {
    0%, 100% { box-shadow: 0 0 10px var(--accent-glow); }
    50% { box-shadow: 0 0 25px var(--accent-glow); }
}

.skill-node.locked {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.skill-icon {
    font-size: 28px;
    margin-bottom: 10px;
}

.skill-name {
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--text-bright);
}

.skill-desc {
    font-size: 11px;
    color: var(--text-dim);
    line-height: 1.4;
}

.skill-cost {
    font-family: var(--font-display);
    font-size: 12px;
    color: var(--accent);
    margin-top: 8px;
    font-weight: 600;
}

/* Booking Panel */
.booking-panel {
    min-width: 400px;
}

.booking-panel h2 {
    color: var(--success);
    text-shadow: 0 0 20px var(--success-glow);
}

.booking-panel::before {
    background: linear-gradient(90deg, transparent, var(--success), transparent);
}

.booking-breakdown {
    margin-bottom: 25px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    font-family: var(--font-ui);
    font-size: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-item.bonus span:last-child {
    color: var(--success);
    font-weight: 700;
}

.breakdown-item.penalty span:last-child {
    color: var(--danger);
    font-weight: 700;
}

.breakdown-item.total {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--warning);
    padding-top: 15px;
    margin-top: 10px;
    border-top: 2px solid var(--glass-border);
}

/* Arrest Overlay */
.arrest-panel {
    background: linear-gradient(145deg, var(--bg-panel-solid), rgba(0, 0, 0, 0.95));
    padding: 35px;
    border-radius: 20px;
    border: 2px solid var(--warning);
    text-align: center;
    box-shadow: 0 0 40px var(--warning-glow);
}

.arrest-panel h2 {
    font-family: var(--font-display);
    color: var(--warning);
    text-shadow: 0 0 20px var(--warning-glow);
    margin-bottom: 25px;
    font-size: 24px;
    letter-spacing: 3px;
}

.arrest-stat {
    margin: 18px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.arrest-stat .label {
    min-width: 120px;
    text-align: left;
    font-family: var(--font-ui);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.bar-fill.progress {
    background: linear-gradient(90deg, var(--primary-dark), var(--primary));
    box-shadow: 0 0 15px var(--primary-glow);
}

.bar-fill.compliance {
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.bar-fill.escape {
    background: linear-gradient(90deg, #dc2626, #ef4444);
    box-shadow: 0 0 15px var(--danger-glow);
}

.arrest-hint {
    margin-top: 25px;
    color: var(--text-dim);
    font-size: 13px;
    font-style: italic;
}

/* Map Panel */
.map-panel h2 {
    color: var(--primary);
    text-shadow: 0 0 20px var(--primary-glow);
}

#fullmap-canvas {
    display: block;
    margin: 0 auto 20px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
}

.map-legend {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 20px;
    font-family: var(--font-ui);
    font-size: 12px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}

.dot.police { background: #3b82f6; color: #3b82f6; }
.dot.store { background: #22c55e; color: #22c55e; }
.dot.fire { background: #ef4444; color: #ef4444; }
.dot.safe { background: #eab308; color: #eab308; }
.dot.target { background: #e879f9; color: #e879f9; }

/* Pause & Settings */
.pause-panel, .settings-panel, .gameover-panel {
    min-width: 340px;
    text-align: center;
}

.pause-panel h2 {
    color: var(--text-bright);
}

.pause-panel .menu-btn,
.settings-panel .menu-btn,
.gameover-panel .menu-btn {
    margin: 10px 0;
    width: 100%;
}

.settings-panel.large {
    min-width: 450px;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
}

.settings-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
    text-align: left;
}

.settings-section h3 {
    font-family: var(--font-ui);
    color: var(--primary);
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 12px 0;
}

.setting-item label {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-normal);
}

.setting-item input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--primary);
}

.setting-item input[type="range"] {
    width: 130px;
    cursor: pointer;
    accent-color: var(--primary);
}

.volume-value {
    font-family: var(--font-display);
    font-size: 12px;
    color: var(--primary);
    width: 45px;
    text-align: right;
}

.settings-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 25px;
}

.settings-buttons .menu-btn {
    flex: 1;
}

/* Game Over */
.gameover-panel {
    min-width: 380px;
    max-width: 450px;
}

.gameover-title {
    font-family: var(--font-display);
    font-size: 48px;
    color: var(--danger);
    text-shadow: 0 0 30px var(--danger-glow), 0 0 60px rgba(239, 68, 68, 0.3);
    margin-bottom: 10px;
    letter-spacing: 8px;
    animation: gameover-pulse 2s ease-in-out infinite;
}

@keyframes gameover-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.02); }
}

.gameover-panel h2 {
    color: var(--danger);
    text-shadow: 0 0 20px var(--danger-glow);
}

.gameover-panel #gameover-reason {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

#gameover-stats {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 15px 25px;
    margin: 20px 0;
    border: 1px solid var(--glass-border);
}

#gameover-stats p {
    font-size: 16px;
    margin: 8px 0;
    color: var(--text-secondary);
}

#gameover-stats span {
    color: var(--primary);
    font-weight: bold;
}

.gameover-panel::before {
    background: linear-gradient(90deg, transparent, var(--danger), transparent);
}

#lives-options {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 20px;
}

#lives-options .menu-btn {
    width: 100%;
}

.penalty {
    font-family: var(--font-display);
    color: var(--danger);
    font-size: 18px;
    margin: 20px 0;
}

/* FAQ Panel */
.faq-panel {
    min-width: 650px;
    max-width: 850px;
    max-height: 88vh;
    overflow-y: auto;
}

.faq-panel h2 {
    color: var(--primary);
    text-shadow: 0 0 20px var(--primary-glow);
}

.faq-content {
    text-align: left;
}

.faq-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--glass-border);
}

.faq-section:last-of-type {
    border-bottom: none;
}

.faq-section h3 {
    font-family: var(--font-ui);
    color: var(--secondary);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 18px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 107, 53, 0.3);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.control-group {
    background: linear-gradient(145deg, rgba(20, 25, 40, 0.8), rgba(10, 15, 25, 0.9));
    padding: 16px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
}

.control-group h4 {
    font-family: var(--font-ui);
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.control-group p {
    font-size: 12px;
    margin: 6px 0;
    color: var(--text-dim);
    line-height: 1.5;
}

.key {
    display: inline-block;
    background: linear-gradient(145deg, rgba(0, 240, 255, 0.2), rgba(0, 240, 255, 0.1));
    padding: 3px 10px;
    border-radius: 5px;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    border: 1px solid var(--border-color);
    margin-right: 6px;
    text-shadow: 0 0 5px var(--primary-glow);
}

.faq-item {
    margin-bottom: 18px;
}

.faq-item h4 {
    font-family: var(--font-ui);
    color: var(--text-bright);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.faq-item p {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.6;
}

.features-list {
    display: grid;
    gap: 12px;
}

.feature {
    font-size: 13px;
    color: var(--text-dim);
    padding: 12px 16px;
    background: linear-gradient(145deg, rgba(20, 25, 40, 0.8), rgba(10, 15, 25, 0.9));
    border-radius: 8px;
    line-height: 1.5;
    border-left: 3px solid var(--primary);
}

.feature strong {
    color: var(--primary);
}

.tips-list {
    list-style: none;
    padding: 0;
}

.tips-list li {
    font-size: 13px;
    color: var(--text-dim);
    padding: 12px 16px;
    margin: 8px 0;
    background: linear-gradient(145deg, rgba(20, 25, 40, 0.8), rgba(10, 15, 25, 0.9));
    border-radius: 8px;
    border-left: 3px solid var(--warning);
    line-height: 1.5;
}

.faq-panel .menu-btn {
    display: block;
    margin: 25px auto 0;
}

/* ========================== */
/* MOBILE CONTROLS            */
/* ========================== */

#mobile-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.joystick {
    position: absolute;
    width: 130px;
    height: 130px;
    pointer-events: auto;
}

#joystick-left {
    bottom: 35px;
    left: 35px;
}

#joystick-right {
    bottom: 35px;
    right: 160px;
}

.joystick-base {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.1), transparent);
    border: 2px solid rgba(0, 240, 255, 0.3);
    border-radius: 50%;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
}

.joystick-stick {
    position: absolute;
    width: 55px;
    height: 55px;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.5), rgba(0, 240, 255, 0.2));
    border: 2px solid var(--primary);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 20px var(--primary-glow);
}

#mobile-buttons {
    position: absolute;
    bottom: 35px;
    right: 35px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: auto;
}

.mobile-btn {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mobile-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.3);
}

.mobile-btn.fire {
    width: 85px;
    height: 85px;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.4), rgba(239, 68, 68, 0.1));
    border-color: var(--danger);
    box-shadow: 0 0 20px var(--danger-glow);
}

/* ========================== */
/* LOADING SCREEN             */
/* ========================== */

#loading-screen {
    background: linear-gradient(135deg, #030308 0%, #0a1020 100%);
}

.loading-content {
    text-align: center;
}

.loading-content h1 {
    font-family: var(--font-display);
    font-size: 56px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), #00ff88);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 30px var(--primary-glow));
    margin-bottom: 40px;
    letter-spacing: 4px;
}

.loading-bar {
    width: 350px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto 20px;
    border: 1px solid var(--border-color);
}

#loading-fill {
    background: linear-gradient(90deg, var(--primary-dark), var(--primary), #00ff88);
    height: 100%;
    width: 0%;
    transition: width 0.4s ease;
    box-shadow: 0 0 20px var(--primary-glow);
    border-radius: 4px;
}

#loading-text {
    font-family: var(--font-ui);
    color: var(--text-dim);
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ========================== */
/* COMPASS                    */
/* ========================== */

.compass-container {
    position: fixed;
    top: 12px;
    right: 18px;
    background: linear-gradient(145deg, var(--glass-bg), rgba(0, 0, 0, 0.8));
    backdrop-filter: blur(12px);
    padding: 8px 0;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
    width: 220px;
    z-index: 101;
}

.compass-strip {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 12px;
    color: var(--text-dim);
    transition: transform 0.1s ease-out;
}

.compass-dir {
    font-weight: 700;
    min-width: 22px;
    text-align: center;
}

.compass-dir.highlight {
    color: var(--primary);
    font-size: 15px;
    text-shadow: 0 0 10px var(--primary-glow);
}

.compass-dir[data-dir="N"] { color: var(--danger); }
.compass-dir[data-dir="S"] { color: #3b82f6; }

.compass-marker {
    width: 1px;
    height: 10px;
    background: var(--text-muted);
    opacity: 0.4;
}

.compass-pointer {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    color: var(--primary);
    font-size: 10px;
}

/* ========================== */
/* REPUTATION INDICATOR       */
/* ========================== */

.reputation-indicator {
    position: fixed;
    top: 60px;
    left: 18px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    font-size: 12px;
    min-width: 140px;
}

.player-name {
    display: block;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 15px;
    color: var(--primary);
    text-shadow: 0 0 15px var(--primary-glow);
    margin-bottom: 6px;
    letter-spacing: 1px;
}

.rep-icon {
    margin-right: 6px;
    font-size: 14px;
}

#reputation-level {
    font-family: var(--font-ui);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#reputation-level.lawful { color: #4ade80; }
#reputation-level.neutral { color: #fbbf24; }
#reputation-level.ruthless { color: #f87171; }

.rep-bar-container {
    position: relative;
    width: 100%;
    height: 6px;
    background: linear-gradient(to right, #ef4444, #6b7280, #22c55e);
    border-radius: 3px;
    margin-top: 8px;
    overflow: visible;
}

.rep-bar-fill {
    position: absolute;
    top: -3px;
    width: 10px;
    height: 12px;
    background: var(--text-bright);
    border-radius: 3px;
    left: 50%;
    transform: translateX(-50%);
    transition: left 0.4s ease-out;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
}

.rep-bar-center {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 6px;
    background: rgba(255, 255, 255, 0.4);
    transform: translateX(-50%);
}

/* Mission Timer */
.mission-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--glass-border);
    font-family: var(--font-display);
    font-size: 16px;
}

.timer-icon {
    font-size: 14px;
}

#mission-time {
    color: var(--primary);
    font-weight: 700;
    text-shadow: 0 0 10px var(--primary-glow);
}

#mission-time.warning {
    color: var(--warning);
    text-shadow: 0 0 10px var(--warning-glow);
}

#mission-time.danger {
    color: var(--danger);
    text-shadow: 0 0 10px var(--danger-glow);
    animation: timerPulse 0.5s ease-in-out infinite;
}

@keyframes timerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Speed Bonus Timer */
.speed-bonus-timer {
    font-family: var(--font-ui);
    font-size: 11px;
    color: var(--warning);
    margin-top: 6px;
}

.speed-bonus-timer.expired {
    color: var(--text-muted);
    text-decoration: line-through;
}

/* Difficulty Badge */
#difficulty-badge {
    position: fixed;
    top: 18px;
    right: 245px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    padding: 6px 14px;
    border-radius: 20px;
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid var(--glass-border);
}

.difficulty-easy {
    border-color: #22c55e !important;
    color: #4ade80;
    text-shadow: 0 0 10px var(--success-glow);
}

.difficulty-normal {
    border-color: #3b82f6 !important;
    color: #60a5fa;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

.difficulty-hard {
    border-color: #f59e0b !important;
    color: #fbbf24;
    text-shadow: 0 0 10px var(--warning-glow);
}

.difficulty-bounty_hunter {
    border-color: #ef4444 !important;
    color: #f87171;
    text-shadow: 0 0 10px var(--danger-glow);
}

.difficulty-select {
    background: var(--bg-dark);
    color: var(--text-normal);
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    border-radius: 8px;
    font-family: var(--font-ui);
    font-size: 14px;
    cursor: pointer;
    min-width: 220px;
    transition: all var(--transition-fast);
}

.difficulty-select:hover {
    border-color: var(--primary);
}

.difficulty-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.difficulty-select option {
    background: var(--bg-dark);
    color: var(--text-normal);
    padding: 12px;
}

.difficulty-description {
    margin-top: 12px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.6;
}

/* ========================== */
/* DEBUG PANEL                */
/* ========================== */

.debug-panel {
    position: fixed;
    top: 65px;
    right: 18px;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    padding: 12px 18px;
    border-radius: 8px;
    border: 1px solid #333;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #0f0;
    z-index: 9999;
    min-width: 200px;
}

.debug-header {
    font-weight: bold;
    color: #ff0;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #444;
}

.debug-section {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #333;
}

.debug-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
}

.debug-row span:first-child { color: #888; }
.debug-row span:last-child { color: #0f0; }

.debug-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.debug-btn {
    background: #222;
    color: #0f0;
    border: 1px solid #0f0;
    padding: 4px 10px;
    font-family: monospace;
    font-size: 10px;
    cursor: pointer;
    border-radius: 3px;
    transition: all var(--transition-fast);
}

.debug-btn:hover {
    background: #0f0;
    color: #000;
}

/* ========================== */
/* SCROLLBAR                  */
/* ========================== */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--border-color), rgba(0, 240, 255, 0.1));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ========================== */
/* RESPONSIVE                 */
/* ========================== */

@media (max-width: 768px) {
    .game-title {
        font-size: 42px;
        letter-spacing: 2px;
    }

    .game-subtitle {
        font-size: 14px;
        letter-spacing: 4px;
    }

    .hud-panel {
        font-size: 11px;
        padding: 8px 12px;
        border-radius: 8px;
    }

    #minimap-container {
        display: none;
    }

    .compass-container {
        width: 160px;
    }

    .store-panel, .skill-panel, .board-panel, .faq-panel {
        min-width: auto;
        width: 95vw;
        max-height: 92vh;
        padding: 20px;
    }

    .warrants-grid, .store-grid {
        grid-template-columns: 1fr;
    }

    .skill-tree {
        grid-template-columns: repeat(2, 1fr);
    }

    .controls-grid {
        grid-template-columns: 1fr;
    }

    .character-grid {
        flex-direction: row;
        justify-content: center;
        gap: 20px;
    }

    .character-card {
        width: 48%;
        max-width: 200px;
        min-width: 180px;
    }

    .menu-btn {
        min-width: 200px;
        padding: 14px 30px;
    }
}

/* ========================== */
/* ANIMATIONS                 */
/* ========================== */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px var(--primary-glow); }
    50% { box-shadow: 0 0 40px var(--primary-glow), 0 0 60px var(--primary-glow); }
}

.animate-fadeIn { animation: fadeIn 0.3s ease-out; }
.animate-slideUp { animation: slideUp 0.4s ease-out; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-glow { animation: glow 2s ease-in-out infinite; }

/* ========================== */
/* CONTROLS HINT OVERLAY      */
/* ========================== */

.controls-hint {
    position: fixed;
    bottom: 100px;
    left: 20px;
    background: var(--panel-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    min-width: 160px;
    z-index: 50;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.controls-hint.hidden {
    opacity: 0;
    transform: translateX(-20px);
    pointer-events: none;
}

.hint-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.hint-title {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 2px;
}

.hint-toggle {
    font-family: var(--font-ui);
    font-size: 10px;
    color: var(--text-muted);
}

.hint-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hint-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.hint-key {
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    background: rgba(0, 240, 255, 0.15);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(0, 240, 255, 0.3);
    min-width: 40px;
    text-align: center;
}

.hint-action {
    font-family: var(--font-body);
    font-size: 11px;
    color: var(--text-secondary);
    text-align: right;
}

/* Controls hint responsive */
@media (max-width: 768px) {
    .controls-hint {
        bottom: 150px;
        left: 10px;
        padding: 10px 12px;
        min-width: 140px;
    }

    .hint-title {
        font-size: 10px;
    }

    .hint-key,
    .hint-action {
        font-size: 10px;
    }
}

/* Hide controls hint on very small screens */
@media (max-width: 480px) {
    .controls-hint {
        display: none;
    }
}

/* ========================== */
/* BLACK MARKET STYLES        */
/* ========================== */

/* Black Market title styling */
#store-ui h2[style*="a855f7"] {
    text-shadow: 0 0 20px rgba(168, 85, 247, 0.6), 0 0 40px rgba(168, 85, 247, 0.3);
}

/* Illegal item card styling */
.store-item.illegal {
    background: linear-gradient(135deg, rgba(88, 28, 135, 0.4), rgba(30, 10, 50, 0.6));
    border: 1px solid rgba(168, 85, 247, 0.5);
    position: relative;
    overflow: hidden;
}

.store-item.illegal::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.1), transparent);
    animation: illegalShimmer 3s infinite;
}

@keyframes illegalShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.store-item.illegal:hover {
    border-color: rgba(168, 85, 247, 0.8);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4), inset 0 0 20px rgba(168, 85, 247, 0.1);
    transform: translateY(-3px);
}

/* Illegal badge */
.illegal-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #7c3aed, #581c87);
    color: #fff;
    font-family: var(--font-display);
    font-size: 9px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.5);
}

/* Illegal item name */
.store-item-name.illegal-name {
    color: #c084fc;
    text-shadow: 0 0 10px rgba(192, 132, 252, 0.5);
}

/* Illegal price styling */
.store-item-price.illegal-price {
    color: #a855f7;
    text-shadow: 0 0 8px rgba(168, 85, 247, 0.5);
}

/* No items message */
.no-items {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: 14px;
}

/* Black Market panel styling when active */
.store-panel:has(h2[style*="a855f7"]) {
    border-color: rgba(168, 85, 247, 0.4);
    box-shadow: 0 0 40px rgba(168, 85, 247, 0.2), inset 0 0 60px rgba(168, 85, 247, 0.05);
}

/* Tab buttons in black market mode */
.store-panel:has(h2[style*="a855f7"]) .tab-btn.active {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), rgba(88, 28, 135, 0.4));
    border-color: #a855f7;
    color: #c084fc;
}

/* ========================== */
/* MOBILE LAYOUT FIXES        */
/* ========================== */

@media (max-width: 768px) {
    /* Hide non-essential HUD on mobile */
    #minimap-container,
    .compass-container,
    #reputation-display,
    .controls-hint,
    #compass {
        display: none !important;
    }

    /* HUD panels - minimal and transparent */
    .hud-panel {
        padding: 5px 10px;
        border-radius: 6px;
        font-size: 11px;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: none;
        border: 1px solid rgba(0, 240, 255, 0.3);
        position: fixed !important;
    }

    /* Player stats - TOP LEFT */
    #player-stats {
        top: 10px !important;
        left: 10px !important;
        bottom: auto !important;
        right: auto !important;
        padding: 8px 12px;
        min-width: 100px;
    }

    .stat-bar {
        height: 16px;
        margin-bottom: 4px;
        display: flex;
        align-items: center;
    }

    .stat-label {
        font-size: 10px;
        width: 30px;
        font-weight: bold;
    }

    .stat-value {
        font-size: 10px;
        width: 30px;
        text-align: right;
    }

    .bar-container {
        height: 8px;
        flex: 1;
        margin: 0 5px;
    }

    /* Weapon info - TOP RIGHT */
    #weapon-info {
        top: 10px !important;
        right: 10px !important;
        bottom: auto !important;
        left: auto !important;
        padding: 8px 12px;
        text-align: center;
    }

    .weapon-name {
        font-size: 12px;
        font-weight: bold;
        color: #00f0ff;
    }

    .ammo-info {
        font-size: 11px;
        margin-top: 3px;
    }

    /* Money display - BELOW player stats */
    #money-display {
        top: 75px !important;
        left: 10px !important;
        bottom: auto !important;
        right: auto !important;
        padding: 5px 10px;
        font-size: 14px;
        font-weight: bold;
        color: #00ff00;
    }

    /* Target info - TOP CENTER */
    #target-info {
        top: 10px !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        transform: translateX(-50%);
        min-width: 140px;
        max-width: 180px;
        padding: 8px 12px;
        text-align: center;
    }

    .target-name { font-size: 11px; }
    .target-status, .target-reward { font-size: 10px; }
    .threat-badge { font-size: 8px; padding: 2px 6px; }

    /* Center prompts - MIDDLE */
    #center-prompts {
        top: 25% !important;
        left: 50% !important;
        transform: translateX(-50%);
        padding: 12px 20px;
        max-width: 280px;
        text-align: center;
    }

    .prompt-text {
        font-size: 13px;
        line-height: 1.4;
    }

    /* Vehicle HUD - TOP CENTER below target */
    #vehicle-hud {
        top: 70px !important;
        left: 50% !important;
        bottom: auto !important;
        transform: translateX(-50%);
        padding: 6px 15px;
    }

    /* MOBILE CONTROLS - BOTTOM */
    #mobile-controls {
        position: fixed !important;
        z-index: 1000;
    }

    #joystick-left {
        position: fixed !important;
        bottom: 25px !important;
        left: 20px !important;
        width: 100px;
        height: 100px;
    }

    #joystick-right {
        display: none !important;
    }

    .joystick-base {
        width: 100%;
        height: 100%;
        background: rgba(255, 255, 255, 0.1);
        border: 2px solid rgba(0, 240, 255, 0.4);
        border-radius: 50%;
    }

    .joystick-stick {
        width: 45px;
        height: 45px;
        background: rgba(0, 240, 255, 0.5);
    }

    #mobile-buttons {
        position: fixed !important;
        bottom: 25px !important;
        right: 15px !important;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .mobile-btn {
        width: 55px;
        height: 55px;
        font-size: 12px;
        font-weight: bold;
        background: rgba(0, 240, 255, 0.2);
        border: 2px solid rgba(0, 240, 255, 0.5);
        border-radius: 50%;
        color: #fff;
    }

    .mobile-btn.fire {
        width: 65px;
        height: 65px;
        font-size: 13px;
        background: rgba(255, 80, 80, 0.3);
        border-color: rgba(255, 80, 80, 0.6);
    }

    /* Menus - cleaner */
    .menu-panel {
        width: 95vw;
        max-width: 400px;
        padding: 15px;
        background: rgba(5, 5, 15, 0.95);
    }

    .menu-btn {
        width: 100%;
        min-width: unset;
        padding: 12px 20px;
        font-size: 14px;
    }

    /* Settings panel */
    .settings-panel,
    .settings-panel.large {
        width: 95vw !important;
        min-width: unset !important;
        max-width: 100vw !important;
        max-height: 90vh;
        padding: 15px;
        overflow-y: auto;
    }

    .settings-section {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }

    .settings-section h3 {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .setting-item {
        flex-wrap: wrap;
        gap: 5px;
        margin: 8px 0;
    }

    .setting-item label {
        font-size: 12px;
        flex: 1;
        min-width: 100px;
    }

    .setting-item input[type="range"] {
        width: 100px;
        flex-shrink: 0;
    }

    .volume-value {
        width: 40px;
        font-size: 11px;
    }

    .settings-buttons {
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 15px;
    }

    .settings-buttons .menu-btn {
        flex: 1 1 auto;
        min-width: 80px;
        padding: 10px 15px;
        font-size: 11px;
    }

    .difficulty-select {
        width: 100%;
        font-size: 12px;
        padding: 8px;
    }

    .difficulty-description {
        font-size: 11px;
        margin-top: 8px;
    }

    /* Store/Skill panels */
    .store-panel, .skill-panel, .board-panel {
        width: 95vw;
        max-height: 80vh;
        padding: 15px;
    }

    .store-item, .skill-card, .warrant-card {
        padding: 10px;
    }

    /* Booking UI */
    .booking-panel {
        width: 95vw;
        padding: 15px;
    }

    /* Game over */
    .game-over-panel {
        width: 90vw;
        padding: 15px;
    }

    /* Character select - MOBILE FIXED */
    #character-select {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        padding: 10px !important;
        padding-top: env(safe-area-inset-top, 10px) !important;
        padding-bottom: env(safe-area-inset-bottom, 10px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        min-height: 100vh;
        min-height: 100dvh;
    }

    #character-select .menu-content {
        padding: 10px;
        width: 100%;
        max-width: 350px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        flex-shrink: 0;
    }

    .select-title {
        font-size: 14px;
        letter-spacing: 1px;
        margin-bottom: 5px;
        text-align: center;
    }

    /* Two cards side by side */
    .character-grid {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
        justify-content: center;
        margin-bottom: 10px;
    }

    .character-card {
        width: calc(50% - 10px);
        max-width: 180px;
        min-width: 160px;
        padding: 10px;
        border-radius: 10px;
        flex-shrink: 0;
    }

    .char-preview {
        width: 100%;
        height: 120px;
        border-radius: 8px;
        background-size: contain !important;
        background-position: center top !important;
    }

    .char-preview::after {
        display: none !important;
    }

    .char-info {
        margin-top: 5px;
    }

    .char-name {
        font-size: 11px;
        margin-top: 5px;
        text-align: center;
    }

    .char-class,
    .char-stats,
    .char-desc {
        display: none;
    }

    /* Buttons ALWAYS visible */
    .char-select-buttons {
        display: flex !important;
        flex-direction: row !important;
        gap: 15px;
        justify-content: center;
        width: 100%;
        padding: 15px 10px;
        margin-top: 10px;
        background: rgba(0,0,0,0.5);
        border-radius: 10px;
        flex-shrink: 0;
    }

    .char-select-buttons .menu-btn {
        padding: 15px 25px;
        font-size: 14px;
        min-width: 100px;
        flex: 1;
        max-width: 150px;
    }

    /* All overlay screens scrollable on mobile */
    .overlay-screen {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y !important;
    }

    /* Allow touch scrolling on menu screens */
    .menu-screen,
    #character-select,
    #main-menu,
    .menu-content,
    .settings-panel,
    .store-panel,
    .skill-panel,
    .board-panel {
        touch-action: pan-y !important;
        -webkit-overflow-scrolling: touch;
    }
}

/* Extra small screens (phones) */
@media (max-width: 480px) {
    /* Minimal HUD */
    .hud-panel {
        padding: 3px 6px;
        font-size: 8px;
    }

    #target-info {
        min-width: 130px;
        max-width: 160px;
    }

    .target-name {
        font-size: 9px;
    }

    #player-stats {
        top: 3px;
        left: 3px;
    }

    #weapon-info {
        top: 3px;
        right: 3px;
    }

    #money-display {
        top: 45px;
        font-size: 11px;
    }

    /* Joystick */
    #joystick-left {
        bottom: 10px;
        left: 10px;
        width: 75px;
        height: 75px;
    }

    .joystick-stick {
        width: 32px;
        height: 32px;
    }

    #mobile-buttons {
        bottom: 10px;
        right: 8px;
        gap: 5px;
    }

    .mobile-btn {
        width: 40px;
        height: 40px;
        font-size: 9px;
    }

    .mobile-btn.fire {
        width: 50px;
        height: 50px;
    }

    /* Full width menus */
    .menu-panel, .settings-panel, .store-panel,
    .skill-panel, .board-panel, .booking-panel {
        width: 98vw;
        border-radius: 10px;
    }

    /* Character select - small phones */
    #character-select .menu-content {
        padding: 5px;
        max-width: 100%;
    }

    .select-title {
        font-size: 12px;
        margin-bottom: 5px;
    }

    .character-grid {
        gap: 8px;
        width: 100%;
    }

    .character-card {
        width: calc(50% - 8px);
        max-width: 160px;
        min-width: 140px;
        padding: 8px;
    }

    .char-preview {
        height: 80px;
    }

    .char-name {
        font-size: 11px;
    }

    .char-select-buttons {
        padding: 10px 5px;
        gap: 10px;
    }

    .char-select-buttons .menu-btn {
        padding: 12px 20px;
        font-size: 12px;
        min-width: 90px;
    }
}

/* Touch device detection - applies to ALL touch devices regardless of width */
@media (pointer: coarse) {
    /* Show mobile controls on touch devices */
    #mobile-controls {
        display: block !important;
    }

    #mobile-controls.hidden {
        display: none !important;
    }

    /* Hide non-essential HUD on touch devices */
    #minimap-container,
    .compass-container,
    #reputation-display,
    .controls-hint,
    #compass {
        display: none !important;
    }

    /* HUD panels - minimal for touch */
    .hud-panel {
        padding: 5px 10px;
        border-radius: 6px;
        font-size: 11px;
        background: rgba(0, 0, 0, 0.7);
        border: 1px solid rgba(0, 240, 255, 0.3);
        position: fixed !important;
    }

    /* Player stats - TOP LEFT */
    #player-stats {
        top: 10px !important;
        left: 10px !important;
        bottom: auto !important;
        right: auto !important;
    }

    /* Money - below player stats */
    #money-display {
        top: 90px !important;
        left: 10px !important;
        bottom: auto !important;
        right: auto !important;
    }

    /* Weapon info - TOP RIGHT */
    #weapon-info {
        top: 10px !important;
        right: 10px !important;
        bottom: auto !important;
        left: auto !important;
    }

    /* Center prompts */
    #center-prompts {
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        bottom: auto !important;
        right: auto !important;
    }

    /* Target info */
    #target-info {
        top: 60px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
}

/* Landscape phone orientation */
@media (max-height: 500px) and (orientation: landscape) {
    #player-stats {
        bottom: auto;
        top: 50px;
        left: 8px;
    }

    #weapon-info {
        bottom: auto;
        top: 50px;
        right: 8px;
    }

    #joystick-left {
        bottom: 10px;
        left: 10px;
        width: 70px;
        height: 70px;
    }

    #joystick-right {
        bottom: 10px;
        right: 90px;
        width: 70px;
        height: 70px;
    }

    .joystick-stick {
        width: 30px;
        height: 30px;
    }

    #mobile-buttons {
        bottom: 10px;
        right: 10px;
        flex-direction: row;
        gap: 5px;
    }

    .mobile-btn {
        width: 40px;
        height: 40px;
        font-size: 9px;
    }

    .mobile-btn.fire {
        width: 50px;
        height: 50px;
    }

    /* Smaller panels in landscape */
    .menu-panel, .settings-panel {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* Touch devices in landscape - more specific */
@media (pointer: coarse) and (orientation: landscape) {
    #player-stats {
        top: 10px !important;
        left: 10px !important;
        bottom: auto !important;
    }

    #weapon-info {
        top: 10px !important;
        right: 10px !important;
        bottom: auto !important;
    }

    #money-display {
        top: 80px !important;
        left: 10px !important;
    }

    #joystick-left {
        bottom: 15px !important;
        left: 15px !important;
        width: 80px !important;
        height: 80px !important;
    }

    #mobile-buttons {
        bottom: 15px !important;
        right: 15px !important;
        flex-direction: row !important;
        gap: 8px !important;
    }

    .mobile-btn {
        width: 50px !important;
        height: 50px !important;
        font-size: 11px !important;
    }

    .mobile-btn.fire {
        width: 60px !important;
        height: 60px !important;
    }

    /* Menus in landscape */
    .menu-content {
        max-width: 90vw !important;
        max-height: 85vh !important;
        overflow-y: auto !important;
    }

    .character-grid {
        flex-direction: row !important;
    }

    .character-card {
        width: 170px !important;
        min-width: 150px !important;
    }
}
