:root {
    --topbar-height: 60px;
    --bg: #070709;
    --panel: #111116;
    --panel-2: #18181f;
    --line: #34343f;
    --text: #f4f4f5;
    --muted: #a3a3ad;
    --red: #c1121f;
    --red-bright: #ef233c;
    --gold: #f2b134;
    --body-background: radial-gradient(circle at top right, #28040a 0, var(--bg) 34rem);
    --topbar-bg: rgba(7, 7, 9, 0.88);
    --panel-glass: rgba(17, 17, 22, 0.96);
    --panel-gradient-end: #0d0d11;
    --accent-shadow: transparent;
}

.quiz-rating-summary {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 10px;
    color: var(--muted);
}

.quiz-rating-summary strong,
.quiz-rating-stars {
    color: var(--gold);
}

.public-quiz-search {
    display: grid;
    gap: 8px;
    margin-bottom: 24px;
}

.public-quiz-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.image-block-upload-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.image-block-upload-row .uploaded-file-input {
    flex: 1 1 18rem;
}

.image-clipboard-error {
    display: block;
}

.quiz-rating-panel {
    width: min(100%, 520px);
    margin: 24px auto 0;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel);
    text-align: center;
}

.quiz-rating-form {
    display: grid;
    justify-items: center;
    gap: 16px;
}

.star-rating {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 0;
    margin: 0;
    padding: 0;
}

.star-rating legend {
    width: 100%;
    margin-bottom: 8px;
    color: var(--muted);
}

.star-rating input {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    opacity: 0;
}

.star-rating label:not(.zero-rating) {
    color: var(--line);
    font-size: clamp(2rem, 10vw, 3.4rem);
    line-height: 1;
    cursor: pointer;
    transition: color 120ms ease, transform 120ms ease;
}

.star-rating label:not(.zero-rating):hover,
.star-rating label:not(.zero-rating):hover ~ label:not(.zero-rating),
.star-rating input:checked ~ label:not(.zero-rating) {
    color: var(--gold);
}

.star-rating label:not(.zero-rating):hover {
    transform: scale(1.08);
}

.star-rating input:focus-visible + label {
    outline: 2px solid var(--red-bright);
    outline-offset: 3px;
}

.quiz-rating-form.is-saved .star-rating {
    filter: drop-shadow(0 0 8px color-mix(in srgb, var(--gold) 38%, transparent));
}

.quiz-rating-save-state:not(:empty) {
    color: var(--red-bright);
}

@media (max-width: 560px) {
    .public-quiz-search-row {
        grid-template-columns: 1fr;
    }
}

html[data-theme="crimson-night"] {
    --bg: #09070b;
    --panel: #151118;
    --panel-2: #211820;
    --line: #4a3038;
    --text: #fff7f7;
    --muted: #bca8ad;
    --red: #b91c35;
    --red-bright: #ff4964;
    --gold: #ffbf69;
    --body-background: radial-gradient(circle at 92% 0, rgba(145, 18, 47, 0.34) 0, transparent 34rem), radial-gradient(circle at 8% 100%, rgba(255, 73, 100, 0.15) 0, transparent 30rem), var(--bg);
    --topbar-bg: rgba(9, 7, 11, 0.9);
    --panel-glass: rgba(21, 17, 24, 0.96);
    --panel-gradient-end: #100b12;
    --accent-shadow: rgba(255, 73, 100, 0.28);
}

html[data-theme="arctic-neon"] {
    --bg: #050b14;
    --panel: #0c1725;
    --panel-2: #12263a;
    --line: #294862;
    --text: #eefaff;
    --muted: #91a9bd;
    --red: #087f9c;
    --red-bright: #35d9ff;
    --gold: #a78bfa;
    --body-background: radial-gradient(circle at 92% 0, rgba(0, 171, 210, 0.27) 0, transparent 34rem), radial-gradient(circle at 8% 100%, rgba(53, 217, 255, 0.14) 0, transparent 30rem), var(--bg);
    --topbar-bg: rgba(5, 11, 20, 0.9);
    --panel-glass: rgba(12, 23, 37, 0.96);
    --panel-gradient-end: #07111d;
    --accent-shadow: rgba(53, 217, 255, 0.25);
}

html[data-theme="emerald-stage"] {
    --bg: #07100d;
    --panel: #0d1b16;
    --panel-2: #142820;
    --line: #315345;
    --text: #f3fbf5;
    --muted: #9bb5a6;
    --red: #0d7b58;
    --red-bright: #35d399;
    --gold: #eabf55;
    --body-background: radial-gradient(circle at 92% 0, rgba(25, 145, 101, 0.28) 0, transparent 34rem), radial-gradient(circle at 8% 100%, rgba(53, 211, 153, 0.14) 0, transparent 30rem), var(--bg);
    --topbar-bg: rgba(7, 16, 13, 0.9);
    --panel-glass: rgba(13, 27, 22, 0.96);
    --panel-gradient-end: #091510;
    --accent-shadow: rgba(53, 211, 153, 0.24);
}

html[data-theme="royal-violet"] {
    --bg: #0d0815;
    --panel: #191126;
    --panel-2: #28183b;
    --line: #51376b;
    --text: #fbf7ff;
    --muted: #b7a4c9;
    --red: #7c3aed;
    --red-bright: #c084fc;
    --gold: #f472b6;
    --body-background: radial-gradient(circle at 92% 0, rgba(124, 58, 237, 0.3) 0, transparent 34rem), radial-gradient(circle at 8% 100%, rgba(192, 132, 252, 0.14) 0, transparent 30rem), var(--bg);
    --topbar-bg: rgba(13, 8, 21, 0.9);
    --panel-glass: rgba(25, 17, 38, 0.96);
    --panel-gradient-end: #110a1c;
    --accent-shadow: rgba(192, 132, 252, 0.25);
}

html[data-theme="sunset-orange"] {
    --bg: #120b06;
    --panel: #21140b;
    --panel-2: #352012;
    --line: #674126;
    --text: #fff8f1;
    --muted: #cbb19a;
    --red: #c6530a;
    --red-bright: #ff8a2a;
    --gold: #ffd166;
    --body-background: radial-gradient(circle at 92% 0, rgba(255, 122, 24, 0.32) 0, transparent 34rem), radial-gradient(circle at 8% 100%, rgba(255, 193, 77, 0.12) 0, transparent 30rem), var(--bg);
    --topbar-bg: rgba(18, 11, 6, 0.9);
    --panel-glass: rgba(33, 20, 11, 0.96);
    --panel-gradient-end: #180e08;
    --accent-shadow: rgba(255, 138, 42, 0.27);
}

html[data-theme="daylight"] {
    --bg: #eef2f7;
    --panel: #ffffff;
    --panel-2: #dfe7f0;
    --line: #b8c4d3;
    --text: #182230;
    --muted: #5f6f82;
    --red: #315f9d;
    --red-bright: #447dc6;
    --gold: #b56b0a;
    --body-background: radial-gradient(circle at 92% 0, rgba(68, 125, 198, 0.18) 0, transparent 34rem), linear-gradient(145deg, #f8fafc, var(--bg));
    --topbar-bg: rgba(255, 255, 255, 0.88);
    --panel-glass: rgba(255, 255, 255, 0.94);
    --panel-gradient-end: #e8eef5;
    --accent-shadow: rgba(49, 95, 157, 0.2);
}

html[data-theme="warm-parchment"] {
    --bg: #e8ddc8;
    --panel: #f5ecd9;
    --panel-2: #ddd0b8;
    --line: #b8a589;
    --text: #392f27;
    --muted: #75675a;
    --red: #a64b2a;
    --red-bright: #cf6841;
    --gold: #8d681e;
    --body-background: radial-gradient(circle at 92% 0, rgba(207, 104, 65, 0.16) 0, transparent 34rem), linear-gradient(145deg, #f1e8d6, var(--bg));
    --topbar-bg: rgba(245, 236, 217, 0.9);
    --panel-glass: rgba(245, 236, 217, 0.95);
    --panel-gradient-end: #d4c5aa;
    --accent-shadow: rgba(166, 75, 42, 0.2);
}

html[data-theme="mint-fog"] {
    --bg: #dce8e3;
    --panel: #edf5f1;
    --panel-2: #c9dbd3;
    --line: #9db8ad;
    --text: #20342d;
    --muted: #5b746a;
    --red: #18705c;
    --red-bright: #2b9479;
    --gold: #8a6420;
    --body-background: radial-gradient(circle at 92% 0, rgba(43, 148, 121, 0.17) 0, transparent 34rem), linear-gradient(150deg, #edf3f0, var(--bg));
    --topbar-bg: rgba(237, 245, 241, 0.9);
    --panel-glass: rgba(237, 245, 241, 0.95);
    --panel-gradient-end: #c1d5cc;
    --accent-shadow: rgba(24, 112, 92, 0.2);
}

html[data-theme="ukrainian-sky"] {
    --bg: #061529;
    --panel: #0b2545;
    --panel-2: #123a66;
    --line: #2d5e8d;
    --text: #f7fbff;
    --muted: #a9c4dd;
    --red: #0057b8;
    --red-bright: #2f80ed;
    --gold: #ffd700;
    --body-background: linear-gradient(160deg, rgba(0, 87, 184, 0.32) 0 48%, rgba(255, 215, 0, 0.13) 52% 100%), var(--bg);
    --topbar-bg: rgba(6, 21, 41, 0.9);
    --panel-glass: rgba(11, 37, 69, 0.96);
    --panel-gradient-end: #071c35;
    --accent-shadow: rgba(255, 215, 0, 0.2);
}

html[data-theme="italian-spirit"] {
    --bg: #0b1511;
    --panel: #12221a;
    --panel-2: #1b3428;
    --line: #3d5f4e;
    --text: #fffaf7;
    --muted: #b7c5bd;
    --red: #008c45;
    --red-bright: #20b86a;
    --gold: #f05a5a;
    --body-background: linear-gradient(120deg, rgba(0, 140, 69, 0.2), transparent 38%), linear-gradient(240deg, rgba(205, 33, 42, 0.18), transparent 38%), var(--bg);
    --topbar-bg: rgba(11, 21, 17, 0.9);
    --panel-glass: rgba(18, 34, 26, 0.96);
    --panel-gradient-end: #0d1a14;
    --accent-shadow: rgba(32, 184, 106, 0.22);
}

html[data-theme="pride-spectrum"] {
    --bg: #100b18;
    --panel: #1a1325;
    --panel-2: #291b38;
    --line: #5a3c70;
    --text: #fff8ff;
    --muted: #c4accb;
    --red: #c22d8f;
    --red-bright: #ff69c7;
    --gold: #ffd166;
    --body-background: radial-gradient(circle at 12% 10%, rgba(228, 3, 3, 0.18) 0, transparent 24rem), radial-gradient(circle at 38% 0, rgba(255, 140, 0, 0.15) 0, transparent 22rem), radial-gradient(circle at 64% 0, rgba(255, 237, 0, 0.12) 0, transparent 22rem), radial-gradient(circle at 86% 18%, rgba(0, 128, 38, 0.15) 0, transparent 24rem), radial-gradient(circle at 92% 75%, rgba(0, 77, 255, 0.17) 0, transparent 28rem), radial-gradient(circle at 8% 82%, rgba(117, 7, 135, 0.2) 0, transparent 28rem), var(--bg);
    --topbar-bg: rgba(16, 11, 24, 0.9);
    --panel-glass: rgba(26, 19, 37, 0.96);
    --panel-gradient-end: #120c1b;
    --accent-shadow: rgba(255, 105, 199, 0.25);
}

html[data-theme="retro-arcade"] {
    --bg: #07081a;
    --panel: #10132b;
    --panel-2: #1a2040;
    --line: #39427a;
    --text: #f8f7ff;
    --muted: #a9add1;
    --red: #be1f91;
    --red-bright: #ff43d1;
    --gold: #b8f34a;
    --body-background: radial-gradient(circle at 88% 0, rgba(255, 67, 209, 0.27) 0, transparent 32rem), radial-gradient(circle at 8% 100%, rgba(184, 243, 74, 0.12) 0, transparent 28rem), var(--bg);
    --topbar-bg: rgba(7, 8, 26, 0.9);
    --panel-glass: rgba(16, 19, 43, 0.96);
    --panel-gradient-end: #090b20;
    --accent-shadow: rgba(255, 67, 209, 0.26);
}

html[data-theme="custom"] {
    --line: color-mix(in srgb, var(--panel-2) 72%, var(--text));
    --body-background: radial-gradient(circle at 92% 0, color-mix(in srgb, var(--red-bright) 26%, transparent) 0, transparent 34rem), radial-gradient(circle at 8% 100%, color-mix(in srgb, var(--gold) 14%, transparent) 0, transparent 30rem), var(--bg);
    --topbar-bg: color-mix(in srgb, var(--bg) 90%, transparent);
    --panel-glass: color-mix(in srgb, var(--panel) 96%, transparent);
    --panel-gradient-end: color-mix(in srgb, var(--panel) 76%, var(--bg));
    --accent-shadow: color-mix(in srgb, var(--red-bright) 25%, transparent);
}

* {
    box-sizing: border-box;
}

html {
    font-family: Inter, Segoe UI, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--body-background);
    background-attachment: fixed;
}

body.portal-layout {
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

.topbar {
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    border-bottom: 1px solid var(--line);
    background: var(--topbar-bg);
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(14px);
}

.brand {
    font-weight: 900;
    letter-spacing: 0.08em;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    order: 1;
}

.topbar-page-context {
    order: 2;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-header-context {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.game-header-context h2 {
    max-width: min(38vw, 32rem);
    margin: 0;
    overflow: hidden;
    font-size: clamp(1rem, 1.45vw, 1.35rem);
    text-overflow: ellipsis;
    white-space: nowrap;
}

    .brand span {
        color: var(--red-bright);
    }

.brand-logo {
    display: block;
    width: auto;
    height: 44px;
    max-width: min(280px, 28vw);
    object-fit: contain;
}

.brand-logo-input-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo-preview {
    width: 140px;
    height: 54px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 4px;
    background: transparent;
}

.topbar nav {
    display: flex;
    gap: 22px;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.15;
}

.action-menu {
    position: relative;
    flex: 0 0 auto;
}

.action-menu > summary {
    list-style: none;
}

.action-menu > summary::-webkit-details-marker {
    display: none;
}

.action-menu-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.action-menu[open] > .action-menu-trigger {
    border-color: var(--red-bright);
}

.action-menu-popover {
    position: absolute;
    top: calc(100% + 0.55rem);
    right: 0;
    z-index: 120;
    display: grid;
    min-width: 15rem;
    max-width: min(22rem, calc(100vw - 2rem));
    padding: 0.45rem;
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    background: var(--panel);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.action-menu-popover form {
    display: contents;
}

.action-menu-popover form[hidden],
.action-menu-popover .action-menu-item[hidden] {
    display: none !important;
}

.action-menu-item {
    display: block;
    width: 100%;
    padding: 0.7rem 0.8rem;
    border: 0;
    border-radius: 0.55rem;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    white-space: normal;
    cursor: pointer;
}

.action-menu-item:hover,
.action-menu-item:focus-visible,
.action-menu-item.active {
    background: var(--panel-2);
    color: var(--text);
    outline: none;
}

.action-menu-item:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.action-menu-danger {
    color: color-mix(in srgb, #ef233c 82%, var(--text));
}

.action-menu-separator {
    height: 1px;
    margin: 0.35rem 0.25rem;
    background: var(--line);
}

.header-action-menu .action-menu-popover {
    min-width: 17rem;
}

.header-action-menu {
    order: 4;
    margin-left: 0.65rem;
}

.quiz-action-menu .action-menu-popover,
.board-action-menu .action-menu-popover {
    min-width: 16rem;
}

    .topbar nav a:hover {
        color: var(--red-bright);
    }

.page-shell {
    width: 100%;
    padding: 34px;
    max-width: 1800px;
    margin: 0 auto;
}

.portal-layout > .page-shell {
    flex: 1 0 auto;
}

/* Portal footer */

.portal-footer {
    display: block;
    flex: 0 0 auto;
    border-top: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
    background: color-mix(in srgb, var(--panel-glass) 88%, transparent);
    color: var(--muted);
}

.portal-footer-inner {
    width: min(100%, 1800px);
    margin: 0 auto;
    padding: 24px 34px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.75fr);
    align-items: center;
    gap: 24px clamp(32px, 6vw, 80px);
}

.portal-footer p {
    margin: 0;
}

.portal-footer-credits,
.portal-footer-support {
    min-width: 0;
    display: grid;
    gap: 8px;
}

.portal-footer-authorship {
    color: var(--text);
    font-weight: 700;
}

.portal-footer-contributors {
    min-height: 1.5em;
    overflow-wrap: anywhere;
}

.portal-footer-name {
    display: inline-grid;
    max-width: 100%;
    vertical-align: top;
    color: var(--gold);
    font-weight: 700;
    transition: opacity 160ms ease;
}

.portal-footer-name > [data-footer-contributor] {
    grid-area: 1 / 1;
    min-width: 0;
    visibility: hidden;
    opacity: 0;
    overflow-wrap: anywhere;
}

.portal-footer-name > [data-footer-contributor][data-current="true"] {
    visibility: visible;
    opacity: 1;
}

.portal-footer.is-changing-contributor .portal-footer-name {
    opacity: 0;
}

.portal-footer-support {
    justify-items: start;
}

.portal-footer-support-link {
    margin: 0;
    padding: 0;
    color: var(--gold);
    background: transparent;
    border: 0;
    font-weight: 800;
    text-align: left;
    text-decoration: underline;
    text-underline-offset: 0.2em;
    cursor: pointer;
}

.portal-footer-support-link:hover {
    color: var(--red-bright);
}

.portal-footer-support-link:focus-visible,
.portal-footer-dialog a:focus-visible,
.portal-footer-dialog button:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 4px;
}

.portal-footer-dialog-card {
    display: grid;
    justify-items: center;
    gap: 18px;
    text-align: center;
}

.portal-footer-dialog-card .dialog-heading {
    width: 100%;
    align-items: center;
    text-align: left;
}

.portal-footer-qr {
    width: min(280px, 72vw);
    max-width: 100%;
    height: auto;
    padding: 10px;
    border-radius: 12px;
    background: #fff;
    image-rendering: pixelated;
}

@media (max-width: 700px) {
    .portal-footer-inner {
        grid-template-columns: minmax(0, 1fr);
        padding: 22px 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .portal-footer-name {
        transition: none;
    }
}

.hero {
    display: grid;
    align-content: center;
    max-width: 850px;
}

.page-shell:has(> .hero) {
    display: grid;
    align-items: center;
}

    .hero h1 {
        font-size: clamp(3rem, 8vw, 7rem);
        line-height: 0.92;
        margin: 12px 0 24px;
        letter-spacing: -0.055em;
    }

.hero-copy {
    max-width: 680px;
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--muted);
}

.hero-actions,
.form-actions,
.editor-actions,
.card-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.discord-button {
    gap: 9px;
}

.discord-button svg {
    width: 1.35em;
    height: 1.35em;
    flex: 0 0 auto;
}

.eyebrow {
    color: var(--red-bright);
    font-weight: 800;
    letter-spacing: 0.16em;
    font-size: 0.75rem;
}

.button {
    border: 1px solid var(--line);
    padding: 12px 18px;
    border-radius: 10px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
}

.button-primary {
    background: var(--red);
    border-color: var(--red-bright);
    color: white;
    box-shadow: 0 8px 24px var(--accent-shadow);
    transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

    .button-primary:hover {
        background: var(--red-bright);
        transform: translateY(-1px);
        box-shadow: 0 10px 30px var(--accent-shadow);
    }

.button-secondary {
    background: var(--panel);
    color: var(--text);
}

    .button-secondary:hover {
        border-color: #646473;
    }

.page-heading,
.editor-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.quiz-editor-toolbar {
    margin-bottom: 12px;
}

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

.page-heading h1,
.editor-toolbar h1 {
    margin-bottom: 0;
}

.quiz-list {
    display: grid;
    gap: 14px;
}

.quiz-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(145deg, var(--panel), var(--panel-gradient-end));
}

    .quiz-card p,
    .quiz-card small {
        color: var(--muted);
    }

.form-card,
.content-panel {
    background: var(--panel-glass);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 24px;
}

.narrow {
    max-width: 720px;
    margin: 30px auto;
}

.stack-form {
    display: grid;
    gap: 10px;
}

label {
    font-weight: 750;
}

input,
textarea,
select {
    width: 100%;
    background: color-mix(in srgb, var(--panel) 88%, var(--text));
    color: var(--text);
    border: 2px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px;
}

    input:focus,
    textarea:focus,
    select:focus {
        outline: none;
        border-color: var(--red-bright);
    }

textarea {
    resize: vertical;
}

.faq-page {
    width: min(920px, 100%);
    margin: 0 auto;
}

.faq-heading {
    margin-bottom: 24px;
}

.faq-list {
    display: grid;
    gap: 12px;
}

.faq-item {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel-glass);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .12);
}

.faq-item summary {
    position: relative;
    padding: 20px 54px 20px 22px;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 850;
    line-height: 1.35;
    cursor: pointer;
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: "+";
    position: absolute;
    top: 50%;
    right: 22px;
    color: var(--gold);
    font-size: 1.55rem;
    line-height: 1;
    transform: translateY(-50%);
}

.faq-item[open] summary {
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--red) 12%, var(--panel));
}

.faq-item[open] summary::after {
    content: "−";
}

.faq-answer {
    padding: 18px 22px 20px;
    color: var(--muted);
    line-height: 1.65;
}

.faq-answer p,
.faq-contact p {
    margin: 0;
}

.faq-contact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 28px;
}

.faq-contact h2 {
    margin: 0 0 8px;
}

@media (max-width: 640px) {
    .faq-item summary {
        padding: 17px 48px 17px 17px;
    }

    .faq-item summary::after {
        right: 17px;
    }

    .faq-answer {
        padding: 16px 17px 18px;
    }

    .faq-contact {
        align-items: stretch;
        flex-direction: column;
    }
}

.round-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.round-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.round-drag-handle {
    cursor: grab;
    color: var(--muted);
    font-size: 16px;
    user-select: none;
    opacity: .65;
    transition: .15s;
}

    .round-drag-handle:hover {
        opacity: 1;
        color: var(--gold);
    }

    .round-drag-handle:active {
        cursor: grabbing;
    }

    .round-tab.active {
        border-color: var(--gold);
        color: var(--gold);
    }

.round-tab-item {
    flex: 0 0 auto;
}

.round-tab-ghost {
    opacity: 0.3;
    border-color: var(--red-bright);
}

.round-tab-chosen {
    border-color: var(--gold);
}

.round-tab-dragging {
    opacity: 0.9;
    cursor: grabbing;
}

.round-add-button {
    flex: 0 0 auto;
}

.round-tab-link {
    display: inline-flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

    .round-tab-link:hover {
        color: inherit;
    }

.quiz-board-form {
    display: grid;
    gap: 14px;
}

.quiz-board-scroll {
    max-width: 100%;
    overflow: auto;
    border-radius: 12px;
    background: color-mix(in srgb, var(--bg) 88%, #000);
}

.quiz-board {
    display: flex;
    align-items: stretch;
    gap: 5px;
    width: 100%;
    min-width: 0;
    padding: 5px;
    box-sizing: border-box;
    background: color-mix(in srgb, var(--bg) 88%, #000);
}

.quiz-board-corner,
.category-cell,
.question-points-cell,
.question-cell {
    min-height: 120px;
    border: 1px solid var(--line);
    background: linear-gradient(145deg, var(--panel-2), var(--panel-gradient-end));
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}

.quiz-board-corner,
.category-cell {
    min-height: 105px;
    position: sticky;
    top: 0;
    z-index: 4;
}

.quiz-board-corner {
    left: 0;
    z-index: 6;
    background: linear-gradient(145deg, color-mix(in srgb, var(--red) 24%, var(--panel)), var(--panel-gradient-end));
}

.category-cell {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 900;
    text-transform: uppercase;
    padding: 12px 14px;
    background: linear-gradient(145deg, color-mix(in srgb, var(--red) 28%, var(--panel-2)), var(--panel));
}

.category-title {
    min-width: 0;
    text-align: center;
    overflow-wrap: anywhere;
}

.category-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.category-actions .icon-button {
    width: 36px;
    height: 36px;
    min-height: 36px;
    flex: 0 0 36px;
}

.question-points-cell {
    position: sticky;
    left: 0;
    z-index: 3;
    padding: 12px;
    background: linear-gradient(145deg, color-mix(in srgb, var(--red) 28%, var(--panel-2)), var(--panel));
}

.question-points-input {
    width: 100%;
    min-width: 0;
    padding: 10px 8px;
    border: 1px solid rgba(242, 177, 52, 0.45);
    background: var(--panel-gradient-end);
    color: var(--gold);
    text-align: center;
    font-size: 1.18rem;
    font-weight: 950;
    font-variant-numeric: tabular-nums;
}

.question-points-input:hover,
.question-points-input:focus {
    border-color: var(--gold);
}

.quiz-board-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quiz-board-primary-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.question-cell:hover {
    border-color: var(--red-bright);
    transform: translateY(-1px);
}

.question-cell.filled {
    background: linear-gradient(145deg, color-mix(in srgb, var(--red) 18%, var(--panel-2)), var(--panel));
}

.question-editor-preview {
    display: flex;
    min-width: 0;
    max-width: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 30px 12px 31px;
}

.question-editor-preview img {
    display: block;
    width: min(100%, 110px);
    height: 56px;
    border-radius: 7px;
    object-fit: contain;
}

.question-editor-preview-text {
    display: -webkit-box;
    overflow: hidden;
    color: var(--text);
    font-size: .82rem;
    font-weight: 750;
    line-height: 1.25;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.question-editor-preview-media {
    color: var(--gold);
    font-size: 1.8rem;
    line-height: 1;
}

.question-editor-preview-type {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.question-completion {
    position: absolute;
    right: 8px;
    bottom: 7px;
    left: 8px;
    display: flex;
    justify-content: center;
    gap: 5px;
}

.question-completion-item {
    padding: 2px 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: color-mix(in srgb, var(--panel) 88%, transparent);
    font-size: .64rem;
    font-weight: 900;
    line-height: 1.2;
}

.question-completion-item.complete {
    border-color: color-mix(in srgb, #238636 68%, var(--line));
    color: color-mix(in srgb, #238636 72%, var(--text));
    background: color-mix(in srgb, #238636 14%, var(--panel));
}

.question-cell-slot {
    position: relative;
    min-width: 0;
    min-height: 0;
    height: 100%;
    cursor: grab;
}

.question-cell-slot .question-cell {
    width: 100%;
    height: 100%;
}

.question-cell-slot:active {
    cursor: grabbing;
}

.question-card-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.question-card-actions .icon-button {
    width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    opacity: .82;
}

.question-card-actions .icon-button:hover,
.question-card-actions .icon-button:focus-visible {
    opacity: 1;
}

.question-card-actions .js-question-delete {
    opacity: 0;
    pointer-events: none;
    transition: opacity 140ms ease;
}

.question-cell-slot:hover .js-question-delete,
.question-cell-slot:focus-within .js-question-delete {
    opacity: .82;
    pointer-events: auto;
}

.question-cell-dragging {
    opacity: .42;
}

.question-cell-drop-target .question-cell {
    border-color: var(--gold);
    box-shadow: inset 0 0 0 2px var(--gold), 0 0 18px var(--accent-shadow);
}

.question-editor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

.panel-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--line);
    margin-bottom: 16px;
}

    .panel-title-row h2 {
        margin-bottom: 14px;
    }

.type-tabs {
    display: flex;
    gap: 6px;
}

.type-tab {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    font-weight: 900;
    cursor: pointer;
}

    .type-tab.active {
        background: var(--red);
        border-color: var(--red-bright);
    }

.editor-type-panel {
    display: none;
    gap: 10px;
}

    .editor-type-panel.active {
        display: grid;
    }

.drop-zone {
    min-height: 150px;
    border: 2px dashed #686876;
    border-radius: 10px;
    background: #d9d9e2;
    color: #15151b;
    display: grid;
    place-content: center;
    text-align: center;
    padding: 20px;
}

    .drop-zone small {
        color: #62626e;
        margin-top: 8px;
    }

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

    .checkbox-row input {
        width: auto;
    }

.editor-actions {
    justify-content: center;
    margin-top: 24px;
}

@media (max-width: 900px) {
    .page-shell {
        padding: 20px;
    }

    .topbar {
        padding: 0 18px;
    }

    .question-editor-grid {
        grid-template-columns: 1fr;
    }

    .editor-toolbar,
    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .quiz-board {
        grid-template-columns: 88px repeat(var(--columns), minmax(130px, 1fr));
    }

    .quiz-board-corner,
    .category-cell,
    .question-points-cell,
    .question-cell {
        min-height: 100px;
    }

    .question-points-cell {
        padding: 8px;
    }

    .question-points-input {
        padding: 9px 4px;
        font-size: 1rem;
    }
}

.alert {
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 0.65rem;
}

.alert-success {
    border: 1px solid rgba(63, 185, 80, 0.45);
    background: rgba(63, 185, 80, 0.12);
}

.ajax-save-status {
    margin: 0;
    align-self: center;
}

.validation-summary,
.field-validation-error {
    color: #ff8d8d;
}

    .validation-summary:empty,
    .field-validation-valid {
        display: none;
    }

.language-selector {
    position: relative;
    margin-left: 22px;
    order: 3;
}

.language-button {
    width: 44px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    color: var(--text);
    cursor: pointer;
    font-size: 1.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .language-button:hover,
    .language-button:focus {
        border-color: var(--red-bright);
        outline: none;
    }

.language-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 185px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-glass);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    display: none;
    z-index: 100;
}

    .language-menu.open {
        display: grid;
    }

    .language-menu a {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        border-radius: 8px;
        color: var(--muted);
        white-space: nowrap;
        cursor: pointer;
    }

    .language-menu a:not(.active) {
        color: var(--muted);
    }

        .language-menu a:hover {
            background: var(--panel-2);
            color: var(--text);
        }

@media (max-width: 700px) {
    .topbar {
        gap: 12px;
    }

        .topbar nav {
            gap: 12px;
        }

    .language-selector {
        margin-left: 0;
    }
}

.language-menu a.active {
    background: var(--red);
    color: white;
}

#success-message {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

    #success-message.success-message-hidden {
        opacity: 0;
        transform: translateY(-6px);
    }

[data-auto-dismiss] {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

[data-auto-dismiss].message-hidden {
    opacity: 0;
    transform: translateY(-6px);
}

.content-block-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.content-block-add-menu {
    position: relative;
}

.content-block-type-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 20;
    min-width: 180px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-glass);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.content-block-type-option {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

    .content-block-type-option:hover {
        background: var(--panel-2);
    }

.content-block-card {
    position: relative;
    transition: opacity 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

    .content-block-card h3,
    .content-block-card h4,
    .content-block-card .content-block-title {
        padding-right: 76px;
    }

.content-block-toolbar {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 6px;
}

.content-block-drag-handle,
.content-block-remove-button {
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #9a9aa3;
    font-family: Arial, sans-serif;
    line-height: 1;
    opacity: 0.65;
    transition: opacity 0.15s, background-color 0.15s, color 0.15s;
}

.content-block-drag-handle {
    font-size: 18px;
    cursor: grab;
    user-select: none;
}

    .content-block-drag-handle:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--text);
        opacity: 1;
    }

    .content-block-drag-handle:active {
        cursor: grabbing;
    }

.content-block-remove-button {
    font-size: 24px;
    cursor: pointer;
}

    .content-block-remove-button:hover {
        background: rgba(220, 53, 69, 0.15);
        color: #ff6b6b;
        opacity: 1;
    }

.content-block-dragging {
    opacity: 0.45;
    transform: scale(0.99);
}

.content-block-drop-before {
    box-shadow: 0 -4px 0 0 var(--red-bright);
}

.content-block-drop-after {
    box-shadow: 0 4px 0 0 var(--red-bright);
}

.image-block-preview {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: color-mix(in srgb, var(--bg) 55%, transparent);
    text-align: center;
}

.image-block-preview-image {
    display: block;
    max-width: 100%;
    max-height: 420px;
    margin: 0 auto;
    border-radius: 8px;
    object-fit: contain;
}

.image-block-preview-top-caption,
.image-block-preview-bottom-caption {
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.image-block-preview-top-caption {
    margin-bottom: 10px;
}

.image-block-preview-bottom-caption {
    margin-top: 10px;
}

.image-block-preview-error {
    padding: 18px;
    color: #ff8d8d;
}

.stored-image-preview {
    margin-bottom: 12px;
}

.stored-image-preview-element {
    display: block;
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 8px;
}

.stored-file-info {
    font-size: 14px;
}

.stored-audio-preview {
    margin-bottom: 12px;
}

.stored-audio-preview-element {
    display: block;
    width: 100%;
    margin-bottom: 8px;
}

.audio-block-editor {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stored-file-preview {
    margin-bottom: 12px;
}

.remove-stored-file-button {
    margin-top: 8px;
}

/* Quiz management: rename and delete dialogs */

.quiz-card-content {
    min-width: 0;
}

.button-danger {
    color: #fff;
}

.button-danger {
    background: #9f101b;
    border-color: var(--red-bright);
}

    .button-danger:hover {
        background: var(--red-bright);
    }

.button-danger-outline {
    background: transparent;
    color: color-mix(in srgb, #d41f35 78%, var(--text));
    border-color: currentColor;
}

    .button-danger-outline:hover {
        color: color-mix(in srgb, #ef233c 82%, var(--text));
        background: color-mix(in srgb, #ef233c 12%, transparent);
        border-color: currentColor;
    }

.button:disabled,
.button[disabled],
.button-danger:disabled,
.button-danger-outline:disabled {
    color: var(--muted);
    background: var(--panel-2);
    border-color: var(--line);
    box-shadow: none;
    opacity: 0.72;
    cursor: not-allowed;
    transform: none;
}

.button:disabled:hover,
.button[disabled]:hover {
    color: var(--muted);
    background: var(--panel-2);
    border-color: var(--line);
    transform: none;
}

.icon-button {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 1.15rem;
}

.message {
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-weight: 700;
}

.message-success {
    background: rgba(46, 160, 67, .12);
    border-color: rgba(63, 185, 80, .55);
}

.message-error {
    background: rgba(239, 35, 60, .12);
    border-color: rgba(239, 35, 60, .62);
}

.app-dialog {
    width: min(580px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    padding: 0;
    overflow: auto;
    color: var(--text);
    background: transparent;
    border: 0;
}

    .app-dialog::backdrop {
        background: rgba(0, 0, 0, .76);
        backdrop-filter: blur(5px);
    }

.dialog-card {
    padding: 24px;
    color: var(--text);
    background: linear-gradient(145deg, var(--panel-2), var(--panel-gradient-end));
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
}

.dialog-card-danger {
    border-color: rgba(239, 35, 60, .55);
}

.game-settings-dialog {
    width: min(920px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
}

.game-settings-dialog-card {
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
}

.dialog-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

    .dialog-heading h2 {
        margin-bottom: 0;
    }

.dialog-close {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    background: var(--panel);
    cursor: pointer;
    font-size: 1.6rem;
    line-height: 1;
}

    .dialog-close:hover {
        border-color: var(--red-bright);
    }

.dialog-actions {
    justify-content: flex-end;
    margin-top: 24px;
}

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

.blocked-player-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 0.7rem;
    background: var(--panel);
}

.dialog-target {
    padding: 14px 16px;
    border-left: 3px solid var(--red-bright);
    background: color-mix(in srgb, var(--red-bright) 8%, transparent);
    font-size: 1.08rem;
    font-weight: 850;
    overflow-wrap: anywhere;
}

.dialog-warning {
    color: var(--muted);
}

@media (max-width: 700px) {
    .quiz-card {
        align-items: stretch;
        flex-direction: column;
    }

    .card-actions form {
        display: flex;
        flex: 1 1 auto;
    }

    .card-actions form .button {
        width: 100%;
    }

    .card-actions .button {
        flex: 1 1 auto;
    }
}

/* Quiz editor: round management */

.round-navigation {
    display: grid;
    justify-items: end;
    gap: 10px;
}

.round-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.round-action-button {
    min-height: 38px;
    padding: 8px 13px;
}

.alert-error {
    border: 1px solid rgba(239, 35, 60, 0.55);
    background: rgba(239, 35, 60, 0.12);
}

@media (max-width: 900px) {
    .round-navigation {
        width: 100%;
        justify-items: start;
    }

    .round-actions {
        justify-content: flex-start;
    }
}

/* Quiz editor: board point values */

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 700px) {
    .quiz-board-actions .button {
        width: 100%;
    }

    .quiz-board-primary-actions {
        width: 100%;
    }
}

.master-game-list {
    display: grid;
    gap: 18px;
}

.master-game-card {
    display: grid;
    gap: 18px;
}

.master-game-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.master-game-heading h2 {
    margin: 0 0 10px;
}

.master-game-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin: 0;
}

.master-game-details div {
    min-width: 0;
}

.master-game-details dt {
    color: var(--muted);
    font-size: 0.85rem;
}

.master-game-details dd {
    margin: 4px 0 0;
    overflow-wrap: anywhere;
}

.master-game-players h3 {
    margin-top: 0;
}

.master-game-players ul {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.master-game-players li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-2);
}

/* Quiz editor: draggable category columns */

.quiz-board-points-column {
    width: 104px;
    flex: 0 0 104px;
    display: grid;
    grid-template-rows: 105px repeat(var(--row-count, 5), 120px);
    gap: 5px;
    position: sticky;
    left: 0;
    z-index: 5;
}

.quiz-board-categories {
    display: flex;
    align-items: stretch;
    gap: 5px;
    flex: 1 1 auto;
    min-width: 0;
}

.quiz-board-category-column {
    flex: 1 1 160px;
    min-width: 160px;
    max-width: none;
    display: grid;
    grid-template-rows: 105px repeat(var(--row-count, 5), 120px);
    gap: 5px;
}

.category-cell,
.question-cell,
.question-points-cell,
.quiz-board-corner {
    min-height: 0;
    height: 100%;
}

.category-drag-handle {
    flex: 0 0 auto;
    cursor: grab;
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
    user-select: none;
    opacity: .65;
    transition: opacity .15s, color .15s;
}

.category-drag-handle:hover {
    color: var(--gold);
    opacity: 1;
}

.category-drag-handle:active {
    cursor: grabbing;
}

.category-column-ghost {
    opacity: .3;
}

.category-column-chosen .category-cell {
    border-color: var(--gold);
}

.category-column-dragging {
    opacity: .9;
    cursor: grabbing;
}

@media (max-width: 900px) {
    .quiz-board-points-column {
        width: 88px;
        flex-basis: 88px;
        grid-template-rows: 100px repeat(var(--row-count, 5), 100px);
    }

    .quiz-board-category-column {
        min-width: 130px;
        width: 130px;
        grid-template-rows: 100px repeat(var(--row-count, 5), 100px);
    }
}


/* Game lobby and player joining */

.game-code-panel {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 24px;
    border: 1px solid rgba(242, 177, 52, 0.5);
    border-radius: 12px;
    background: rgba(242, 177, 52, 0.08);
    text-align: center;
}

.game-code-panel span,
.game-code-panel small {
    color: var(--muted);
}

.game-code-panel strong {
    color: var(--gold);
    font-size: clamp(2.4rem, 10vw, 4.5rem);
    letter-spacing: 0.16em;
    line-height: 1;
}

.game-code-panel.compact strong {
    font-size: clamp(2rem, 9vw, 3.2rem);
}

.player-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.player-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--panel-2);
}

.player-list li.current-player {
    border-color: var(--gold);
}

.player-lobby h2 {
    margin-top: 22px;
}


/* Player presence */

.player-presence {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.presence-badge {
    min-width: 96px;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 850;
}

.presence-active {
    color: color-mix(in srgb, #238636 78%, var(--text));
    border-color: currentColor;
    background: color-mix(in srgb, #3fb950 15%, transparent);
}

.presence-inactive {
    color: color-mix(in srgb, #9a6700 78%, var(--text));
    border-color: currentColor;
    background: color-mix(in srgb, #f2b134 16%, transparent);
}

.presence-disconnected {
    color: color-mix(in srgb, #d1242f 78%, var(--text));
    border-color: currentColor;
    background: color-mix(in srgb, #ef233c 14%, transparent);
}


/* Host runtime game board */

.host-game-board {
    margin-top: 0;
}

.host-game-heading {
    align-items: center;
    margin-bottom: 16px;
}

.host-game-heading h2 {
    margin-bottom: 0;
}

.host-board-grid {
    display: grid;
    grid-template-columns: repeat(var(--board-columns), minmax(0, 1fr));
    height: 100%;
    min-height: 0;
    gap: 6px;
    overflow: hidden;
    padding: 6px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--bg) 88%, #000);
}

.host-board-layout {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
    min-height: 0;
}

.board-player-sidebar {
    display: none;
}

.board-host-sidebar {
    position: fixed;
    z-index: 17;
    left: var(--board-host-left, 12px);
    top: var(--board-host-top, 120px);
    display: none;
    width: var(--board-host-width, 238px);
    height: var(--board-host-height, 300px);
    min-width: 0;
    align-self: start;
}

.board-host-sidebar .host-card {
    width: 100%;
    height: 100%;
    min-width: 0;
    max-width: none;
    box-sizing: border-box;
}

.board-host-card-list {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.board-host-card-resizer {
    position: absolute;
    z-index: 4;
    right: -7px;
    bottom: -7px;
    width: 22px;
    height: 22px;
    border: 2px solid var(--gold);
    border-top: 0;
    border-left: 0;
    border-radius: 0 0 7px 0;
    cursor: nwse-resize;
    touch-action: none;
}

.board-host-card-resizer:hover,
.board-host-card-resizer:focus-visible,
.is-resizing-host-card .board-host-card-resizer {
    filter: brightness(1.35);
}

.board-host-card-drag-handle {
    position: absolute;
    z-index: 5;
    top: -9px;
    left: 50%;
    width: 58px;
    height: 20px;
    border: 2px solid var(--gold);
    border-radius: 999px;
    background: var(--panel);
    cursor: ns-resize;
    touch-action: none;
    transform: translateX(-50%);
}

.board-host-card-drag-handle::after {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--gold);
    content: "•••";
    font-size: .7rem;
    letter-spacing: .12em;
    line-height: 1;
}

.board-host-card-drag-handle:hover,
.board-host-card-drag-handle:focus-visible,
.is-moving-host-card .board-host-card-drag-handle {
    filter: brightness(1.35);
}

.is-moving-host-card {
    cursor: ns-resize;
    user-select: none;
}

.board-player-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.board-player-list li {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: linear-gradient(145deg, var(--panel-2), var(--panel-gradient-end));
}

.board-player-name {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    font-weight: 800;
}

.board-player-name > span {
    display: inline-block;
}

.board-player-name.is-overflowing > span {
    padding-left: 100%;
    animation: board-player-name-scroll 8s linear infinite;
}

.board-player-score {
    color: var(--gold);
    font-size: 1.2rem;
    font-variant-numeric: tabular-nums;
}

.board-player-score.score-negative {
    color: #ff5d68;
}

@keyframes board-player-name-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

@media (prefers-reduced-motion: reduce) {
    .board-player-name.is-overflowing > span {
        padding-left: 0;
        animation: none;
        text-overflow: ellipsis;
        overflow: hidden;
        max-width: 100%;
    }
}

@media (min-width: 1300px) {
    .host-board-layout {
        grid-template-columns: minmax(0, 1fr) 250px;
        align-items: stretch;
        gap: 18px;
    }

    .board-player-sidebar {
        display: block;
        min-width: 0;
        max-height: 100%;
        overflow-y: auto;
    }

    .host-game-board:has(.board-player-sidebar) .game-scoreboard .scoreboard-score {
        display: none;
    }
}

@media (min-width: 1700px) {
    .host-game-board:has(.board-host-sidebar.is-positioned) .host-board-layout {
        padding-left: calc(var(--board-host-width, 190px) + 24px);
    }

    .board-host-sidebar.is-positioned {
        display: block;
    }
}

.host-board-column {
    display: grid;
    grid-template-rows: auto;
    grid-auto-rows: minmax(0, 1fr);
    gap: 6px;
    min-width: 0;
    min-height: 0;
    height: 100%;
}

    .host-board-column h3 {
        min-width: 0;
        min-height: 0;
        margin: 0;
        padding: 8px;
        display: grid;
        place-items: center;
        overflow: hidden;
        overflow-wrap: anywhere;
        text-align: center;
    }

    .host-board-column form {
        display: flex;
        min-height: 0;
    }

.host-board-question {
    width: 100%;
    min-height: 0;
    height: 100%;
    border: 1px solid var(--line);
    background: linear-gradient( 145deg, var(--panel-2), var(--panel-gradient-end) );
    color: var(--gold);
    font-size: 1.65rem;
    font-weight: 950;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.host-board-question {
    width: 100%;
    height: 100%;
    min-height: 0;
}

.host-board-question.status-resolved {
    filter: grayscale(0.6) saturate(0.5) brightness(0.78);
    opacity: 0.72;
}

.question-review-preview {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.question-review-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.question-review-heading h2 {
    margin-bottom: 0;
}

.question-review-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

.question-review-content .game-content-presentation {
    min-height: 24rem;
    padding: clamp(1rem, 3vw, 2rem);
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: var(--panel-2);
}

.question-review-content .game-content-text {
    font-size: clamp(1.4rem, 3vw, 2.6rem);
}

.question-review-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

@media (max-width: 900px) {
    .question-review-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .question-review-content {
        grid-template-columns: 1fr;
    }
}

.host-board-question:hover:not(:disabled) {
    border-color: var(--red-bright);
    transform: translateY(-1px);
}

.host-board-question:disabled {
    cursor: default;
    opacity: 0.48;
}

.host-board-question.status-selected,
.host-board-question.status-awaitingwager {
    border-color: var(--gold);
    background: rgba(242, 177, 52, 0.14);
    opacity: 1;
}

.current-question-summary {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    border-color: rgba(242, 177, 52, 0.55);
}

/* Quiz editor: wager questions */

.wager-question-setting span {
    display: grid;
    gap: 3px;
}

.wager-question-setting small {
    color: var(--muted);
    font-weight: 500;
}

.question-cell.wager-question {
    border-color: rgba(242, 177, 52, 0.65);
}

.question-wager-badge {
    position: absolute;
    top: 10px;
    left: 12px;
    padding: 3px 7px;
    border: 1px solid rgba(242, 177, 52, 0.65);
    border-radius: 999px;
    color: var(--gold);
    background: rgba(242, 177, 52, 0.12);
    font-size: 0.7rem;
    font-weight: 850;
    text-transform: uppercase;
}

/* In-game player scoreboard */

.game-scoreboard {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 10px;
    margin: 18px 0 0;
    padding: 0 6px 6px;
    overflow-x: auto;
    list-style: none;
}

.game-side-controls {
    position: fixed;
    z-index: 19;
    right: max(12px, calc((100vw - 1800px) / 2 + 12px));
    bottom: calc(var(--game-scoreboard-space) / 2);
    display: flex;
    flex-direction: column;
    gap: 6px;
    transform: translateY(50%);
}

.player-join-lock-form {
    margin: 0;
}

.game-side-control {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(115, 163, 255, 0.8);
    border-radius: 10px;
    background: rgba(27, 65, 112, 0.95);
    color: #fff;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    font-size: 1rem;
}

.game-side-controls .player-join-lock {
    width: 36px;
    height: 36px;
    font-size: 1.05rem;
}

.game-side-control:hover {
    transform: translateY(-1px);
    filter: brightness(1.12);
}

.game-side-control:disabled {
    cursor: wait;
    opacity: 0.55;
}

.player-join-lock {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    background: var(--panel-2);
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    font-size: 1.3rem;
}

.player-join-lock.is-open {
    border-color: rgba(72, 199, 142, 0.8);
    background: rgba(37, 112, 78, 0.95);
}

.player-join-lock.is-closed {
    border-color: rgba(255, 93, 104, 0.8);
    background: rgba(123, 38, 48, 0.95);
}

.player-join-lock:hover {
    transform: translateY(-1px);
    filter: brightness(1.12);
}

.scoreboard-player {
    position: relative;
    min-width: 207px;
    max-width: 311px;
    flex: 1 1 230px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 8px;
    padding: 14px 50px 14px 16px;
    border: 2px solid var(--line);
    border-radius: 10px 10px 0 0;
    background: linear-gradient(145deg, var(--panel-2), var(--panel-gradient-end));
    text-align: center;
}

.game-scoreboard .scoreboard-player:not(.host-card) {
    min-width: var(--player-card-width, 230px);
    max-width: var(--player-card-width, 230px);
    flex: 0 0 var(--player-card-width, 230px);
}

.game-scoreboard .scoreboard-player.host-card {
    min-width: var(--host-bottom-card-width, 230px);
    max-width: var(--host-bottom-card-width, 230px);
    flex: 0 0 var(--host-bottom-card-width, 230px);
}

.player-card-width-resizer {
    position: absolute;
    z-index: 5;
    top: 50%;
    left: -6px;
    width: 12px;
    height: 52px;
    border-radius: 999px;
    background: #77778a;
    box-shadow: 0 0 0 1px #111;
    transform: translateY(-50%);
    cursor: ew-resize;
    touch-action: none;
    transition: height 120ms ease, background 120ms ease;
}

.player-card-width-resizer:hover,
.player-card-width-resizer:focus-visible,
.is-resizing-player-cards .player-card-width-resizer {
    height: 72px;
    background: var(--gold);
}

.is-resizing-player-cards {
    cursor: ew-resize;
    user-select: none;
}

.scoreboard-player > strong {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1.05rem;
}

.scoreboard-player.host-card {
    grid-template-rows: auto minmax(0, 1fr);
    align-content: stretch;
    padding-right: 16px;
}

.board-host-sidebar .player-card-width-resizer {
    display: none;
}

.host-card-media {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    object-fit: contain;
    border-radius: 8px;
    background: transparent;
}

iframe.host-card-media {
    border: 0;
}

.host-webcam-url-field {
    grid-column: 1 / -1;
}

.host-webcam-url-field .form-hint a,
.player-webcam-url-field .form-hint a {
    color: var(--gold);
    font-weight: 800;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.host-webcam-url-field .form-hint a:hover,
.host-webcam-url-field .form-hint a:focus-visible,
.player-webcam-url-field .form-hint a:hover,
.player-webcam-url-field .form-hint a:focus-visible {
    color: var(--text);
}

.host-image-field {
    grid-column: 1 / -1;
}

.host-image-input-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.host-image-input-row input[type="file"] {
    min-width: 0;
    flex: 1 1 auto;
}

.host-image-preview {
    width: 88px;
    height: 66px;
    flex: 0 0 auto;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg);
}

.host-image-preview[hidden] {
    display: none;
}

.host-avatar-field {
    grid-column: 1 / -1;
}

.host-avatar-input-row,
.player-avatar-control {
    display: flex;
    align-items: center;
    gap: 14px;
}

.player-avatar-control {
    flex-wrap: wrap;
}

.player-media-settings {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-2);
}

.player-media-settings > summary {
    padding: 10px 12px;
    color: var(--text);
    font-weight: 850;
    cursor: pointer;
}

.player-media-settings-content {
    display: grid;
    gap: 10px;
    padding: 0 12px 12px;
}

.player-menu-settings {
    margin-bottom: 8px;
}

.player-menu-settings .player-language-settings {
    padding-top: 0;
    border-top: 0;
}

.player-menu-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.player-menu-links .button,
.player-menu-links form,
.player-menu-links form .button {
    width: 100%;
}

.player-menu-links + .player-language-settings {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.player-language-settings {
    display: grid;
    gap: 7px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.player-language-options {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.player-language-options .button {
    min-height: 38px;
    padding: 7px 10px;
}

.player-language-options .is-selected {
    border-color: var(--gold);
    color: var(--text);
    box-shadow: 0 0 0 1px var(--gold);
}

.player-lobby.is-page-buzzer-active {
    cursor: pointer;
}

.player-lobby.is-page-buzzer-active :is(button, a, input, textarea, select, summary) {
    cursor: auto;
}

.player-image-source-switch,
.player-image-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.player-image-source-switch .button,
.player-image-actions .button {
    min-height: 42px;
}

.host-avatar-preview,
.player-avatar-current,
.player-list-avatar {
    width: 64px;
    height: 64px;
    flex: 0 0 auto;
    object-fit: contain;
    border-radius: 10px;
}

.player-webcam-preview,
video.player-card-avatar,
video.host-card-media {
    object-fit: cover;
}

.player-webcam-url-preview,
.player-webcam-url-frame {
    border: 0;
}

.player-webcam-url-field {
    display: grid;
    gap: 6px;
    width: 100%;
}

.player-webcam-url-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.player-webcam-url-row input {
    min-width: 0;
    flex: 1 1 auto;
}

@media (max-width: 560px) {
    .player-webcam-url-row {
        align-items: stretch;
        flex-direction: column;
    }
}

.player-webcam-preview,
video.host-card-media {
    transform: scaleX(-1);
}

.host-avatar-preview[hidden],
.player-avatar-current[hidden] {
    display: none;
}

.player-card-avatar {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: contain;
}

.scoreboard-player:has(.player-card-avatar) {
    grid-template-rows: minmax(0, 1fr) auto auto;
    align-content: stretch;
}

.avatar-picker {
    width: min(960px, calc(100vw - 32px));
    max-width: none;
    max-height: 92dvh;
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: transparent;
}

.avatar-picker::backdrop {
    background: rgba(0, 0, 0, 0.78);
}

.avatar-picker-card {
    max-height: 92dvh;
    overflow: auto;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
    color: var(--text);
}

.avatar-gender-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.avatar-gender-grid button,
.avatar-option {
    padding: 10px;
    border: 2px solid transparent;
    border-radius: 14px;
    background: var(--panel-2);
    color: var(--text);
    cursor: pointer;
}

.avatar-gender-grid button:hover,
.avatar-option:hover,
.avatar-option:focus-visible {
    border-color: var(--gold);
}

.avatar-gender-grid img,
.avatar-option img {
    width: 100%;
    display: block;
    object-fit: contain;
}

.avatar-picker-toolbar {
    margin-bottom: 12px;
}

.avatar-option-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

@media (max-width: 600px) {
    .avatar-picker {
        width: calc(100vw - 16px);
        max-height: 96dvh;
    }

    .avatar-picker-card {
        max-height: 96dvh;
        padding: 12px;
    }

    .avatar-option-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
    }
}

.scoreboard-details {
    display: grid;
    justify-items: center;
    gap: 7px;
}

.scoreboard-score {
    color: var(--gold);
    font-size: 1.45rem;
    font-weight: 950;
    font-variant-numeric: tabular-nums;
}

.scoreboard-score.score-negative {
    color: #ff5d68;
}

.scoreboard-details .presence-badge {
    min-width: 0;
    font-size: 0.68rem;
}

.scoreboard-details .button {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 0.75rem;
}

.presence-rejoinpending {
    color: color-mix(in srgb, #9a6700 82%, var(--text));
    border-color: currentColor;
    background: color-mix(in srgb, #f2b134 20%, transparent);
}

@media (max-width: 700px) {
    .game-scoreboard {
        justify-content: flex-start;
    }

    .scoreboard-player {
        min-width: 155px;
    }

    .game-scoreboard .scoreboard-player:not(.host-card) {
        min-width: var(--player-card-width, 155px);
        max-width: var(--player-card-width, 155px);
        flex-basis: var(--player-card-width, 155px);
    }
}

body:has(.player-lobby) > .topbar {
    display: none;
}

body:has(.player-lobby) > .page-shell {
    min-height: 100dvh;
}

@media (max-width: 700px) {
    body:has(.player-lobby:has(.player-buzzer-panel)) > .page-shell {
        height: 100dvh;
    }
}

/* Shared join code presentation */

.join-code-value {
    display: block;
    max-width: 100%;
    color: var(--gold);
    font-size: clamp(2.4rem, 11vw, 6rem);
    letter-spacing: 0.1em;
    line-height: 0.95;
    text-indent: 0.1em;
    white-space: nowrap;
}

.join-qr-code {
    width: min(320px, 70vw);
    max-width: 100%;
    height: auto;
    box-sizing: border-box;
    padding: 12px;
    border-radius: 12px;
    background: #fff;
    image-rendering: pixelated;
}

.lobby-join-qr {
    width: min(280px, 68vw);
}

.join-selected-game {
    margin: 0;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gold);
    border-radius: 0.75rem;
    color: var(--gold);
    text-align: center;
    font-weight: 700;
}

.lobby-join-copy-status {
    align-self: center;
    min-width: 0;
    color: var(--gold);
    font-size: 0.8rem;
    font-weight: 800;
    white-space: nowrap;
}

/* In-game join code floating panel */

.join-code-floating-panel {
    position: fixed;
    z-index: 45;
    display: grid;
    grid-template-rows: 34px minmax(0, 1fr);
    min-width: 240px;
    min-height: 300px;
    overflow: clip;
    border: 2px solid var(--gold);
    border-radius: 16px;
    color: var(--text);
    background: radial-gradient(circle at top, color-mix(in srgb, var(--red) 20%, var(--panel-2)), var(--panel-gradient-end) 68%);
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.55);
    container-type: size;
}

.join-code-floating-panel[hidden] {
    display: none;
}

.join-code-floating-toolbar {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 0;
    align-items: center;
    justify-content: center;
    padding: 0 38px 0 10px;
    overflow: hidden;
    border-bottom: 1px solid color-mix(in srgb, var(--gold) 42%, var(--line));
    background: color-mix(in srgb, var(--panel) 92%, transparent);
    cursor: move;
    touch-action: none;
    user-select: none;
}

.join-code-floating-grip {
    color: var(--gold);
    font-size: .8rem;
    letter-spacing: .18em;
    line-height: 1;
}

.join-code-floating-content {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(4px, 1.2cqh, 8px);
    padding: clamp(6px, 1.5cqh, 10px) clamp(8px, 2.5cqw, 14px);
    overflow: clip;
    text-align: center;
}

.join-code-floating-content h2 {
    flex: 0 0 auto;
    width: min(84cqw, 360px);
    max-width: 100%;
    margin: 0;
    color: var(--text);
    font-size: clamp(.75rem, 6.5cqw, 1.6rem);
    line-height: 1.1;
    white-space: nowrap;
}

.join-code-floating-panel .join-qr-code {
    flex: 0 1 auto;
    width: min(82cqw, calc(100cqh - 34px - 5.6rem));
    height: min(82cqw, calc(100cqh - 34px - 5.6rem));
    min-width: 0;
    min-height: 0;
    max-width: 100%;
    max-height: 100%;
    box-sizing: border-box;
    padding: clamp(3px, .9cqh, 7px);
    border-radius: 10px;
    object-fit: contain;
    background: #fff;
    image-rendering: pixelated;
}

.join-code-floating-panel .join-code-value {
    flex: 0 0 auto;
    display: block;
    max-width: 92cqw;
    margin: 0;
    overflow: hidden;
    color: var(--gold);
    font-size: clamp(1.15rem, 8.5cqw, 3.4rem);
    font-weight: 950;
    letter-spacing: .08em;
    line-height: 1;
    text-indent: .08em;
    text-overflow: clip;
    white-space: nowrap;
}

.join-code-floating-panel .join-code-close {
    position: absolute;
    top: 2px;
    right: 3px;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    color: var(--text);
    background: transparent;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
}

.join-code-floating-panel .join-code-close:hover,
.join-code-floating-panel .join-code-close:focus-visible {
    background: var(--panel-2);
    outline: none;
}

.join-code-floating-resizer {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 22px;
    height: 22px;
    border-right: 3px solid var(--gold);
    border-bottom: 3px solid var(--gold);
    border-radius: 0 0 12px 0;
    cursor: nwse-resize;
    touch-action: none;
}

.join-code-floating-resizer:hover,
.join-code-floating-resizer:focus-visible,
.is-resizing-join-code-panel .join-code-floating-resizer {
    filter: brightness(1.35);
    outline: none;
}

.is-moving-join-code-panel,
.is-resizing-join-code-panel {
    user-select: none;
}

/* Quiz editor: random wager settings */

.round-wager-settings {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    align-items: end;
    gap: 24px;
    margin-bottom: 18px;
}

.round-wager-settings .checkbox-row {
    margin: 0;
}

.round-wager-settings .checkbox-row span,
#round-category-count-setting,
#round-question-count-setting,
#random-wager-count-setting {
    display: grid;
    gap: 5px;
}

.round-wager-settings small {
    color: var(--muted);
    font-weight: 500;
}

@media (max-width: 700px) {
    .round-wager-settings {
        grid-template-columns: 1fr;
    }
}


/* Host question wager */

.current-question-summary {
    display: grid;
}

.current-question-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.question-wager-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(140px, 220px) auto;
    align-items: end;
    gap: 12px;
    margin-top: 16px;
}

.question-wager-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 750;
}

.question-wager-form select,
.question-wager-form input {
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    background: var(--panel);
}

.accepted-wager {
    margin: 12px 0 0;
    color: var(--gold);
    font-weight: 850;
}

@media (max-width: 700px) {
    .current-question-heading {
        flex-direction: column;
    }

    .question-wager-form {
        grid-template-columns: 1fr;
    }
}


/* Active player and wager keypad */

.active-player {
    border-color: var(--gold) !important;
    box-shadow: 0 0 0 1px rgba(242, 177, 52, 0.32);
}

.active-player-badge {
    padding: 4px 8px;
    border: 1px solid rgba(242, 177, 52, 0.65);
    border-radius: 999px;
    color: var(--gold);
    background: rgba(242, 177, 52, 0.12);
    font-size: 0.7rem;
    font-weight: 850;
    text-transform: uppercase;
}

.player-management {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.player-management .button,
.scoreboard-player .button {
    min-height: 32px;
    padding: 5px 9px;
    font-size: 0.72rem;
}

.player-card-actions {
    position: absolute;
    top: 50%;
    right: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transform: translateY(-50%);
}

.player-list .player-card-actions {
    flex-direction: row;
}

.player-list li:has(.player-card-actions) {
    position: relative;
    min-height: 88px;
    padding-right: 88px;
}

.player-management .player-action-button,
.scoreboard-player .player-action-button {
    width: 32px;
    height: 32px;
    min-height: 32px;
    flex: 0 0 32px;
    padding: 0;
    border-radius: 8px;
    font-size: 1rem;
    line-height: 1;
}

.wager-entry-panel {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(260px, 360px);
    gap: 24px;
    margin-top: 16px;
}

.wager-player-summary {
    display: grid;
    align-content: start;
    gap: 8px;
}

.wager-player-summary span,
.wager-player-summary small {
    color: var(--muted);
}

.wager-player-summary strong {
    color: var(--gold);
    font-size: 1.5rem;
}

.question-wager-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 0;
}

.wager-display-label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 750;
}

.wager-display {
    width: 100%;
    min-height: 64px !important;
    padding: 8px 14px !important;
    color: var(--gold) !important;
    font-size: 2rem !important;
    font-weight: 950;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.wager-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.wager-keypad button {
    min-height: 54px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    background: var(--panel-2);
    cursor: pointer;
    font-size: 1.25rem;
    font-weight: 900;
}

.wager-keypad button:hover {
    border-color: var(--gold);
    background: rgba(242, 177, 52, 0.12);
}

.wager-validation {
    min-height: 1.25em;
    margin: 0;
    color: #ff8d8d;
    font-size: 0.82rem;
}

.wager-validation.wager-valid {
    color: color-mix(in srgb, #22c55e 58%, var(--text));
    font-weight: 800;
}

.buzzer-race-card li {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
}

@media (max-width: 700px) {
    .wager-entry-panel {
        grid-template-columns: 1fr;
    }
}


/* Focused wager entry */

.current-question-summary.wager-mode {
    width: 100%;
    min-height: min(680px, calc(100vh - 210px));
    grid-template-columns: minmax(0, 1fr);
    place-items: center;
    align-content: center;
    padding: clamp(20px, 4vw, 48px);
}

.current-question-summary.wager-mode .current-question-heading {
    width: min(720px, 100%);
}

.current-question-summary.wager-mode .wager-entry-panel {
    width: 100%;
    justify-self: stretch;
    grid-template-columns: 160px minmax(0, 1fr);
    align-items: center;
    column-gap: 24px;
}

.current-question-summary.wager-mode .wager-player-summary {
    grid-column: 1;
    width: 100%;
    justify-self: stretch;
    text-align: left;
}

.current-question-summary.wager-mode .question-wager-form {
    grid-column: 2;
    width: min(360px, 100%);
    justify-self: center;
}

.wager-keypad-max {
    grid-column: 1 / -1;
    color: var(--gold) !important;
    border-color: rgba(242, 177, 52, 0.65) !important;
    letter-spacing: 0.08em;
}

@media (max-width: 700px) {
    .current-question-summary.wager-mode {
        min-height: auto;
    }

    .current-question-summary.wager-mode .wager-entry-panel {
        width: min(360px, 100%);
        grid-template-columns: 1fr;
        justify-self: center;
    }

    .current-question-summary.wager-mode .wager-player-summary,
    .current-question-summary.wager-mode .question-wager-form {
        grid-column: 1;
        width: 100%;
        justify-self: stretch;
        text-align: left;
    }
}


/* Host question judgment */

.question-judgment-panel {
    display: grid;
    gap: 14px;
    margin: 18px 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-glass);
}

.question-judgment-panel h3 {
    margin: 0;
}

.judgment-player-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.judgment-player {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-2);
}

.judgment-player > span {
    color: var(--gold);
    font-weight: 900;
}

.judgment-correct-button {
    color: #fff;
    border-color: rgba(63, 185, 80, 0.7);
    background: #237a37;
}

.judgment-correct-button:hover {
    background: #2ea043;
}

.judgment-incorrect-button {
    color: #fff;
    border-color: rgba(239, 35, 60, 0.7);
    background: #9f101b;
}

.judgment-incorrect-button:hover {
    background: var(--red-bright);
}

.question-attempts {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.question-attempts li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
}

.judgment-correct {
    color: #7ee787;
}

.judgment-incorrect {
    color: #ff8d8d;
}


/* Full-screen question and answer presentation */

.current-question-summary:not(.wager-mode) {
    min-height: min(720px, calc(100vh - 210px));
    align-content: center;
    gap: 8px;
    padding: clamp(24px, 4vw, 56px);
}

.game-content-presentation {
    width: min(1200px, 100%);
    min-width: 0;
    margin: 0 auto;
    display: grid;
    justify-items: center;
    gap: 24px;
    text-align: center;
}

.game-content-blocks {
    width: 100%;
    min-width: 0;
    display: grid;
    gap: clamp(18px, 3vw, 36px);
}

.game-content-block {
    min-width: 0;
    display: grid;
    justify-items: center;
    gap: 12px;
}

.game-content-text {
    width: 100%;
    max-width: 1100px;
    margin: 0;
    font-size: clamp(1.8rem, 4.5vw, 4rem);
    font-weight: 850;
    line-height: 1.2;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.game-content-caption {
    max-width: 1000px;
    margin: 0;
    color: var(--muted);
    font-size: clamp(1rem, 2vw, 1.45rem);
    line-height: 1.4;
}

.game-content-image,
.game-content-video {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: min(62vh, 680px);
    border: 0;
    border-radius: 12px;
    object-fit: contain;
}

iframe.game-content-video {
    width: min(100%, 960px);
    aspect-ratio: 16 / 9;
}

iframe.youtube-auto-expanded {
    position: fixed !important;
    inset: 0 !important;
    z-index: 10000 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #000;
}

.youtube-auto-expand-close {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10001;
    display: grid;
    width: 44px;
    height: 44px;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

body.youtube-auto-expanded-open {
    overflow: hidden;
}

.game-content-audio-shell {
    display: flex;
    width: 100%;
    max-width: 720px;
    min-width: 0;
    min-height: 54px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #f1f3f4;
}

.game-content-block:has(.game-content-audio-shell) {
    width: 100%;
}

.game-content-audio {
    display: block;
    width: 100%;
    max-width: none;
    min-width: 0;
    height: 54px;
    min-height: 54px;
    flex: 1 1 auto;
    visibility: visible;
    opacity: 1;
}

.answer-presentation {
    padding-top: 8px;
}

.answer-presentation > .eyebrow {
    color: var(--gold);
}

@media (max-width: 700px) {
    .current-question-summary:not(.wager-mode) {
        min-height: auto;
        padding: 20px;
    }
}


/* Viewport-anchored gameplay layout */

/* Viewport-anchored gameplay layout */

.host-game-board {
    --game-scoreboard-space: 230px;
    min-height: calc(100dvh - var(--topbar-height) - 68px);
    padding-bottom: var(--game-scoreboard-space);
}

@media (max-width: 900px) {
    .host-game-board {
        min-height: calc(100dvh - var(--topbar-height) - 40px);
    }
}

.game-scoreboard {
    position: fixed;
    z-index: 18;
    right: 0;
    bottom: 0;
    left: 0;
    height: var(--game-scoreboard-space);
    min-height: 0;
    max-height: none;
    margin: 0;
    padding: 12px max(66px, calc((100vw - 1800px) / 2 + 66px)) 0
        max(12px, calc((100vw - 1800px) / 2 + 34px));
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 97%, transparent);
    box-shadow: 0 -16px 36px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(14px);
}

.game-scoreboard-resizer {
    position: fixed;
    z-index: 20;
    right: 0;
    bottom: calc(var(--game-scoreboard-space) - 8px);
    left: 0;
    height: 16px;
    display: grid;
    place-items: center;
    cursor: ns-resize;
    touch-action: none;
}

.game-scoreboard-resizer span {
    width: 72px;
    height: 5px;
    border-radius: 999px;
    background: #77778a;
    box-shadow: 0 0 0 1px #111;
    transition: width 120ms ease, background 120ms ease;
}

.game-scoreboard-resizer:hover span,
.game-scoreboard-resizer:focus-visible span,
.is-resizing-scoreboard .game-scoreboard-resizer span {
    width: 104px;
    background: var(--gold);
}

.is-resizing-scoreboard {
    cursor: ns-resize;
    user-select: none;
}

.current-question-summary:not(.wager-mode) {
    min-height: calc(100dvh - var(--topbar-height) - var(--game-scoreboard-space) - 24px);
    max-height: calc(100dvh - var(--topbar-height) - var(--game-scoreboard-space) - 24px);
    grid-template-rows: auto minmax(0, 1fr) auto;
    align-content: stretch;
    overflow: hidden;
}

.answering-player-header {
    align-self: start;
    justify-self: center;
    margin: 0;
    text-align: center;
}

.game-content-presentation {
    overflow: hidden;
    min-height: 0;
    height: 100%;
    grid-template-rows: auto minmax(0, 1fr) auto;
    align-content: stretch;
}

.game-content-blocks {
    min-height: 0;
    align-self: stretch;
    align-content: safe center;
    place-items: center;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 12px 8px;
}

.game-content-presentation > form {
    align-self: end;
    justify-self: center;
}

.current-question-summary:not(.wager-mode) > .question-controls {
    align-self: end;
    width: 100%;
    margin: 0;
}

.current-question-summary:not(.wager-mode) .judgment-player {
    grid-template-rows: auto auto 1fr;
}

.current-question-summary:not(.wager-mode) .judgment-player .form-actions {
    align-self: end;
}

@media (max-width: 700px) {
    .host-game-board {
        --game-scoreboard-space: 212px;
    }

    .game-scoreboard {
        min-height: 140px;
        padding-right: 66px;
        padding-left: 12px;
    }

    .current-question-summary:not(.wager-mode) {
        min-height: calc(100dvh - var(--topbar-height) - var(--game-scoreboard-space) - 16px);
        max-height: none;
    }
}


.current-question-summary:not(.wager-mode) > .answering-player-header {
    grid-row: 1;
}

.current-question-summary:not(.wager-mode) > .game-content-presentation {
    grid-row: 2;
}

.current-question-summary:not(.wager-mode) > .question-controls {
    grid-row: 3;
}


/* Center gameplay regions and shared host actions */

.current-question-summary:not(.wager-mode) {
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
    justify-items: stretch;
}

.current-question-summary:not(.wager-mode) > .answering-player-header {
    width: min(960px, 100%);
    justify-self: center;
}

.current-question-summary:not(.wager-mode) > .game-content-presentation {
    width: 100%;
    justify-self: center;
}

.current-question-summary:not(.wager-mode) .game-content-text,
.current-question-summary:not(.wager-mode) .game-content-caption {
    max-width: none;
}

.current-question-summary:not(.wager-mode) > .question-controls {
    width: min(960px, 100%);
    justify-self: center;
}

.judgment-general-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Keep gameplay content above the fixed player scoreboard */

.host-game-board {
    --game-scoreboard-space: 230px;
    display: flex;
    flex-direction: column;
    /*
     * --topbar-height - top navigation
     * 34px   top padding of .page-shell
     */
    height: calc(100dvh - var(--topbar-height) - 34px);
    min-height: 0;
    /*
     * The scoreboard is position: fixed, so reserve its space
     * inside the gameplay container.
     */
    padding-bottom: var(--game-scoreboard-space);
    /*
     * Cancel the bottom padding of .page-shell so the whole
     * gameplay layout still fits exactly inside the viewport.
     */
    margin-bottom: -34px;
    overflow-y: auto;
}

.current-question-summary:not(.wager-mode) {
    flex: 1 1 auto;
    /*
     * Override the previous viewport-based min/max height.
     * The panel now receives only the free space above the scoreboard.
     */
    height: auto;
    min-height: 0;
    max-height: none;
    margin-bottom: 0;
    padding: 16px clamp(24px, 4vw, 56px) 8px;
    overflow: hidden;
}

/* Let active questions and answers use the viewport instead of the page-shell cap. */
.host-game-board:has(> .current-question-summary:not(.wager-mode)) {
    width: calc(100vw - 32px);
    max-width: none;
    margin-left: calc(50% - 50vw + 16px);
    margin-right: calc(50% - 50vw + 16px);
}

.host-game-board:has(> .current-question-summary:not(.wager-mode)),
.host-game-board:has(> .host-board-layout) {
    margin-top: -17px;
}

.current-question-summary:not(.wager-mode) > .game-content-presentation {
    gap: 8px;
}

.current-question-summary:not(.wager-mode) > .game-content-presentation > .eyebrow {
    font-size: clamp(.95rem, 1.25vw, 1.3rem);
    line-height: 1.15;
}

.current-question-summary:not(.wager-mode) .game-content-blocks {
    padding-block: 4px;
}

.current-question-summary:not(.wager-mode) > .question-controls {
    padding-top: 0;
}

@media (max-width: 900px) {
    .host-game-board:has(> .current-question-summary:not(.wager-mode)),
    .host-game-board:has(> .host-board-layout) {
        margin-top: -10px;
    }

    .host-game-board {
        /*
         * .page-shell uses 20px padding below 900px.
         */
        height: calc(100dvh - var(--topbar-height) - 20px);
        margin-bottom: -20px;
    }
}

@media (max-width: 700px) {
    .host-game-board {
        --game-scoreboard-space: 212px;
    }
}

/* Player buzzer */

.buzzer-status {
    margin: 0;
    text-align: center;
}

.player-buzzer-panel {
    display: grid;
    justify-items: center;
    gap: 12px;
    margin: 24px 0;
}

.player-buzzer {
    width: min(320px, 80vw);
    aspect-ratio: 1;
    border: 6px solid #5a151d;
    border-radius: 50%;
    color: #fff;
    background: #5c0b14;
    box-shadow: inset 0 -18px 0 rgba(0, 0, 0, 0.28);
    font-size: clamp(2rem, 10vw, 4rem);
    font-weight: 950;
    cursor: not-allowed;
}

.player-buzzer.player-buzzer-open {
    border-color: #ff6072;
    background: var(--red);
    box-shadow:
        0 0 36px rgba(239, 35, 60, 0.5),
        inset 0 -18px 0 rgba(0, 0, 0, 0.22);
    cursor: pointer;
}

.player-buzzer.player-buzzer-open:active {
    transform: translateY(6px);
    box-shadow:
        0 0 22px rgba(239, 35, 60, 0.4),
        inset 0 -8px 0 rgba(0, 0, 0, 0.22);
}

@media (max-width: 700px) {
    .page-shell:has(.player-lobby:has(.player-buzzer-panel)) {
        height: 100dvh;
        padding: 8px;
        overflow: hidden;
    }

    .player-lobby:has(.player-buzzer-panel) {
        width: 100%;
        height: 100%;
        max-width: none;
        margin: 0;
        padding: 10px;
        display: flex;
        flex-direction: column;
        gap: 5px;
        overflow: hidden;
    }

    .player-lobby:has(.player-buzzer-panel) > .eyebrow,
    .player-lobby:has(.player-buzzer-panel) > h1,
    .player-lobby:has(.player-buzzer-panel) > p,
    .player-lobby:has(.player-buzzer-panel) > h2 {
        margin: 0;
    }

    .player-lobby:has(.player-buzzer-panel) > h1 {
        font-size: clamp(1.25rem, 6vw, 1.8rem);
        line-height: 1.05;
    }

    .player-lobby:has(.player-buzzer-panel) .game-code-panel.compact {
        min-height: 0;
        padding: 6px 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }

    .player-lobby:has(.player-buzzer-panel) .game-code-panel.compact strong {
        font-size: 1.35rem;
    }

    .player-lobby:has(.player-buzzer-panel) .player-media-settings > summary {
        padding: 7px 10px;
    }

    .player-lobby:has(.player-buzzer-panel) .player-buzzer-panel {
        flex: 1 1 auto;
        min-height: 0;
        gap: 5px;
        margin: 2px 0;
    }

    .player-lobby:has(.player-buzzer-panel) .player-buzzer {
        width: min(100%, 34dvh, 250px);
        min-width: 0;
        min-height: 0;
    }

    .player-lobby:has(.player-buzzer-panel) .player-list {
        grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
        gap: 4px;
    }

    .player-lobby:has(.player-buzzer-panel) .player-list li {
        gap: 6px;
        padding: 5px 7px;
    }

    .player-lobby:has(.player-buzzer-panel) > .dialog-warning:last-child {
        display: none;
    }
}


/* Near-simultaneous buzzer result */

.buzzer-race-overlay {
    position: fixed;
    z-index: 40;
    right: 0;
    bottom: 0;
    left: 0;
    height: var(--game-scoreboard-space, 230px);
    display: grid;
    place-items: center;
    padding: clamp(6px, 1.4vh, 14px);
    pointer-events: none;
    animation: buzzer-race-overlay-life 5s ease forwards;
}

.buzzer-race-card[data-auto-fit-overlay] {
    visibility: hidden;
}

.buzzer-race-card[data-auto-fit-overlay].is-auto-fit-ready {
    visibility: visible;
}

.buzzer-race-card {
    width: min(900px, 94vw);
    max-height: 100%;
    box-sizing: border-box;
    padding: clamp(10px, 2vh, 24px);
    overflow: hidden;
    border: 2px solid var(--gold);
    border-radius: 22px;
    color: var(--text);
    background: var(--panel-glass);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.72);
    text-align: center;
}

.buzzer-race-card:not(.answer-result-card) {
    display: grid;
    align-content: center;
    gap: clamp(4px, 1vh, 10px);
}

.buzzer-race-card p {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    margin: 0;
    color: var(--gold);
    font-size: clamp(1.5rem, 3vw, 2.6rem);
    font-weight: 950;
    white-space: nowrap;
}

.buzzer-race-card ul {
    min-width: 0;
    max-width: 100%;
    display: grid;
    gap: clamp(2px, .55vh, 6px);
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: clamp(1.25rem, 2.5vw, 2rem);
    font-weight: 850;
    line-height: 1.12;
}

@media (max-width: 700px) {
    .buzzer-race-card p {
        white-space: normal;
    }
}

@keyframes buzzer-race-overlay-life {
    0%, 82% {
        opacity: 1;
        visibility: visible;
    }

    100% {
        opacity: 0;
        visibility: hidden;
    }
}


/* Compact host question controls */

.question-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 8px 0 0;
}

.question-controls form,
.question-judge-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0;
}

.question-controls .button {
    min-height: 42px;
}

/* Current-question state in the fixed scoreboard */

.scoreboard-player.question-answering-player {
    border-color: var(--gold);
    background:
        linear-gradient(rgba(255, 184, 0, 0.3), rgba(255, 184, 0, 0.16)),
        var(--panel-2);
    box-shadow:
        0 0 0 2px rgba(255, 184, 0, 0.35),
        0 0 28px rgba(255, 184, 0, 0.24);
}

.scoreboard-player.question-attempted-player {
    border-color: #555;
    background: #25252a;
    filter: grayscale(1);
    opacity: 0.52;
}


/* Solid question-state colors override persistent active-player styling */

.scoreboard-player.question-answering-player,
.scoreboard-player.active-player.question-answering-player {
    color: #111;
    border-color: #ffd45a;
    background: #dca900;
    box-shadow: none;
    filter: none;
    opacity: 1;
}

.scoreboard-player.question-answering-player .scoreboard-score,
.scoreboard-player.question-answering-player .active-player-badge {
    color: #111;
    border-color: rgba(17, 17, 17, 0.45);
    background: rgba(255, 255, 255, 0.28);
}

.scoreboard-player.question-attempted-player,
.scoreboard-player.active-player.question-attempted-player {
    color: #aaa;
    border-color: #555;
    background: #303035;
    box-shadow: none;
    filter: grayscale(1);
    opacity: 0.58;
}


.scoreboard-player.question-answering-player .scoreboard-score {
    border-color: #dca900;
    background: #dca900;
    box-shadow: none;
}


/* Inter-round leaderboard */

.round-summary {
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    place-content: center;
    justify-items: center;
    gap: 24px;
    padding: clamp(24px, 5vw, 72px);
    text-align: center;
    overflow: auto;
}

.round-summary h2 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 4.5rem);
}

.round-podium {
    width: min(1100px, 100%);
    min-width: 0;
    justify-self: center;
    display: flex;
    align-items: end;
    justify-content: center;
    gap: clamp(12px, 2vw, 28px);
    margin: 0;
    padding: 24px 0;
    list-style: none;
}

.round-podium-player {
    width: min(280px, 100%);
    min-width: 0;
    flex: 0 1 280px;
    min-height: 190px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    padding: 24px 16px;
    border: 2px solid #454550;
    border-radius: 20px 20px 8px 8px;
    background: var(--panel-2);
    animation: round-podium-rise 650ms ease both;
}

.round-podium-player:only-child {
    width: min(420px, 100%);
    flex-basis: 420px;
}

.round-podium-player:nth-child(2) { animation-delay: 120ms; }
.round-podium-player:nth-child(3) { animation-delay: 240ms; }

.round-podium-player.round-winner {
    min-height: 260px;
    color: #111;
    border-color: #ffe07a;
    background: #dca900;
    box-shadow: 0 0 42px rgba(220, 169, 0, 0.42);
}

.round-podium-position {
    display: grid;
    place-items: center;
    width: 48px;
    aspect-ratio: 1;
    border-radius: 50%;
    color: #111;
    background: var(--gold);
    font-size: 1.35rem;
    font-weight: 950;
}

.round-winner .round-podium-position {
    color: #dca900;
    background: #111;
}

.round-podium-player strong {
    max-width: 100%;
    font-size: clamp(1.1rem, 2.4vw, 1.8rem);
    overflow-wrap: anywhere;
}
.round-podium-score { font-size: clamp(1.5rem, 3vw, 2.5rem); font-weight: 950; }
.round-summary-finished { color: var(--gold); font-size: 1.2rem; font-weight: 850; }

@keyframes round-podium-rise {
    from { opacity: 0; transform: translateY(70px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 700px) {
    .round-podium { align-items: stretch; flex-direction: column; }
    .round-podium-player,
    .round-podium-player.round-winner { width: 100%; min-height: 120px; }
}


/* Podium medal colors */

.round-podium-player:nth-child(2) {
    color: #111;
    border-color: #f2f2f2;
    background: #c0c0c0;
    box-shadow: 0 0 34px rgba(192, 192, 192, 0.28);
}

.round-podium-player:nth-child(2) .round-podium-position {
    color: #c0c0c0;
    background: #111;
}

.round-podium-player:nth-child(3) {
    color: #111;
    border-color: #e2a36f;
    background: #b87333;
    box-shadow: 0 0 34px rgba(184, 115, 51, 0.28);
}

.round-podium-player:nth-child(3) .round-podium-position {
    color: #b87333;
    background: #111;
}


/* Synchronized question timers */

.game-timer {
    position: absolute;
    z-index: 6;
    top: 18px;
    right: 18px;
    min-width: 132px;
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 10px 16px;
    border: 2px solid var(--gold);
    border-radius: 14px;
    color: var(--gold);
    background: var(--panel-glass);
    box-shadow: 0 0 24px rgba(220, 169, 0, 0.22);
}

.game-timer[hidden] {
    display: none;
}

.game-timer span {
    font-size: 0.78rem;
    font-weight: 850;
    text-transform: uppercase;
}

.game-timer strong {
    font-variant-numeric: tabular-nums;
    font-size: 1.75rem;
    line-height: 1;
}

.game-timer.answer-timer {
    color: color-mix(in srgb, #d1242f 78%, var(--text));
    border-color: currentColor;
    box-shadow: 0 0 24px color-mix(in srgb, #d1242f 24%, transparent);
}

.current-question-summary {
    position: relative;
}

.player-game-timer {
    position: static;
    width: min(240px, 100%);
    margin: 18px auto;
}


/* Compact timer controls */

.game-timer {
    min-width: 0;
    grid-auto-flow: column;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
}

.game-timer strong {
    min-width: 68px;
    text-align: center;
}

.game-timer-control {
    display: block;
    margin: 0;
}

.game-timer-control[hidden] {
    display: none;
}

.game-timer-control button {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid currentColor;
    border-radius: 8px;
    color: inherit;
    background: transparent;
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
}

.game-timer-control button:hover {
    background: rgba(255, 255, 255, 0.12);
}


/* Timer and quiz editor layout refinements */

.host-game-timer {
    grid-template-columns: 68px 30px;
    grid-template-rows: 30px;
    grid-auto-flow: initial;
    gap: 6px;
    padding: 7px 9px;
}

.host-game-timer > strong {
    grid-column: 1;
    grid-row: 1;
}

.host-game-timer > .game-timer-control {
    grid-column: 2;
    grid-row: 1;
}

.final-question-panel {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    text-align: center;
    overflow-y: auto;
}

.final-submission-list,
.final-judging-list {
    width: min(100%, 52rem);
    margin: 0;
    padding: 0;
    list-style: none;
}

.final-submission-list li,
.final-judging-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--panel-2);
}

.final-submission-list li + li,
.final-judging-card + .final-judging-card {
    margin-top: 0.65rem;
}

.final-judging-card {
    flex-wrap: wrap;
    text-align: left;
}

.final-judging-card p {
    flex: 1 1 100%;
    margin: 0;
}

.final-judging-mode {
    justify-content: stretch;
}

.final-judging-mode .final-judging-list {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.final-player-answer-presentation {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.final-player-answer-presentation h2 {
    margin: 0 0 1rem;
    color: var(--gold);
    font-size: clamp(1.5rem, 4vw, 3rem);
}

.final-player-answer-presentation .game-content-text {
    width: 100%;
    align-self: center;
    margin-inline: auto;
    font-size: clamp(2rem, 6vw, 5rem);
    text-align: center;
}

.final-judging-actions {
    flex: 0 0 auto;
    justify-content: center;
    width: 100%;
    margin-top: auto;
}

.player-final-panel {
    display: grid;
    gap: 1rem;
    margin-block: 1.5rem;
    padding: 1.25rem;
    border: 1px solid var(--gold);
    border-radius: 1rem;
}

.player-final-panel textarea {
    min-height: 8rem;
    resize: vertical;
}

.final-wager-form {
    width: min(360px, 100%);
    justify-self: center;
}

.host-game-actions {
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.host-game-actions form {
    margin: 0;
}

.final-game-actions {
    flex: 0 0 auto;
    width: 100%;
}

.answer-history-page,
.answer-history-list {
    display: grid;
    gap: 1rem;
}

.answer-history-add summary {
    cursor: pointer;
    color: var(--gold);
    font-weight: 850;
}

.answer-history-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(10rem, 1fr)) auto auto;
    align-items: end;
    gap: 0.75rem;
    margin-top: 1rem;
}

.answer-history-entry-form {
    grid-template-columns: repeat(2, minmax(10rem, 1fr)) repeat(4, auto);
}

.answer-history-form label {
    display: grid;
    gap: 0.35rem;
}

.answer-history-correct {
    display: flex !important;
    align-items: center;
    align-self: end;
    justify-content: flex-start;
    width: max-content;
    min-height: 46px;
    gap: 0.5rem !important;
}

.answer-history-correct input[type="checkbox"] {
    flex: 0 0 auto;
    width: auto;
    margin: 0;
}

.answer-history-add-warning {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--red-bright);
}

.answer-history-delta {
    display: flex;
    align-items: center;
    align-self: end;
    min-height: 46px;
    color: var(--success);
    font-size: 1.15rem;
    font-weight: 900;
}

.answer-history-question h2 {
    margin-top: 0;
}

@media (max-width: 900px) {
    .host-game-actions {
        flex-wrap: wrap;
    }

    .answer-history-form {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

}

.answer-key-page {
    min-height: calc(100dvh - 140px);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.game-history-list {
    display: grid;
    gap: 1rem;
}

.game-history-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.game-history-card h2,
.game-history-card p {
    margin-block: 0.35rem;
}

.game-history-player-list {
    display: grid;
    gap: 0.65rem;
}

.game-history-player {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--panel-2);
    font-size: 1.1rem;
}

.table-scroll {
    overflow-x: auto;
}

.game-history-table {
    width: 100%;
    border-collapse: collapse;
}

.game-history-table th,
.game-history-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.statistics-table th,
.statistics-table td {
    white-space: nowrap;
    text-align: center;
}

.statistics-table th:first-child,
.statistics-table td:first-child {
    text-align: left;
}

@media (max-width: 700px) {
    .game-history-card {
        align-items: stretch;
        flex-direction: column;
    }
}

.answer-key-header {
    text-align: center;
}

.answer-key-header h1,
.answer-key-header p {
    margin-block: 0.35rem;
}

.answer-key-content,
.answer-key-waiting {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.round-wager-settings {
    align-items: center;
}

.category-cell {
    display: flex;
    min-width: 0;
    padding: 10px 46px 10px 28px;
    overflow: hidden;
}

.category-cell .category-drag-handle {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.category-cell .category-actions {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
}

.category-cell .category-title {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    overflow-wrap: anywhere;
    word-break: normal;
    hyphens: auto;
    font-size: clamp(0.78rem, 1.15vw, 1.25rem);
    line-height: 1.12;
}


/* Game settings */

.lobby-settings-panel {
    overflow: hidden;
    border: 1px solid var(--gold);
    border-radius: 12px;
    background: color-mix(in srgb, var(--panel) 88%, var(--gold) 12%);
}

.lobby-settings-panel > summary {
    padding: 16px 18px;
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 850;
    cursor: pointer;
}

.lobby-settings-panel[open] > summary {
    border-bottom: 1px solid var(--line);
}

.lobby-settings-panel > form {
    padding: 18px;
}

.lobby-secondary-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
}

.lobby-join-access {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
}

.lobby-join-details {
    min-width: 0;
}

.lobby-join-details > summary {
    list-style: none;
}

.lobby-join-details > summary::-webkit-details-marker {
    display: none;
}

.lobby-join-reveal {
    width: 100%;
    cursor: pointer;
}

.lobby-join-details[open] .lobby-join-reveal {
    border-color: var(--gold);
}

.lobby-join-reveal-content {
    display: grid;
    justify-items: center;
    gap: 16px;
    margin-top: 8px;
    padding: 20px;
    border: 1px solid rgba(242, 177, 52, 0.5);
    border-radius: 12px;
    background: rgba(242, 177, 52, 0.08);
    text-align: center;
}

.lobby-join-code-value {
    font-size: clamp(2rem, 9vw, 4rem);
}

.lobby-join-copy-actions {
    display: flex;
    gap: 8px;
}

.lobby-secondary-actions .lobby-join-copy-actions .icon-button {
    flex: 0 0 46px;
    width: 46px;
    min-width: 46px;
}

.lobby-secondary-actions > *,
.lobby-secondary-actions .button,
.lobby-start-button {
    width: 100%;
}

.lobby-start-button {
    margin-top: -8px;
}

.final-finish-actions {
    justify-content: center;
    margin-top: 18px;
}

@media (max-width: 720px) {
    .lobby-secondary-actions {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .lobby-join-access {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .lobby-start-button {
        margin-top: 0;
    }
}

.settings-description {
    color: var(--muted);
    line-height: 1.55;
}

.host-id-value {
    display: block;
    overflow-wrap: anywhere;
    user-select: all;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin: 12px 0 18px;
}

.settings-grid label {
    display: grid;
    align-content: start;
    gap: 8px;
}

.settings-grid small {
    color: var(--muted);
}

.theme-picker {
    grid-column: 1 / -1;
    margin: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--panel-2) 52%, transparent);
}

.theme-picker summary {
    padding: 2px 4px;
    font-weight: 850;
    cursor: pointer;
    user-select: none;
}

.theme-picker summary::marker {
    color: var(--red-bright);
}

.theme-picker-content {
    padding-top: 16px;
}

.theme-picker-content > p {
    margin-bottom: 16px;
    color: var(--muted);
}

.theme-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.settings-grid .theme-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 12px;
    border: 2px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

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

.theme-option:has(input:checked) {
    border-color: var(--red-bright);
    box-shadow: 0 0 0 3px var(--accent-shadow);
}

.theme-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.theme-option strong {
    min-width: 0;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: auto;
}

.theme-swatch {
    display: flex;
    gap: 3px;
    flex: 0 0 auto;
    padding: 6px;
    border-radius: 999px;
    background: #09090b;
}

.theme-swatch i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef233c;
}

.theme-swatch i:nth-child(2) { background: #f2b134; }
.theme-swatch i:nth-child(3) { background: #f4f4f5; }
.theme-option-crimson .theme-swatch { background: #151118; }
.theme-option-crimson .theme-swatch i { background: #ff4964; }
.theme-option-crimson .theme-swatch i:nth-child(2) { background: #ffbf69; }
.theme-option-crimson .theme-swatch i:nth-child(3) { background: #fff7f7; }
.theme-option-arctic .theme-swatch { background: #0c1725; }
.theme-option-arctic .theme-swatch i { background: #35d9ff; }
.theme-option-arctic .theme-swatch i:nth-child(2) { background: #a78bfa; }
.theme-option-arctic .theme-swatch i:nth-child(3) { background: #eefaff; }
.theme-option-emerald .theme-swatch { background: #0d1b16; }
.theme-option-emerald .theme-swatch i { background: #35d399; }
.theme-option-emerald .theme-swatch i:nth-child(2) { background: #eabf55; }
.theme-option-emerald .theme-swatch i:nth-child(3) { background: #f3fbf5; }
.theme-option-violet .theme-swatch { background: #191126; }
.theme-option-violet .theme-swatch i { background: #c084fc; }
.theme-option-violet .theme-swatch i:nth-child(2) { background: #f472b6; }
.theme-option-violet .theme-swatch i:nth-child(3) { background: #fbf7ff; }
.theme-option-orange .theme-swatch { background: #21140b; }
.theme-option-orange .theme-swatch i { background: #ff8a2a; }
.theme-option-orange .theme-swatch i:nth-child(2) { background: #ffd166; }
.theme-option-orange .theme-swatch i:nth-child(3) { background: #fff8f1; }
.theme-option-light .theme-swatch { background: #ffffff; }
.theme-option-light .theme-swatch i { background: #447dc6; }
.theme-option-light .theme-swatch i:nth-child(2) { background: #b56b0a; }
.theme-option-light .theme-swatch i:nth-child(3) { background: #182230; }
.theme-option-parchment .theme-swatch { background: #f5ecd9; }
.theme-option-parchment .theme-swatch i { background: #cf6841; }
.theme-option-parchment .theme-swatch i:nth-child(2) { background: #8d681e; }
.theme-option-parchment .theme-swatch i:nth-child(3) { background: #392f27; }
.theme-option-mint .theme-swatch { background: #edf5f1; }
.theme-option-mint .theme-swatch i { background: #2b9479; }
.theme-option-mint .theme-swatch i:nth-child(2) { background: #8a6420; }
.theme-option-mint .theme-swatch i:nth-child(3) { background: #20342d; }
.theme-option-ukraine .theme-swatch { background: #0057b8; }
.theme-option-ukraine .theme-swatch i { background: #2f80ed; }
.theme-option-ukraine .theme-swatch i:nth-child(2) { background: #ffd700; }
.theme-option-ukraine .theme-swatch i:nth-child(3) { background: #f7fbff; }
.theme-option-italy .theme-swatch { background: #ffffff; }
.theme-option-italy .theme-swatch i { background: #008c45; }
.theme-option-italy .theme-swatch i:nth-child(2) { background: #f4f4f2; }
.theme-option-italy .theme-swatch i:nth-child(3) { background: #cd212a; }
.theme-option-pride .theme-swatch { background: linear-gradient(90deg, #e40303 0 16.6%, #ff8c00 16.6% 33.2%, #ffed00 33.2% 49.8%, #008026 49.8% 66.4%, #004dff 66.4% 83%, #750787 83%); }
.theme-option-pride .theme-swatch i { background: #ff69c7; }
.theme-option-pride .theme-swatch i:nth-child(2) { background: #ffd166; }
.theme-option-pride .theme-swatch i:nth-child(3) { background: #fff8ff; }
.theme-option-arcade .theme-swatch { background: #10132b; }
.theme-option-arcade .theme-swatch i { background: #ff43d1; }
.theme-option-arcade .theme-swatch i:nth-child(2) { background: #b8f34a; }
.theme-option-arcade .theme-swatch i:nth-child(3) { background: #f8f7ff; }
.theme-option-custom .theme-swatch { background: var(--panel); }
.theme-option-custom .theme-swatch i { background: var(--red-bright); }
.theme-option-custom .theme-swatch i:nth-child(2) { background: var(--gold); }
.theme-option-custom .theme-swatch i:nth-child(3) { background: var(--text); }

.custom-theme-colors {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.settings-grid .custom-theme-colors label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 9px;
    background: var(--panel);
    font-size: 0.82rem;
}

.custom-theme-colors input[type="color"] {
    width: 38px;
    height: 32px;
    flex: 0 0 auto;
    padding: 2px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: transparent;
    cursor: pointer;
}

.settings-grid .settings-checkbox {
    display: flex;
    align-items: center;
    align-self: center;
}

.settings-checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
}

@media (max-width: 700px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .theme-options {
        grid-template-columns: 1fr;
    }

    .custom-theme-colors {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.nav-form {
    display: inline;
}

.nav-link-button {
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.auth-card {
    width: min(100%, 34rem);
    margin: 3rem auto;
}

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

.auth-card input[type="email"],
.auth-card input[type="password"] {
    width: 100%;
}

.auth-card .auth-link {
    color: var(--gold);
    font-weight: 850;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.22em;
}

.auth-card .auth-link:hover,
.auth-card .auth-link:focus-visible {
    color: var(--red-bright);
}
.four-clue-grid {
    --four-clue-gap: clamp(.5rem, 1vw, 1rem);
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: var(--four-clue-gap);
    width: 100%;
}

.four-clue-grid .game-content-block {
    flex: 0 0 calc((100% - 3 * var(--four-clue-gap)) / 4);
    align-self: stretch;
    height: auto;
    min-height: clamp(8rem, 24vh, 18rem);
    padding: clamp(.6rem, 1.3vw, 1.25rem);
    border: 2px solid var(--line);
    border-radius: 1rem;
    background: var(--panel);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.four-clue-grid .game-content-text {
    font-size: clamp(1rem, 2.2vw, 2.25rem);
}

.four-clue-grid .game-content-image {
    width: 100%;
    height: 100%;
    max-height: 24vh;
    object-fit: contain;
}

.four-clue-grid .game-content-audio {
    width: 100%;
    max-width: 22rem;
}

.four-clue-grid .game-content-audio-shell {
    width: 100%;
    max-width: 22rem;
}

.page-heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.page-heading-actions form {
    margin: 0;
}

@media (max-width: 760px) {
    .four-clue-grid {
        flex-wrap: wrap;
    }

    .four-clue-grid .game-content-block {
        flex-basis: calc((100% - var(--four-clue-gap)) / 2);
    }
}
.discord-settings .settings-summary {
    display: grid;
    gap: 0.75rem;
    margin: 0 0 1.25rem;
}

.discord-auto-mute-form {
    display: grid;
    gap: 12px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.discord-auto-mute-actions {
    align-items: center;
    margin-top: 12px;
}

.discord-auto-mute-actions form {
    margin: 0;
}

@media (min-width: 701px) {
    .discord-auto-mute-actions {
        flex-wrap: nowrap;
    }
}

.discord-settings-dialog {
    width: min(920px, calc(100vw - 24px));
    max-width: none;
}

.discord-settings-dialog-card {
    width: 100%;
    height: min(800px, calc(100vh - 36px));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    padding: 0;
    overflow: hidden;
}

.discord-settings-dialog-card .dialog-heading {
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.discord-settings-frame {
    width: 100%;
    height: 100%;
    border: 0;
    background: var(--bg);
}

.embedded-discord-settings .page-shell {
    width: 100%;
    max-width: none;
    padding: 12px 18px;
}

.embedded-discord-settings .discord-settings {
    width: 100%;
    max-width: none;
    margin: 0;
}

.discord-settings .settings-summary > div {
    display: grid;
    grid-template-columns: minmax(8rem, 0.6fr) 1fr;
    gap: 1rem;
}

.discord-settings dt {
    color: var(--muted);
}

.discord-settings dd {
    margin: 0;
}

.discord-health-ok {
    color: #63d884;
}

.discord-health-error {
    color: var(--red-bright);
}

.discord-operation-status {
    min-height: 1.5rem;
    padding: 0.25rem 1rem;
    text-align: center;
}

.question-clue-hidden {
    display: none !important;
}

/* User question conversations */
.question-conversation-page,
.question-inbox-page {
    width: min(100%, 1120px);
    margin: 0 auto;
}

.question-conversation-heading {
    margin-bottom: 20px;
}

.question-conversation-heading h1,
.question-inbox-page > h1 {
    margin-bottom: 10px;
}

.question-conversation-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0;
    color: var(--muted);
}

.question-conversation-meta strong {
    color: var(--text);
}

.question-conversation,
.question-inbox-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: color-mix(in srgb, var(--panel-glass) 92%, transparent);
    box-shadow: 0 14px 34px color-mix(in srgb, var(--bg) 30%, transparent);
}

.question-inbox-list {
    display: grid;
    gap: 24px;
}

.question-inbox-card-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--panel-2) 72%, var(--panel));
}

.question-inbox-card-label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.question-messages {
    display: grid;
    gap: 12px;
    padding: 20px;
}

.question-message {
    position: relative;
    min-width: 0;
    padding: 14px 16px 15px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-2);
}

.question-message::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    border-radius: 12px 0 0 12px;
    content: "";
}

.question-message-user::before {
    background: var(--gold);
}

.question-message-developer::before {
    background: var(--red-bright);
}

.question-message-user {
    background: color-mix(in srgb, var(--gold) 7%, var(--panel-2));
}

.question-message-developer {
    background: color-mix(in srgb, var(--red-bright) 7%, var(--panel-2));
}

.question-message-author {
    margin-bottom: 7px;
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.035em;
}

.question-message-user .question-message-author {
    color: var(--gold);
}

.question-message-developer .question-message-author {
    color: var(--red-bright);
}

.question-message-body {
    margin: 0;
    line-height: 1.55;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.question-status {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 20px 20px;
    padding: 12px 14px;
    border: 1px solid color-mix(in srgb, var(--gold) 52%, var(--line));
    border-radius: 10px;
    background: color-mix(in srgb, var(--gold) 8%, var(--panel));
    color: var(--muted);
}

.question-status strong {
    color: var(--text);
}

.question-reply-panel {
    padding: 20px;
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--panel) 88%, var(--bg));
}

.question-reply-form {
    display: grid;
    gap: 10px;
}

.question-reply-form label {
    color: var(--text);
    font-weight: 850;
}

.question-reply-form textarea {
    min-height: 132px;
}

.question-reply-form .form-actions {
    margin-top: 2px;
}

.question-inbox-actions-panel:has(> .form-actions) {
    padding-top: 16px;
    padding-bottom: 16px;
}

@media (max-width: 700px) {
    .question-inbox-list {
        gap: 18px;
    }

    .question-inbox-card-header,
    .question-messages,
    .question-reply-panel {
        padding: 16px;
    }

    .question-status {
        margin: 0 16px 16px;
    }

    .question-message {
        padding: 12px 13px 13px;
    }

    .question-reply-form .form-actions,
    .question-inbox-actions-panel > .form-actions {
        width: 100%;
    }

    .question-reply-form .form-actions .button,
    .question-inbox-actions-panel > .form-actions .button {
        flex: 1 1 auto;
    }
}

/* My questions */
.my-questions-page {
    width: min(100%, 1120px);
    margin: 0 auto;
}

.my-questions-page .page-heading {
    margin-bottom: 20px;
}

.my-questions-list {
    display: grid;
    gap: 16px;
}

.my-question-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: color-mix(in srgb, var(--panel-glass) 92%, transparent);
    box-shadow: 0 12px 30px color-mix(in srgb, var(--bg) 26%, transparent);
    transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.my-question-card:hover {
    border-color: color-mix(in srgb, var(--gold) 55%, var(--line));
    transform: translateY(-1px);
    box-shadow: 0 16px 34px color-mix(in srgb, var(--bg) 34%, transparent);
}

.my-question-card-main {
    min-width: 0;
    display: grid;
    gap: 16px;
    padding: 20px;
}

.my-question-preview {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text);
    font-size: 1.06rem;
    font-weight: 800;
    line-height: 1.5;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

    .my-question-preview::before {
        width: 4px;
        min-height: 2.8em;
        align-self: stretch;
        flex: 0 0 4px;
        border-radius: 999px;
        background: var(--gold);
        content: "";
    }

.my-question-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px 14px;
    color: var(--muted);
    font-size: 0.84rem;
}

.my-question-meta strong {
    color: var(--text);
    font-weight: 800;
}

.my-question-status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 900;
    line-height: 1.2;
}

.my-question-status.is-waiting {
    color: var(--gold);
    border-color: color-mix(in srgb, var(--gold) 55%, var(--line));
    background: color-mix(in srgb, var(--gold) 9%, var(--panel));
}

.my-question-status.is-replyable {
    color: var(--red-bright);
    border-color: color-mix(in srgb, var(--red-bright) 55%, var(--line));
    background: color-mix(in srgb, var(--red-bright) 9%, var(--panel));
}

.my-question-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 18px;
    border-left: 1px solid var(--line);
    background: color-mix(in srgb, var(--panel) 88%, var(--bg));
}

.my-question-actions .button {
    min-width: 132px;
}

.my-questions-empty {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--panel-glass) 92%, transparent);
    color: var(--muted);
}

.my-questions-empty p {
    margin: 0;
}

@media (max-width: 700px) {
    .my-questions-list {
        gap: 14px;
    }

    .my-question-card {
        grid-template-columns: 1fr;
    }

    .my-question-card-main {
        padding: 16px;
    }

    .my-question-actions {
        flex-direction: row;
        padding: 14px 16px 16px;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .my-question-actions .button {
        min-width: 0;
        flex: 1 1 auto;
    }
}

.answer-reward-decay-setting-disabled {
    opacity: 0.55;
}

    .answer-reward-decay-setting-disabled input {
        cursor: not-allowed;
    }

.question-reward-changed {
    animation: question-reward-changed 420ms ease-out;
    transform-origin: left center;
}

@media (prefers-reduced-motion: reduce) {
    .question-reward-changed {
        animation: none;
    }
}

@keyframes question-reward-changed {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }

    35% {
        transform: scale(1.25);
        filter: brightness(1.45);
    }

    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

[data-question-reward] {
    display: inline-block;
    transform-origin: center;
}

[data-question-reward].question-reward-changed {
    animation: question-reward-changed 420ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
    [data-question-reward].question-reward-changed {
        animation: none;
    }
}

.answer-result-card .answer-result-player-name {
    max-width: 100%;
    margin-bottom: clamp(4px, 1vh, 10px);
    overflow: hidden;
    white-space: nowrap;
    font-size: clamp(1.5rem, 3vw, 2.6rem);
    line-height: 1.02;
}

.answer-result-card .answer-result-score {
    display: block;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    font-size: clamp(3.25rem, 6vw, 5rem);
    font-weight: 950;
    line-height: 1;
}

.answer-result-overlay-content {
    gap: 14px;
}

.final-player-action-icon {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    line-height: 1;
}


/* Player card quick score context menu */
.player-score-context-menu {
    position: fixed;
    inset: auto;
    margin: 0;
    z-index: 10000;
    display: flex;
    gap: 6px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-glass);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .5);
}

.player-score-context-menu[hidden] {
    display: none !important;
}

.player-score-context-action {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    background: var(--panel-2);
    font-size: 1.7rem;
    font-weight: 950;
    line-height: 1;
    cursor: pointer;
}

.player-score-context-add {
    color: color-mix(in srgb, #3fb950 76%, var(--text));
}

.player-score-context-subtract {
    color: color-mix(in srgb, #ef233c 82%, var(--text));
}

.player-score-context-action:hover,
.player-score-context-action:focus-visible {
    border-color: var(--gold);
    outline: none;
}

.quick-score-warning {
    margin: 0;
}


/* Quick score adjustment dialog mode */
.quick-score-dialog-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.quick-score-dialog-title-row h2 {
    margin: 0;
}

.quick-score-mode-badge {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 10px;
    font-size: 1.75rem;
    font-weight: 950;
    line-height: 1;
}

#quick-score-dialog[data-quick-score-mode="add"] .quick-score-dialog-card {
    border-color: color-mix(in srgb, #3fb950 65%, var(--line));
}

#quick-score-dialog[data-quick-score-mode="add"] .quick-score-mode-badge {
    color: color-mix(in srgb, #3fb950 82%, var(--text));
    background: color-mix(in srgb, #3fb950 14%, var(--panel));
}

#quick-score-dialog[data-quick-score-mode="subtract"] .quick-score-dialog-card {
    border-color: color-mix(in srgb, #ef233c 68%, var(--line));
}

#quick-score-dialog[data-quick-score-mode="subtract"] .quick-score-mode-badge {
    color: color-mix(in srgb, #ef233c 84%, var(--text));
    background: color-mix(in srgb, #ef233c 14%, var(--panel));
}

/* Question card context menu */
.question-context-menu {
    position: fixed;
    inset: auto;
    margin: 0;
    z-index: 10000;
    display: grid;
    grid-template-columns: repeat(2, 42px);
    gap: 4px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-glass);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .5);
}

.question-context-menu[hidden] {
    display: none !important;
}

.question-context-action {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text);
    background: transparent;
    font: inherit;
    font-size: 1.15rem;
    font-weight: 800;
    cursor: pointer;
}

.question-context-action:hover,
.question-context-action:focus-visible {
    border-color: var(--gold);
    background: var(--panel-2);
    outline: none;
}

.question-context-gift {
    font-size: 1.2rem;
}

.question-context-close {
    color: color-mix(in srgb, #ef233c 82%, var(--text));
}


/* Category context menu */
.category-context-menu {
    position: fixed;
    inset: auto;
    margin: 0;
    z-index: 10000;
    display: grid;
    grid-template-columns: 42px;
    gap: 4px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-glass);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .5);
}

.category-context-menu[hidden] {
    display: none !important;
}

.category-context-action {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    color: color-mix(in srgb, #ef233c 82%, var(--text));
    background: transparent;
    font: inherit;
    font-size: 1.15rem;
    font-weight: 800;
    cursor: pointer;
}

.category-context-action:hover,
.category-context-action:focus-visible {
    border-color: var(--gold);
    background: var(--panel-2);
    outline: none;
}


.host-board-column h3[data-category-preview-url] {
    border: 1px solid var(--line);
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: border-color 120ms ease, transform 120ms ease;
}

.host-board-column h3[data-category-preview-url]:hover,
.host-board-column h3[data-category-preview-url]:focus-visible {
    border-color: var(--red-bright);
    transform: translateY(-1px);
    outline: none;
}


/* Issue 165: quick timer time controls */
.game-timer-actions,
.game-timer-primary-control {
    display: contents;
}

.game-timer-quick-actions {
    position: absolute;
    z-index: 12;
    top: 100%;
    left: 50%;
    width: max-content;
    display: grid;
    grid-template-columns: repeat(2, 44px);
    gap: 5px;
    padding-top: 6px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-50%);
    transition: opacity 120ms ease, visibility 120ms ease;
}

.host-game-timer:hover .game-timer-quick-actions,
.host-game-timer:focus-within .game-timer-quick-actions {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.game-timer-quick-actions .game-timer-control {
    margin: 0;
}

.game-timer-quick-actions button {
    min-width: 44px;
}


/* Host-only timer expiration impact notification. */
.question-skip-unanimous-notification[hidden] {
    display: none !important;
}

.question-skip-unanimous-notification {
    position: fixed;
    z-index: 1320;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgb(0 0 0 / 34%);
    pointer-events: none;
    opacity: 0;
}

.question-skip-unanimous-card {
    width: min(820px, calc(100vw - 40px));
    box-sizing: border-box;
    padding: clamp(22px, 4vw, 42px);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: clamp(16px, 3vw, 28px);
    border: 2px solid color-mix(in srgb, var(--gold) 76%, white 18%);
    border-radius: 24px;
    background: color-mix(in srgb, var(--panel) 94%, black);
    box-shadow:
        0 30px 90px rgb(0 0 0 / 58%),
        0 0 54px color-mix(in srgb, var(--gold) 22%, transparent);
}

.question-skip-unanimous-icon {
    display: grid;
    place-items: center;
    width: clamp(64px, 9vw, 92px);
    aspect-ratio: 1;
    border: 2px solid color-mix(in srgb, var(--gold) 78%, white 14%);
    border-radius: 50%;
    background: color-mix(in srgb, var(--gold) 10%, var(--panel-2));
    color: var(--gold);
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1;
}

.question-skip-unanimous-card strong {
    color: var(--text);
    font-size: clamp(1.7rem, 4.6vw, 3.8rem);
    font-weight: 950;
    line-height: 1.04;
    text-wrap: balance;
}

.question-skip-unanimous-notification.is-visible {
    animation: question-skip-unanimous-in 360ms cubic-bezier(.16, 1, .3, 1) both;
}

.question-skip-unanimous-notification.is-leaving {
    animation: question-skip-unanimous-out 320ms ease both;
}

@keyframes question-skip-unanimous-in {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes question-skip-unanimous-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@media (max-width: 620px) {
    .question-skip-unanimous-card {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .question-skip-unanimous-notification.is-visible,
    .question-skip-unanimous-notification.is-leaving {
        animation-duration: 1ms;
    }
}

.question-timeout-notification {
    position: fixed;
    z-index: 1300;
    top: clamp(82px, 13vh, 150px);
    left: 50%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: clamp(14px, 2vw, 24px);
    width: min(760px, calc(100vw - 32px));
    padding: clamp(18px, 3vw, 30px) clamp(22px, 4vw, 38px);
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--red-bright) 78%, white 22%);
    border-radius: 22px;
    background: linear-gradient(115deg, rgba(193, 18, 31, 0.94), rgba(42, 6, 12, 0.97) 58%, rgba(9, 9, 12, 0.98)), var(--panel);
    box-shadow: 0 26px 80px rgba(0, 0, 0, 0.52), 0 0 46px color-mix(in srgb, var(--red-bright) 40%, transparent), inset 0 1px rgba(255, 255, 255, 0.12);
    color: var(--text);
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -24px) scale(0.88);
    transform-origin: 50% 35%;
    isolation: isolate;
}

.question-timeout-notification::before,
.question-timeout-notification::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.question-timeout-notification::before {
    z-index: -2;
    background: repeating-linear-gradient(120deg, transparent 0 28px, rgba(255, 255, 255, 0.035) 28px 30px);
}

.question-timeout-notification::after {
    z-index: -1;
    inset: auto -12% -80% 28%;
    height: 190%;
    background: radial-gradient(circle, rgba(242, 177, 52, 0.24), transparent 62%);
}

.question-timeout-notification.is-visible {
    animation: question-timeout-impact 620ms cubic-bezier(.16, 1.2, .3, 1) both;
}

.question-timeout-notification.is-leaving {
    animation: question-timeout-exit 420ms ease both;
}

.question-timeout-notification-glow {
    position: absolute;
    inset: -50%;
    z-index: -1;
    background: conic-gradient(from 90deg, transparent, rgba(239, 35, 60, 0.28), transparent 34%, rgba(242, 177, 52, 0.18), transparent 70%);
    animation: question-timeout-glow 3.8s linear infinite;
}

.question-timeout-notification-icon {
    display: grid;
    place-items: center;
    width: clamp(58px, 8vw, 82px);
    aspect-ratio: 1;
    border: 2px solid rgba(255, 255, 255, 0.72);
    border-radius: 50%;
    background: rgba(7, 7, 9, 0.34);
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.05), 0 0 30px rgba(242, 177, 52, 0.28);
    font-size: clamp(2rem, 5vw, 3.25rem);
    line-height: 1;
}

.question-timeout-notification-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.question-timeout-notification-kicker {
    color: var(--gold);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.question-timeout-notification-copy strong {
    font-size: clamp(2rem, 7vw, 4.6rem);
    font-weight: 950;
    letter-spacing: -0.055em;
    line-height: 0.95;
    text-shadow: 0 4px 22px rgba(0, 0, 0, 0.4);
}

.question-timeout-notification-copy [data-question-timeout-message] {
    margin-top: 6px;
    color: rgba(255, 255, 255, 0.86);
    font-size: clamp(0.9rem, 2vw, 1.08rem);
    font-weight: 650;
}

@keyframes question-timeout-impact {
    0% { opacity: 0; transform: translate(-50%, -34px) scale(0.76) rotate(-1.5deg); filter: brightness(1.7); }
    52% { opacity: 1; transform: translate(-50%, 5px) scale(1.035) rotate(0.5deg); }
    72% { transform: translate(-50%, -2px) scale(0.99); }
    100% { opacity: 1; transform: translate(-50%, 0) scale(1); filter: brightness(1); }
}

@keyframes question-timeout-exit {
    from { opacity: 1; transform: translate(-50%, 0) scale(1); }
    to { opacity: 0; transform: translate(-50%, -18px) scale(0.96); }
}

@keyframes question-timeout-glow {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .question-timeout-notification.is-visible,
    .question-timeout-notification.is-leaving,
    .question-timeout-notification-glow {
        animation-duration: 1ms;
        animation-iteration-count: 1;
    }
}


/* All-player question runtime layout */
.all-player-host-choice-preview {
    display: grid;
    width: min(100%, 84rem);
    margin: 1rem auto 0;
    align-self: stretch;
    justify-self: stretch;
}

.question-presentation > .all-player-host-close-form {
    display: flex;
    justify-content: center;
    margin: 0 0 0.65rem;
}

.all-player-host-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(0, 1fr);
    width: 100%;
    gap: clamp(0.75rem, 1.5vw, 1.25rem);
}

.all-player-host-choice-option {
    min-width: 0;
    min-height: clamp(5rem, 10vh, 8rem);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.8rem, 1.6vw, 1.35rem);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--panel-2);
    font-size: clamp(1.4rem, 2.6vw, 3rem);
    text-align: center;
}

.all-player-host-choice-option img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: min(28vh, 20rem);
    object-fit: contain;
}

.all-player-multiple-choice-answer-presentation .game-content-blocks,
.all-player-answer-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-rows: minmax(4.5rem, auto);
    align-items: stretch;
    justify-items: stretch;
    align-content: center;
    width: 100%;
    overflow: hidden;
    gap: clamp(0.5rem, 1vw, 0.85rem) !important;
}

.all-player-multiple-choice-answer-presentation .game-content-block,
.all-player-answer-option {
    min-width: 0;
    width: 100%;
    min-height: clamp(4.5rem, 13vh, 8rem);
    height: auto !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    padding: clamp(0.45rem, 0.8vw, 0.75rem);
    overflow: hidden;
    border: 3px solid #c62828;
    border-radius: 0.8rem;
    text-align: center;
}

.all-player-answer-option-correct,
.all-player-multiple-choice-answer-presentation .game-content-block:first-child {
    border-color: #2e7d32;
}

.all-player-answer-option-incorrect {
    border-color: #c62828;
}

.all-player-multiple-choice-answer-presentation .game-content-text,
.all-player-multiple-choice-answer-presentation .game-content-caption,
.all-player-answer-option .game-content-text,
.all-player-answer-option .game-content-caption {
    width: 100%;
    margin: 0;
    text-align: center;
}

.all-player-multiple-choice-answer-presentation .game-content-text,
.all-player-answer-option .game-content-text {
    font-size: clamp(1.5rem, 3vw, 3.25rem);
}

.all-player-multiple-choice-answer-presentation .game-content-image,
.all-player-answer-option .game-content-image {
    display: block;
    width: 100%;
    height: min(14vh, 9rem);
    min-height: 0;
    max-height: min(14vh, 9rem);
    object-fit: contain;
}



/* All-player host hover drawers */
@media (hover: hover) and (pointer: fine) and (min-width: 801px) {
    .host-game-board
        .current-question-summary:has(.all-player-host-choice-preview)
        > .question-presentation {
        --all-player-choice-action-width: clamp(15rem, 21vw, 20rem);
        position: relative;
    }

    .host-game-board
        .current-question-summary:has(.all-player-host-choice-preview)
        > .question-presentation > .game-content-blocks {
        padding-bottom: 3.5rem;
    }

    .host-game-board
        .current-question-summary:has(.all-player-host-choice-preview)
        .all-player-host-choice-preview {
        position: absolute;
        z-index: 35;
        right: auto;
        bottom: 0;
        left: 50%;
        width: min(
            84rem,
            calc(
                100% - var(--all-player-choice-action-width) -
                var(--all-player-choice-action-width) - 2rem));
        max-height: min(48dvh, 25rem);
        margin: 0;
        padding: 3.2rem 0.75rem 0.75rem;
        overflow: hidden;
        border: 1px solid var(--line);
        border-bottom: 0;
        border-radius: 0.9rem 0.9rem 0 0;
        background: var(--panel-glass);
        box-shadow: 0 -18px 38px rgb(0 0 0 / 28%);
        transform: translate(-50%, calc(100% - 2.75rem));
        transition: transform 180ms ease, box-shadow 180ms ease;
    }

    .host-game-board
        .current-question-summary:has(.all-player-host-choice-preview)
        > .question-presentation > .all-player-host-close-form {
        position: absolute;
        z-index: 36;
        right: auto;
        bottom: 0.15rem;
        left: 0.5rem;
        width: var(--all-player-choice-action-width);
        margin: 0;
        transform: none;
        white-space: nowrap;
    }

    .host-game-board
        .current-question-summary:has(.all-player-host-choice-preview)
        > .question-presentation > .all-player-host-close-form > .button {
        width: 100%;
    }

    .host-game-board
        .current-question-summary:has(.all-player-host-choice-preview)
        .all-player-host-choice-preview::before {
        content: "▦";
        position: absolute;
        top: 0;
        right: 0;
        left: 0;
        height: 2.75rem;
        display: grid;
        place-items: center;
        border-bottom: 1px solid var(--line);
        border-radius: 0.85rem 0.85rem 0 0;
        background: var(--panel-2);
        color: var(--text);
        font-size: 1.2rem;
        line-height: 1;
        pointer-events: none;
    }

    .host-game-board
        .current-question-summary:has(.all-player-host-choice-preview)
        .all-player-host-choice-preview:hover,
    .host-game-board
        .current-question-summary:has(.all-player-host-choice-preview)
        .all-player-host-choice-preview:focus,
    .host-game-board
        .current-question-summary:has(.all-player-host-choice-preview)
        .all-player-host-choice-preview:focus-within {
        box-shadow: 0 -20px 44px rgb(0 0 0 / 36%);
        transform: translate(-50%, 0);
    }

    .host-game-board
        .current-question-summary:has(.all-player-host-choice-preview)
        .all-player-host-choice-preview:focus-visible {
        outline: 2px solid var(--gold);
        outline-offset: -2px;
    }

    .host-game-board
        .current-question-summary:has(.all-player-host-choice-preview)
        .all-player-host-choice-grid {
        max-height: calc(min(48dvh, 25rem) - 4rem);
        gap: clamp(0.45rem, 0.8vw, 0.7rem);
        overflow-y: auto;
        overscroll-behavior: contain;
        padding-right: 2px;
    }

    .host-game-board
        .current-question-summary:has(.all-player-host-choice-preview)
        .all-player-host-choice-option {
        min-height: clamp(4rem, 8vh, 6.5rem);
        padding: clamp(0.55rem, 1vw, 0.85rem);
        font-size: clamp(1.2rem, 2vw, 2.25rem);
    }

    .host-game-board
        .current-question-summary:has(.all-player-host-choice-preview)
        .all-player-host-choice-option img {
        height: min(16vh, 8rem);
        max-height: min(16vh, 8rem);
    }

    .host-game-board.all-player-question-answering
        .current-question-summary {
        position: relative;
    }

    .host-game-board.all-player-question-answering
        .current-question-summary .all-player-host-progress {
        position: absolute;
        z-index: 40;
        top: clamp(3.25rem, 8vh, 5rem);
        right: 0;
        bottom: clamp(3.5rem, 7vh, 4.75rem);
        width: min(24rem, calc(100% - 1rem));
        max-width: none;
        grid-template-columns: 1fr;
        align-content: start;
        gap: 0.5rem;
        margin: 0;
        padding: 0.65rem 0.65rem 0.65rem 3.25rem;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
        border: 1px solid var(--line);
        border-right: 0;
        border-radius: 0.9rem 0 0 0.9rem;
        background: var(--panel-glass);
        box-shadow: -18px 0 38px rgb(0 0 0 / 28%);
        transform: translateX(calc(100% - 2.75rem));
        transition: transform 180ms ease, box-shadow 180ms ease;
    }

    .host-game-board.all-player-question-answering
        .current-question-summary .all-player-host-progress::before {
        content: "👥";
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        width: 2.75rem;
        display: grid;
        place-items: center;
        border-right: 1px solid var(--line);
        border-radius: 0.85rem 0 0 0.85rem;
        background: var(--panel-2);
        color: var(--text);
        font-size: 1.15rem;
        line-height: 1;
        pointer-events: none;
    }

    .host-game-board.all-player-question-answering
        .current-question-summary .all-player-host-progress:hover,
    .host-game-board.all-player-question-answering
        .current-question-summary .all-player-host-progress:focus,
    .host-game-board.all-player-question-answering
        .current-question-summary .all-player-host-progress:focus-within {
        box-shadow: -20px 0 44px rgb(0 0 0 / 36%);
        transform: translateX(0);
    }

    .host-game-board.all-player-question-answering
        .current-question-summary .all-player-host-progress:focus-visible {
        outline: 2px solid var(--gold);
        outline-offset: -2px;
    }

    .host-game-board.all-player-question-answering
        .current-question-summary .all-player-answer-progress {
        grid-template-columns: 1fr;
        align-content: start;
        overflow: visible;
    }
}

@media (prefers-reduced-motion: reduce) {
    .all-player-host-choice-preview,
    .all-player-host-progress {
        transition: none !important;
    }
}


/* All-player per-player wagering and private text review */
.all-player-wager-waiting {
    min-height: min(58dvh, 38rem);
    display: grid;
    place-items: center;
    text-align: center;
}

.all-player-answer-progress .final-player-action-icon {
    flex: 0 0 auto;
}

.all-player-host-review {
    width: min(100%, 72rem);
    margin: auto;
}

.host-game-board.all-player-text-reviewing
    .question-presentation > .game-content-blocks,
.host-game-board.all-player-text-reviewing
    .question-presentation > .all-player-host-choice-preview,
.host-game-board.all-player-text-reviewing
    .all-player-host-close-form,
.host-game-board.all-player-text-reviewing
    .all-player-host-timer-form {
    display: none !important;
}

.host-game-board.all-player-text-reviewing
    .all-player-host-review .final-player-answer-presentation {
    min-height: clamp(12rem, 42dvh, 30rem);
}

/* Stable all-player controls and full-width wager waiting */
.host-game-board:has(> .current-question-summary.wager-mode:has(.all-player-wager-waiting)) {
    width: calc(100vw - 32px);
    max-width: none;
    margin-top: -17px;
    margin-right: calc(50% - 50vw + 16px);
    margin-left: calc(50% - 50vw + 16px);
}

.current-question-summary.wager-mode:has(.all-player-wager-waiting) {
    width: 100%;
    max-width: none;
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    max-height: none;
    margin: 0;
    box-sizing: border-box;
    grid-template-rows: auto minmax(0, 1fr) auto;
    align-content: stretch;
    justify-items: stretch;
    padding: 16px clamp(24px, 4vw, 56px) 8px;
    overflow: hidden;
}

.current-question-summary.wager-mode:has(.all-player-wager-waiting)
    .current-question-heading {
    width: 100%;
}

.current-question-summary.wager-mode:has(.all-player-wager-waiting)
    .all-player-wager-waiting {
    min-height: 0;
    height: 100%;
    grid-row: 2;
}

.all-player-host-primary-action {
    min-height: 42px;
    grid-row: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 0.5rem;
}

.player-lobby.all-player-runtime-active .player-buzzer-panel {
    display: none !important;
}

.page-shell:has(.player-lobby.all-player-runtime-active) {
    overflow-x: hidden;
    overflow-y: auto;
}

@media (max-width: 900px) {
    .host-game-board:has(> .current-question-summary.wager-mode:has(.all-player-wager-waiting)) {
        margin-top: -10px;
    }
}

@media (max-width: 700px) {
    .page-shell:has(.player-lobby.all-player-runtime-active) {
        height: auto;
        min-height: 100dvh;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .player-lobby:has(.player-buzzer-panel).all-player-runtime-active {
        height: auto;
        min-height: 100%;
        overflow: visible;
    }
}

/* Explicit all-player wager layout state. */
.host-game-board.all-player-question-wagering {
    width: calc(100vw - 32px) !important;
    max-width: none !important;
    margin-right: calc(50% - 50vw + 16px) !important;
    margin-left: calc(50% - 50vw + 16px) !important;
}

.host-game-board.all-player-question-wagering
    > [data-host-gameplay-view]
    > .current-question-summary.wager-mode {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    justify-self: stretch !important;
    align-self: stretch !important;
}


/* Anonymous shared wager stable layouts */
.round-wager-settings #random-wager-count-setting,
.round-wager-settings #random-anonymous-shared-wager-count-setting {
    display: grid;
    gap: 5px;
}

.round-wager-settings #random-wager-count-setting.is-disabled,
.round-wager-settings #random-anonymous-shared-wager-count-setting.is-disabled {
    opacity: 0.58;
}

.round-wager-settings #random-wager-count-setting.is-disabled input,
.round-wager-settings #random-anonymous-shared-wager-count-setting.is-disabled input {
    cursor: not-allowed;
}

.host-game-board.anonymous-shared-wager-active {
    width: calc(100vw - 32px);
    max-width: none;
    margin-top: -17px;
    margin-right: calc(50% - 50vw + 16px);
    margin-left: calc(50% - 50vw + 16px);
    overflow-y: hidden;
}

.host-game-board.anonymous-shared-wager-active > [data-host-gameplay-view] {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.host-game-board.anonymous-shared-wager-active
    > [data-host-gameplay-view]
    > .current-question-summary {
    width: 100%;
    max-width: none;
    flex: 1 1 auto;
    margin-bottom: 0;
}

.host-game-board.anonymous-shared-wager-active
    > [data-host-gameplay-view]
    > .current-question-summary.wager-mode.anonymous-shared-wager-mode {
    height: auto;
    min-height: 0;
    max-height: none;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    align-content: stretch;
    justify-items: stretch;
    padding: 16px clamp(24px, 4vw, 56px) 8px;
    overflow: hidden;
}

.current-question-summary.wager-mode.anonymous-shared-wager-mode
    .current-question-heading {
    width: 100%;
}

.current-question-summary.wager-mode.anonymous-shared-wager-mode
    > .anonymous-shared-wager-host-panel {
    width: min(760px, 100%);
    min-height: 0;
    align-self: stretch;
    justify-self: center;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 12px;
    text-align: center;
}

.anonymous-shared-wager-host-panel h3,
.anonymous-shared-wager-host-panel p,
.anonymous-shared-wager-player-panel h2,
.anonymous-shared-wager-player-panel p {
    margin: 0;
}

.anonymous-shared-wager-host-panel ul {
    margin: 0;
    padding-left: 1.4rem;
    text-align: left;
}

.anonymous-shared-wager-host-panel li + li {
    margin-top: 6px;
}

.question-controls > .anonymous-shared-wager-host-panel {
    flex: 1 0 100%;
    width: 100%;
    display: grid;
    justify-items: center;
    gap: 10px;
    text-align: center;
}

.anonymous-shared-wager-player-panel {
    width: 100%;
    display: grid;
    align-content: start;
    gap: 16px;
}

.anonymous-shared-wager-choices {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
}

.anonymous-shared-wager-choices .button {
    width: 100%;
    min-width: 0;
    padding-inline: clamp(6px, 2vw, 14px);
}

.anonymous-shared-wager-choices .button.is-selected {
    color: var(--gold);
    border-color: var(--gold);
    box-shadow: inset 0 0 0 2px var(--gold);
}

.anonymous-shared-wager-selection {
    width: 100%;
    color: var(--gold);
    font-weight: 800;
    text-align: center;
}

.anonymous-shared-wager-confirm {
    width: min(360px, 100%);
    justify-self: center;
}

@media (max-width: 900px) {
    .host-game-board.anonymous-shared-wager-active {
        margin-top: -10px;
    }
}

@media (max-width: 420px) {
    .anonymous-shared-wager-choices {
        gap: 4px;
    }

    .anonymous-shared-wager-choices .button {
        padding-inline: 4px;
        font-size: 0.9rem;
    }
}


/* Host tools dialog */
.host-tools-dialog {
    width: min(820px, calc(100vw - 28px));
    max-height: calc(100dvh - 28px);
    overflow: visible;
}

.host-tools-dialog::backdrop {
    background:
        radial-gradient(circle at 50% 20%, rgba(15, 90, 165, 0.18), transparent 36rem),
        rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(8px);
}

.host-tools-dialog-card {
    max-height: calc(100dvh - 28px);
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 22px;
    background:
        linear-gradient(145deg, var(--panel-2), var(--panel-gradient-end));
    box-shadow:
        0 28px 90px rgba(0, 0, 0, 0.62),
        0 0 0 1px rgba(255, 255, 255, 0.025) inset;
}

.host-tools-dialog .dialog-heading {
    position: sticky;
    top: 0;
    z-index: 2;
    align-items: center;
    margin: 0;
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--line);
    background:
        linear-gradient(180deg, var(--panel-2), var(--panel));
}

.host-tools-dialog-title {
    min-width: 0;
}

.host-tools-dialog-title h2 {
    margin: 3px 0 0;
    font-size: clamp(1.45rem, 2.5vw, 1.9rem);
    letter-spacing: -0.025em;
}

.host-tools-kicker {
    display: block;
    color: var(--gold);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.18em;
}

.host-tools-dialog .dialog-close {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--panel);
}

.host-tools-dialog-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
    max-height: calc(100dvh - 122px);
    padding: 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.host-tools-action-form {
    display: contents;
}

.host-tools-action-form[hidden],
.host-tools-action[hidden] {
    display: none !important;
}

.host-tools-action {
    position: relative;
    width: 100%;
    min-width: 0;
    min-height: 74px;
    margin: 0;
    padding: 13px 15px;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    gap: 13px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 15px;
    background:
        linear-gradient(145deg, var(--panel), var(--panel-2));
    color: var(--text);
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.16),
        0 1px 0 rgba(255, 255, 255, 0.025) inset;
    transition:
        transform 140ms ease,
        border-color 140ms ease,
        background 140ms ease,
        box-shadow 140ms ease;
}

.host-tools-action::after {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background:
        linear-gradient(110deg, transparent 45%, rgba(255, 255, 255, 0.035));
    content: "";
}

.host-tools-action:hover,
.host-tools-action:focus-visible {
    z-index: 1;
    border-color: var(--gold);
    background:
        linear-gradient(145deg, var(--panel-2), var(--panel));
    transform: translateY(-2px);
    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.28),
        0 0 0 1px rgba(242, 177, 52, 0.08) inset;
    outline: none;
}

.host-tools-action:active {
    transform: translateY(0);
}

.host-tools-action:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.host-tools-action-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--panel-2);
    color: var(--gold);
    font-size: 1.22rem;
    font-weight: 950;
    line-height: 1;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.host-tools-action-label {
    min-width: 0;
    color: var(--text);
    font-size: 0.98rem;
    font-weight: 850;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.host-tools-action-wide,
.host-tools-action-warning,
.host-tools-action-danger {
    grid-column: 1 / -1;
}

.host-tools-action-warning {
    border-color: rgba(255, 176, 32, 0.52);
    background:
        linear-gradient(145deg, rgba(255, 176, 32, 0.10), var(--panel));
}

.host-tools-action-warning .host-tools-action-icon {
    border-color: rgba(255, 176, 32, 0.58);
    background: rgba(255, 176, 32, 0.11);
    color: #ffc45a;
}

.host-tools-action-warning:hover,
.host-tools-action-warning:focus-visible {
    border-color: #ffc45a;
}

.host-tools-action-danger {
    border-color: rgba(239, 35, 60, 0.48);
    background:
        linear-gradient(145deg, rgba(239, 35, 60, 0.09), var(--panel));
}

.host-tools-action-danger .host-tools-action-icon {
    border-color: rgba(239, 35, 60, 0.58);
    background: rgba(239, 35, 60, 0.11);
    color: #ff7f88;
}

.host-tools-action-danger:hover,
.host-tools-action-danger:focus-visible {
    border-color: #ff6b78;
}

@media (max-width: 640px) {
    .host-tools-dialog {
        width: calc(100vw - 14px);
        max-height: calc(100dvh - 14px);
    }

    .host-tools-dialog-card {
        max-height: calc(100dvh - 14px);
        border-radius: 18px;
    }

    .host-tools-dialog .dialog-heading {
        padding: 17px 17px 14px;
    }

    .host-tools-dialog-actions {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        max-height: calc(100dvh - 102px);
        padding: 12px;
    }

    .host-tools-action {
        min-height: 62px;
        grid-template-columns: 40px minmax(0, 1fr);
        gap: 10px;
        padding: 10px 12px;
        border-radius: 12px;
    }

    .host-tools-action-icon {
        width: 40px;
        height: 40px;
        border-radius: 11px;
        font-size: 1.08rem;
    }

    .host-tools-action-wide,
    .host-tools-action-warning,
    .host-tools-action-danger {
        grid-column: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .host-tools-action {
        transition: none;
    }
}
