:root {
    color-scheme: light;
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #eef4f7;
    --surface-strong: #e5edf2;
    --ink: #17202a;
    --muted: #667085;
    --line: #d7e0e7;
    --primary: #2952cc;
    --primary-strong: #1f3f9f;
    --accent: #00a9a5;
    --accent-strong: #007f7b;
    --success: #1f9d63;
    --warning: #f4b23f;
    --danger: #df3b3b;
    --danger-strong: #b92c2c;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .08);
    --shadow-md: 0 12px 34px rgba(39, 54, 78, .13);
    --shadow-lg: 0 24px 70px rgba(22, 34, 51, .2);
    --body-layer: linear-gradient(180deg, rgba(255, 255, 255, .88), rgba(245, 247, 251, .96));
    --body-grid: repeating-linear-gradient(90deg, rgba(41, 82, 204, .035) 0 1px, transparent 1px 72px);
    --body-glow: linear-gradient(120deg, rgba(0, 169, 165, .08), transparent 38%, rgba(244, 178, 63, .08));
    --surface-alpha: rgba(255, 255, 255, .94);
    --surface-panel: rgba(255, 255, 255, .92);
    --field-bg: #fbfcfe;
    --field-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
    --label: #344054;
    --disabled-bg: #e7ebef;
    --disabled-ink: #8b95a1;
    --board-shell: #253047;
    --board-head: #1f2937;
    --board-head-ink: #f8fafc;
    --board-cell: #fff7df;
    --board-cell-border: rgba(244, 178, 63, .42);
    --board-selected: #dff7f6;
    --board-selected-border: rgba(0, 169, 165, .35);
    --board-button-ink: #101828;
    --success-soft: #e7f8ef;
    --success-line: #b7ebcf;
    --success-ink: #14532d;
    --danger-soft: #fdeaea;
    --danger-line: #f8c0c0;
    --danger-ink: #7f1d1d;
    --chat-header: #17202a;
    --chat-header-ink: #ffffff;
    --modal-backdrop: rgba(15, 23, 42, .72);
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0b1020;
    --surface: #111827;
    --surface-soft: #172033;
    --surface-strong: #223047;
    --ink: #f8fafc;
    --muted: #a7b0bd;
    --line: #2b3a55;
    --primary: #6c8cff;
    --primary-strong: #8fa6ff;
    --accent: #2dd4bf;
    --accent-strong: #5eead4;
    --success: #4ade80;
    --warning: #fbbf24;
    --danger: #f87171;
    --danger-strong: #ef4444;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .28);
    --shadow-md: 0 16px 40px rgba(0, 0, 0, .34);
    --shadow-lg: 0 28px 80px rgba(0, 0, 0, .48);
    --body-layer: linear-gradient(180deg, rgba(11, 16, 32, .96), rgba(15, 23, 42, .96));
    --body-grid: repeating-linear-gradient(90deg, rgba(94, 234, 212, .055) 0 1px, transparent 1px 72px);
    --body-glow: linear-gradient(120deg, rgba(45, 212, 191, .12), transparent 42%, rgba(108, 140, 255, .13));
    --surface-alpha: rgba(17, 24, 39, .94);
    --surface-panel: rgba(17, 24, 39, .9);
    --field-bg: #0f172a;
    --field-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
    --label: #d7dee8;
    --disabled-bg: #263244;
    --disabled-ink: #718096;
    --board-shell: #070b14;
    --board-head: #111827;
    --board-head-ink: #e5eef9;
    --board-cell: #342b15;
    --board-cell-border: rgba(251, 191, 36, .28);
    --board-selected: #0b3f3d;
    --board-selected-border: rgba(45, 212, 191, .38);
    --board-button-ink: #f8fafc;
    --success-soft: #0f2f22;
    --success-line: #1f6f4b;
    --success-ink: #bbf7d0;
    --danger-soft: #3b1518;
    --danger-line: #7f1d1d;
    --danger-ink: #fecaca;
    --chat-header: #020617;
    --chat-header-ink: #f8fafc;
    --modal-backdrop: rgba(2, 6, 23, .82);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #0b1020;
        --surface: #111827;
        --surface-soft: #172033;
        --surface-strong: #223047;
        --ink: #f8fafc;
        --muted: #a7b0bd;
        --line: #2b3a55;
        --primary: #6c8cff;
        --primary-strong: #8fa6ff;
        --accent: #2dd4bf;
        --accent-strong: #5eead4;
        --success: #4ade80;
        --warning: #fbbf24;
        --danger: #f87171;
        --danger-strong: #ef4444;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .28);
        --shadow-md: 0 16px 40px rgba(0, 0, 0, .34);
        --shadow-lg: 0 28px 80px rgba(0, 0, 0, .48);
        --body-layer: linear-gradient(180deg, rgba(11, 16, 32, .96), rgba(15, 23, 42, .96));
        --body-grid: repeating-linear-gradient(90deg, rgba(94, 234, 212, .055) 0 1px, transparent 1px 72px);
        --body-glow: linear-gradient(120deg, rgba(45, 212, 191, .12), transparent 42%, rgba(108, 140, 255, .13));
        --surface-alpha: rgba(17, 24, 39, .94);
        --surface-panel: rgba(17, 24, 39, .9);
        --field-bg: #0f172a;
        --field-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
        --label: #d7dee8;
        --disabled-bg: #263244;
        --disabled-ink: #718096;
        --board-shell: #070b14;
        --board-head: #111827;
        --board-head-ink: #e5eef9;
        --board-cell: #342b15;
        --board-cell-border: rgba(251, 191, 36, .28);
        --board-selected: #0b3f3d;
        --board-selected-border: rgba(45, 212, 191, .38);
        --board-button-ink: #f8fafc;
        --success-soft: #0f2f22;
        --success-line: #1f6f4b;
        --success-ink: #bbf7d0;
        --danger-soft: #3b1518;
        --danger-line: #7f1d1d;
        --danger-ink: #fecaca;
        --chat-header: #020617;
        --chat-header-ink: #f8fafc;
        --modal-backdrop: rgba(2, 6, 23, .82);
    }
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 24px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--body-layer), var(--body-grid);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: var(--body-glow);
    z-index: -1;
}

h1, h2, h3, h4, p {
    margin-top: 0;
}

button,
input,
select {
    font: inherit;
}

button {
    border: 0;
}

button,
.quiz-btn,
.msg-btn,
.board-btn {
    min-height: 44px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 760;
    letter-spacing: 0;
    transition: transform .14s ease, box-shadow .14s ease, background .14s ease, border-color .14s ease;
}

button:hover:not(:disabled) {
    transform: translateY(-1px);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled,
button.board-btn:disabled,
td.answered,
td.missing-question {
    cursor: not-allowed;
    color: var(--disabled-ink);
    background: var(--disabled-bg);
    box-shadow: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
#chatbox-header:focus-visible,
#beamer-playerlist-toggle:focus-visible {
    outline: 3px solid rgba(0, 169, 165, .32);
    outline-offset: 3px;
}

.hide {
    display: none !important;
}

#hostview,
#beamerview,
#playerview {
    display: none;
}

.logo-headline-row {
    width: min(1180px, 100%);
    margin: 0 auto 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.theme-toggle {
    width: 46px;
    min-height: 46px;
    display: inline-grid;
    place-items: center;
    color: var(--ink);
    background: var(--surface-alpha);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
}

.theme-toggle-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.logo-img {
    width: 58px;
    height: 58px;
    border-radius: var(--radius-md);
    object-fit: cover;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.headline-title {
    margin: 0;
    color: var(--ink);
    font-size: clamp(2rem, 5vw, 3.8rem);
    font-weight: 870;
    line-height: 1;
}

#loginbereich {
    width: min(440px, 100%);
    margin: 0 auto;
}

#loginForm {
    display: grid;
    gap: 14px;
    padding: 24px;
    background: var(--surface-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(16px);
}

label {
    display: grid;
    gap: 7px;
    color: var(--label);
    font-size: .94rem;
    font-weight: 720;
}

input[type="text"],
input[type="password"],
input[type="number"],
select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    color: var(--ink);
    background: var(--field-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--field-shadow);
}

input::placeholder {
    color: #98a2b3;
}

#pwdiv {
    display: none;
    gap: 14px;
    padding-top: 4px;
}

.quiz-info-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px;
    color: var(--ink);
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.quiz-info-card.has-preview {
    grid-template-columns: 86px minmax(0, 1fr);
}

.quiz-info-card[hidden] {
    display: none;
}

.quiz-info-preview {
    width: 86px;
    height: 64px;
    object-fit: cover;
    background: var(--field-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.quiz-info-body {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.quiz-info-body strong,
.quiz-info-body span,
.quiz-info-body small {
    overflow: hidden;
    text-overflow: ellipsis;
}

.quiz-info-body strong {
    color: var(--ink);
    font-size: .98rem;
}

.quiz-info-body span,
.quiz-info-body small {
    color: var(--muted);
    font-size: .84rem;
    font-weight: 680;
}

#connectBtn,
.quiz-btn,
.msg-btn {
    width: 100%;
    padding: 11px 16px;
    color: #fff;
    background: var(--primary);
    box-shadow: 0 10px 24px rgba(41, 82, 204, .22);
}

#connectBtn:hover:not(:disabled),
.quiz-btn:hover:not(:disabled),
.msg-btn:hover:not(:disabled) {
    background: var(--primary-strong);
}

#fragenNeuLadenBtn,
#resetRoomBtn,
#qrShowBtn,
#qrCloseBtn,
#podiumCloseBtn,
#estimateBtn {
    padding: 10px 16px;
    color: #fff;
    background: var(--primary);
    box-shadow: var(--shadow-sm);
}

#resetRoomBtn,
.autohost-stop {
    background: var(--danger) !important;
}

#resetRoomBtn:hover:not(:disabled),
.autohost-stop:hover:not(:disabled) {
    background: var(--danger-strong) !important;
}

.autohost-apply,
#estimateBtn {
    background: var(--accent);
}

.autohost-apply:hover:not(:disabled),
#estimateBtn:hover:not(:disabled) {
    background: var(--accent-strong);
}

#login-avatar-select {
    display: grid;
    gap: 8px;
}

.avatar-gallery-row {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 3px;
    -webkit-overflow-scrolling: touch;
}

#avatarGallery {
    display: flex;
    gap: 9px;
    width: max-content;
    padding: 4px 2px 8px;
    scroll-snap-type: x mandatory;
}

.avatar-option {
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    border: 2px solid transparent;
    border-radius: 50%;
    background: var(--surface-soft);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    object-fit: cover;
    scroll-snap-align: center;
    transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}

.avatar-option:hover {
    transform: translateY(-1px);
}

.avatar-option.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 169, 165, .14), var(--shadow-sm);
}

#hostview,
#playerview,
#beamerview {
    width: min(1240px, 100%);
    margin: 0 auto;
}

#hostview {
    grid-template-columns: 1fr;
    gap: 18px;
}

#hostview > div:first-child {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

#hostview > div:first-child button {
    width: auto;
}

.host-flex-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 18px;
    align-items: start;
}

.host-main-col,
.host-dashboard,
.playerlist,
.autohost-panel,
#host-punktebuttons,
#host-rf-buttons,
.scorebox,
#chatbox-panel,
#mcstats,
.estimate-result-box {
    background: var(--surface-alpha);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.host-main-col {
    min-width: 0;
    padding: 16px;
}

.moderator-panel {
    margin-top: 14px;
    padding: 12px;
    text-align: left;
    background: var(--surface-soft);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
}

.moderator-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
    color: var(--accent-strong);
    font-size: .86rem;
    font-weight: 850;
    text-transform: uppercase;
}

.moderator-panel-head strong {
    color: var(--label);
    font-size: .78rem;
}

.moderator-notes {
    display: grid;
    gap: 7px;
    margin: 0;
    padding-left: 20px;
}

.moderator-notes li {
    color: var(--ink);
    font-size: .95rem;
    line-height: 1.35;
}

.host-side-col {
    display: grid;
    gap: 14px;
    min-width: 0;
}

#host-board,
#beamer-board,
#player-board {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 8px;
    background: var(--board-shell);
    border-radius: var(--radius-md);
    padding: 8px;
    box-shadow: var(--shadow-md);
}

th {
    padding: 14px 8px;
    color: var(--board-head-ink);
    background: var(--board-head);
    border-radius: var(--radius-sm);
    font-size: clamp(.82rem, 1.3vw, 1.18rem);
    font-weight: 820;
    text-align: center;
}

td {
    min-height: 72px;
    padding: 0;
    text-align: center;
    background: var(--board-cell);
    border-radius: var(--radius-sm);
}

td.selectable {
    background: var(--surface-soft);
}

button.board-btn {
    width: 100%;
    min-height: 72px;
    padding: 10px 8px;
    color: var(--board-button-ink);
    background: var(--board-cell);
    border: 1px solid var(--board-cell-border);
    border-radius: var(--radius-sm);
    box-shadow: inset 0 -2px 0 rgba(244, 178, 63, .25);
    font-size: clamp(.92rem, 1.5vw, 1.35rem);
}

td.selectable button.board-btn {
    color: var(--board-button-ink);
    background: var(--board-selected);
    border-color: var(--board-selected-border);
    box-shadow: inset 0 -2px 0 rgba(0, 169, 165, .2);
}

td.missing-question button.board-btn {
    color: var(--muted);
    background: var(--disabled-bg);
    border-style: dashed;
    box-shadow: none;
}

button.board-btn:hover:not(:disabled) {
    box-shadow: 0 8px 22px rgba(16, 24, 40, .16), inset 0 -2px 0 rgba(0, 0, 0, .08);
}

#host-board table {
    border-spacing: 6px;
}

#host-board table th {
    font-size: .82rem;
}

#host-board table td,
#host-board button.board-btn {
    font-size: .9rem;
}

#host-board button.board-btn {
    min-height: 54px;
    padding: 8px 6px;
}

.frage-anzeige {
    width: min(980px, 100%);
    margin: 22px auto;
    padding: clamp(18px, 4vw, 42px);
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    font-size: clamp(1.4rem, 4vw, 3.1rem);
    font-weight: 840;
    line-height: 1.16;
    text-align: center;
}

#host-lösung {
    margin: 14px 0 0;
    padding: 14px 16px;
    color: var(--success-ink);
    background: var(--success-soft);
    border: 1px solid var(--success-line);
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    font-weight: 780;
}

#host-rf-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
}

#host-rf-buttons .quiz-btn {
    width: auto;
    min-width: 160px;
}

.host-override-panel {
    display: grid;
    gap: 10px;
    width: 100%;
}

.host-override-head,
.host-override-row,
.host-override-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.host-override-head {
    color: #d7e2ff;
}

.host-override-head span,
.host-override-meta small {
    color: #94a3b8;
    font-size: 0.82rem;
}

.host-override-row {
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-left-width: 4px;
    border-radius: 8px;
    padding: 8px 10px;
    background: rgba(15, 23, 42, 0.58);
}

.host-override-row.is-correct {
    border-left-color: #22c55e;
}

.host-override-row.is-wrong {
    border-left-color: #ef4444;
}

.host-override-meta {
    display: grid;
    min-width: 0;
}

.host-override-meta span {
    overflow-wrap: anywhere;
}

.host-override-actions,
.host-override-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.playerlist {
    min-width: 0;
    padding: 14px;
}

.host-dashboard {
    min-width: 0;
    padding: 14px;
}

.host-dashboard-head {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.host-dashboard-head .panel-title {
    margin: 0;
    text-align: left;
}

.host-dashboard-head span,
.host-dashboard-foot span,
.host-forecast span,
.host-metric span,
.host-metric small,
.host-forecast small {
    color: var(--label);
    font-size: .78rem;
    font-weight: 720;
}

.host-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.host-metric,
.host-forecast {
    min-width: 0;
    padding: 10px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.host-metric {
    display: grid;
    gap: 4px;
    min-height: 92px;
}

.host-metric strong {
    color: var(--ink);
    font-size: 1.24rem;
    line-height: 1;
}

.host-metric small,
.host-forecast small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.host-forecast {
    display: grid;
    gap: 5px;
    margin-top: 10px;
    background: var(--surface-soft);
    border-left: 4px solid var(--accent);
}

.host-forecast strong {
    color: var(--ink);
    font-size: 1rem;
    line-height: 1.18;
}

.host-dashboard-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.host-dashboard-events {
    display: grid;
    gap: 6px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.host-dashboard-events li {
    min-width: 0;
    overflow: hidden;
    padding: 7px 9px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: .82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.panel-title {
    margin: 0 0 14px;
    color: var(--ink);
    font-size: 1.05rem;
    font-weight: 850;
    text-align: center;
}

.playerrow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px 38px auto;
    gap: 8px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.player-streak {
    grid-column: 1 / -1;
    color: var(--label);
    font-size: .78rem;
    font-weight: 720;
}

.powerup-area {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
    gap: 8px;
    width: 100%;
    margin: 10px 0;
}

.powerup-btn {
    display: grid;
    gap: 3px;
    min-height: 54px;
    padding: 8px;
    color: var(--ink);
    background: var(--surface-soft);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    font-weight: 820;
}

.powerup-btn small {
    color: var(--label);
    font-size: .75rem;
}

.powerup-btn:disabled,
.powerup-disabled-choice {
    opacity: .45;
    filter: grayscale(.45);
}

.boss-answer-box {
    display: grid;
    gap: 10px;
    width: min(100%, 520px);
    margin: 12px auto 0;
}

.boss-wager-label {
    color: var(--label);
    font-weight: 800;
    text-align: center;
}

#bossWager {
    width: 100%;
}

#bossFeedback {
    min-height: 22px;
    color: var(--ink);
    font-weight: 800;
    text-align: center;
}

.boss-result-row {
    grid-template-columns: minmax(90px, .8fr) minmax(0px, 1.4fr) minmax(80px, .7fr) minmax(70px, .5fr);
}

.boss-result-wager {
    color: var(--label);
    font-weight: 750;
}

.streak-record {
    position: fixed;
    top: 92px;
    left: 50%;
    z-index: 6000;
    min-width: min(520px, calc(100vw - 32px));
    padding: 18px 24px;
    color: var(--ink);
    background: var(--surface-alpha);
    border: 2px solid var(--accent);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -18px) scale(.94);
}

.streak-record.is-visible {
    animation: streakRecordPop 4.2s ease both;
}

.streak-record-kicker {
    color: var(--accent-strong);
    font-size: .9rem;
    font-weight: 850;
    text-transform: uppercase;
}

.streak-record-name {
    margin-top: 4px;
    font-size: clamp(1.7rem, 5vw, 3.7rem);
    font-weight: 900;
    line-height: 1;
}

.streak-record-count {
    margin-top: 8px;
    font-size: clamp(1rem, 2vw, 1.45rem);
    font-weight: 820;
}

.streak-record-bonus {
    display: inline-block;
    margin-top: 10px;
    padding: 7px 12px;
    color: var(--success-ink);
    background: var(--success-soft);
    border: 1px solid var(--success-line);
    border-radius: 999px;
    font-weight: 850;
}

@keyframes streakRecordPop {
    0% {
        opacity: 0;
        transform: translate(-50%, -24px) scale(.9);
    }
    12% {
        opacity: 1;
        transform: translate(-50%, 0) scale(1.04);
    }
    20%,
    82% {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -16px) scale(.96);
    }
}

.playerrow:last-child {
    border-bottom: 0;
}

.playerrow b {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-weight: 780;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.playerrow button {
    width: 38px;
    min-height: 38px;
    color: #fff;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.playerrow span,
.playerrow .hostpoints {
    color: var(--accent-strong);
    font-weight: 840;
    font-variant-numeric: tabular-nums;
}

#playerview {
    grid-template-columns: 1fr;
    gap: 18px;
    justify-items: center;
}

.scorebox {
    width: min(460px, 100%);
    padding: 16px 18px;
    text-align: center;
}

.scorebox .score-main {
    color: var(--ink);
    font-size: 1.25rem;
    font-weight: 850;
}

.scorebox .score-up {
    color: var(--success);
    font-weight: 760;
}

.scorebox .score-down {
    color: var(--danger);
    font-weight: 760;
}

.personal-stats {
    width: min(720px, 100%);
    margin: 8px auto 0;
    text-align: left;
}

.personal-stats-title {
    margin-bottom: 10px;
    color: var(--ink);
    font-weight: 850;
    text-align: center;
}

.personal-stats-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 12px;
    align-items: baseline;
}

.personal-stats-grid span {
    color: var(--label);
    font-weight: 720;
}

.personal-stats-grid strong {
    color: var(--accent-strong);
    font-weight: 850;
    text-align: right;
}

.scorebox .score-note {
    color: var(--muted);
}

#player-frage,
#beamer-frage {
    width: 100%;
}

#beamer-estimate-result {
    display: none;
}

#player-medienbereich,
#beamer-medienbereich,
#host-medienbereich {
    width: 100%;
    text-align: center;
}

#buzzerbereich {
    display: none;
    text-align: center;
}

#buzzerBtn {
    width: min(280px, 72vw);
    aspect-ratio: 1;
    min-height: 0;
    color: #fff;
    background: radial-gradient(circle at 35% 25%, #ff7b6f, var(--danger) 48%, #9f1f1f 100%);
    border: 10px solid rgba(255, 255, 255, .92);
    border-radius: 50%;
    box-shadow: 0 22px 55px rgba(223, 59, 59, .35), inset 0 -12px 30px rgba(0, 0, 0, .22);
    font-size: clamp(1.35rem, 7vw, 2.25rem);
    line-height: 1.05;
    text-align: center;
}

#buzzerBtn.winner {
    background: radial-gradient(circle at 35% 25%, #68e2a5, var(--success) 54%, #11683e);
    box-shadow: 0 0 0 10px rgba(31, 157, 99, .12), 0 24px 60px rgba(31, 157, 99, .34);
    animation: pulseGlow 1s infinite alternate;
}

#buzzerBtn.disabled {
    color: var(--disabled-ink);
    background: var(--disabled-bg);
    box-shadow: none;
}

#buzzer-answer-area {
    display: none;
    width: min(520px, 100%);
    margin: 18px auto 0;
    gap: 10px;
    justify-items: center;
}

#buzzerAnswerInput {
    width: min(420px, 100%) !important;
    font-size: 1.15rem !important;
    text-align: center;
}

#buzzerAnswerBtn {
    width: min(260px, 100%);
}

#buzzerAnswerFeedback {
    min-height: 22px;
    color: var(--muted);
    font-weight: 760;
}

@keyframes pulseGlow {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.035);
    }
}

#buzzinfo,
#mcinfo,
#mcfeedback {
    color: var(--muted);
    font-weight: 700;
    text-align: center;
}

#mcbereich {
    display: none;
    width: min(620px, 100%);
    text-align: center;
}

#mcbuttons {
    display: grid;
    gap: 10px;
}

.mc-btn {
    width: 100%;
    padding: 14px 18px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    font-size: 1.04rem;
    text-align: left;
}

.mc-btn:hover:not(:disabled) {
    border-color: rgba(0, 169, 165, .5);
    box-shadow: 0 12px 24px rgba(0, 169, 165, .12);
}

.mc-beamer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    width: min(980px, 100%);
    margin: 22px auto;
}

.mc-beamer-grid .mcopt {
    min-height: 120px;
    padding: 22px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 7px solid var(--accent);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    font-size: clamp(1.05rem, 2vw, 1.55rem);
    font-weight: 760;
    line-height: 1.25;
}

.mc-beamer-grid .mcopt b {
    color: var(--accent-strong);
}

.mcfeedback-gross {
    width: min(560px, 100%);
    margin: 20px auto 0;
    padding: 22px;
    color: var(--success-ink);
    background: var(--success-soft);
    border: 1px solid var(--success-line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    font-size: clamp(1.35rem, 5vw, 2rem);
    font-weight: 850;
    text-align: center;
}

.mcfeedback-gross.falsch {
    color: var(--danger-ink);
    background: var(--danger-soft);
    border-color: var(--danger-line);
}

#mcstats {
    position: relative;
    width: min(640px, 100%);
    margin: 16px auto;
    padding: 18px;
    display: none;
}

#mcstats h4 {
    color: var(--ink);
    margin-bottom: 14px;
    font-size: 1.1rem;
    text-align: center;
}

.mcstat-row {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr) 46px;
    gap: 10px;
    align-items: center;
    margin: 9px 0;
}

.mcstat-label {
    min-width: 0;
    overflow: hidden;
    color: var(--label);
    font-weight: 780;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mcstat-bar-bg {
    position: relative;
    height: 16px;
    overflow: hidden;
    background: var(--surface-strong);
    border-radius: 999px;
}

.mcstat-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #76d7c9);
    border-radius: inherit;
}

.mcstat-percent {
    position: absolute;
    top: 50%;
    left: 50%;
    color: #fff;
    font-size: .78rem;
    font-weight: 850;
    line-height: 1;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .32);
    transform: translate(-50%, -50%);
    white-space: nowrap;
}

.mcstat-count {
    color: var(--ink);
    font-weight: 820;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.mcstat-total {
    margin-top: 12px;
    color: var(--muted);
    text-align: center;
}

.progressbar-outer {
    position: relative;
    width: min(420px, 90vw);
    height: 28px;
    margin: 14px auto;
    overflow: hidden;
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.progressbar-inner {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    background: linear-gradient(90deg, var(--accent), var(--success));
    border-radius: inherit;
    transition: width .35s ease;
}

#progressbar-label {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    color: #064e3b;
    font-size: .9rem;
    font-weight: 780;
    line-height: 26px;
    text-align: center;
}

#estimatearea,
#clozearea {
    display: grid;
    gap: 14px;
    justify-items: center;
    width: min(520px, 100%);
}

.estimate-input {
    width: 100% !important;
    max-width: 360px;
    font-size: 1.25rem !important;
    text-align: center;
}

#estimateBtn,
#clozeBtn {
    width: min(320px, 100%);
}

#clozeFeedback {
    min-height: 22px;
    color: var(--muted);
    font-weight: 760;
    text-align: center;
}

.estimate-result-box {
    width: min(760px, calc(100vw - 40px));
    max-height: 70vh;
    padding: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
}

.estimate-result-header {
    position: relative;
    padding: clamp(18px, 2.6vw, 28px) clamp(18px, 3vw, 32px) 16px;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    text-align: center;
}

.estimate-result-close,
.result-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    min-height: 38px;
    padding: 0;
    display: grid;
    place-items: center;
    color: var(--ink);
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 50%;
    box-shadow: none;
    font-size: 1.45rem;
    font-weight: 760;
    line-height: 1;
}

.estimate-result-close:hover,
.result-close:hover {
    background: var(--surface);
    transform: none;
}

.estimate-result-kicker {
    color: var(--muted);
    font-size: .82rem;
    font-weight: 820;
    letter-spacing: 0;
    text-transform: uppercase;
}

.estimate-result-winnerline {
    margin-top: 6px;
    color: var(--success);
    font-size: clamp(1.5rem, 4vw, 2.45rem);
    font-weight: 900;
    line-height: 1.08;
}

.estimate-result-solution {
    margin-top: 10px;
    color: var(--label);
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 760;
}

.estimate-result-winners,
.estimate-exact {
    color: var(--success);
    font-weight: 850;
}

.estimate-result-scroll {
    min-height: 0;
    padding: 18px clamp(16px, 3vw, 28px) clamp(18px, 2.6vw, 28px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.estimate-bars-outer {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.estimate-bar-labelcol {
    display: grid;
    gap: 17px;
    padding-top: 23px;
}

.estimate-bar-label {
    min-width: 110px;
    max-width: 180px;
    overflow: hidden;
    color: var(--label);
    font-weight: 760;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.estimate-bar-wrap {
    position: relative;
    width: min(360px, 50vw);
}

.estimate-solution-marker {
    position: absolute;
    top: 0;
    left: 50%;
    width: 3px;
    height: 100%;
    margin-left: -1.5px;
    background: var(--danger);
    border-radius: 999px;
}

.estimate-bar {
    position: absolute;
    top: 20px;
    display: flex;
    align-items: center;
    height: 28px;
    border-radius: 999px;
    transition: width .35s ease, left .35s ease;
}

.estimate-bar-left {
    left: 50%;
    justify-content: flex-end;
    background: #ffd9c2;
    transform: translateX(-100%);
}

.estimate-bar-right {
    left: 50%;
    justify-content: flex-start;
    background: #c9f2df;
}

.estimate-bar-winner {
    box-shadow: 0 0 0 3px rgba(31, 157, 99, .22);
}

.estimate-bar-value {
    min-width: 42px;
    margin: 0 8px;
    padding: 2px 9px;
    color: var(--ink);
    background: var(--surface-alpha);
    border-radius: 999px;
    font-size: .9rem;
    font-weight: 820;
    text-align: center;
}

#beamerview {
    position: relative;
    min-height: calc(100vh - 120px);
    padding: 0 clamp(10px, 2vw, 24px) 24px;
    align-items: stretch;
    gap: 12px;
}

#beamer-statusbar {
    position: sticky;
    top: 8px;
    z-index: 21;
    width: 100%;
    min-height: 48px;
    padding: 8px 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    color: var(--ink);
    background: color-mix(in srgb, var(--surface-alpha) 92%, transparent);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(8px);
}

.beamer-status-group {
    display: flex;
    min-width: 0;
    gap: 8px;
    align-items: center;
}

.beamer-status-actions {
    justify-content: flex-end;
}

.beamer-status-label,
#beamer-answer-status {
    color: var(--muted);
    font-size: .9rem;
    font-weight: 760;
    white-space: nowrap;
}

.autohost-countdown {
    width: fit-content;
    min-width: 188px;
    min-height: 32px;
    padding: 5px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--danger-ink);
    background: var(--danger-soft);
    border: 1px solid var(--danger-line);
    border-radius: 999px;
    font-size: .9rem;
    font-weight: 850;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.autohost-countdown.is-idle {
    visibility: hidden;
}

#player-countdown {
    display: flex;
    min-width: min(260px, calc(100% - 24px));
    margin: 8px auto 12px;
}

#beamer-status-room {
    padding: 4px 8px;
    color: var(--accent-strong);
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: .98rem;
    font-variant-numeric: tabular-nums;
}

.beamer-status-main {
    min-width: 180px;
    overflow: hidden;
    font-weight: 850;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#beamer-statusbar button {
    width: auto;
    min-height: 34px;
    padding: 7px 12px;
    color: var(--chat-header-ink);
    background: var(--chat-header);
    border: 0;
    border-radius: var(--radius-sm);
    box-shadow: none;
    font-size: .92rem;
    font-weight: 780;
}

#beamer-stage {
    position: relative;
    display: grid;
    width: 100%;
    min-height: calc(100vh - 210px);
    max-height: calc(100vh - 150px);
    padding: clamp(8px, 2vh, 22px) 0;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    align-content: center;
    justify-items: center;
    gap: clamp(8px, 1.8vh, 18px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

#beamerview.mode-board #beamer-stage {
    align-content: center;
}

#beamerview.mode-board #beamer-frage,
#beamerview.mode-board #beamer-medienbereich,
#beamerview.mode-board #mcstats {
    display: none;
}

#beamerview.mode-board #beamer-board-wrap {
    display: grid;
}

#beamerview.mode-question #beamer-stage {
    grid-template-rows: auto minmax(0, 1fr) auto;
    align-content: start;
}

#beamerview.mode-question #beamer-board-wrap,
#beamerview.mode-question #mcstats {
    display: none;
}

#beamerview.mode-question #beamer-frage,
#beamerview.mode-question #beamer-medienbereich {
    display: block;
}

#beamerview.mode-result #beamer-stage {
    align-content: center;
}

#beamerview.mode-result #beamer-board-wrap,
#beamerview.mode-result #progressbar {
    display: none;
}

#beamerview.mode-result #mcstats {
    display: block;
}

#beamerview:has(#beamer-estimate-result.is-visible) #beamer-frage,
#beamerview:has(#beamer-estimate-result.is-visible) #beamer-medienbereich,
#beamerview:has(#beamer-estimate-result.is-visible) #beamer-board-wrap,
#beamerview:has(#beamer-estimate-result.is-visible) #progressbar,
#beamerview:has(#beamer-estimate-result.is-visible) #beamer-playerlist-panel,
#beamerview:has(#beamer-buzzer-result.is-visible) #beamer-board-wrap,
#beamerview:has(#beamer-buzzer-result.is-visible) #progressbar,
#beamerview:has(#beamer-buzzer-result.is-visible) #beamer-playerlist-panel {
    visibility: hidden;
}

#beamer-estimate-result {
    position: fixed;
    inset: 0;
    z-index: 40;
    padding: clamp(18px, 4vw, 56px);
    background: rgba(8, 13, 20, .46);
    backdrop-filter: blur(2px);
    pointer-events: none;
}

#beamer-estimate-result.is-visible {
    display: grid;
    place-items: center;
    pointer-events: auto;
}

#beamer-estimate-result .estimate-result-box {
    pointer-events: auto;
}

#beamer-buzzer-result {
    display: none;
    width: min(860px, 100%);
    justify-self: center;
    pointer-events: none;
}

#beamer-buzzer-result.is-visible {
    display: grid;
    place-items: center;
}

#beamer-buzzer-result .buzzer-result-box {
    pointer-events: auto;
}

.buzzer-result-box {
    position: relative;
    width: min(760px, 100%);
    padding: clamp(24px, 4vw, 44px);
    display: grid;
    gap: clamp(14px, 2vh, 22px);
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.buzzer-result-box.is-correct {
    border-color: color-mix(in srgb, var(--success) 42%, var(--line));
}

.buzzer-result-box.is-wrong {
    border-color: color-mix(in srgb, var(--danger) 42%, var(--line));
}

.buzzer-result-kicker {
    color: var(--muted);
    font-size: .98rem;
    font-weight: 850;
    text-transform: uppercase;
}

.buzzer-result-box h1 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(2.3rem, 6vw, 4.8rem);
    line-height: 1;
}

.buzzer-result-box.is-correct h1 {
    color: var(--success);
}

.buzzer-result-box.is-wrong h1 {
    color: var(--danger);
}

.buzzer-result-player {
    color: var(--accent-strong);
    font-size: clamp(1.25rem, 3vw, 2rem);
    font-weight: 900;
}

.buzzer-result-answer {
    display: grid;
    gap: 8px;
    padding: clamp(14px, 2.4vw, 22px);
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.buzzer-result-answer span {
    color: var(--muted);
    font-size: .95rem;
    font-weight: 850;
    text-transform: uppercase;
}

.buzzer-result-answer strong {
    overflow-wrap: anywhere;
    font-size: clamp(1.35rem, 3.4vw, 2.5rem);
    line-height: 1.15;
}

.buzzer-result-solution {
    background: color-mix(in srgb, var(--success-soft) 68%, var(--surface));
    border-color: color-mix(in srgb, var(--success) 32%, var(--line));
}

.cloze-result-box {
    position: relative;
    width: min(600px, calc(100vw - 40px));
    max-height: min(72vh, 760px);
    padding: clamp(20px, 3vw, 34px);
    margin-top: 36px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 18px;
    overflow: hidden;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.cloze-result-header {
    display: grid;
    gap: 8px;
    text-align: center;
}

.cloze-result-kicker {
    color: var(--muted);
    font-size: .95rem;
    font-weight: 850;
    text-transform: uppercase;
}

.cloze-result-header h1 {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: clamp(1.4rem, 3.2vw, 3.4rem);
    line-height: 1.08;
}

.cloze-result-summary {
    color: var(--muted);
    font-weight: 850;
}

.cloze-result-list {
    min-height: 0;
    display: grid;
    gap: 8px;
    overflow-y: auto;
    padding-right: 4px;
}

.cloze-result-row {
    display: grid;
    grid-template-columns: minmax(90px, .7fr) minmax(0px, 1.5fr) 64px;
    gap: 10px;
    align-items: center;
    min-width: 0;
    padding: 10px 12px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.cloze-result-row.is-correct {
    border-color: var(--success-line);
    background: color-mix(in srgb, var(--success-soft) 72%, var(--surface));
}

.cloze-result-row.is-wrong {
    border-color: var(--danger-line);
    background: color-mix(in srgb, var(--danger-soft) 72%, var(--surface));
}

.cloze-result-name,
.cloze-result-score {
    font-weight: 850;
}

.cloze-result-answer {
    overflow-wrap: anywhere;
    font-weight: 760;
}

.cloze-result-row > * {
    min-width: 0;
}

.cloze-result-answer,
.boss-result-wager {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.cloze-result-score {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.cloze-result-empty {
    padding: 18px;
    color: var(--muted);
    text-align: center;
    font-weight: 780;
}

#beamer-board-wrap {
    position: relative;
    width: 100%;
    margin: 0 auto;
    overflow: visible;
    align-self: center;
    justify-self: center;
    min-height: 0;
}

#beamer-board {
    width: 100%;
    min-width: min(820px, 100%);
    transform-origin: top center;
    will-change: transform;
    overflow: visible;
}

#beamer-playerlist-panel {
    position: fixed;
    top: 50%;
    right: 16px;
    z-index: 20;
    width: min(300px, calc(100vw - 72px));
    max-height: min(78vh, 680px);
    transform: translate(calc(100% + 16px), -50%);
    transition: transform .22s ease;
    pointer-events: none;
}

#beamer-playerlist-panel.is-open,
#beamer-playerlist-panel:focus-within {
    transform: translate(0, -50%);
    pointer-events: auto;
}

#beamer-playerlist-toggle {
    position: static;
    width: auto;
    min-height: 34px;
    padding: 7px 12px;
    color: var(--chat-header-ink);
    background: var(--chat-header);
    border: 0;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    font-weight: 780;
    line-height: 1.2;
    text-align: center;
    writing-mode: horizontal-tb;
    transform: none;
    user-select: none;
    pointer-events: auto;
}

#beamer-playerlist-content {
    padding: 14px;
    min-height: 220px;
    max-height: min(78vh, 680px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: color-mix(in srgb, var(--surface-alpha) 92%, transparent);
    backdrop-filter: blur(8px);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    pointer-events: auto;
}

#beamer-message-toast {
    position: fixed;
    left: 50%;
    bottom: 22px;
    z-index: 22;
    width: min(560px, calc(100vw - 40px));
    padding: 12px 16px;
    color: var(--ink);
    background: color-mix(in srgb, var(--surface-alpha) 94%, transparent);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    font-weight: 760;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 10px);
    transition: opacity .18s ease, transform .18s ease;
    backdrop-filter: blur(8px);
}

#beamer-message-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

#beamer-playerlist-content .panel-title {
    margin-bottom: 10px;
    text-align: left;
}

.beamer-playerrow {
    display: grid;
    grid-template-columns: 30px 30px minmax(0, 1fr) auto;
    gap: 9px;
    align-items: center;
    min-height: 40px;
    padding: 7px 8px;
    border-bottom: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.beamer-playerrow:nth-child(even) {
    background: color-mix(in srgb, var(--surface-soft) 64%, transparent);
}

.beamer-playerrow:last-child {
    border-bottom: 0;
}

.beamer-place,
.beamer-points {
    color: var(--accent-strong);
    font-weight: 850;
    font-variant-numeric: tabular-nums;
}

.beamer-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow-sm);
}

.beamer-name {
    min-width: 0;
    overflow: hidden;
    font-weight: 760;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#qrbox {
    position: fixed;
    top: 18px;
    left: 18px;
    z-index: 20;
}

#qrShowBtn {
    border-radius: 999px;
}

#qrmodal,
#podium-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--modal-backdrop);
    backdrop-filter: blur(8px);
    z-index: 9999;
}

#qrmodal-inner,
#podium-content {
    width: min(520px, 100%);
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

#qrmodal-inner .qr-desc,
#podium-content h2 {
    color: var(--ink);
    font-size: 1.35rem;
    font-weight: 850;
}

#qrmodal-inner .qr-img {
    width: min(260px, 70vw);
    height: auto;
    border-radius: var(--radius-md);
}

#qrmodal-inner .qr-hint {
    margin: 12px 0;
    color: var(--muted);
    font-size: .92rem;
}

#podium-rows {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}

.podium-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.podium-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 92px;
}

.podium-player-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.podium-rank-label {
    margin-bottom: 10px;
    color: var(--ink);
    font-weight: 820;
    text-align: center;
}

.podium-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow-sm);
}

.podium-avatar-large {
    width: 74px;
    height: 74px;
}

.podium-name {
    color: var(--ink);
    font-weight: 780;
}

.podium-name-large {
    margin-top: 10px;
    font-size: 1.18rem;
}

.podium-points {
    margin-top: 4px;
    color: var(--muted);
    font-size: .98rem;
    font-weight: 700;
}

.podium-place {
    margin-top: 7px;
    color: var(--label);
    font-weight: 820;
}

.podium-bar {
    width: 58px;
    margin-top: 12px;
    border-radius: 12px 12px 0 0;
    box-shadow: var(--shadow-sm);
}

.podium-rank-0 .podium-bar {
    height: 86px;
    background: #a8adad;
}

.podium-rank-1 .podium-bar {
    height: 120px;
    background: #f9d145;
}

.podium-rank-2 .podium-bar {
    height: 62px;
    background: #d6903a;
}

#podiumCloseBtn {
    width: auto;
    margin-top: 24px;
}

#videoelem {
    display: block;
    max-width: min(960px, 92vw);
    max-height: 58vh;
    margin: 0 auto 16px;
    background: #111827;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

audio {
    width: min(520px, 100%);
}

.reveal-img-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: min(420px, 55vh);
    margin: 18px 0;
}

.reveal-img {
    max-width: 92vw;
    max-height: 64vh;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    image-rendering: pixelated;
}

.reveal-img.inline {
    display: block;
    margin: 12px auto 0;
}

.autohost-panel {
    width: 100%;
    padding: 16px;
}

.autohost-title {
    margin-bottom: 12px;
    color: var(--ink);
    font-weight: 850;
}

.host-settings-title {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.host-settings-title > div {
    display: grid;
    gap: 2px;
}

.host-settings-title strong {
    color: var(--ink);
    font-size: 1.05rem;
}

.host-settings-kicker {
    color: var(--label);
    font-size: .78rem;
    font-weight: 820;
    text-transform: uppercase;
}

.host-settings-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.host-settings-section {
    display: grid;
    align-content: start;
    gap: 10px;
    min-width: 0;
    padding: 12px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.host-settings-section-primary {
    border-left: 4px solid var(--primary);
}

.host-settings-section-head {
    display: grid;
    gap: 2px;
}

.host-settings-section-head h3 {
    margin: 0;
    color: var(--ink);
    font-size: .98rem;
    line-height: 1.15;
}

.host-settings-section-head span {
    color: var(--label);
    font-size: .78rem;
    font-weight: 700;
}

.host-settings-pair,
.autohost-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.autohost-actions .quiz-btn,
.autohost-panel .quiz-btn {
    width: 100%;
}

.autohost-input {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px;
    gap: 8px;
    align-items: center;
    min-width: 0;
    padding: 8px 9px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.autohost-input label {
    min-width: 0;
    color: var(--label);
    font-size: .84rem;
    line-height: 1.2;
}

.autohost-input input[type="number"] {
    min-height: 36px;
    padding: 7px 8px;
    text-align: right;
}

.autohost-input.autohost-toggle {
    grid-template-columns: minmax(0, 1fr) 28px;
}

.autohost-input.autohost-toggle input {
    width: 18px;
    height: 18px;
    justify-self: end;
}

.autohost-status {
    flex: 0 0 auto;
    padding: 9px 12px;
    border-radius: 999px;
    font-weight: 820;
    white-space: nowrap;
}

.autohost-status.is-off {
    color: #475467;
    background: #eef2f6;
}

.autohost-status.is-on {
    color: var(--success-ink);
    background: var(--success-soft);
}

.fastest-badge {
    position: fixed;
    top: 86px;
    left: 18px;
    z-index: 9999;
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px 14px;
    color: var(--ink);
    background: var(--surface-alpha);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: var(--shadow-md);
    font-weight: 780;
    opacity: 0;
    transform: translateY(-12px);
    transition: transform .22s ease, opacity .22s ease;
}

.fastest-badge.show {
    opacity: 1;
    transform: translateY(0);
}

.fastest-badge .dot {
    width: 10px;
    height: 10px;
    background: var(--warning);
    border-radius: 50%;
    box-shadow: 0 0 0 5px rgba(244, 178, 63, .18);
}

.fastest-badge .label {
    white-space: nowrap;
}

#chatbox-panel {
    width: min(420px, calc(100vw - 32px));
    margin: 28px auto 0;
    overflow: hidden;
}

#chatbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    color: var(--chat-header-ink);
    background: var(--chat-header);
    cursor: pointer;
    font-weight: 800;
    user-select: none;
}

#chatbox-content {
    display: none;
    padding: 12px;
    background: var(--surface);
}

#messages {
    display: grid;
    gap: 8px;
    max-height: 160px;
    min-height: 56px;
    margin: 0 0 12px;
    padding: 0;
    overflow-y: auto;
    list-style: none;
}

.message-row,
.message-row.system,
.message-row.own {
    padding: 9px 11px;
    border-radius: var(--radius-sm);
    font-size: .95rem;
    word-break: break-word;
}

.message-row {
    color: var(--ink);
    background: var(--surface-soft);
}

.message-row.system {
    color: #475467;
    background: #f1f4f8;
    font-style: italic;
}

.message-row.own {
    color: #064e3b;
    background: #dcfce7;
}

#chatbox-send-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

#msgInput {
    min-width: 0;
}

#sendBtn.msg-btn {
    width: auto;
    padding-inline: 18px;
}

@media (max-width: 920px) {
    body {
        padding: 16px;
    }

    .host-flex-row {
        grid-template-columns: 1fr;
    }

    .playerlist {
        width: 100%;
    }

    .host-side-col {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .host-settings-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #qrbox {
        position: fixed;
        top: 12px;
        left: 12px;
        width: auto;
        margin: 0;
    }

    #beamer-statusbar {
        position: sticky;
        top: 6px;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "room actions"
            "main main";
    }

    #beamer-statusbar .beamer-status-group:first-child {
        grid-area: room;
    }

    .beamer-status-main {
        grid-area: main;
        min-width: 0;
    }

    .beamer-status-actions {
        grid-area: actions;
    }

    #beamer-playerlist-panel {
        position: fixed;
        top: auto;
        right: 12px;
        bottom: 12px;
        left: 12px;
        width: auto;
        max-height: min(58vh, 440px);
        margin: 0;
        transform: translateY(calc(100% - 92px));
    }

    #beamer-playerlist-panel.is-open,
    #beamer-playerlist-panel:focus-within {
        transform: translateY(0);
    }

    #beamer-playerlist-toggle {
        position: static;
        width: 100%;
        min-height: 44px;
        padding: 11px 14px;
        border-radius: var(--radius-sm) var(--radius-sm) 0 0;
        box-shadow: var(--shadow-sm);
        text-align: center;
        writing-mode: horizontal-tb;
        transform: none;
    }

    #beamer-playerlist-content {
        min-height: 150px;
        max-height: calc(min(58vh, 440px) - 44px);
        border-top: 0;
        border-right: 1px solid var(--line);
        border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    }

    #beamer-playerlist-panel:not(.is-open):not(:focus-within) #beamer-playerlist-content {
        min-height: 0;
        max-height: 52px;
        overflow: hidden;
        padding-top: 6px;
        padding-bottom: 6px;
    }

    #beamer-playerlist-panel:not(.is-open):not(:focus-within) .panel-title,
    #beamer-playerlist-panel:not(.is-open):not(:focus-within) .beamer-playerrow:nth-of-type(n+4) {
        display: none;
    }

    #beamer-playerlist-panel:not(.is-open):not(:focus-within) .beamer-playerrow {
        display: inline-grid;
        width: calc(33.333% - 7px);
        grid-template-columns: 24px minmax(0, 1fr) auto;
        min-height: 36px;
        padding: 4px 6px;
        border-bottom: 0;
        border-right: 1px solid var(--line);
        border-radius: 0;
        background: transparent;
    }

    #beamer-playerlist-panel:not(.is-open):not(:focus-within) .beamer-playerrow:nth-of-type(3) {
        border-right: 0;
    }

    #beamer-playerlist-panel:not(.is-open):not(:focus-within) .beamer-avatar {
        display: none;
    }
}

@media (max-height: 520px) {
    body {
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .logo-headline-row {
        margin-bottom: 8px;
    }

    .logo-img {
        width: 42px;
        height: 42px;
    }

    .headline-title {
        font-size: 2rem;
    }

    .frage-anzeige {
        margin: 8px auto;
        padding: 14px 18px;
    }

    #beamerview {
        min-height: calc(100vh - 70px);
        padding-bottom: 8px;
    }

    #beamer-stage {
        min-height: calc(100vh - 86px);
        max-height: calc(100vh - 70px);
        padding-top: 0;
        padding-bottom: 0;
        gap: 8px;
    }

    #beamer-playerlist-content {
        max-height: calc(100vh - 74px);
    }
}

@media (max-width: 680px) {
    body {
        padding: 12px;
    }

    .logo-headline-row {
        justify-content: flex-start;
    }

    .logo-img {
        width: 48px;
        height: 48px;
    }

    #loginForm,
    .host-main-col,
    .autohost-panel,
    .host-dashboard,
    .playerlist {
        padding: 14px;
        border-radius: var(--radius-md);
    }

    .host-side-col,
    .host-dashboard-grid,
    .host-settings-grid,
    .host-settings-pair,
    .autohost-actions {
        grid-template-columns: 1fr;
    }

    .host-settings-title {
        align-items: flex-start;
        flex-direction: column;
    }

    table {
        min-width: 560px;
        border-spacing: 5px;
        padding: 5px;
    }

    button.board-btn {
        min-height: 58px;
    }

    .mc-beamer-grid {
        grid-template-columns: 1fr;
    }

    .mc-beamer-grid .mcopt {
        min-height: auto;
    }

    .mcstat-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .mcstat-count {
        text-align: left;
    }

    #beamer-estimate-result {
        padding: 14px;
    }

    .estimate-result-box {
        width: 100%;
        max-height: 76vh;
    }

    .estimate-result-header {
        padding: 16px;
    }

    .estimate-result-scroll {
        padding: 14px;
    }

    .estimate-bars-outer {
        grid-template-columns: 1fr;
    }

    .estimate-bar-labelcol {
        display: none;
    }

    .estimate-bar-wrap {
        width: 100%;
    }

    .autohost-input {
        grid-template-columns: 1fr;
    }

    #chatbox-send-box {
        grid-template-columns: 1fr;
    }

    #sendBtn.msg-btn {
        width: 100%;
    }

    #podium-rows {
        gap: 6px;
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 8px;
    }
}
