:root {
    --primary-color: #ef4444;
    /* Red */
    --secondary-color: #f87171;
    --accent-color: #facc15;
    --background-color: #fef2f2;
    --text-color: #7f1d1d;
}

* {
    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: 60px;
    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: bold;
}

.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;
    color: white;
}

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

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

.btn-primary-small {
    background-color: #22c55e;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: bold;
}

#game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background-color: #fff1f2;
    gap: 20px;
}

.track {
    width: 100%;
    height: 150px;
    background: #334155;
    border-radius: 10px;
    position: relative;
    border-right: 10px solid #facc15;
    /* Finish line */
    overflow: hidden;
}

.track::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    border-top: 4px dashed white;
    transform: translateY(-50%);
}

.car {
    font-size: 3rem;
    position: absolute;
    left: 10px;
    transition: left 0.2s;
}

.car.player {
    top: 10px;
}

.car.rival {
    bottom: 10px;
}

.word-display {
    font-size: 3rem;
    font-weight: bold;
    color: #1e293b;
    margin-top: 30px;
}

.input-field {
    font-size: 2rem;
    padding: 10px;
    width: 300px;
    text-align: center;
    border: 3px solid #cbd5e1;
    border-radius: 10px;
    outline: none;
}

.input-field:focus {
    border-color: var(--primary-color);
}

.input-field.error {
    border-color: #ef4444;
    background: #fecaca;
}

/* Modal */
.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: 320px;
}

.hidden {
    display: none !important;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 1.1rem;
    cursor: pointer;
    margin-top: 15px;
}

.btn-secondary {
    background-color: transparent;
    color: #64748b;
    border: 2px solid #cbd5e1;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    margin-top: 10px;
}