:root {
    --bg-color: #1a1a1a;
    --lane-color: #2a2a2a;
    --text-color: #ffffff;
    --accent-color: #00ffcc;
    --red-color: #ff4444;
    --black-char-color: #000000;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
    touch-action: none;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 100%;
    background: #222;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(20, 20, 20, 0.95);
    z-index: 10;
    transition: opacity 0.3s ease;
}

.hidden {
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

h1.title {
    font-family: 'Anton', sans-serif;
    font-size: 5rem;
    line-height: 1;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(0, 255, 204, 0.5);
}

.instructions {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
}

.rule-box {
    padding: 1rem;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.2rem;
}

.rule-box.black {
    background: #ccc;
    color: #000;
    border: 2px solid #fff;
}

.rule-box.red {
    background: #300;
    color: #f66;
    border: 2px solid #f00;
}

button {
    background: var(--accent-color);
    color: #000;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 50px;
    transition: transform 0.1s, box-shadow 0.1s;
    font-family: 'Anton', sans-serif;
    text-transform: uppercase;
}

button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px var(--accent-color);
}

button:active {
    transform: scale(0.95);
}

/* Game Screen */
#game-screen {
    background: transparent;
}

.hud {
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    text-align: center;
    z-index: 5;
}

.score-box {
    font-family: 'Anton', sans-serif;
    font-size: 3rem;
    color: var(--text-color);
}

.lane-container {
    display: flex;
    width: 100%;
    height: 100%;
}

.lane {
    flex: 1;
    border-right: 1px solid #333;
    position: relative;
    background: linear-gradient(to bottom, #222, #111);
}

.lane:last-child {
    border-right: none;
}

.lane-indicator {
    position: absolute;
    bottom: 20px;
    width: 100%;
    text-align: center;
    font-size: 2rem;
    opacity: 0.3;
}

.hit-zone {
    position: absolute;
    bottom: 10%;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 2;
    pointer-events: none;
}

.character {
    position: absolute;
    width: 80px;
    height: 80px;
    line-height: 80px;
    text-align: center;
    font-family: 'Anton', sans-serif;
    font-size: 3.5rem;
    background: #fff;
    border-radius: 12px;
    transform: translateX(-50%);
    left: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    z-index: 3;
}

.character.black {
    color: black;
    border: 4px solid #000;
}

.character.red {
    color: #ff0000;
    border: 4px solid #ff0000;
    background: #fff0f0;
}


.leaderboard {
    margin: 20px 0;
    text-align: center;
    width: 80%;
    max-width: 300px;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
}

.leaderboard h3 {
    margin-bottom: 10px;
    color: var(--accent-color);
    font-family: 'Anton', sans-serif;
    letter-spacing: 1px;
}

.leaderboard ol {
    list-style: none;
    padding: 0;
}

.leaderboard li {
    font-size: 1.2rem;
    margin: 5px 0;
    display: flex;
    justify-content: space-between;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
}

.leaderboard li:nth-child(1) {
    color: #ffd700;
    /* Gold */
    font-weight: bold;
}

.leaderboard li:nth-child(2) {
    color: #c0c0c0;
    /* Silver */
}

.leaderboard li:nth-child(3) {
    color: #cd7f32;
    /* Bronze */
}

/* Animations */
@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }

    100% {
        transform: translateX(0);
    }
}


.shake {
    animation: shake 0.3s;
}

@keyframes flyLeft {
    0% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateX(-200%) scale(1.5) rotate(-20deg);
        opacity: 0;
    }
}

@keyframes flyRight {
    0% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateX(100%) scale(1.5) rotate(20deg);
        opacity: 0;
    }
}

.fly-left {
    animation: flyLeft 0.3s forwards ease-out;
}

.fly-right {
    animation: flyRight 0.3s forwards ease-out;
}