:root {
    --primary: #2196F3;
    --secondary: #1976D2;
    --success: #4CAF50;
    --danger: #f44336;
    --white: #ffffff;
    --light: #f5f5f5;
    --dark: #212121;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--light);
    color: var(--dark);
    padding: 20px;
}

.game-container {
    width: 100%;
    max-width: 800px;
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    text-align: center;
}

.welcome-screen {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

h1 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.rules {
    text-align: left;
    background: var(--light);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.rules h2 {
    color: var(--secondary);
    margin-bottom: 1rem;
}

.rules ul {
    list-style-position: inside;
    line-height: 1.6;
}

.game-screen {
    display: none;
}

.number-display {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary);
    margin: 2rem 0;
    min-height: 5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.countdown {
    font-size: 2rem;
    color: var(--secondary);
    margin: 1rem 0;
}

.number-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 400px;
    margin: 2rem auto;
}

.number-btn {
    font-size: 1.5rem;
    padding: 1rem;
    border: none;
    background: var(--light);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.control-btn {
    font-size: 1.2rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: var(--primary);
    color: var(--white);
    margin: 1rem;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: var(--secondary);
}

.progress-container {
    margin: 2rem 0;
    background: var(--light);
    border-radius: 8px;
    overflow: hidden;
}

.progress-bar {
    width: 0;
    height: 20px;
    background: var(--success);
    transition: width 0.3s ease;
}

.game-over {
    display: none;
}

.score {
    font-size: 2rem;
    margin: 1rem 0;
}

.score-message {
    font-size: 1.5rem;
    margin: 1rem 0;
    color: var(--success);
}

.player-input {
    font-size: 2rem;
    margin: 1rem 0;
    min-height: 3rem;
}

@media (max-width: 600px) {
    .game-container {
        padding: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    .number-display {
        font-size: 2.5rem;
    }

    .number-btn {
        font-size: 1.2rem;
        padding: 0.8rem;
    }
}
