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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #1a1a2e;
    color: #eee;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- Common --- */
.screen { display: none; }
.screen.active { display: block; }

h1 { color: #d4a017; text-align: center; font-size: 2rem; margin-bottom: 24px; }
h2 { color: #d4a017; text-align: center; font-size: 1.5rem; margin-bottom: 20px; }
.subtitle { text-align: center; color: #888; margin-bottom: 20px; font-size: 1.1rem; }

button {
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 12px;
    transition: transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}
button:active { transform: scale(0.97); }
button:disabled { opacity: 0.5; cursor: default; transform: none; }

#start-btn, #playagain-btn {
    width: 100%;
    max-width: 400px;
    display: block;
    margin: 20px auto;
    background: #d4a017;
    color: #1a1a2e;
}

.player-tag {
    display: inline-block;
    padding: 10px 20px;
    margin: 8px;
    background: #16213e;
    border: 2px solid #d4a017;
    border-radius: 8px;
    font-size: 1.1rem;
}
#player-list { text-align: center; margin-bottom: 20px; }

/* Timer */
#timer-bar {
    height: 8px;
    background: #333;
    border-radius: 4px;
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
}
#timer-fill {
    height: 100%;
    background: linear-gradient(90deg, #e74c3c, #d4a017);
    border-radius: 4px;
    width: 100%;
    transition: width 0.1s linear;
}
#timer-text {
    position: absolute;
    right: 0;
    top: -22px;
    color: #e74c3c;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Results */
.result-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 8px;
    background: #16213e;
    font-size: 1.1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.result-correct { border-left: 4px solid #27ae60; }
.result-wrong { border-left: 4px solid #e74c3c; }

.correct-banner {
    background: #1a4a2e;
    border: 2px solid #27ae60;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    font-size: 1.3rem;
    margin: 20px auto;
    color: #27ae60;
    max-width: 600px;
}

.final-score-row {
    display: flex;
    justify-content: space-between;
    padding: 16px;
    margin-bottom: 8px;
    border-radius: 8px;
    background: #16213e;
    font-size: 1.2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}
.final-score-row:first-child { border: 2px solid #d4a017; }

/* Player feedback */
.feedback {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 16px;
}
.feedback.correct { background: #1a4a2e; color: #27ae60; }
.feedback.wrong { background: #4a1a1a; color: #e74c3c; }
.feedback.timeout { background: #4a3a1a; color: #d4a017; }

/* Bonus breakdown */
.bonus-line {
    text-align: center;
    font-size: 1.1rem;
    padding: 6px 0;
    color: #d4a017;
    font-weight: 600;
}

.my-score {
    text-align: center;
    font-size: 1.5rem;
    color: #d4a017;
    padding: 20px;
    background: #16213e;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 12px;
}

/* Text input */
input[type="text"] {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    border: 2px solid #d4a017;
    border-radius: 8px;
    background: #16213e;
    color: #eee;
    margin-bottom: 16px;
    outline: none;
}
