/* ==========================================
   BEACH BUGGY RACING 3D - COMPLETE STYLES
   FULLY FIXED VERSION
   ========================================== */

/* CSS Variables */
:root {
    --primary-color: #ff6b35;
    --secondary-color: #f7c59f;
    --accent-color: #2ec4b6;
    --dark-color: #1a1a2e;
    --darker-color: #16213e;
    --light-color: #edf2f4;
    --gold-color: #ffd700;
    --silver-color: #c0c0c0;
    --bronze-color: #cd7f32;
    --success-color: #4ade80;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    
    --font-primary: 'Orbitron', sans-serif;
    --font-secondary: 'Rajdhani', sans-serif;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.2);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.3);
    --shadow-glow: 0 0 20px rgba(255, 107, 53, 0.5);
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-secondary);
    background: var(--dark-color);
    color: var(--light-color);
}

body {
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--darker-color) 100%);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--darker-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Utility Classes */
.hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* ==========================================
   PRELOADER STYLES - FIXED
   ========================================== */

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #87CEEB 0%, #f4a460 50%, #ff6b35 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s ease;
}

.loader-container {
    text-align: center;
    position: relative;
    padding: 20px;
}

.loader-car {
    position: relative;
    width: 120px;
    height: 50px;
    margin: 0 auto 30px;
    animation: carBounce 0.5s ease-in-out infinite;
}

@keyframes carBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.car-body {
    position: absolute;
    width: 100%;
    height: 30px;
    background: linear-gradient(135deg, var(--primary-color), #ff8c5a);
    border-radius: 10px 30px 5px 5px;
    top: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.car-body::before {
    content: '';
    position: absolute;
    width: 50px;
    height: 15px;
    background: rgba(255,255,255,0.3);
    top: -10px;
    left: 35px;
    border-radius: 5px 15px 0 0;
}

.car-body::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 8px;
    background: #333;
    bottom: 5px;
    right: 10px;
    border-radius: 3px;
}

.wheel {
    position: absolute;
    width: 25px;
    height: 25px;
    background: #333;
    border-radius: 50%;
    bottom: -8px;
    border: 4px solid #666;
    animation: wheelSpin 0.3s linear infinite;
}

@keyframes wheelSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.wheel-front {
    left: 15px;
}

.wheel-back {
    right: 15px;
}

.dust {
    position: absolute;
    bottom: -15px;
    left: -30px;
    width: 180px;
    height: 20px;
}

.dust::before,
.dust::after {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    background: rgba(210, 180, 140, 0.6);
    border-radius: 50%;
    animation: dustFloat 0.5s ease-out infinite;
}

.dust::before {
    left: 0;
    animation-delay: 0s;
}

.dust::after {
    left: 20px;
    animation-delay: 0.2s;
}

@keyframes dustFloat {
    0% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-30px) scale(2);
    }
}

.loader-road {
    width: 300px;
    height: 10px;
    background: #333;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
    margin: 0 auto 30px;
}

.loader-road::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: repeating-linear-gradient(
        90deg,
        #fff 0px,
        #fff 20px,
        transparent 20px,
        transparent 40px
    );
    top: 50%;
    transform: translateY(-50%);
    animation: roadMove 0.5s linear infinite;
}

@keyframes roadMove {
    from { transform: translateX(0) translateY(-50%); }
    to { transform: translateX(-40px) translateY(-50%); }
}

.loader-text {
    text-align: center;
}

.loader-text h2 {
    font-family: var(--font-primary);
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--dark-color);
    text-shadow: 2px 2px 0 var(--secondary-color);
    margin-bottom: 20px;
    letter-spacing: 5px;
}

.loading-bar {
    width: 300px;
    height: 20px;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto 15px;
    border: 2px solid rgba(0,0,0,0.2);
}

.loading-progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--gold-color), var(--primary-color));
    background-size: 200% 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
    position: relative;
    animation: progressGlow 1.5s ease infinite;
}

@keyframes progressGlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.loading-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,0.4),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.loader-text p {
    font-size: 1.1rem;
    color: var(--dark-color);
    font-weight: 600;
}

.loader-text p span {
    color: var(--darker-color);
    font-weight: 700;
}

/* ==========================================
   MAIN MENU STYLES
   ========================================== */

.menu-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

#mainMenu {
    overflow: hidden;
}

.menu-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #87CEEB 0%, #ffd89b 70%, #f4a460 100%);
    overflow: hidden;
}

.palm-tree {
    position: absolute;
    bottom: 15%;
    width: 80px;
    height: 200px;
}

.palm-tree::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 150px;
    background: linear-gradient(180deg, #8B4513 0%, #654321 100%);
    border-radius: 5px;
}

.palm-tree::after {
    content: '🌴';
    font-size: 100px;
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
}

.palm-1 {
    left: 5%;
    animation: palmSway 3s ease-in-out infinite;
}

.palm-2 {
    right: 5%;
    animation: palmSway 3.5s ease-in-out infinite reverse;
}

@keyframes palmSway {
    0%, 100% { transform: rotate(-2deg); }
    50% { transform: rotate(2deg); }
}

.sun {
    position: absolute;
    top: 10%;
    right: 15%;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, #FFD700 0%, #FFA500 50%, transparent 70%);
    border-radius: 50%;
    animation: sunPulse 3s ease-in-out infinite;
}

@keyframes sunPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.9; }
}

.clouds {
    position: absolute;
    width: 100%;
    height: 30%;
    top: 5%;
}

.cloud {
    position: absolute;
    background: white;
    border-radius: 50px;
    opacity: 0.8;
}

.cloud::before,
.cloud::after {
    content: '';
    position: absolute;
    background: white;
    border-radius: 50%;
}

.cloud-1 {
    width: 100px;
    height: 40px;
    top: 20%;
    left: -100px;
    animation: cloudMove 30s linear infinite;
}

.cloud-1::before {
    width: 50px;
    height: 50px;
    top: -25px;
    left: 15px;
}

.cloud-1::after {
    width: 40px;
    height: 40px;
    top: -20px;
    left: 45px;
}

.cloud-2 {
    width: 80px;
    height: 35px;
    top: 40%;
    left: -80px;
    animation: cloudMove 35s linear infinite 10s;
}

.cloud-2::before {
    width: 40px;
    height: 40px;
    top: -20px;
    left: 10px;
}

.cloud-2::after {
    width: 35px;
    height: 35px;
    top: -15px;
    left: 35px;
}

.cloud-3 {
    width: 120px;
    height: 45px;
    top: 10%;
    left: -120px;
    animation: cloudMove 40s linear infinite 20s;
}

.cloud-3::before {
    width: 60px;
    height: 60px;
    top: -30px;
    left: 20px;
}

.cloud-3::after {
    width: 50px;
    height: 50px;
    top: -25px;
    left: 55px;
}

@keyframes cloudMove {
    from { transform: translateX(0); }
    to { transform: translateX(calc(100vw + 200px)); }
}

.waves {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20%;
    background: linear-gradient(180deg, transparent 0%, rgba(32, 178, 170, 0.5) 30%, #20B2AA 100%);
    overflow: hidden;
}

.waves::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='%2320B2AA' d='M0,192L48,186.7C96,181,192,171,288,181.3C384,192,480,224,576,218.7C672,213,768,171,864,165.3C960,160,1056,192,1152,197.3C1248,203,1344,181,1392,170.7L1440,160L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: repeat-x;
    animation: waveMove 10s linear infinite;
}

@keyframes waveMove {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.menu-content {
    position: relative;
    z-index: 10;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.logo-container {
    text-align: center;
    margin-bottom: 50px;
}

.game-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: var(--font-primary);
}

.logo-beach {
    font-size: 3rem;
    font-weight: 900;
    color: var(--primary-color);
    text-shadow: 
        3px 3px 0 var(--dark-color),
        -1px -1px 0 var(--dark-color),
        1px -1px 0 var(--dark-color),
        -1px 1px 0 var(--dark-color);
    letter-spacing: 10px;
    animation: logoFloat 3s ease-in-out infinite;
}

.logo-buggy {
    font-size: 5rem;
    font-weight: 900;
    color: var(--gold-color);
    text-shadow: 
        4px 4px 0 var(--dark-color),
        -2px -2px 0 var(--dark-color),
        2px -2px 0 var(--dark-color),
        -2px 2px 0 var(--dark-color),
        0 0 30px rgba(255, 215, 0, 0.5);
    letter-spacing: 15px;
    animation: logoFloat 3s ease-in-out infinite 0.5s;
}

.logo-racing {
    font-size: 2rem;
    font-weight: 600;
    color: var(--accent-color);
    text-shadow: 2px 2px 0 var(--dark-color);
    letter-spacing: 20px;
    animation: logoFloat 3s ease-in-out infinite 1s;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.logo-underline {
    width: 300px;
    height: 5px;
    background: linear-gradient(90deg, transparent, var(--primary-color), var(--gold-color), var(--primary-color), transparent);
    margin-top: 20px;
    border-radius: 5px;
}

.main-nav {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 400px;
}

.menu-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 18px 40px;
    font-family: var(--font-primary);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--light-color);
    background: linear-gradient(135deg, var(--darker-color), var(--dark-color));
    border: 3px solid var(--primary-color);
    border-radius: 15px;
    cursor: pointer;
    overflow: hidden;
    transition: all var(--transition-normal);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.menu-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.menu-btn:hover::before {
    left: 100%;
}

.menu-btn:hover {
    background: linear-gradient(135deg, var(--primary-color), #ff8c5a);
    border-color: var(--gold-color);
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.4);
}

.menu-btn i {
    font-size: 1.5rem;
}

.menu-btn.primary-btn {
    background: linear-gradient(135deg, var(--primary-color), #ff8c5a);
    border-color: var(--gold-color);
    animation: primaryBtnPulse 2s ease-in-out infinite;
}

@keyframes primaryBtnPulse {
    0%, 100% { box-shadow: 0 5px 20px rgba(255, 107, 53, 0.4); }
    50% { box-shadow: 0 5px 40px rgba(255, 107, 53, 0.8); }
}

.menu-btn.primary-btn:hover {
    background: linear-gradient(135deg, var(--gold-color), #ffc107);
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: skewX(-20deg);
    animation: btnShine 3s infinite;
}

@keyframes btnShine {
    0% { left: -100%; }
    20% { left: 150%; }
    100% { left: 150%; }
}

.menu-footer {
    position: absolute;
    bottom: 20px;
    text-align: center;
    width: 100%;
}

.menu-footer p {
    color: var(--dark-color);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-links a {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dark-color);
    color: var(--light-color);
    border-radius: 50%;
    font-size: 1.2rem;
    transition: all var(--transition-normal);
    text-decoration: none;
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-5px);
}

/* ==========================================
   SCREEN HEADER STYLES
   ========================================== */

.screen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: linear-gradient(180deg, var(--darker-color), transparent);
}

.back-btn {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    color: var(--light-color);
    font-size: 1.3rem;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.back-btn:hover {
    background: var(--gold-color);
    transform: scale(1.1);
}

.screen-header h2 {
    font-family: var(--font-primary);
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold-color);
    text-shadow: 2px 2px 0 var(--dark-color);
}

.currency {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--darker-color);
    padding: 10px 20px;
    border-radius: 25px;
    border: 2px solid var(--gold-color);
}

.currency i {
    color: var(--gold-color);
    font-size: 1.3rem;
}

.currency span {
    font-family: var(--font-primary);
    font-size: 1.2rem;
    color: var(--gold-color);
}

.level-progress {
    font-family: var(--font-primary);
    color: var(--accent-color);
    font-size: 1rem;
}

/* ==========================================
   GARAGE STYLES
   ========================================== */

#garageScreen {
    background: linear-gradient(135deg, var(--dark-color), var(--darker-color));
}

.garage-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 20px;
    padding: 20px;
    height: calc(100% - 90px);
    overflow-y: auto;
}

.vehicle-display {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
    background: linear-gradient(135deg, #2a2a4a, #1a1a2e);
    border-radius: 20px;
    padding: 20px;
    border: 3px solid var(--primary-color);
}

.vehicle-3d-view {
    height: 300px;
    background: radial-gradient(circle at center, #3a3a5a, #1a1a2e);
    border-radius: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.vehicle-3d-view::before {
    content: '🏎️';
    font-size: 8rem;
    animation: vehiclePreviewBounce 2s ease-in-out infinite;
}

@keyframes vehiclePreviewBounce {
    0%, 100% { transform: translateY(0) rotateY(0deg); }
    25% { transform: translateY(-10px) rotateY(10deg); }
    50% { transform: translateY(0) rotateY(0deg); }
    75% { transform: translateY(-10px) rotateY(-10deg); }
}

#vehicleCanvas {
    width: 100%;
    height: 100%;
}

.vehicle-info h3 {
    font-family: var(--font-primary);
    font-size: 1.8rem;
    color: var(--gold-color);
    margin-bottom: 20px;
    text-align: center;
}

.vehicle-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-label {
    width: 120px;
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.stat-bar {
    flex: 1;
    height: 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--gold-color));
    border-radius: 10px;
    transition: width 0.5s ease;
}

.vehicle-selection {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    background: linear-gradient(135deg, #2a2a4a, #1a1a2e);
    border-radius: 20px;
    padding: 20px;
    border: 3px solid var(--accent-color);
}

.vehicle-selection h4,
.color-selection h4 {
    font-family: var(--font-primary);
    font-size: 1.2rem;
    color: var(--accent-color);
    margin-bottom: 15px;
}

.vehicle-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.category-btn {
    padding: 8px 16px;
    background: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    border-radius: 20px;
    font-family: var(--font-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.category-btn:hover,
.category-btn.active {
    background: var(--accent-color);
    color: var(--dark-color);
}

.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 5px;
}

.vehicle-item {
    aspect-ratio: 1;
    background: rgba(255,255,255,0.05);
    border-radius: 15px;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    position: relative;
}

.vehicle-item:hover {
    border-color: var(--accent-color);
    background: rgba(255,255,255,0.1);
    transform: scale(1.05);
}

.vehicle-item.selected {
    border-color: var(--gold-color);
    background: rgba(255, 215, 0, 0.2);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.vehicle-item.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.vehicle-item.locked::after {
    content: '🔒';
    position: absolute;
    font-size: 1.5rem;
}

.vehicle-item .vehicle-icon {
    font-size: 2rem;
    margin-bottom: 5px;
}

.vehicle-item span {
    font-size: 0.7rem;
    margin-top: 5px;
    text-align: center;
    color: var(--secondary-color);
}

.color-selection {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    background: linear-gradient(135deg, #2a2a4a, #1a1a2e);
    border-radius: 20px;
    padding: 20px;
    border: 3px solid var(--secondary-color);
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
}

.color-item {
    aspect-ratio: 1;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all var(--transition-normal);
}

.color-item:hover {
    transform: scale(1.2);
}

.color-item.selected {
    border-color: white;
    box-shadow: 0 0 15px currentColor;
    transform: scale(1.1);
}

.select-vehicle-btn {
    grid-column: 1 / 3;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color), #ff8c5a);
    border: none;
    border-radius: 15px;
    color: var(--light-color);
    font-family: var(--font-primary);
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.select-vehicle-btn:hover {
    background: linear-gradient(135deg, var(--gold-color), #ffc107);
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
}

/* ==========================================
   LEVEL SELECTION STYLES
   ========================================== */

#levelScreen {
    background: linear-gradient(135deg, var(--dark-color), var(--darker-color));
}

.level-container {
    padding: 20px;
    height: calc(100% - 90px);
    overflow-y: auto;
}

.world-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.world-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 15px;
    color: var(--light-color);
    font-family: var(--font-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.world-tab:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--primary-color);
}

.world-tab.active {
    background: var(--primary-color);
    border-color: var(--gold-color);
}

.world-tab i {
    font-size: 1.3rem;
}

.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.level-item {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #2a2a4a, #1a1a2e);
    border-radius: 20px;
    border: 3px solid rgba(255,255,255,0.1);
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    position: relative;
    overflow: hidden;
}

.level-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s;
}

.level-item:hover::before {
    transform: translateX(100%);
}

.level-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.level-item.completed {
    border-color: var(--success-color);
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.1), #1a1a2e);
}

.level-item.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.level-item.locked:hover {
    transform: none;
    border-color: rgba(255,255,255,0.1);
}

.level-num {
    font-family: var(--font-primary);
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--gold-color);
}

.level-name {
    font-size: 0.8rem;
    color: var(--secondary-color);
    margin-top: 5px;
    text-align: center;
}

.level-stars {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.level-stars i {
    color: rgba(255,255,255,0.2);
    font-size: 0.9rem;
}

.level-stars i.earned {
    color: var(--gold-color);
}

.level-lock {
    position: absolute;
    font-size: 2rem;
}

/* ==========================================
   SETTINGS STYLES
   ========================================== */

#settingsScreen {
    background: linear-gradient(135deg, var(--dark-color), var(--darker-color));
}

.settings-container {
    padding: 30px;
    max-width: 800px;
    margin: 0 auto;
    height: calc(100% - 90px);
    overflow-y: auto;
}

.settings-group {
    background: rgba(255,255,255,0.05);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 25px;
    border: 2px solid rgba(255,255,255,0.1);
}

.settings-group h4 {
    font-family: var(--font-primary);
    font-size: 1.3rem;
    color: var(--gold-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item label {
    font-weight: 500;
    color: var(--light-color);
}

.setting-item input[type="range"] {
    width: 200px;
    height: 8px;
    -webkit-appearance: none;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    outline: none;
}

.setting-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.5);
}

.setting-item input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--gold-color);
    transform: scale(1.1);
}

.range-value {
    width: 50px;
    text-align: right;
    color: var(--primary-color);
    font-weight: 600;
    font-family: var(--font-primary);
}

.setting-item select {
    padding: 10px 20px;
    background: var(--darker-color);
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    color: var(--light-color);
    font-family: var(--font-secondary);
    cursor: pointer;
    outline: none;
}

.setting-item select:focus {
    border-color: var(--gold-color);
}

.toggle {
    position: relative;
    width: 60px;
    height: 30px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.1);
    border-radius: 30px;
    transition: var(--transition-normal);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition-normal);
}

.toggle input:checked + .toggle-slider {
    background: var(--success-color);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(30px);
}

.control-keys {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.key-binding {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
}

.key-binding kbd {
    background: var(--darker-color);
    padding: 8px 15px;
    border-radius: 8px;
    border: 2px solid var(--primary-color);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    color: var(--primary-color);
}

.save-settings-btn {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, var(--success-color), #22c55e);
    border: none;
    border-radius: 15px;
    color: white;
    font-family: var(--font-primary);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.save-settings-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(74, 222, 128, 0.4);
}

/* ==========================================
   HIGHSCORE / LEADERBOARD STYLES
   ========================================== */

#highscoreScreen {
    background: linear-gradient(135deg, var(--dark-color), var(--darker-color));
}

.highscore-container {
    padding: 30px;
    max-width: 900px;
    margin: 0 auto;
    height: calc(100% - 90px);
    overflow-y: auto;
}

.highscore-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
}

.hs-tab {
    padding: 15px 40px;
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 30px;
    font-family: var(--font-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.hs-tab:hover,
.hs-tab.active {
    background: var(--primary-color);
    color: white;
}

/* Leaderboard Styles - FIXED */
.leaderboard,
#leaderboard {
    background: rgba(255,255,255,0.05);
    border-radius: 20px;
    padding: 20px;
    border: 2px solid rgba(255,255,255,0.1);
}

.leaderboard-header {
    display: grid;
    grid-template-columns: 60px 1fr 80px 100px 80px;
    padding: 15px 20px;
    background: rgba(255, 107, 0, 0.2);
    border-radius: 10px;
    margin-bottom: 15px;
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary-color);
}

.leaderboard-entry {
    display: grid;
    grid-template-columns: 60px 1fr 80px 100px 80px;
    align-items: center;
    padding: 15px 20px;
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    margin-bottom: 10px;
    transition: all var(--transition-normal);
}

.leaderboard-entry:hover {
    background: rgba(255,255,255,0.08);
    transform: translateX(5px);
}

.leaderboard-entry.top-1 {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.05));
    border: 2px solid var(--gold-color);
}

.leaderboard-entry.top-2 {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.2), rgba(192, 192, 192, 0.05));
    border: 2px solid var(--silver-color);
}

.leaderboard-entry.top-3 {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.2), rgba(205, 127, 50, 0.05));
    border: 2px solid var(--bronze-color);
}

.leaderboard-entry.player {
    background: rgba(0, 212, 255, 0.15);
    border: 2px solid var(--accent-color);
}

.leaderboard-entry .rank {
    font-family: var(--font-primary);
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--gold-color);
}

.leaderboard-entry .name {
    font-weight: 600;
    font-size: 1.1rem;
}

.leaderboard-entry .level,
.leaderboard-entry .time,
.leaderboard-entry .stars {
    color: var(--secondary-color);
    font-size: 0.95rem;
}

.leaderboard-entry .stars {
    color: var(--gold-color);
}

/* ==========================================
   GAME SCREEN STYLES
   ========================================== */

#gameScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 2000;
}

#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* HUD Styles */
#gameHUD {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.hud-top {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0 30px;
}

.position-display {
    background: linear-gradient(135deg, rgba(0,0,0,0.8), rgba(0,0,0,0.5));
    padding: 15px 25px;
    border-radius: 15px;
    border: 3px solid var(--primary-color);
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.position-num {
    font-family: var(--font-primary);
    font-size: 3rem;
    font-weight: 900;
    color: var(--gold-color);
}

.position-suffix {
    font-family: var(--font-primary);
    font-size: 1.2rem;
    color: var(--gold-color);
}

.position-total {
    font-size: 1rem;
    color: rgba(255,255,255,0.5);
}

.lap-display {
    background: linear-gradient(135deg, rgba(0,0,0,0.8), rgba(0,0,0,0.5));
    padding: 15px 30px;
    border-radius: 15px;
    border: 3px solid var(--accent-color);
    text-align: center;
}

.lap-label {
    display: block;
    font-size: 0.8rem;
    color: var(--accent-color);
    margin-bottom: 5px;
}

.lap-current {
    font-family: var(--font-primary);
    font-size: 2.5rem;
    font-weight: 900;
    color: white;
}

.lap-separator {
    color: rgba(255,255,255,0.5);
    margin: 0 5px;
}

.lap-total {
    font-family: var(--font-primary);
    font-size: 1.5rem;
    color: rgba(255,255,255,0.7);
}

.time-display {
    background: linear-gradient(135deg, rgba(0,0,0,0.8), rgba(0,0,0,0.5));
    padding: 15px 25px;
    border-radius: 15px;
    border: 3px solid var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.time-display i {
    color: var(--secondary-color);
    font-size: 1.3rem;
}

.time-display span {
    font-family: var(--font-primary);
    font-size: 1.5rem;
    color: white;
}

.hud-bottom {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 30px;
}

.speed-display {
    position: relative;
}

.speedometer {
    width: 180px;
    height: 180px;
    position: relative;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.2);
}

.speed-gauge {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.gauge-bg {
    fill: none;
    stroke: rgba(255,255,255,0.1);
    stroke-width: 15;
    stroke-dasharray: 400;
    stroke-dashoffset: 100;
    stroke-linecap: round;
}

.gauge-fill {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 15;
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s ease;
}

.speed-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.speed-num {
    display: block;
    font-family: var(--font-primary);
    font-size: 2.5rem;
    font-weight: 900;
    color: white;
}

.speed-unit {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
}

.nitro-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.nitro-label {
    font-family: var(--font-primary);
    font-size: 1rem;
    color: var(--accent-color);
}

.nitro-bar {
    width: 200px;
    height: 25px;
    background: rgba(0,0,0,0.5);
    border-radius: 15px;
    border: 3px solid var(--accent-color);
    overflow: hidden;
}

.nitro-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), #00ffff, var(--accent-color));
    background-size: 200% 100%;
    animation: nitroFlow 1s linear infinite;
    transition: width 0.2s ease;
    border-radius: 12px;
}

@keyframes nitroFlow {
    from { background-position: 0% 0%; }
    to { background-position: 200% 0%; }
}

.nitro-flames {
    display: flex;
    gap: 5px;
    height: 20px;
}

.nitro-flames.active::before,
.nitro-flames.active::after {
    content: '🔥';
    font-size: 1.5rem;
    animation: flameFlicker 0.1s infinite alternate;
}

@keyframes flameFlicker {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.2); }
}

.minimap {
    width: 150px;
    height: 150px;
    background: rgba(0,0,0,0.7);
    border-radius: 15px;
    border: 3px solid rgba(255,255,255,0.3);
    position: relative;
    overflow: hidden;
}

#minimapCanvas {
    width: 100%;
    height: 100%;
}

.player-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px var(--primary-color);
}

.hud-left {
    position: absolute;
    left: 50%;
    top: 40%;
    transform: translateX(-50%);
}

.wrong-way {
    background: var(--danger-color);
    padding: 15px 30px;
    border-radius: 10px;
    font-family: var(--font-primary);
    font-size: 1.5rem;
    color: white;
    display: none;
    align-items: center;
    gap: 10px;
    animation: wrongWayBlink 0.5s infinite;
}

.wrong-way.visible {
    display: flex;
}

@keyframes wrongWayBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Countdown */
.countdown,
#countdown {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
}

.countdown-num {
    font-family: var(--font-primary);
    font-size: 12rem;
    font-weight: 900;
    color: var(--primary-color);
    text-shadow: 
        0 0 50px rgba(255, 107, 53, 0.8),
        5px 5px 0 var(--dark-color);
    animation: countdownPop 0.8s ease-out;
}

@keyframes countdownPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.3);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Overlay Menus */
.overlay-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    pointer-events: auto;
}

.pause-content,
.results-content {
    background: linear-gradient(135deg, var(--darker-color), var(--dark-color));
    padding: 50px;
    border-radius: 30px;
    border: 5px solid var(--primary-color);
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.pause-content h2,
.results-content h2 {
    font-family: var(--font-primary);
    font-size: 3rem;
    color: var(--gold-color);
    margin-bottom: 30px;
    text-shadow: 2px 2px 0 var(--dark-color);
}

.pause-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
    padding: 18px;
    margin-bottom: 15px;
    background: rgba(255,255,255,0.1);
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    color: white;
    font-family: var(--font-primary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.pause-btn:hover {
    background: var(--primary-color);
    transform: scale(1.02);
}

.result-position {
    margin-bottom: 30px;
}

.big-position {
    font-family: var(--font-primary);
    font-size: 8rem;
    font-weight: 900;
    background: linear-gradient(180deg, var(--gold-color), #ff8c5a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

.result-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.result-stat {
    text-align: center;
    padding: 10px;
}

.result-stat .stat-label {
    display: block;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.5);
    margin-bottom: 5px;
}

.result-stat .stat-value {
    font-family: var(--font-primary);
    font-size: 1.5rem;
    color: var(--accent-color);
}

.rewards {
    background: rgba(255,255,255,0.05);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.rewards h3 {
    font-family: var(--font-primary);
    font-size: 1.2rem;
    color: var(--gold-color);
    margin-bottom: 15px;
}

.reward-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.reward-item i {
    color: var(--gold-color);
    font-size: 1.5rem;
}

.reward-item span {
    font-family: var(--font-primary);
    font-size: 1.5rem;
    color: var(--gold-color);
}

.reward-item.stars {
    gap: 15px;
}

.reward-item.stars i {
    color: rgba(255,255,255,0.2);
    font-size: 2.5rem;
    transition: all 0.3s ease;
}

.reward-item.stars i.earned {
    color: var(--gold-color);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    animation: starEarned 0.5s ease;
}

@keyframes starEarned {
    0% { transform: scale(0) rotate(-180deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.result-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.result-btn {
    flex: 1;
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: var(--primary-color);
    border: none;
    border-radius: 12px;
    color: white;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.result-btn:hover {
    background: var(--gold-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(255, 215, 0, 0.3);
}

/* ==========================================
   MOBILE CONTROLS
   ========================================== */

#mobileControls {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    pointer-events: none;
    z-index: 150;
}

.control-left,
.control-right {
    position: absolute;
    bottom: 50px;
}

.control-left {
    left: 20px;
}

.control-right {
    left: 100px;
}

.control-bottom {
    position: absolute;
    right: 20px;
    bottom: 30px;
    display: flex;
    gap: 15px;
}

.mobile-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: 3px solid rgba(255,255,255,0.5);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    pointer-events: auto;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-btn:active {
    background: var(--primary-color);
    transform: scale(0.95);
}

.gas-btn {
    background: rgba(74, 222, 128, 0.3);
    border-color: var(--success-color);
}

.brake-btn {
    background: rgba(239, 68, 68, 0.3);
    border-color: var(--danger-color);
}

.nitro-btn {
    background: rgba(46, 196, 182, 0.3);
    border-color: var(--accent-color);
}

/* ==========================================
   NOTIFICATION STYLES
   ========================================== */

.game-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary-color), #ff8c5a);
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    z-index: 10000;
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.4);
    animation: notificationSlide 0.5s ease;
}

@keyframes notificationSlide {
    from {
        transform: translateX(-50%) translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* ==========================================
   RESPONSIVE STYLES
   ========================================== */

@media (max-width: 1024px) {
    .garage-container {
        grid-template-columns: 1fr;
    }
    
    .vehicle-display {
        grid-column: 1;
        grid-row: auto;
    }
    
    .vehicle-selection,
    .color-selection {
        grid-column: 1;
        grid-row: auto;
    }
    
    .select-vehicle-btn {
        grid-column: 1;
    }
    
    .leaderboard-header,
    .leaderboard-entry {
        grid-template-columns: 50px 1fr 60px 80px 60px;
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .logo-beach {
        font-size: 2rem;
        letter-spacing: 5px;
    }
    
    .logo-buggy {
        font-size: 3rem;
        letter-spacing: 10px;
    }
    
    .logo-racing {
        font-size: 1.2rem;
        letter-spacing: 15px;
    }
    
    .menu-btn {
        padding: 15px 30px;
        font-size: 1rem;
    }
    
    .screen-header {
        padding: 15px 20px;
    }
    
    .screen-header h2 {
        font-size: 1.5rem;
    }
    
    .vehicle-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .color-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .hud-top {
        padding: 0 15px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .position-num {
        font-size: 2rem;
    }
    
    .speedometer {
        width: 120px;
        height: 120px;
    }
    
    .speed-num {
        font-size: 1.8rem;
    }
    
    .nitro-bar {
        width: 120px;
    }
    
    .minimap {
        width: 100px;
        height: 100px;
    }
    
    .countdown-num {
        font-size: 8rem;
    }
    
    .big-position {
        font-size: 5rem;
    }
    
    .pause-content,
    .results-content {
        padding: 30px;
    }
    
    .pause-content h2,
    .results-content h2 {
        font-size: 2rem;
    }
    
    .world-tabs {
        justify-content: center;
    }
    
    .world-tab {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .levels-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    #mobileControls {
        display: block !important;
    }
    
    .leaderboard-header,
    .leaderboard-entry {
        grid-template-columns: 40px 1fr 50px 70px 50px;
        padding: 10px 15px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .loader-text h2 {
        font-size: 1.8rem;
    }
    
    .loading-bar {
        width: 250px;
    }
    
    .menu-content {
        padding: 10px;
    }
    
    .logo-beach {
        font-size: 1.5rem;
        letter-spacing: 3px;
    }
    
    .logo-buggy {
        font-size: 2.2rem;
        letter-spacing: 5px;
    }
    
    .logo-racing {
        font-size: 1rem;
        letter-spacing: 8px;
    }
    
    .menu-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
        gap: 10px;
    }
    
    .menu-btn i {
        font-size: 1.2rem;
    }
    
    .settings-container {
        padding: 15px;
    }
    
    .control-keys {
        grid-template-columns: 1fr;
    }
    
    .result-buttons {
        flex-direction: column;
    }
    
    .countdown-num {
        font-size: 6rem;
    }
    
    .hud-bottom {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .speedometer {
        width: 100px;
        height: 100px;
    }
    
    .speed-num {
        font-size: 1.5rem;
    }
    
    .leaderboard-header,
    .leaderboard-entry {
        grid-template-columns: 35px 1fr 45px;
        gap: 5px;
    }
    
    .leaderboard-entry .level,
    .leaderboard-entry .time,
    .leaderboard-header span:nth-child(4),
    .leaderboard-header span:nth-child(5) {
        display: none;
    }
}

/* ==========================================
   ANIMATIONS
   ========================================== */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.slide-up {
    animation: slideUp 0.5s ease forwards;
}

.slide-down {
    animation: slideDown 0.5s ease forwards;
}

.scale-in {
    animation: scaleIn 0.3s ease forwards;
}

/* Particle Effects */
.particle {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    animation: particleFade 1s ease-out forwards;
}

@keyframes particleFade {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px) scale(0);
    }
}

/* SVG Gradient for Speedometer */
svg defs {
    display: block;
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }
}