:root {
    --bg: #020617;
    --accent: #00f3ff;
    --accent-glow: rgba(0, 243, 255, 0.4);
    --gold: #facc15;
    --gold-glow: rgba(250, 204, 21, 0.4);
    --danger: #ff4757;
    --glass: rgba(15, 23, 42, 0.7);
    --card-border: rgba(0, 243, 255, 0.2);
}

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

body {
    background: var(--bg);
    color: white;
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(0, 243, 255, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(250, 204, 21, 0.05) 0%, transparent 40%);
}

.container {
    max-width: 1000px;
    width: 95%;
    padding: 40px 0;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 4px;
    background: linear-gradient(135deg, var(--accent), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
}

.status-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid var(--card-border);
    font-size: 0.8rem;
    color: var(--accent);
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Racing Track Area */
.game-area {
    background: var(--glass);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 40px;
    backdrop-filter: blur(20px);
    position: relative;
    margin-bottom: 30px;
}

.track {
    height: 300px;
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.finish-line {
    position: absolute;
    right: 50px;
    top: 0;
    bottom: 0;
    width: 10px;
    background: repeating-linear-gradient(0deg,
            white,
            white 20px,
            black 20px,
            black 40px);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.player-lane {
    height: 60px;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    display: flex;
    align-items: center;
}

.racer {
    position: absolute;
    left: 0;
    font-size: 2.5rem;
    transition: left 0.1s linear;
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.racer-name {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0.7;
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
}

.lap-badge {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    white-space: nowrap;
    color: var(--gold);
    background: rgba(250, 204, 21, 0.15);
    border: 1px solid rgba(250, 204, 21, 0.4);
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Controls */
.controls {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
}

.btn {
    padding: 14px 30px;
    border-radius: 12px;
    border: none;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #00a8ff);
    color: var(--bg);
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Hall of Fame */
.leaderboard {
    background: var(--glass);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 30px;
    width: 100%;
}

.leaderboard h2 {
    color: var(--gold);
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.5rem;
    letter-spacing: 2px;
}

.hall-of-fame-list {
    list-style: none;
}

.hall-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    animation: fadeIn 0.5s ease-out;
}

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

.hall-rank {
    color: var(--gold);
    font-weight: 800;
    width: 30px;
}

/* Modal / Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(2, 6, 23, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.login-card {
    background: var(--glass);
    padding: 40px;
    border-radius: 24px;
    border: 1px solid var(--card-border);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.emoji-picker {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.emoji-opt {
    font-size: 1.6rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 10px;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
    user-select: none;
}

.emoji-opt:hover {
    background: rgba(0, 243, 255, 0.15);
    transform: scale(1.15);
}

.emoji-opt.selected {
    border-color: var(--accent);
    background: rgba(0, 243, 255, 0.2);
    box-shadow: 0 0 10px var(--accent-glow);
    transform: scale(1.2);
}

input {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: white;
    margin: 20px 0;
    font-family: inherit;
    text-align: center;
}

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

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

.winner-banner {
    background: linear-gradient(to right, transparent, var(--gold-glow), transparent);
    padding: 20px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gold);
    margin-top: 20px;
    border-radius: 12px;
    display: none;
}