:root {
    --primary-color: #ef4444;
    /* Racing Red */
    --secondary-color: #f87171;
    --accent-color: #f59e0b;
    --background-color: #e0f2fe;
    --road-color: #334155;
    --grass-color: #4ade80;
    --text-color: #1e293b;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#game-container {
    width: 100%;
    max-width: 800px;
    height: 100vh;
    max-height: 600px;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

#game-header {
    height: 70px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    color: white;
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.game-title {
    font-size: 1.5rem;
    font-weight: 800;
    font-style: italic;
    text-transform: uppercase;
}

.stats {
    display: flex;
    gap: 20px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 12px;
    border-radius: 8px;
}

.stat-label {
    font-size: 0.7rem;
    opacity: 0.8;
}

.stat-value {
    font-weight: bold;
    font-family: monospace;
    font-size: 1.2rem;
}

#game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background-color: var(--grass-color);
    overflow: hidden;
}

/* Scenery */
.sky {
    height: 30%;
    background: linear-gradient(to bottom, #7dd3fc, #bae6fd);
    position: relative;
    overflow: hidden;
}

.clouds {
    position: absolute;
    font-size: 4rem;
    animation: floatClouds 20s linear infinite;
    top: 20px;
    opacity: 0.8;
}

@keyframes floatClouds {
    from {
        transform: translateX(110%);
    }

    to {
        transform: translateX(-20%);
    }
}

.road-container {
    height: 40%;
    background-color: var(--grass-color);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 600px;
}

.road {
    width: 60%;
    height: 100%;
    background-color: var(--road-color);
    position: relative;
    border-left: 10px solid #cbd5e1;
    border-right: 10px solid #cbd5e1;
    overflow: hidden;
}

.lane-marker {
    position: absolute;
    top: 0;
    left: 50%;
    width: 10px;
    height: 100%;
    background: repeating-linear-gradient(to bottom,
            transparent 0,
            transparent 20px,
            #facc15 20px,
            #facc15 60px);
    transform: translateX(-50%);
    animation: roadMove 1s linear infinite;
}

@keyframes roadMove {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 0 100px;
    }

    /* Actually dependent on lane marking size */
}

/* Cars */
.car {
    position: absolute;
    font-size: 4rem;
    bottom: 20px;
    transition: bottom 0.5s, left 0.5s;
    filter: drop-shadow(0 10px 5px rgba(0, 0, 0, 0.3));
    z-index: 5;
}

.car.player {
    left: 30%;
    /* Left lane */
}

.car.opponent {
    left: 60%;
    /* Right lane */
    filter: hue-rotate(220deg) drop-shadow(0 10px 5px rgba(0, 0, 0, 0.3));
}

/* Dashboard / Controls */
#dashboard {
    height: 30%;
    background-color: #1e293b;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.2);
    z-index: 20;
}

.question-display {
    background-color: #0f172a;
    color: #38bdf8;
    padding: 10px 30px;
    border-radius: 10px;
    border: 2px solid #334155;
    font-family: monospace;
    font-size: 2rem;
    font-weight: bold;
    min-width: 200px;
    text-align: center;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.options-container {
    display: flex;
    gap: 15px;
    width: 100%;
    justify-content: center;
}

.option-btn {
    flex: 1;
    max-width: 150px;
    padding: 15px;
    border: none;
    border-radius: 10px;
    background-color: #475569;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.1s;
    box-shadow: 0 4px 0 #334155;
}

.option-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #334155;
}

.option-btn.correct {
    background-color: #22c55e;
    box-shadow: 0 4px 0 #15803d;
}

.option-btn.wrong {
    background-color: #ef4444;
    box-shadow: 0 4px 0 #b91c1c;
}

/* Modal */
.hidden {
    display: none !important;
}

.modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    width: 300px;
}

.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 10px;
    border: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-secondary {
    background: #e2e8f0;
    color: #334155;
}