* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;

    font-family: Arial, Helvetica, sans-serif;

    background:
        radial-gradient(
            circle at top,
            #27275c 0%,
            #111126 45%,
            #090912 100%
        );

    color: white;

    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: min(900px, 92%);
}

/* Kopfbereich */

header {
    display: flex;
    align-items: center;
    gap: 16px;

    margin-bottom: 60px;
}

.logo {
    width: 55px;
    height: 55px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 14px;

    background: #5555FF;

    font-size: 24px;
    font-weight: bold;
}

h1 {
    margin: 0;
    font-size: 28px;
}

.subtitle {
    margin: 5px 0 0;
    color: #b7b7cc;
}

/* Begrüßung */

.welcome {
    text-align: center;
    margin-bottom: 45px;
}

.welcome h2 {
    margin-bottom: 10px;
    font-size: 36px;
}

.welcome p {
    color: #c0c0d5;
    font-size: 18px;
}

/* Auswahlkarten */

.cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.card {
    padding: 35px;

    background: rgba(40, 40, 75, 0.72);

    border: 1px solid rgba(120, 120, 180, 0.38);
    border-radius: 20px;

    text-align: center;

    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);

    transition:
        transform 0.2s,
        border-color 0.2s;
}

.card:hover {
    transform: translateY(-5px);
    border-color: #5555FF;
}

.card h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.card p {
    min-height: 45px;
    color: #c0c0d5;
}

/* Buttons */

button {
    width: 100%;

    margin-top: 20px;
    padding: 14px 20px;

    border: 0;
    border-radius: 10px;

    background: #5555FF;
    color: white;

    font-size: 16px;
    font-weight: bold;

    cursor: pointer;

    transition:
        background 0.2s,
        transform 0.1s;
}

button:hover {
    background: #7070FF;
}

button:active {
    transform: scale(0.98);
}

/* Serverstatus */

.connection {
    margin-top: 35px;

    display: flex;
    justify-content: center;
    align-items: center;
    gap: 9px;

    color: #b7b7cc;
    font-size: 14px;
}

.dot {
    width: 10px;
    height: 10px;

    border-radius: 50%;

    background: #e0a800;
}

.dot.connected {
    background: #38d477;
}

.dot.disconnected {
    background: #e05252;
}

/* Credits */

.footer {
    margin-top: 22px;

    text-align: center;

    color: #5555FF;
    font-size: 12px;
}

input {
    width: 100%;
    margin-top: 12px;
    padding: 14px 16px;

    border: 1px solid rgba(120, 120, 180, 0.45);
    border-radius: 10px;

    background: #101035;
    color: white;

    font-size: 16px;
}

input:focus {
    outline: none;
    border-color: #5555FF;
}

#playerList {
    margin-top: 18px;

    display: grid;
    gap: 10px;

    color: #d0d0e5;
}

#playerList div {
    padding: 12px 14px;

    background: #101035;

    border: 1px solid rgba(85, 85, 255, 0.45);
    border-radius: 10px;
}

.player-row {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 15px;

    padding: 12px 14px;

    background: #101035;

    border: 1px solid rgba(85, 85, 255, 0.45);
    border-radius: 10px;
}

.player-name {
    font-weight: bold;
}

.player-status {
    font-size: 13px;
}

.player-status.online {
    color: #38d477;
}

.player-status.offline {
    color: #e0a800;
}

.player-waiting-card {
    max-width: 650px;
    margin: 0 auto;

    text-align: center;
}

.player-state {
    margin: 20px 0;

    padding: 12px 16px;

    border-radius: 10px;

    background: #101035;

    color: #c0c0d5;
}

.player-state.connected {
    border: 1px solid #38d477;
    color: #38d477;
}

.player-state.reconnecting {
    border: 1px solid #e0a800;
    color: #e0a800;
}

.player-state.error {
    border: 1px solid #e05252;
    color: #e05252;
}

.waiting-area {
    margin-top: 30px;
    padding: 28px 20px;

    border-top: 1px solid rgba(85, 85, 255, 0.35);
}

.waiting-circle {
    width: 22px;
    height: 22px;

    margin: 0 auto 18px;

    border: 3px solid rgba(85, 85, 255, 0.25);
    border-top-color: #5555FF;

    border-radius: 50%;

    animation: waiting-spin 1s linear infinite;
}

@keyframes waiting-spin {
    to {
        transform: rotate(360deg);
    }
}

.secondary-button {
    background: #252540;
}

.secondary-button:hover {
    background: #303052;
}

/* Smartphone */

@media (max-width: 650px) {

    body {
        display: block;
        min-height: 100vh;
        padding: 24px 0 20px;

        background: linear-gradient(
            180deg,
            #080820 0%,
            #050514 55%,
            #03030c 100%
        );
    }

    .container {
        width: 92%;
        margin: 0 auto;
    }

    header {
        margin-bottom: 30px;
        gap: 12px;
    }

    .logo {
        width: 48px;
        height: 48px;

        font-size: 20px;
        border-radius: 12px;

        background: #5555FF;
    }

    h1 {
        font-size: 23px;
    }

    .subtitle {
        font-size: 14px;
        color: #C0C0DD;
    }

    .welcome {
        margin-bottom: 28px;
    }

    .welcome h2 {
        margin-bottom: 8px;

        font-size: 27px;
        line-height: 1.2;
    }

    .welcome p {
        max-width: 420px;
        margin: 0 auto;

        font-size: 16px;
        line-height: 1.5;

        color: #C8C8DF;
    }

    .cards {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .card {
        padding: 26px 22px;

        background: #101035;

        border: 2px solid #5555FF;
        border-radius: 18px;

        box-shadow:
            0 8px 24px rgba(0, 0, 0, 0.35),
            0 0 12px rgba(85, 85, 255, 0.18);
    }

    .card:hover {
        transform: none;
        border-color: #5555FF;
    }

    .card h3 {
        margin-top: 0;
        margin-bottom: 8px;

        font-size: 23px;
        color: #FFFFFF;
    }

    .card p {
        min-height: 0;
        margin-bottom: 18px;

        color: #D0D0E5;

        font-size: 15px;
        line-height: 1.45;
    }

    button {
        margin-top: 6px;
        padding: 14px 18px;

        background: #5555FF;

        border: 1px solid #7777FF;

        font-size: 16px;
    }

    button:hover {
        background: #6666FF;
    }

    .connection {
        margin-top: 24px;

        color: #C0C0D5;

        font-size: 13px;
    }

    .footer {
        margin-top: 14px;
        padding-bottom: 4px;

        color: #5555FF;

        font-size: 11px;
    }
}

.resume-game {
    max-width: 500px;
    margin: 25px auto 0;
    padding: 20px;
    text-align: center;

    background: #101035;
    border: 1px solid #5555FF;
    border-radius: 14px;
}

.resume-game h3 {
    margin: 0 0 8px;
    color: #ffffff;
}

.resume-game p {
    margin: 0 0 16px;
    color: #c0c0d5;
}

.resume-game-button,
.resume-forget-button {
    display: block;
    width: 100%;
    margin-top: 10px;
}

.resume-forget-button {
    background: transparent;
    border: 1px solid #5555FF;
    color: #ffffff;
}

.player-state.reconnecting {
    border: 1px solid #e0a800;
    color: #e0a800;
}

.player-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.remove-player-button {
    width: auto;
    flex-shrink: 0;

    align-self: center;
    margin: 0;

    padding: 8px 12px;

    background: transparent;
    border: 1px solid #c94b4b;
    color: #ff7777;

    border-radius: 8px;
    cursor: pointer;
}

.remove-player-button:hover {
    background: rgba(201, 75, 75, 0.15);
}

@media (max-width: 600px) {
    .player-row {
        align-items: flex-start;
    }

    .player-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

.moderator-start-area {
    margin-top: 28px;
    text-align: center;
}

.start-game-info {
    margin-bottom: 12px;
    color: #c0c0d5;
}

.start-game-button {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}

.start-game-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.moderator-game-area {
    margin-top: 24px;
    text-align: center;
}

.moderator-game-area h4 {
    margin-top: 24px;
}

.turn-order-row {
    max-width: 420px;
    margin: 8px auto;
    padding: 12px 16px;

    background: #0d0d30;
    border: 1px solid #5555FF;
    border-radius: 10px;

    text-align: left;
    font-weight: 600;
}

.player-game-area {
    margin-top: 28px;
    text-align: center;
}

.player-position {
    width: fit-content;
    margin: 18px auto;
    padding: 12px 22px;

    border: 1px solid #5555FF;
    border-radius: 12px;

    font-size: 1.3rem;
    font-weight: 700;
}

.buzzer-button {
    display: block;

    width: min(280px, 80vw);
    height: min(280px, 80vw);

    margin: 30px auto 16px;

    border: 4px solid #5555FF;
    border-radius: 50%;

    font-size: 2rem;
    font-weight: 800;

    background: #151548;
    color: #ffffff;
}

.buzzer-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.buzzer-hint {
    color: #a8a8c0;
    font-size: 0.9rem;
}

/* Einheitlicher Abstand oben */

.container {
    padding-top: 28px;
}

header {
    margin-bottom: 32px;
}

/* Startseite nicht zusätzlich nach unten drücken */

.welcome {
    margin-top: 0;
}

/* Player-Seite kompakter */

.player-waiting-card {
    padding-top: 28px;
    padding-bottom: 28px;
}

.player-waiting-card > h3 {
    margin-top: 0;
    margin-bottom: 8px;
}

.player-waiting-card > p {
    margin-top: 0;
    margin-bottom: 18px;
}

.player-state {
    margin-top: 12px;
    margin-bottom: 22px;
}

.player-game-area {
    margin-top: 18px;
}

.player-game-area h2 {
    margin-top: 0;
    margin-bottom: 12px;
}

.player-game-area p {
    margin-top: 8px;
    margin-bottom: 8px;
}

.player-position {
    margin: 14px auto;
    padding: 10px 18px;
}

.buzzer-button {
    width: min(230px, 70vw);
    height: min(230px, 70vw);

    margin: 14px auto 6px;

    font-size: 1.7rem;
}

.buzzer-hint {
    margin-top: 8px;
    margin-bottom: 0;
}

.player-game-area #playerGameInfo {
    margin-bottom: 2px;
}

.buzzer-hint {
    margin-top: 2px;
    margin-bottom: 0;
}

/* Buzzer-Spielansicht kompakter */

#playerGameInfo {
    margin: 6px 0 4px !important;
}

.buzzer-button {
    margin: 4px auto 4px !important;
}

.buzzer-hint {
    margin: 4px 0 0 !important;
}

.player-waiting-card {
    padding-bottom: 10px !important;
}

.moderator-resume {
    margin-bottom: 14px;
}

.moderator-game-area {
    margin-top: 24px;
}

.current-turn-box {
    margin-bottom: 20px;
    padding: 14px 18px;
    border: 1px solid #5555ff;
    border-radius: 10px;
    text-align: center;
}

.current-turn-box span {
    display: block;
    margin-bottom: 5px;
    color: #aeb4c8;
}

.current-turn-box strong {
    font-size: 1.35rem;
    color: #ffffff;
}

.quiz-board {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    max-width: 100%;
}

.quiz-category {
    display: grid;
    grid-template-rows:
        minmax(72px, auto)
        repeat(5, 72px);
    gap: 8px;
    min-width: 0;
}

.quiz-category-title {
    display: flex;
    align-items: center;
    justify-content: center;

    min-width: 0;

    padding: 8px 6px;

    border-radius: 8px;

    background: #171f3a;
    color: #ffffff;

    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;

    overflow-wrap: normal;
    hyphens: auto;
    word-break: normal;
}

.quiz-question-button {
    width: 100%;
    min-width: 0;

    border: 1px solid #5555ff;
    border-radius: 8px;

    background: #111a35;
    color: #ffffff;

    font-size: 1.35rem;
    font-weight: 700;
}

.quiz-question-button:disabled {
    opacity: 1;
    cursor: default;
}

.quiz-question-button.played {
    border-color: #34384a;
    background: #141722;
}

@media (max-width: 800px) {
    .quiz-board {
        grid-template-columns: repeat(6, 115px);
        overflow-x: auto;
        padding-bottom: 8px;
    }
}

.quiz-question-button:not(:disabled) {
    cursor: pointer;
    transition:
        transform 0.12s ease,
        background 0.12s ease;
}

.quiz-question-button:not(:disabled):hover {
    transform: translateY(-2px);
    background: #18234a;
}

.quiz-question-button.question-locked {
    opacity: 0.55;
}

.active-question-area {
    margin-top: 24px;
    padding: 22px;

    border: 1px solid #5555ff;
    border-radius: 12px;

    background: #151a35;
}

.active-question-top {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;

    margin-bottom: 20px;
}

.active-question-top span {
    font-size: 1.05rem;
    font-weight: 700;
}

.active-question-top strong {
    font-size: 1.4rem;
    color: #ffffff;
}

.active-question-text {
    padding: 24px 18px;

    border-radius: 10px;

    background: #10162e;

    color: #ffffff;

    font-size: 1.4rem;
    font-weight: 700;

    line-height: 1.45;

    text-align: center;
}

.moderator-answer-box {
    margin-top: 18px;
    padding: 14px 16px;

    border-radius: 10px;

    background: #10162e;

    text-align: center;
}

.moderator-answer-box span {
    display: block;

    margin-bottom: 5px;

    color: #aeb4c8;
}

.moderator-answer-box strong {
    font-size: 1.2rem;
    color: #ffffff;
}

.question-player-box {
    margin-top: 18px;

    text-align: center;
}

.question-player-box span {
    color: #aeb4c8;
}

.question-player-box strong {
    margin-left: 6px;

    color: #ffffff;
}

.question-timer {
    margin: 22px auto 10px;

    width: 130px;

    padding: 14px;

    border: 1px solid #5555ff;
    border-radius: 10px;

    background: #10162e;

    color: #ffffff;

    font-size: 2rem;
    font-weight: 700;

    text-align: center;
}

.question-phase-text {
    margin-bottom: 0;

    text-align: center;

    color: #aeb4c8;
}


