* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f2f4f8;
    color: #1f2933;
}

button,
input,
textarea {
    font: inherit;
}

button {
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.hidden {
    display: none;
}

.site-header {
    padding: 2rem 1rem;
    text-align: center;
    background: #20283a;
    color: white;
}

.site-header h1 {
    margin: 0;
}

.site-header p {
    margin-bottom: 0;
}

.game-container {
    width: min(90%, 700px);
    margin: 2rem auto;
}

.game-screen {
    padding: 2rem;
    border-radius: 16px;
    background: white;
    box-shadow: 0 8px 24px rgb(0 0 0 / 10%);
}

.eyebrow {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: bold;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #667085;
}

.player-form {
    margin-bottom: 1.5rem;
}

.player-form label,
.letters-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.player-form-controls {
    display: flex;
    gap: 0.75rem;
}

.player-form input,
.letters-form input {
    width: 100%;
    min-width: 0;
    border: 1px solid #bcc5d1;
    border-radius: 8px;
    padding: 0.75rem;
}

.player-form input {
    flex: 1;
}

.player-form button,
.letters-form button,
#start-game-button,
#continue-button {
    background: #4255d4;
    color: white;
}

.player-list {
    display: grid;
    gap: 0.75rem;
    padding: 0;
    list-style: none;
}

.player-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #d9dee7;
    border-radius: 10px;
}

.player-information {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.player-number {
    font-size: 0.85rem;
    color: #667085;
}

.ready-button {
    background: #e2e6ef;
    color: #1f2933;
}

.ready-button.is-ready {
    background: #238636;
    color: white;
}

.status-message {
    min-height: 1.5rem;
    color: #667085;
}

#start-game-button,
#continue-button {
    width: 100%;
    margin-top: 1rem;
}

.timer-display {
    margin: 1.5rem 0;
    font-size: 1.25rem;
    font-weight: bold;
}

#tzar-timer {
    display: inline-block;
    min-width: 2ch;
    font-size: 2rem;
    color: #4255d4;
}

.letters-form {
    display: grid;
    gap: 1rem;
}

.letters-form input {
    font-size: 1.5rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.prompt-letters {
    margin: 2rem 0;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    font-size: clamp(2rem, 8vw, 4rem);
    font-weight: bold;
    letter-spacing: 0.2em;
    background: #eef0ff;
    color: #2d3db7;
    overflow-wrap: anywhere;
}

#response-timer {
    display: inline-block;
    min-width: 2ch;
    font-size: 2rem;
    color: #4255d4;
}

.response-forms {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}

.response-card {
    padding: 1rem;
    border: 1px solid #d9dee7;
    border-radius: 10px;
}

.response-card h3 {
    margin-top: 0;
}

.response-form {
    display: grid;
    gap: 0.75rem;
}

.response-form textarea {
    width: 100%;
    min-height: 100px;
    resize: vertical;
    border: 1px solid #bcc5d1;
    border-radius: 8px;
    padding: 0.75rem;
    font: inherit;
}

.response-form button,
#judging-button {
    background: #4255d4;
    color: white;
}

.response-error {
    min-height: 1.25rem;
    margin: 0;
    color: #b42318;
}

.submitted-response {
    padding: 1rem;
    border-radius: 8px;
    background: #eaf7ed;
    color: #176329;
}

.submitted-response p {
    margin: 0.5rem 0 0;
}

#judging-button {
    width: 100%;
    margin-top: 1rem;
}

@media (max-width: 500px) {
    .player-form-controls {
        flex-direction: column;
    }

    .player-card {
        align-items: stretch;
        flex-direction: column;
    }
}