/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette - Cozy & Warm */
    --primary-blue: #5D8AA8;
    --primary-blue-dark: #4A6D85;
    --accent-orange: #FF9F1C;
    --accent-yellow: #FFBF69;
    --bg-light: #FFF8F0;
    --bg-white: #FFFFFF;
    --text-dark: #2D3047;
    --text-light: #8D99AE;
    --success: #6FB98F;
    --error: #E56B6F;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 25px rgba(0, 0, 0, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --border-radius: 24px;
    --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

html,
body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

body {
    font-family: 'Inter', sans-serif;
    background: #FFF8F0;
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(255, 159, 28, 0.05) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(93, 138, 168, 0.05) 0%, transparent 20%);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(74, 144, 226, 0.2);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(74, 144, 226, 0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    text-shadow: none;
    transition: var(--transition);
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.car-icon {
    font-size: 1.5rem;
    color: white;
    /* Ensure emoji is white */
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: var(--transition);
    flex-shrink: 0;
}

.logo:hover .car-icon {
    transform: translateX(3px) scale(1.1);
    filter: drop-shadow(0 4px 8px rgba(74, 144, 226, 0.5));
}

.logo:hover {
    transform: scale(1.02);
    text-shadow: 0 4px 8px rgba(74, 144, 226, 0.4);
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-orange);
    transition: width 0.3s ease;
}

.logo:hover::after {
    width: 100%;
}

.nav {
    display: flex;
    gap: 1rem;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(74, 144, 226, 0.3);
    color: var(--primary-blue);
    padding: 0.5rem 1.5rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-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;
}

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

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   MAIN CONTAINER
   ============================================ */
.main-container {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.screen {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
    animation: fadeIn 0.5s ease-in;
    position: relative;
    z-index: 1;
}

.screen.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   START SCREEN
   ============================================ */
.start-content {
    text-align: center;
    background: linear-gradient(135deg, var(--bg-white) 0%, #F8F9FA 100%);
    padding: 4rem 2rem;
    border-radius: var(--border-radius);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(74, 144, 226, 0.1);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(74, 144, 226, 0.15);
}

.start-content::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(74, 144, 226, 0.05) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
    pointer-events: none;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.main-title-container {
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.main-title {
    font-size: 4.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 50%, var(--accent-orange) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(74, 144, 226, 0.3);
    animation: titleGlow 3s ease-in-out infinite;
    letter-spacing: -1px;
    position: relative;
}

@keyframes titleGlow {

    0%,
    100% {
        filter: drop-shadow(0 0 10px rgba(74, 144, 226, 0.3));
    }

    50% {
        filter: drop-shadow(0 0 20px rgba(74, 144, 226, 0.5));
    }
}

.title-underline {
    width: 150px;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--primary-blue), transparent);
    margin: 0 auto;
    border-radius: 2px;
    animation: underlineExpand 2s ease-in-out infinite;
}

@keyframes underlineExpand {

    0%,
    100% {
        width: 150px;
        opacity: 0.7;
    }

    50% {
        width: 200px;
        opacity: 1;
    }
}

.welcome-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.subtitle {
    font-size: 1.4rem;
    color: var(--text-light);
    margin-bottom: 3rem;
    line-height: 1.8;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.game-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-bottom: 3.5rem;
    position: relative;
    z-index: 1;
}

.info-card {
    background: linear-gradient(135deg, var(--bg-white) 0%, var(--bg-light) 100%);
    padding: 2.5rem 2rem;
    border-radius: var(--border-radius);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(74, 144, 226, 0.1);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-orange));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.info-card:hover::before {
    transform: scaleX(1);
}

.info-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-blue);
}

.info-icon {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 1rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    animation: iconFloat 3s ease-in-out infinite;
}

.info-card:nth-child(2) .info-icon {
    animation-delay: 0.5s;
}

.info-card:nth-child(3) .info-icon {
    animation-delay: 1s;
}

@keyframes iconFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.info-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.info-text {
    font-size: 1.1rem;
    color: var(--text-light);
    font-weight: 500;
    margin: 0;
}

.game-mode-buttons {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 3rem 0;
    align-items: center;
    position: relative;
    z-index: 1;
}

.game-mode-buttons .btn {
    width: 100%;
    max-width: 350px;
    font-size: 1.2rem;
    padding: 1.3rem 2.5rem;
    position: relative;
    overflow: hidden;
}

.btn-large {
    font-size: 1.3rem !important;
    padding: 1.5rem 3rem !important;
    font-weight: 600;
    box-shadow: var(--shadow-md);
}

.btn-icon {
    font-size: 1.5rem;
    margin-right: 0.75rem;
    display: inline-block;
    animation: iconBounce 2s ease-in-out infinite;
}

@keyframes iconBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.btn-primary.btn-large {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

.btn-primary.btn-large:hover {
    box-shadow: 0 8px 30px rgba(74, 144, 226, 0.6);
    transform: translateY(-4px);
}

.btn-secondary.btn-large {
    font-size: 1.2rem;
    padding: 1.3rem 2.5rem;
    border-width: 3px;
    font-weight: 600;
}

.btn-secondary.btn-large:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

@media (min-width: 768px) {
    .game-mode-buttons {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }

    .game-mode-buttons .btn {
        width: auto;
        min-width: 220px;
        flex: 0 1 auto;
    }
}

.cta-text {
    margin-top: 2.5rem;
    font-size: 1.3rem;
    color: var(--text-dark);
    font-weight: 600;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: ctaPulse 2s ease-in-out infinite;
}

/* New Mode Cards */
.logo-animation {
    font-size: 4rem;
    animation: floatCar 3s ease-in-out infinite;
    margin-bottom: 1rem;
    filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.1));
}

@keyframes floatCar {

    0%,
    100% {
        transform: translateY(0) rotate(-2deg);
    }

    50% {
        transform: translateY(-15px) rotate(2deg);
    }
}

.section-title {
    font-size: 1.5rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.game-modes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    position: relative;
    z-index: 2;
}

.mode-card {
    background: var(--bg-white);
    border: none;
    padding: 2.5rem 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.mode-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.mode-icon {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    transition: transform 0.4s ease;
}

.mode-card:hover .mode-icon {
    transform: scale(1.2) rotate(5deg);
}

.mode-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.mode-desc {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.5;
}

.mode-tag {
    margin-top: auto;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.mode-tag.easy {
    background: #E8F5E9;
    color: #2E7D32;
}

.mode-tag.medium {
    background: #E3F2FD;
    color: #1565C0;
}

.mode-tag.hard {
    background: #FFEBEE;
    color: #C62828;
}

/* Difficulty Selector */
.difficulty-selector {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--border-radius);
    margin-top: 2rem;
    box-shadow: var(--shadow-md);
    animation: fadeIn 0.3s ease;
}

.difficulty-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.diff-btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-light);
    color: var(--text-dark);
}

.diff-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.diff-btn.easy:hover {
    background: #E8F5E9;
    color: #2E7D32;
}

.diff-btn.normal:hover {
    background: #E3F2FD;
    color: #1565C0;
}

.diff-btn.hard:hover {
    background: #FFEBEE;
    color: #C62828;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    padding: 1rem 2.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: var(--bg-white);
    position: relative;
    overflow: hidden;
}

.btn-primary::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;
}

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

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.4);
}

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

.btn-secondary {
    background: var(--bg-white);
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-secondary:hover {
    background: var(--primary-blue);
    color: var(--bg-white);
    transform: translateY(-2px);
}

.hint-button {
    position: relative;
}

.hint-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hint-button.highlight-hint {
    animation: highlightPulse 2s ease-in-out;
    box-shadow: 0 0 20px rgba(74, 144, 226, 0.6);
    transform: scale(1.1);
}

@keyframes highlightPulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(74, 144, 226, 0.6);
        transform: scale(1.1);
    }

    50% {
        box-shadow: 0 0 30px rgba(74, 144, 226, 0.8);
        transform: scale(1.15);
    }
}

.next-button {
    background: linear-gradient(135deg, var(--success) 0%, #229954 100%);
    color: white;
    border: none;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 1.2rem 2.5rem;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
}

.next-button-pulse {
    animation: nextButtonPulse 1.5s ease-in-out infinite;
}

@keyframes nextButtonPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 25px rgba(39, 174, 96, 0.6);
    }
}

.end-game-btn {
    background: var(--error);
    color: white;
    border-color: var(--error);
    opacity: 0.8;
}

.end-game-btn:hover {
    opacity: 1;
    background: #C0392B;
}

.btn.hidden {
    display: none;
}

/* ============================================
   GAME SCREEN
   ============================================ */
.game-header {
    background: linear-gradient(135deg, var(--bg-white) 0%, var(--bg-light) 100%);
    padding: 1.2rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 70px;
    z-index: 50;
    border: 1px solid rgba(74, 144, 226, 0.1);
    backdrop-filter: blur(10px);
}

.score-display {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.score-item {
    text-align: center;
}

.score-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.score-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.score-value.streak {
    color: var(--accent-orange);
}

.timer-container {
    position: relative;
    height: 40px;
    background: var(--bg-light);
    border-radius: 20px;
    overflow: hidden;
}

.timer-bar {
    width: 100%;
    height: 100%;
    position: relative;
}

.timer-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-orange) 0%, var(--accent-yellow) 100%);
    width: 100%;
    transition: width 0.1s linear;
    border-radius: 20px;
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.4);
    position: relative;
    overflow: hidden;
}

.timer-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: timerShine 2s infinite;
}

@keyframes timerShine {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
    z-index: 1;
}

.game-content {
    background: linear-gradient(135deg, var(--bg-white) 0%, #F8F9FA 100%);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(74, 144, 226, 0.1);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    border: 1px solid rgba(74, 144, 226, 0.15);
    position: relative;
}

.car-image-container {
    position: relative;
    min-height: 250px;
    max-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-light) 0%, #E8ECF1 100%);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 2px solid rgba(74, 144, 226, 0.2);
    box-shadow:
        inset 0 0 40px rgba(74, 144, 226, 0.05),
        0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.car-image-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(74, 144, 226, 0.1) 0%, transparent 70%);
    animation: rotate 15s linear infinite;
    pointer-events: none;
}

.car-image {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
    animation: slideIn 0.5s ease-out;
    transition: all 0.3s ease-in;
    position: relative;
    z-index: 2;
}

.car-image:hover {
    filter: drop-shadow(0 6px 20px rgba(74, 144, 226, 0.3));
    transform: scale(1.02);
}

.car-image.hidden {
    opacity: 0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   MODAL STYLES (New)
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg-white);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 450px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
    position: relative;
    border: 1px solid rgba(74, 144, 226, 0.2);
}

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

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-title {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 2rem;
    font-weight: 700;
}

.difficulty-buttons-vertical {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.difficulty-btn {
    display: flex;
    align-items: center;
    padding: 1.2rem 1.5rem;
    border: 2px solid transparent;
    border-radius: 16px;
    background: var(--bg-light);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.difficulty-btn:hover {
    transform: translateX(5px);
    background: white;
    box-shadow: var(--shadow-md);
    border-color: var(--primary-blue);
}

.diff-icon {
    font-size: 1.8rem;
    margin-right: 1rem;
}

.diff-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
    flex-grow: 1;
}

.diff-sub {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

.close-modal-btn {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
}

/* Dark Mode Support for Modal */
body.dark-mode .modal-content {
    background: #1E293B;
    border-color: #334155;
    color: #F1F5F9;
}

body.dark-mode .modal-title {
    color: #F1F5F9;
}

body.dark-mode .difficulty-btn {
    background: #334155;
}

body.dark-mode .difficulty-btn:hover {
    background: #475569;
    border-color: #60A5FA;
}

body.dark-mode .diff-text {
    color: #F1F5F9;
}

body.dark-mode .diff-sub {
    color: #94A3B8;
}

/* ============================================
   DARK MODE GLOBAL FIXES
   ============================================ */
body.dark-mode {
    background: #0F172A;
    /* Darker Slate */
    color: #F8FAFC !important;
}

body.dark-mode .header {
    background: rgba(15, 23, 42, 0.8);
    border-bottom: 1px solid rgba(96, 165, 250, 0.1);
}

body.dark-mode .logo {
    color: #60A5FA;
    /* Lighter Blue */
}

body.dark-mode .nav-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #F1F5F9;
}

body.dark-mode .nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #60A5FA;
}

body.dark-mode .start-content {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border-color: rgba(96, 165, 250, 0.1);
}

body.dark-mode .start-content::before {
    opacity: 0.1;
}

body.dark-mode .main-title {
    text-shadow: 0 4px 20px rgba(96, 165, 250, 0.5);
}

body.dark-mode .subtitle,
body.dark-mode .section-title,
body.dark-mode .title,
body.dark-mode .stat-box h3,
body.dark-mode .leaderboard-name,
body.dark-mode .leaderboard-rank,
body.dark-mode .leaderboard-score,
body.dark-mode .user-name,
body.dark-mode .stats-list li,
body.dark-mode .stats-list li span {
    color: #F8FAFC !important;
}

body.dark-mode .mode-card {
    background: #1E293B;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

body.dark-mode .mode-title {
    color: #F1F5F9;
}

body.dark-mode .mode-desc {
    color: #94A3B8;
}

body.dark-mode .mode-card:hover {
    background: #334155;
    border-color: #60A5FA;
}

body.dark-mode .game-header,
body.dark-mode .score-item,
body.dark-mode .stat-overview-card,
body.dark-mode .stat-box {
    background: #1E293B;
    color: #F1F5F9;
    border-color: #334155;
}

body.dark-mode .score-label,
body.dark-mode .stat-overview-label {
    color: #94A3B8;
}

body.dark-mode .score-value,
body.dark-mode .stat-overview-value {
    color: #F8FAFC !important;
}

body.dark-mode .leaderboard-item {
    background: #1E293B;
    color: #F8FAFC !important;
    border-bottom-color: #334155;
}

body.dark-mode .footer {
    color: #94A3B8;
}

body.dark-mode .footer a {
    color: #60A5FA;
}

body.dark-mode .btn-secondary {
    background: transparent;
    color: #60A5FA;
    border-color: #60A5FA;
}

body.dark-mode .btn-secondary:hover {
    background: #60A5FA;
    color: #0F172A;
}

/* Ensure modal is hidden properly */
/* End Game Confirmation Modal */
.confirm-modal {
    max-width: 380px;
}

.confirm-icon {
    font-size: 3.5rem;
    margin-bottom: 0.75rem;
    animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.confirm-modal .modal-desc {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.confirm-yes {
    background: linear-gradient(135deg, var(--error) 0%, #c0392b 100%) !important;
    border: none !important;
    color: white !important;
    font-weight: 700;
    padding: 0.85rem 1.5rem !important;
    border-radius: 16px !important;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(229, 107, 111, 0.4);
    transition: all 0.3s ease;
}

.confirm-yes:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 107, 111, 0.5);
}

.confirm-no {
    background: transparent !important;
    border: 2px solid var(--primary-blue) !important;
    color: var(--primary-blue) !important;
    font-weight: 600;
    padding: 0.85rem 1.5rem !important;
    border-radius: 16px !important;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.confirm-no:hover {
    background: var(--primary-blue) !important;
    color: white !important;
    transform: translateY(-2px);
}

/* Dark mode for confirm modal */
body.dark-mode .confirm-modal {
    background: #1e1e2e;
    border-color: rgba(74, 144, 226, 0.3);
}

body.dark-mode .confirm-modal .modal-title {
    color: #F8FAFC;
}

body.dark-mode .confirm-modal .modal-desc {
    color: #b0b0b0;
}

.modal-overlay.hidden {
    display: none;
}

.hint-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, var(--accent-yellow) 0%, #FFD93D 100%);
    color: var(--text-dark);
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(255, 200, 87, 0.4);
    z-index: 10;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.hint-badge:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(255, 200, 87, 0.6);
    background: linear-gradient(135deg, #FFD93D 0%, var(--accent-yellow) 100%);
}

.hint-badge:active {
    transform: scale(1.05);
}

.hint-badge.hidden {
    display: none;
}

.options-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.9rem;
}

.option-btn {
    background: linear-gradient(135deg, var(--bg-white) 0%, #F8F9FA 100%);
    border: 2px solid var(--primary-blue);
    color: #3b82f6;
    padding: 1rem 1.2rem;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.15);
    position: relative;
    overflow: hidden;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.option-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(74, 144, 226, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.option-btn:hover:not(:disabled)::after {
    width: 300px;
    height: 300px;
}

.option-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(74, 144, 226, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.option-btn:active::before {
    width: 300px;
    height: 300px;
}

.option-btn:hover:not(:disabled) {
    background: var(--primary-blue);
    color: var(--bg-white);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.option-btn.correct {
    background: var(--success);
    border-color: var(--success);
    color: var(--bg-white);
    animation: pop 0.3s ease-out;
}

.option-btn.incorrect {
    background: var(--error);
    border-color: var(--error);
    color: var(--bg-white);
    animation: shake 0.3s ease-out;
}

.option-btn.eliminated {
    opacity: 0.3;
    pointer-events: none;
}

@keyframes pop {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

.game-actions {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    flex-wrap: wrap;
    padding-top: 0.5rem;
    position: sticky;
    bottom: 0;
    background: var(--bg-white);
    z-index: 10;
    margin-top: auto;
}

.feedback-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-in;
}

.feedback-overlay.hidden {
    display: none;
}

.feedback-content {
    background: var(--bg-white);
    padding: 3rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.feedback-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
}

.feedback-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* ============================================
   GAME OVER SCREEN
   ============================================ */
.game-over-content {
    background: var(--bg-white);
    padding: 3rem 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.final-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: var(--border-radius);
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.name-input-container {
    margin: 2rem 0;
}

.name-input {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
    border: 2px solid var(--primary-blue);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    margin-bottom: 1rem;
    text-align: center;
}

.game-over-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.share-buttons {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--bg-light);
}

.share-text {
    margin-bottom: 1rem;
    color: var(--text-light);
    font-weight: 500;
}

.share-icons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.share-btn {
    background: var(--bg-light);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.share-btn:hover {
    background: var(--primary-blue);
    color: var(--bg-white);
    transform: translateY(-2px);
}

/* Share Toast Notification */
.share-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: white;
    padding: 1rem 1.75rem;
    border-radius: 16px;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    z-index: 9999;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    text-align: center;
    max-width: 90%;
    white-space: nowrap;
}

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

body.dark-mode .share-toast {
    background: linear-gradient(135deg, #4A90E2 0%, #357abd 100%);
}

/* ============================================
   LEADERBOARD
   ============================================ */
.leaderboard-content {
    background: var(--bg-white);
    padding: 3rem 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.leaderboard-tabs {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.tab-btn {
    background: var(--bg-light);
    border: 2px solid transparent;
    padding: 0.75rem 2rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.tab-btn.active {
    background: var(--primary-blue);
    color: var(--bg-white);
    border-color: var(--primary-blue);
}

.tab-btn:hover:not(.active) {
    background: var(--bg-white);
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.leaderboard-list {
    min-height: 300px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    margin-bottom: 0.5rem;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.leaderboard-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-sm);
}

.leaderboard-rank {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    min-width: 50px;
}

.leaderboard-name {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-left: 1rem;
}

.leaderboard-score {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-orange);
}

/* ============================================
   STATISTICS
   ============================================ */
.stats-content {
    background: var(--bg-white);
    padding: 3rem 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-overview-card {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    color: white;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.stat-overview-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-overview-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-overview-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.stat-box {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: var(--border-radius);
}

.stat-box h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.stats-list {
    list-style: none;
}

.stats-list li {
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.stats-list li:hover {
    background: var(--bg-light);
    transform: translateX(5px);
}

.stats-list li:last-child {
    border-bottom: none;
}

.user-rank {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rank-number {
    font-weight: 700;
    color: var(--primary-blue);
    font-size: 1.1rem;
}

.user-name {
    font-weight: 600;
    color: var(--text-dark);
}

.user-stats {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.stat-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.stat-badge.score {
    background: var(--primary-blue);
    color: white;
}

.stat-badge.correct {
    background: var(--success);
    color: white;
}

.stat-badge.streak {
    background: var(--accent-orange);
    color: white;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    text-align: center;
    margin-top: 1rem;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    color: var(--bg-white);
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
}

.footer-logo {
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
}

.footer-logo:hover {
    color: var(--accent-orange);
    transform: scale(1.1);
    text-shadow: 0 0 10px rgba(255, 107, 53, 0.5);
}

.footer-links {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--bg-white);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-orange);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.footer-links a:hover {
    color: var(--accent-orange);
    background: rgba(255, 107, 53, 0.1);
}

.footer-links a:hover::after {
    width: 80%;
}

/* ============================================
   AD CONTAINER
   ============================================ */
.ad-container {
    min-height: 100px;
    background: var(--bg-light);
    margin: 2rem 0;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

/* ============================================
   LOADING STATES & ANIMATIONS
   ============================================ */
.image-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: var(--text-light);
}

.image-loading.hidden {
    display: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--bg-light);
    border-top: 4px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-light);
}

.loading-state.hidden {
    display: none;
}

/* Pulse animation for hint badge */
.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* Score update animation */
.score-update {
    animation: scorePop 0.3s ease-out;
}

@keyframes scorePop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
        color: var(--accent-orange);
    }

    100% {
        transform: scale(1);
    }
}

/* Confetti animation */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    top: -10px;
    z-index: 10000;
    animation: confettiFall 2s linear forwards;
    pointer-events: none;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Smooth screen transitions */
.screen {
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

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

/* ============================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ============================================ */

/* Small phones (360px and up) */
@media (min-width: 360px) {
    .main-title {
        font-size: 3rem;
    }

    .welcome-title {
        font-size: 1.6rem;
    }

    .subtitle {
        font-size: 1.1rem;
    }

    .info-title {
        font-size: 1.4rem;
    }

    .info-text {
        font-size: 0.95rem;
    }

    .game-info {
        grid-template-columns: 1fr;
    }

    .options-container {
        grid-template-columns: 1fr;
    }

    .btn {
        width: 100%;
        max-width: 300px;
    }

    .game-content {
        padding: 1rem;
    }

    .car-image-container {
        min-height: 200px;
        max-height: 250px;
        padding: 1rem;
    }

    .game-header {
        padding: 1rem;
        top: 60px;
    }

    .score-display {
        gap: 0.5rem;
    }

    .game-actions {
        flex-direction: column;
    }

    .game-actions .btn {
        width: 100%;
    }
}

/* Tablets (768px and up) */
@media (min-width: 768px) {
    .main-title {
        font-size: 4rem;
    }

    .welcome-title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1.3rem;
    }

    .start-content {
        padding: 5rem 3rem;
    }

    .game-info {
        grid-template-columns: repeat(3, 1fr);
    }

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

    .btn {
        width: auto;
    }

    .car-image-container {
        min-height: 400px;
    }
}

/* Desktop (1024px and up) */
@media (min-width: 1024px) {
    .options-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .screen {
        padding: 3rem;
    }
}

/* Large Desktop (1440px and up) */
@media (min-width: 1440px) {
    .main-container {
        padding: 3rem 0;
    }

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

/* Touch-friendly adjustments */
@media (hover: none) and (pointer: coarse) {

    .btn,
    .option-btn,
    .nav-btn {
        min-height: 44px;
        min-width: 44px;
        -webkit-tap-highlight-color: rgba(74, 144, 226, 0.3);
    }

    .option-btn {
        padding: 1.5rem 1.5rem;
    }

    .option-btn:active {
        transform: scale(0.95);
        background: var(--primary-blue);
        color: var(--bg-white);
    }

    .btn:active {
        transform: scale(0.98);
    }
}

/* Focus states for accessibility */
.btn:focus,
.option-btn:focus,
.nav-btn:focus {
    outline: 3px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Skip to main content for screen readers */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-blue);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
}

.skip-link:focus {
    top: 0;
}

/* Landscape orientation for mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .car-silhouette-container {
        min-height: 200px;
    }

    .game-header {
        padding: 1rem;
    }

    .screen {
        padding: 1rem;
    }
}

/* ============================================
   DARK MODE - Premium Car Theme
   ============================================ */
body.dark-mode {
    background: linear-gradient(135deg, #0f1419 0%, #1a2332 50%, #0f1419 100%);
    color: #F8FAFC !important;
    position: relative;
}

body.dark-mode::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(74, 144, 226, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(255, 107, 53, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

body.dark-mode .start-content,
body.dark-mode .game-content,
body.dark-mode .game-header,
body.dark-mode .game-over-content,
body.dark-mode .leaderboard-content,
body.dark-mode .stats-content {
    background: linear-gradient(135deg, #1a2332 0%, #243447 100%);
    color: #F8FAFC !important;
    border: 1px solid rgba(74, 144, 226, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(74, 144, 226, 0.1);
    position: relative;
    z-index: 1;
}

body.dark-mode .info-card,
body.dark-mode .stat-card,
body.dark-mode .stat-box {
    background: linear-gradient(135deg, #1e2a3a 0%, #243447 100%);
    color: #F8FAFC !important;
    border: 1px solid rgba(74, 144, 226, 0.15);
}

body.dark-mode .leaderboard-item {
    background: linear-gradient(135deg, #1e2a3a 0%, #243447 100%);
    color: #F8FAFC !important;
    border: 1px solid rgba(74, 144, 226, 0.1);
}

body.dark-mode .leaderboard-item:hover {
    background: linear-gradient(135deg, #243447 0%, #2a3d52 100%);
    border-color: rgba(74, 144, 226, 0.3);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.2);
}

body.dark-mode .text-dark {
    color: #F8FAFC !important;
}

body.dark-mode .text-light {
    color: #CBD5E1 !important;
}

body.dark-mode .car-silhouette-container {
    background: linear-gradient(135deg, #1a2332 0%, #243447 100%);
    border: 2px solid rgba(74, 144, 226, 0.3);
    box-shadow: inset 0 0 30px rgba(74, 144, 226, 0.1), 0 4px 20px rgba(0, 0, 0, 0.3);
}

body.dark-mode .car-image {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

body.dark-mode .car-image:hover {
    filter: drop-shadow(0 6px 20px rgba(74, 144, 226, 0.5));
}

/* Base dark mode style for option buttons */
body.dark-mode .option-btn {
    background: rgba(66, 82, 110, 0.95);
    border: 2px solid rgba(74, 144, 226, 0.3);
    color: #3b82f6;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Specific theme override for dark mode */
body.dark-mode #gameScreen[data-theme] .option-btn {
    background: rgba(66, 82, 110, 0.95) !important;
    border: 2px solid rgba(74, 144, 226, 0.4) !important;
    color: #3b82f6 !important;
    font-weight: 800 !important;
}



body.dark-mode .option-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    border-color: var(--primary-blue);
    color: white;
    box-shadow: 0 4px 16px rgba(74, 144, 226, 0.4);
    transform: translateY(-2px);
}

body.dark-mode .option-btn.correct {
    background: linear-gradient(135deg, #27AE60 0%, #229954 100%);
    border-color: #27AE60;
    box-shadow: 0 4px 16px rgba(39, 174, 96, 0.4);
}

body.dark-mode .option-btn.incorrect {
    background: linear-gradient(135deg, #E74C3C 0%, #C0392B 100%);
    border-color: #E74C3C;
    box-shadow: 0 4px 16px rgba(231, 76, 60, 0.4);
}

body.dark-mode .btn-secondary {
    background: linear-gradient(135deg, #1e2a3a 0%, #243447 100%);
    color: var(--primary-blue);
    border: 2px solid rgba(74, 144, 226, 0.4);
}

body.dark-mode .btn-secondary:hover {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: white;
    border-color: var(--primary-blue);
    box-shadow: 0 4px 16px rgba(74, 144, 226, 0.4);
}

body.dark-mode .hint-button {
    background: linear-gradient(135deg, #1e2a3a 0%, #243447 100%);
    color: var(--primary-blue);
    border: 2px solid rgba(74, 144, 226, 0.4);
}

body.dark-mode .hint-button:hover {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: white;
}

body.dark-mode .next-button {
    background: linear-gradient(135deg, #1D8348 0%, #145A32 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(29, 131, 72, 0.5);
    border: none;
}

body.dark-mode .end-game-btn {
    background: linear-gradient(135deg, #943126 0%, #78281F 100%);
    color: white;
    border: 1px solid #943126;
}


body.dark-mode .watch-ad-button {
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.5);
}

body.dark-mode .btn-primary {
    box-shadow: 0 4px 16px rgba(74, 144, 226, 0.3);
}

body.dark-mode .header {
    background: rgba(26, 35, 50, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(74, 144, 226, 0.2);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

body.dark-mode .footer {
    background: rgba(15, 20, 25, 0.8);
    border-top: 1px solid rgba(74, 144, 226, 0.1);
}

body.dark-mode .nav-btn {
    background: rgba(30, 42, 58, 0.6);
    border-color: rgba(74, 144, 226, 0.3);
}

body.dark-mode .nav-btn:hover {
    background: rgba(74, 144, 226, 0.2);
    border-color: rgba(74, 144, 226, 0.5);
}

body.dark-mode .main-title {
    background: linear-gradient(135deg, #4A90E2 0%, #5BA3F5 50%, #FF6B35 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(74, 144, 226, 0.5));
}

body.dark-mode .timer-fill {
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.5);
}

body.dark-mode .hint-badge {
    background: linear-gradient(135deg, #FFC857 0%, #FFD93D 100%);
    box-shadow: 0 4px 15px rgba(255, 200, 87, 0.5);
    border-color: rgba(255, 200, 87, 0.6);
}

body.dark-mode .timer-container {
    background: rgba(30, 42, 58, 0.9);
    border: 1px solid rgba(74, 144, 226, 0.3);
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .timer-bar {
    background: rgba(20, 30, 45, 0.8);
}

body.dark-mode .timer-fill {
    box-shadow: 0 0 15px rgba(255, 107, 53, 0.6);
}

body.dark-mode .hint-button {
    background: linear-gradient(135deg, #1e2a3a 0%, #243447 100%);
    color: #e8e8e8;
    border-color: rgba(74, 144, 226, 0.4);
}

body.dark-mode .hint-button:hover {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: white;
    border-color: var(--primary-blue);
    box-shadow: 0 4px 16px rgba(74, 144, 226, 0.4);
}

body.dark-mode .timer-text {
    color: #e8e8e8;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 0 0 10px rgba(255, 107, 53, 0.5);
}

body.dark-mode .summary-container h3 {
    color: #F8FAFC !important;
}

body.dark-mode .game-actions {
    background: rgba(56, 72, 93, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(74, 144, 226, 0.2);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
    padding: 1.5rem;
}




body.dark-mode .game-header {
    position: sticky !important;
    top: 70px !important;
    z-index: 50;
    background: linear-gradient(135deg, #1a2332 0%, #243447 100%) !important;
    border-radius: var(--border-radius);
    border: 1px solid rgba(74, 144, 226, 0.2);
}


/* Fix for the "white container" behind the score in dark mode */
body.dark-mode #gameScreen[data-theme] {
    background: rgba(56, 72, 93, 0.95) !important;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid rgba(74, 144, 226, 0.1);
}

body.dark-mode .car-image-container {
    background: rgba(66, 82, 110, 0.95) !important;
    border: 2px solid rgba(74, 144, 226, 0.3);
}

/* Ensure specific theme backgrounds don't override images area in dark mode */
body.dark-mode #gameScreen[data-theme] .car-image-container {
    background: rgba(66, 82, 110, 0.95) !important;
    border: 2px solid rgba(74, 144, 226, 0.4) !important;
}




/* ============================================
   COMPREHENSIVE MOBILE RESPONSIVE
   ============================================ */

/* Mobile: phones (up to 768px) */
@media (max-width: 768px) {
    .hint-badge {
        top: 0.5rem;
        right: 0.5rem;
        width: 38px;
        height: 38px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        font-size: 1.2rem;
        box-shadow: 0 4px 12px rgba(255, 200, 87, 0.5);
    }

    .hint-text-available {
        display: none;
    }
}

@media (max-width: 768px) {
    .header .container {
        padding: 0 12px;
    }

    .logo {
        font-size: 1.15rem;
        gap: 0.4rem;
    }

    .nav {
        gap: 0.4rem;
    }

    .nav-btn {
        padding: 0.35rem 0.7rem;
        font-size: 0.75rem;
    }

    .screen {
        padding: 0.75rem;
    }

    .main-title {
        font-size: 2rem !important;
    }

    .subtitle {
        font-size: 1rem !important;
    }

    .game-content {
        padding: 0.75rem;
        gap: 1rem;
        border-radius: 16px;
    }

    .car-image-container {
        min-height: 180px;
        max-height: 220px;
        padding: 0.75rem;
        border-radius: 16px;
    }

    .car-image {
        max-height: 200px;
    }

    .options-container {
        grid-template-columns: 1fr 1fr;
        gap: 0.6rem;
    }

    .option-btn {
        padding: 0.7rem 0.5rem;
        font-size: 0.85rem;
        border-radius: 14px;
    }

    .game-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .game-actions .btn {
        width: 100%;
    }

    .game-header {
        padding: 0.75rem;
    }

    .score-display {
        gap: 0.5rem;
    }

    .mode-card {
        padding: 1.2rem;
    }

    .game-modes-grid {
        gap: 1rem;
    }

    .main-container {
        padding: 1rem 0;
    }

    .footer {
        padding: 1.5rem 0;
        margin-top: 2rem;
    }

    .start-content {
        padding: 2rem 0.5rem;
    }

    .final-stats {
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }
}

/* Small phones (up to 480px) */
@media (max-width: 480px) {
    .logo {
        font-size: 1rem;
    }

    .car-icon {
        font-size: 1.2rem;
    }

    .nav-btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.7rem;
    }

    .options-container {
        grid-template-columns: 1fr !important;
        gap: 0.5rem;
    }

    .option-btn {
        padding: 0.65rem 0.75rem;
        font-size: 0.85rem;
    }

    .car-image-container {
        min-height: 160px;
        max-height: 200px;
        padding: 0.5rem;
    }

    .stat-overview-value {
        font-size: 1.5rem !important;
    }

    .game-content {
        padding: 0.5rem;
        gap: 0.75rem;
    }

    .score-value {
        font-size: 1.2rem;
    }

    .score-label {
        font-size: 0.65rem;
    }

    .main-title {
        font-size: 1.6rem !important;
    }

    .section-title {
        font-size: 1.1rem;
    }

    .hint-badge {
        padding: 0.4rem 0.8rem;
        font-size: 0.7rem;
        top: 0.5rem;
        right: 0.5rem;
        border-width: 1px;
    }

    .timer-text {
        font-size: 0.75rem;
    }
}

/* Prevent touch zoom and horizontal issues */
@media (hover: none) and (pointer: coarse) {
    * {
        -webkit-tap-highlight-color: transparent;
    }

    .option-btn {
        min-height: 44px;
    }

    .nav-btn {
        min-height: 36px;
    }
}


body.dark-mode .stat-overview-card {
    background: linear-gradient(135deg, #243447 0%, #2a3d52 100%);
    border: 1px solid rgba(74, 144, 226, 0.3);
}

body.dark-mode .stats-list li:hover {
    background: rgba(30, 42, 58, 0.5);
}

body.dark-mode .user-name {
    color: #e8e8e8;
}

/* Removed CAR REAL IMAGE styles as per user request */

/* ============================================
   PAYMENT MODAL
   ============================================ */
.payment-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in;
}

.payment-modal.hidden {
    display: none;
}

.payment-modal-content {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.payment-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--error);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    opacity: 0.7;
    transition: var(--transition);
}

.payment-modal-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

.payment-form {
    margin-top: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--primary-blue);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-blue-dark);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
}

.payment-note {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 1rem;
}

body.dark-mode .payment-modal-content {
    background: #2c2c3e;
    color: #e0e0e0;
}

body.dark-mode .form-group label {
    color: #e8e8e8;
}

body.dark-mode .form-group input {
    background: #1e2a3a;
    border-color: rgba(74, 144, 226, 0.4);
    color: #e8e8e8;
}

body.dark-mode .form-group input:focus {
    border-color: var(--primary-blue);
    background: #243447;
}

/* ============================================
   GAME THEMES - APPLY VISUAL CHANGES (WITH BACKGROUND)
   ============================================ */
#gameScreen[data-theme="default"] {
    background: linear-gradient(135deg, var(--bg-light) 0%, #E8ECF1 100%);
}

#gameScreen[data-theme="ocean"] {
    background: linear-gradient(135deg, #0EA5E9 0%, #0284C7 100%);
}

#gameScreen[data-theme="forest"] {
    background: linear-gradient(135deg, #22C55E 0%, #16A34A 100%);
}

#gameScreen[data-theme="sunset"] {
    background: linear-gradient(135deg, #F97316 0%, #C2410C 100%);
}

#gameScreen[data-theme="midnight"] {
    background: linear-gradient(135deg, #1F2937 0%, #374151 100%);
}

#gameScreen[data-theme="neon"] {
    background: linear-gradient(135deg, #EC4899 0%, #DB2777 100%);
}

/* Car container */
#gameScreen[data-theme="default"] .car-image-container {
    background: linear-gradient(135deg, var(--bg-light) 0%, #E8ECF1 100%);
}

#gameScreen[data-theme="ocean"] .car-image-container {
    background: linear-gradient(135deg, #0EA5E9 0%, #0284C7 100%);
}

#gameScreen[data-theme="forest"] .car-image-container {
    background: linear-gradient(135deg, #22C55E 0%, #16A34A 100%);
}

#gameScreen[data-theme="sunset"] .car-image-container {
    background: linear-gradient(135deg, #F97316 0%, #C2410C 100%);
}

#gameScreen[data-theme="midnight"] .car-image-container {
    background: linear-gradient(135deg, #1F2937 0%, #374151 100%);
}

#gameScreen[data-theme="neon"] .car-image-container {
    background: linear-gradient(135deg, #EC4899 0%, #DB2777 100%);
}

/* Buttons for options */
#gameScreen[data-theme="default"] .option-btn {
    background: linear-gradient(135deg, var(--bg-white) 0%, #F8F9FA 100%);
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
}

#gameScreen[data-theme="ocean"] .option-btn {
    background: linear-gradient(135deg, #0EA5E9 0%, #0284C7 100%);
    border: 2px solid #0B6DA7;
    color: white;
}

#gameScreen[data-theme="forest"] .option-btn {
    background: linear-gradient(135deg, #22C55E 0%, #16A34A 100%);
    border: 2px solid #15803D;
    color: white;
}

#gameScreen[data-theme="sunset"] .option-btn {
    background: linear-gradient(135deg, #F97316 0%, #C2410C 100%);
    border: 2px solid #9A3412;
    color: white;
}

#gameScreen[data-theme="midnight"] .option-btn {
    background: linear-gradient(135deg, #1F2937 0%, #374151 100%);
    border: 2px solid #111827;
    color: white;
}

#gameScreen[data-theme="neon"] .option-btn {
    background: linear-gradient(135deg, #EC4899 0%, #DB2777 100%);
    border: 2px solid #BE185D;
    color: white;
}

#gameScreen[data-theme="neon"] .option-btn {
    background: linear-gradient(135deg, #EC4899 0%, #DB2777 100%);
    border: 2px solid #BE185D;
    color: white;
}

/* ============================================
   SUMMARY GRID (WORDLE STYLE)
   ============================================ */
.summary-container {
    margin: 2rem 0;
    text-align: center;
}

.summary-container h3 {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.summary-grid {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    min-height: 40px;
}

.result-box {
    width: 35px;
    height: 35px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 1.1rem;
    box-shadow: var(--shadow-sm);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    opacity: 0;
}

.result-box.correct {
    background: var(--success);
}

.result-box.wrong {
    background: var(--error);
}

.result-box:nth-child(1) {
    animation-delay: 0.1s;
}

.result-box:nth-child(2) {
    animation-delay: 0.2s;
}

.result-box:nth-child(3) {
    animation-delay: 0.3s;
}

.result-box:nth-child(4) {
    animation-delay: 0.4s;
}

.result-box:nth-child(5) {
    animation-delay: 0.5s;
}

.result-box:nth-child(6) {
    animation-delay: 0.6s;
}

.result-box:nth-child(7) {
    animation-delay: 0.7s;
}

.result-box:nth-child(8) {
    animation-delay: 0.8s;
}

.result-box:nth-child(9) {
    animation-delay: 0.9s;
}

.result-box:nth-child(10) {
    animation-delay: 1.0s;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}