html, body {
    height: 100%;
    width: 100vw;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #1e272e;
    color: #fff;
    box-sizing: border-box;
    overflow: hidden;
}

body {
    min-height: 100vh;
    min-width: 100vw;
}

.screen {
    display: none;
    width: 100vw;
    height: 100vh;
    align-items: stretch;
    justify-content: center;
    background: #1e272e;
    position: absolute;
    top: 0; left: 0;
}

.screen.active {
    display: flex;
}

.setup-container,
.end-container,
.game-container {
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

h1, h2 {
    text-align: center;
    font-size: 2.7em;
    margin-bottom: 0.5em;
    color: #fdcb6e;
    letter-spacing: 2px;
}

label {
    font-size: 1.3em;
    color: #fff;
}

input[type="number"],
#team-names input {
    font-size: 1.2em;
    width: 100%;
    margin: 0.3em 0 0.8em 0;
    padding: 0.6em 1em;
    border-radius: 14px;
    border: none;
    outline: none;
    background: #222f3e;
    color: #fff;
    box-shadow: 0 2px 8px #2d343610;
    max-width: 350px;
}

#team-names input {
    margin-bottom: 0.6em;
}

.big-btn {
    width: 100%;
    max-width: 360px;
    padding: 1em;
    font-size: 1.5em;
    background: linear-gradient(90deg, #00b894 60%, #0984e3 100%);
    color: #fff;
    border: none;
    border-radius: 18px;
    margin-top: 1em;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-weight: bold;
    letter-spacing: 1px;
}
.big-btn:hover {
    background: linear-gradient(90deg, #00b894 40%, #fdcb6e 100%);
    transform: scale(1.04);
}

#game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 96vw;
    min-width: 0;
    margin: 0 0 2.5vh 0;
    gap: 2vw;
    padding: 0 2vw;
}

#team-turn {
    font-weight: bold;
    font-size: 2.1em;
    color: #00b894;
    background: #222f3e;
    padding: 0.5em 1.3em;
    border-radius: 14px;
    box-shadow: 0 1px 10px #00b89433;
    min-width: 12vw;
}

#scoreboard {
    font-size: 1.3em;
    text-align: right;
    color: #fff;
    background: #222f3e;
    border-radius: 12px;
    padding: 0.7em 1.2em;
    box-shadow: 0 1px 10px #0984e333;
    min-width: 13vw;
}

#word-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    min-height: 0;
    height: 45vh;
    width: 100vw;
    margin-bottom: 1.5vh;
}

#status-message {
    min-height: 2.2em;
    font-size: 1.8em;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1vh;
    color: #fdcb6e;
    text-shadow: 0 1px 12px #000b;
}

#word {
    font-size: 7vw;
    font-weight: bold;
    color: #fff;
    background: #0984e3;
    padding: 0.1em 1.2em;
    border-radius: 28px;
    margin-bottom: 0.7em;
    margin-top: 0.2em;
    letter-spacing: 3px;
    min-width: 2ch;
    min-height: 1.3em;
    box-shadow: 0 2px 30px #0984e345;
    text-align: center;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    word-break: break-word;
}

#timer {
    font-size: 3.5em;
    color: #d63031;
    font-weight: bold;
    margin-top: 1vh;
    margin-bottom: 0.2em;
    text-shadow: 0 2px 20px #d6303155;
    text-align: center;
    letter-spacing: 2px;
}

#game-buttons {
    display: flex;
    justify-content: center;
    gap: 6vw;
    width: 100vw;
    margin-bottom: 2vh;
    margin-top: 1vh;
}
.action-btn {
    width: 18vw;
    min-width: 120px;
    max-width: 300px;
    height: 9vh;
    max-height: 130px;
    min-height: 65px;
    font-size: 2.7em;
    border: none;
    border-radius: 18px;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 24px #0005;
    margin: 0 1em;
    transition: background 0.15s, transform 0.09s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.guessed-btn {
    background: linear-gradient(90deg, #00b894 80%, #00cec9 100%);
}
.guessed-btn:active {
    background: linear-gradient(90deg, #00b894 60%, #00cec9 100%);
    transform: scale(0.96);
}
.pass-btn {
    background: linear-gradient(90deg, #d63031 80%, #fdcb6e 100%);
}
.pass-btn:active {
    background: linear-gradient(90deg, #d63031 60%, #fdcb6e 100%);
    transform: scale(0.96);
}
.action-btn:disabled {
    background: #636e72 !important;
    color: #a8a8a8;
    cursor: not-allowed;
}

#flow-buttons {
    display: flex;
    justify-content: center;
    gap: 1em;
    width: 100vw;
    margin-bottom: 0.5em;
    flex-wrap: wrap;
}
.flow-btn {
    min-width: 130px;
    padding: 0.7em 0.8em;
    font-size: 1.2em;
    margin: 0.2em 0.2em;
    border-radius: 14px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    color: #fff;
    transition: background 0.15s, transform 0.09s;
}
.start-round-btn { background: #00b894; }
.start-round-btn:active { background: #00b894cc; }
.skip-round-btn { background: #fdcb6e; color: #222f3e;}
.skip-round-btn:active { background: #e1b44d; }
.stop-game-btn { background: #d63031; }
.stop-game-btn:active { background: #c0392b; }
.reset-btn { background: #0984e3; }
.reset-btn:active { background: #0984e3cc; }
.flow-btn:disabled {
    background: #636e72 !important;
    color: #b2bec3;
    cursor: not-allowed;
}

#final-scoreboard {
    margin: 2em 0 1em 0;
    font-size: 1.6em;
    width: 100%;
    text-align: center;
}

#winner {
    font-size: 2em;
    color: #00b894;
    font-weight: bold;
    text-align: center;
    margin-bottom: 2em;
}

@media (max-width: 900px) {
    #word {
        font-size: 9vw;
    }
    #timer {
        font-size: 2.2em;
    }
    #team-turn {
        font-size: 1.4em;
        padding: 0.3em 0.7em;
    }
    #scoreboard {
        font-size: 1em;
        padding: 0.35em 0.7em;
        min-width: 80px;
    }
    .action-btn {
        width: 32vw;
        min-width: 90px;
        max-width: 210px;
        height: 6.5vh;
        font-size: 1.3em;
    }
    .flow-btn {
        min-width: 80px;
        font-size: 1em;
        padding: 0.3em 0.5em;
    }
}

::-webkit-scrollbar {
    width: 8px;
    background: #222f3e;
}
::-webkit-scrollbar-thumb {
    background: #636e72;
    border-radius: 6px;
}