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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
}

.game-header {
    text-align: center;
    margin-bottom: 20px;
}

.game-header h1 {
    font-size: 2rem;
    color: #f1c40f;
    text-shadow: 0 0 20px rgba(241, 196, 15, 0.5);
}

.game-header .subtitle {
    color: #ecf0f1;
    font-size: 0.9rem;
    margin-top: 5px;
    letter-spacing: 2px;
}

.stats-container {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
}

.stat-box {
    text-align: center;
}

.stat-label {
    display: block;
    color: #95a5a6;
    font-size: 0.8rem;
    font-weight: bold;
}

.stat-value {
    display: block;
    color: #ecf0f1;
    font-size: 1.3rem;
    font-weight: bold;
}

.game-area {
    height: 300px;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.3s ease;
    user-select: none;
}

.game-area.waiting {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.game-area.ready {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.game-area.go {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.game-area.result {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.game-area.early {
    background: linear-gradient(135deg, #e67e22, #d35400);
}

.game-content {
    text-align: center;
    color: white;
}

.icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: pulse 2s ease infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.game-area.go .icon {
    animation: none;
}

.game-content h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.game-content p {
    font-size: 1rem;
    opacity: 0.9;
}

.results-container {
    margin-top: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
}

.results-container.hidden {
    display: none;
}

.results-container h3 {
    color: #ecf0f1;
    margin-bottom: 15px;
}

.results-list {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.result-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
    color: #ecf0f1;
    font-weight: bold;
}

.result-item.best {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    color: #1a1a2e;
}

.final-result {
    color: #ecf0f1;
    margin-bottom: 15px;
}

.final-result p {
    margin: 5px 0;
}

#ranking {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2ecc71;
}

.restart-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

@media (max-width: 500px) {
    .game-container {
        padding: 15px;
    }

    .game-header h1 {
        font-size: 1.5rem;
    }

    .game-area {
        height: 250px;
    }

    .icon {
        font-size: 3rem;
    }

    .game-content h2 {
        font-size: 1.5rem;
    }
}
