/* ── base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: 'Segoe UI', sans-serif;
    background: var(--bg-page);
    color: var(--text);
}

/* ── dark scrollbars ── */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) var(--bg-inset);
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-inset); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #5a5a80; }
::-webkit-scrollbar-corner { background: var(--bg-inset); }

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}
.blazor-error-boundary::after { content: "An error has occurred."; }

/* ── BINGO colour palette + surface colours ── */
:root {
    --b: #e63946;
    --i: #f4a261;
    --n: #2a9d8f;
    --g: #457b9d;
    --o: #9b5de5;
    --bg-page:      #1a1a2e;
    --bg-display:   #0f0f1a;
    --bg-surface:   #1e1e38;
    --bg-inset:     #12122a;
    --color-border: #3d3d5c;
    --bg-uncalled:  #2d2d44;
    --bg-cell-dark: #1e1e30;
    --text:         #eee;
    --text-2:       #ccc;
    --text-3:       #999;
    --text-4:       #666;
    --border-soft:  #444;
    --bg-panel:     #1e1e3a;
    --bg-input:     #111;
    --overlay-tint: 255,255,255;
    --badge-blue-text: #90b8f8;
    --badge-red-text: #ef9a9a;
}

/* ── Themes ── */
:root[data-theme="midnight"] {
    --b: #ff3b6b; --i: #ff9f43; --n: #00d2d3; --g: #54a0ff; --o: #c56cf0;
    --bg-page:      #050510;
    --bg-display:   #030308;
    --bg-surface:   #0a0a20;
    --bg-inset:     #030308;
    --color-border: #2a2a50;
    --bg-uncalled:  #0d0d28;
    --bg-cell-dark: #080820;
}
:root[data-theme="forest"] {
    --b: #ff6b6b; --i: #ffd43b; --n: #51cf66; --g: #20c997; --o: #74c0fc;
    --bg-page:      #0a1a0d;
    --bg-display:   #060e08;
    --bg-surface:   #0f2213;
    --bg-inset:     #061008;
    --color-border: #2a5a35;
    --bg-uncalled:  #121f14;
    --bg-cell-dark: #0d1a0f;
}
:root[data-theme="sunset"] {
    --b: #ff4757; --i: #ffa502; --n: #eccc68; --g: #ff6b81; --o: #a29bfe;
    --bg-page:      #1a0d0a;
    --bg-display:   #100806;
    --bg-surface:   #2a1510;
    --bg-inset:     #120806;
    --color-border: #5a3830;
    --bg-uncalled:  #2d1a15;
    --bg-cell-dark: #1f1210;
}
:root[data-theme="white"] {
    --b: #d62839; --i: #d9720d; --n: #1f8a7a; --g: #2c5f82; --o: #7c3fc0;
    --bg-page:      #f2f3f7;
    --bg-display:   #ffffff;
    --bg-surface:   #ffffff;
    --bg-inset:     #eceef2;
    --color-border: #d6d9e0;
    --bg-uncalled:  #e3e5ec;
    --bg-cell-dark: #ebedf2;
    --text:         #1a1a2e;
    --text-2:       #3d3d4d;
    --text-3:       #6b6b78;
    --text-4:       #8a8a96;
    --border-soft:  #c7cad4;
    --bg-panel:     #eef0f6;
    --bg-input:     #ffffff;
    --overlay-tint: 0,0,0;
    --badge-blue-text: #1565c0;
    --badge-red-text: #c62828;
}

/* ── column colour classes (shared by caller + display) ── */
.col-b { background: var(--b); color: #fff; }
.col-i { background: var(--i); color: #fff; }
.col-n { background: var(--n); color: #fff; }
.col-g { background: var(--g); color: #fff; }
.col-o { background: var(--o); color: #fff; }

/* ────────────────────────────────────────────
   CALLER PAGE
─────────────────────────────────────────────*/
header { display: none !important; }
main { padding: 0 !important; height: 100vh; overflow: hidden; }

.caller-page {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 1vh 1vw;
    overflow: hidden;
}

.caller-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 0;
    overflow: hidden;
}

.caller-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    margin-bottom: .6vh;
}

.caller-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text);
}

.header-controls { display: flex; gap: .5rem; }

.btn-open-display {
    background: #2a9d8f;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .55rem 1.2rem;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.btn-open-display:hover { background: #21867a; }

.btn-reset {
    background: #c0392b;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .55rem 1.2rem;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.btn-reset:hover { background: #a93226; }

/* last-called strip */
.last-called-strip {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #16213e;
    border-radius: 10px;
    padding: .5vh 1vw;
    margin-bottom: .5vh;
    min-height: 90px;
    flex-shrink: 0;
}

.last-called-inner {
    display: flex;
    align-items: center;
    gap: .5rem;
    border-radius: 8px;
    padding: .3vh .8vw;
}

.last-called-inner.empty .last-letter,
.last-called-inner.empty .last-number,
.last-called-inner.empty .last-label {
    visibility: hidden;
}

.last-called-inner.empty {
    background: var(--bg-uncalled);
    color: var(--text-4);
}

.last-letter { font-size: 3.5vh; font-weight: 900; line-height: 1; }
.last-number { font-size: 3.5vh; font-weight: 900; line-height: 1; }

.last-label {
    font-size: 1vh;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: .8;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.call-count {
    margin-left: auto;
    font-size: 1.8vh;
    color: var(--text-3);
    font-weight: 600;
}
.roll-message {
    display: block;
    font-size: .75em;
    font-weight: 400;
    color: #f4a261;
    font-style: italic;
}

/* mini win-pattern preview, next to the call count — capped at 80px tall */
.win-pattern-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    max-height: 80px;
    overflow: hidden;
    flex-shrink: 0;
}

.win-pattern-mini-title {
    font-size: 9px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--text-3);
    text-transform: uppercase;
}

.win-pattern-mini-grid {
    display: grid;
    grid-template-columns: repeat(5, 9px);
    grid-template-rows: 8px repeat(5, 9px);
    gap: 2px;
}

.wpm-header {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 7px;
    border-radius: 2px;
}

.wpm-cell {
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wpm-cell.wpm-empty {
    background: #1a1a30;
    border: 1px solid var(--bg-uncalled);
}

.wpm-cell.wpm-filled.col-b { background: var(--b); }
.wpm-cell.wpm-filled.col-i { background: var(--i); }
.wpm-cell.wpm-filled.col-n { background: var(--n); }
.wpm-cell.wpm-filled.col-g { background: var(--g); }
.wpm-cell.wpm-filled.col-o { background: var(--o); }

.wpm-cell.wpm-free {
    background: var(--bg-uncalled);
    border: 1px solid #4d4d6c;
}

.wpm-free-text {
    font-size: 7px;
    color: #aaa;
}

/* recent calls row */
.recent-calls {
    display: flex;
    gap: .4rem;
    flex-wrap: nowrap;
    margin-bottom: .5vh;
    flex-shrink: 0;
    overflow: hidden;
    min-height: 3vh;
}

.recent-ball {
    display: flex;
    align-items: center;
    gap: .2rem;
    border-radius: 20px;
    padding: .15rem .6rem;
    font-weight: 700;
    font-size: 1.6vh;
    opacity: .75;
}
.recent-letter { font-size: 1.2vh; }
.recent-num { font-size: 1.6vh; }

/* main ball grid */
.bingo-grid-container {
    flex: 1;
    display: flex;
    gap: .5vw;
    min-height: 0;
}

.bingo-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .3vh;
}

.column-header {
    text-align: center;
    font-size: 2.8vh;
    font-weight: 900;
    padding: .3vh 0;
    border-radius: 6px;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.ball-btn {
    flex: 1;
    width: 100%;
    min-height: 0;
    border: 2px solid var(--color-border);
    border-radius: 6px;
    font-size: 1.8vh;
    font-weight: 700;
    cursor: pointer;
    transition: filter .1s;
}

.ball-btn.uncalled {
    background: var(--bg-uncalled);
    color: var(--text-2);
}

.ball-btn.uncalled:hover {
    filter: brightness(1.4);
}

.ball-btn.called {
    color: #fff;
    border-color: transparent;
}

.bingo-column.column-unneeded {
    opacity: .4;
}

/* ────────────────────────────────────────────
   MODALS (caller page)
─────────────────────────────────────────────*/
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    z-index: 100;
}

.modal-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 101;
    background: var(--bg-surface);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 2rem;
    width: 480px;
    max-width: 95vw;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
}

.modal-hint {
    font-size: .85rem;
    color: var(--text-3);
}

.sponsor-textarea {
    width: 100%;
    background: var(--bg-inset);
    color: var(--text);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: .75rem;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    line-height: 1.6;
}

.sponsor-textarea:focus {
    outline: 2px solid #2a9d8f;
    border-color: transparent;
}

.modal-actions {
    display: flex;
    gap: .6rem;
    justify-content: flex-end;
}

.btn-modal-save {
    background: #2a9d8f;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .5rem 1.4rem;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
}
.btn-modal-save:hover { background: #21867a; }

.btn-modal-cancel {
    background: var(--color-border);
    color: var(--text);
    border: none;
    border-radius: 8px;
    padding: .5rem 1.4rem;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
}
.btn-modal-cancel:hover { background: #4d4d70; }

.btn-modal-danger {
    background: #e63946;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .5rem 1.4rem;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
}
.btn-modal-danger:hover { background: #c92d3a; }

.modal-box--confirm { width: 420px; }
.modal-message {
    font-size: .95rem;
    color: var(--text-2);
    line-height: 1.5;
    margin: 0;
}

.text-input {
    width: 100%;
    box-sizing: border-box;
    background: var(--bg-inset);
    border: 1px solid var(--bg-uncalled);
    border-radius: 6px;
    color: var(--text);
    padding: .5rem .7rem;
    font-family: inherit;
    font-size: .95rem;
    margin: .6rem 0;
    transition: border-color .13s;
}
.text-input:focus { outline: none; border-color: #9b5de5; }

.saved-pattern-chip {
    display: inline-flex;
    align-items: stretch;
}
.saved-pattern-chip .btn-template {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.btn-saved-pattern-delete {
    background: var(--bg-uncalled);
    color: var(--text-3);
    border: 1px solid var(--border-soft);
    border-left: none;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    padding: 5px 9px;
    font-size: .9rem;
    line-height: 1;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.btn-saved-pattern-delete:hover { background: #e63946; color: #fff; border-color: #e63946; }

.btn-game-setup {
    background: #e76f51;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .55rem 1.2rem;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.btn-game-setup:hover { background: #c7543a; }

.modal-box--wide { width: 420px; max-height: 88vh; overflow-y: auto; }

/* game setup card inside modal */
.setup-card {
    background: var(--bg-inset);
    border-radius: 10px;
    padding: .8rem;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.setup-card-row {
    display: flex;
    gap: 5px;
}

.setup-card-header {
    flex: 1;
    text-align: center;
    font-weight: 900;
    font-size: 1.1rem;
    padding: .4rem 0;
    border-radius: 6px;
}

.setup-card-cell {
    flex: 1;
    aspect-ratio: 1;
    border-radius: 6px;
    border: 2px solid var(--color-border);
    cursor: pointer;
    font-weight: 700;
    font-size: .75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: filter .1s, transform .1s;
}

.setup-card-cell:not(:disabled):hover {
    filter: brightness(1.25);
    transform: scale(1.08);
}

.setup-card-cell.cell-empty {
    background: var(--bg-uncalled);
    color: var(--text-4);
}

.setup-card-cell.cell-filled {
    color: #fff;
    border-color: transparent;
}

.setup-card-cell.cell-free {
    background: var(--border-soft);
    border-color: var(--border-soft);
    color: var(--text-2);
    cursor: default;
    font-size: .7rem;
    letter-spacing: .5px;
}

.traditional-mode-badge {
    background: rgba(58, 123, 213, 0.15);
    border: 1px solid rgba(58, 123, 213, 0.4);
    border-radius: 8px;
    padding: .5rem .8rem;
    font-size: .82rem;
    color: var(--badge-blue-text);
    text-align: center;
    margin-bottom: .5rem;
}

.btn-modal-secondary {
    background: var(--border-soft);
    color: var(--text);
    border: none;
    border-radius: 8px;
    padding: .5rem 1.1rem;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    margin-right: auto;
}
.btn-modal-secondary:hover { background: #555; }

.template-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.template-label {
    color: var(--text-3);
    font-size: 0.85rem;
    margin-right: 2px;
}

.btn-template {
    background: var(--bg-uncalled);
    color: var(--text-2);
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.btn-template:hover {
    background: #3a7bd5;
    color: #fff;
    border-color: #3a7bd5;
}

.btn-template--active {
    background: #3a7bd5;
    color: #fff;
    border-color: #3a7bd5;
}

.btn-sponsors {
    background: #9b5de5;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .55rem 1.2rem;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.btn-sponsors:hover { background: #7c3fc0; }

.btn-roll {
    background: #f4a261;
    color: #1a1a2e;
    border: none;
    border-radius: 8px;
    padding: .45rem 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}
.btn-roll:hover { background: #e07c3a; }

/* ────────────────────────────────────────────
   DISPLAY PAGE (projector)
─────────────────────────────────────────────*/
.display-layout {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: stretch;
    background: var(--bg-display);
}

.display-page {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 1.5vh 2vw;
    gap: 1.5vh;
}

.display-last-called {
    display: grid;
    grid-template-columns: 18vh 1fr auto;
    align-items: center;
    column-gap: 2vw;
    flex-shrink: 0;
}

.display-ball {
    width: 18vh;
    height: 18vh;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 40px rgba(255,255,255,.15);
}

.display-ball.empty {
    background: var(--bg-uncalled);
    color: var(--text-4);
    box-shadow: none;
}

.display-ball-letter { font-size: 4vh; font-weight: 900; line-height: 1; }
.display-ball-number { font-size: 7vh; font-weight: 900; line-height: 1; }

.display-count { font-size: 3vh; color: var(--text-3); font-weight: 600; }

.display-board {
    flex: 1;
    display: flex;
    gap: .6vw;
    min-height: 0;
}

.display-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .4vh;
}

.display-column.column-unneeded {
    opacity: .4;
}

.display-col-header {
    text-align: center;
    font-size: 4vh;
    font-weight: 900;
    border-radius: 8px;
    padding: .3vh 0;
    flex-shrink: 0;
}

.display-cell {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 2.6vh;
    font-weight: 700;
    transition: all .4s ease;
    border: 2px solid transparent;
    min-height: 0;
}

.display-cell.dark {
    background: var(--bg-cell-dark);
    color: var(--text-4);
    border-color: var(--bg-uncalled);
}

.display-cell.lit {
    color: #fff;
    box-shadow: 0 0 14px rgba(255,255,255,.25);
}

/* ── sponsor marquee (display page) ── */
.sponsor-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 1vw;
    background: var(--bg-inset);
    border-top: 2px solid var(--bg-uncalled);
    padding: .5vh 1vw;
    height: 6vh;
    overflow: hidden;
}

.sponsor-label {
    font-size: 1.4vh;
    font-weight: 800;
    letter-spacing: 2px;
    color: #9b5de5;
    white-space: nowrap;
    text-transform: uppercase;
}

.marquee-viewport {
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

.marquee-track {
    display: flex;
    width: max-content;
    animation: marquee-scroll linear infinite;
}

.marquee-content {
    font-size: 2.2vh;
    font-weight: 600;
    color: var(--text-2);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding-right: 6vw;
}

@keyframes marquee-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.marquee-sep {
    padding: 0 1vw;
    color: var(--text-4);
}

.sponsor-img {
    height: 2.2vh;
    width: auto;
    object-fit: contain;
    vertical-align: middle;
}

/* ── game pattern card (inside display header strip) ── */
.pattern-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    align-self: center;
    gap: .4vh;
}

.pattern-card-title {
    text-align: center;
    font-size: 1.4vh;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--text-3);
    text-transform: uppercase;
}

.pattern-card {
    background: rgba(12, 12, 28, 0.9);
    border: 2px solid var(--color-border);
    border-radius: 8px;
    padding: .5vh .6vw;
}

/* cells 2vh — total card height ~13.5vh, well under 18vh ball */
.pattern-grid {
    display: grid;
    grid-template-columns: repeat(5, 2vh);
    grid-template-rows: 1.5vh repeat(5, 2vh);
    gap: 2px;
}

.pattern-header {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1vh;
    border-radius: 2px;
}

.pattern-cell {
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pattern-cell.pat-empty {
    background: #1a1a30;
    border: 1px solid var(--bg-uncalled);
}

/* per-column glow colour */
.pattern-cell.pat-filled.col-b { --glow: var(--b); }
.pattern-cell.pat-filled.col-i { --glow: var(--i); }
.pattern-cell.pat-filled.col-n { --glow: var(--n); }
.pattern-cell.pat-filled.col-g { --glow: var(--g); }
.pattern-cell.pat-filled.col-o { --glow: var(--o); }

.pattern-cell.pat-filled {
    animation: pat-glow 1.8s ease-in-out infinite alternate;
}

@keyframes pat-glow {
    from {
        box-shadow: 0 0 3px 1px var(--glow, #fff);
        filter: brightness(1.0);
    }
    to {
        box-shadow: 0 0 8px 3px var(--glow, #fff), 0 0 18px var(--glow, #fff);
        filter: brightness(1.4);
    }
}

.pattern-cell.pat-free {
    background: var(--bg-uncalled);
    border: 1px solid #4d4d6c;
}

.pat-free-text {
    font-size: 1vh;
    color: #aaa;
}

/* ────────────────────────────────────────────
   ROLLING BALL ANIMATION
   Positioned + animated entirely by bingo-anim.js via Web Animations API
   + CSS offset-path (compositor thread, true 60fps).
─────────────────────────────────────────────*/
.anim-ball {
    /* position/path set by JS — only visuals here */
    pointer-events: none;
    width: 16vh;
    height: 16vh;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    will-change: offset-distance, transform, opacity;
    box-shadow:
        0 0 50px rgba(255,255,255,0.4),
        0 0 100px rgba(255,255,255,0.15),
        inset -6px -6px 18px rgba(0,0,0,0.5),
        inset 6px 6px 12px rgba(255,255,255,0.15);
}

.anim-ball::before {
    content: '';
    position: absolute;
    top: 10%; left: 16%;
    width: 32%; height: 32%;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.anim-ball-letter {
    font-size: 3.5vh;
    font-weight: 900;
    color: rgba(255,255,255,0.95);
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0,0,0,0.7);
    position: relative;
    z-index: 1;
}

.anim-ball-number {
    font-size: 4.5vh;
    font-weight: 900;
    color: #fff;
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0,0,0,0.7);
    position: relative;
    z-index: 1;
}

/* ── Blazor reconnect overlay ── */
#components-reconnect-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(10, 10, 25, 0.88);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
}

.reconnect-card {
    background: var(--bg-surface);
    color: var(--text);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 2rem 2.5rem;
    text-align: center;
    font-family: 'Segoe UI', sans-serif;
    font-size: 1rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    max-width: 380px;
    width: 90vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
}

/* spinner shown only during reconnect-show */
.reconnect-spinner {
    display: none;
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--color-border);
    border-top-color: #2a9d8f;
    border-radius: 50%;
    animation: reconnect-spin .8s linear infinite;
}
#components-reconnect-modal.components-reconnect-show .reconnect-spinner {
    display: block;
}
@keyframes reconnect-spin { to { transform: rotate(360deg); } }

/* show only the relevant message per state */
.reconnect-text { margin: 0; display: none; }

#components-reconnect-modal.components-reconnect-show   .reconnect-text--show     { display: block; }
#components-reconnect-modal.components-reconnect-failed .reconnect-text--failed   { display: block; }
#components-reconnect-modal.components-reconnect-rejected .reconnect-text--rejected { display: block; }

.reconnect-card a {
    color: #2a9d8f;
    text-decoration: underline;
    cursor: pointer;
}

#blazor-error-ui {
    background: var(--bg-surface);
    color: var(--text);
    border-top: 1px solid var(--color-border);
    padding: .6rem 1rem;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 9999;
    display: none;
}

#blazor-error-ui a { color: #2a9d8f; }
#blazor-error-ui .dismiss { float: right; cursor: pointer; }

/* ────────────────────────────────────────────
   VERIFY CARD BUTTON + EXPORT BUTTON
─────────────────────────────────────────────*/
.header-controls { flex-wrap: wrap; }

.btn-verify {
    background: #3a7bd5;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .55rem 1.2rem;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.btn-verify:hover { background: #2d64b5; }

.btn-export {
    background: #546e7a;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .55rem 1.2rem;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.btn-export:hover { background: #37474f; }

/* ────────────────────────────────────────────
   VERIFY CARD MODAL
─────────────────────────────────────────────*/
.modal-box--verifier { width: 390px; }

.verify-status {
    text-align: center;
    padding: .6rem 1rem;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 700;
}
.status-empty   { background: var(--bg-uncalled); color: var(--text-4); }
.status-nobingo { background: #2a1a1a; color: #888; }
.status-bingo   {
    background: #1a4a1a;
    color: #4caf50;
    font-size: 1.4rem;
    animation: bingo-pulse 1s ease-in-out infinite alternate;
}
@keyframes bingo-pulse {
    from { box-shadow: 0 0 0 0   rgba(76,175,80,.4); }
    to   { box-shadow: 0 0 0 8px rgba(76,175,80,0);  }
}

.verify-card {
    background: var(--bg-inset);
    border-radius: 10px;
    padding: .8rem;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.verify-card-row { display: flex; gap: 5px; }
.verify-card-row > * { flex: 1; min-width: 0; }

.verify-card-header {
    text-align: center;
    font-weight: 900;
    font-size: 1.1rem;
    padding: .4rem 0;
    border-radius: 6px;
}

.verify-cell {
    height: 48px;
    background: var(--bg-uncalled);
    color: var(--text-2);
    border: 2px solid var(--color-border);
    border-radius: 6px;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    padding: 0;
    -moz-appearance: textfield;
    transition: background .15s, border-color .15s, color .15s;
}
.verify-cell::-webkit-outer-spin-button,
.verify-cell::-webkit-inner-spin-button { -webkit-appearance: none; }
.verify-cell:focus { outline: 2px solid #3a7bd5; border-color: transparent; }

.verify-cell.vc-called     { background: #1a4a1a; color: #4caf50; border-color: #4caf50; }
.verify-cell.vc-not-called { background: #4a1a1a; color: #ef5350; border-color: #ef5350; }

.verify-cell.cell-free {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-uncalled);
    border: 2px solid var(--border-soft);
    color: var(--text-3);
    font-size: .7rem;
    letter-spacing: .5px;
    cursor: default;
}

/* ────────────────────────────────────────────
   FULLSCREEN BUTTON (display page)
─────────────────────────────────────────────*/
.btn-fullscreen {
    position: fixed;
    bottom: 1vh;
    right: 1vw;
    top: auto;
    background: rgba(var(--overlay-tint),.08);
    color: rgba(var(--overlay-tint),.5);
    border: 1px solid rgba(var(--overlay-tint),.15);
    border-radius: 6px;
    padding: .3rem .55rem;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    z-index: 50;
    transition: background .15s, color .15s;
}
.btn-fullscreen:hover {
    background: rgba(var(--overlay-tint),.2);
    color: var(--text);
}
:fullscreen .btn-fullscreen,
:-webkit-full-screen .btn-fullscreen,
:-moz-full-screen .btn-fullscreen {
    display: none;
}

/* ────────────────────────────────────────────
   TRIAL WATERMARK (caller & display pages)
─────────────────────────────────────────────*/
.trial-watermark {
    position: fixed;
    top: 1vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: .5rem;
    background: rgba(0,0,0,.45);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 999px;
    padding: .3rem .9rem;
    z-index: 60;
    pointer-events: none;
    font-family: system-ui, sans-serif;
}
.trial-watermark-badge {
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .08em;
    color: #ffca28;
}
.trial-watermark-count {
    font-size: .75rem;
    color: rgba(255,255,255,.75);
}

/* ────────────────────────────────────────────
   HEADER BUTTON GROUPS
─────────────────────────────────────────────*/
.btn-group-text,
.btn-group-icons {
    display: flex;
    gap: .4rem;
    align-items: center;
    flex-wrap: wrap;
}

.header-sep {
    width: 1px;
    height: 1.8rem;
    background: rgba(var(--overlay-tint),.2);
    margin: 0 .15rem;
    flex-shrink: 0;
}

.btn-icon {
    padding: .5rem .7rem !important;
    font-size: 1rem !important;
    min-width: 2.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-announcements-main {
    background: #2a9d8f;
    color: #fff;
    border: none;
    border-radius: 8px 0 0 8px;
    padding: .55rem 1.1rem;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    border-right: 1px solid rgba(255,255,255,.3);
    white-space: nowrap;
}
.btn-announcements-main:hover { background: #21867a; }

.btn-announcements-arrow {
    background: #2a9d8f;
    color: #fff;
    border: none;
    border-radius: 0 8px 8px 0;
    padding: .55rem .55rem;
    font-size: .7rem;
    cursor: pointer;
    transition: background .15s;
    line-height: 1;
    position: relative;
}
.btn-announcements-arrow:hover { background: #21867a; }

.btn-sponsors {
    background: #8e5fd8;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .55rem 1.2rem;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.btn-sponsors:hover { background: #7548bf; }

.btn-help {
    background: #546e7a;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .55rem 1.2rem;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.btn-help:hover { background: #37474f; }

.btn-settings {
    background: #607d8b;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .55rem .9rem;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.btn-settings:hover { background: #455a64; }


/* settings — remote sharing section */
.settings-pin-row { margin-top: .6rem; }
.settings-pin-label { display: block; font-size: .8rem; color: var(--text-3); margin-bottom: .3rem; }
.settings-pin-display { display: flex; align-items: center; gap: .6rem; }
.settings-pin-value {
    font-family: monospace; font-size: 1.4rem; letter-spacing: .3em;
    font-weight: 700; color: var(--text); background: var(--bg-input);
    padding: .25rem .6rem; border-radius: 6px; border: 1.5px solid var(--border-soft);
}
.btn-regenerate-pin {
    background: #37474f; color: #ccc; border: none; border-radius: 6px;
    padding: .3rem .65rem; font-size: .8rem; cursor: pointer; transition: background .15s;
}
.btn-regenerate-pin:hover { background: #455a64; color: #fff; }
.settings-tunnel-active { margin-top: .75rem; }
.settings-tunnel-qr svg { width: 140px; height: 140px; border-radius: 6px; display: block; }
.settings-tunnel-url {
    font-family: monospace; font-size: .78rem; color: var(--badge-blue-text);
    word-break: break-all; margin-top: .3rem;
}
.settings-tunnel-status { font-size: .85rem; color: var(--text-3); margin-top: .5rem; }
.settings-tunnel-error  { font-size: .82rem; color: var(--badge-red-text); margin-top: .5rem; }

/* tunnel provider chooser + Ztpr credentials */
.settings-tunnel-provider {
    display: flex; flex-wrap: wrap; gap: .4rem 1.2rem;
    margin: .5rem 0 .4rem 1.7rem;
}
.settings-radio { display: flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--text-2); cursor: pointer; }
.settings-radio input { accent-color: #1565c0; }
.settings-ztpr-fields { margin: .2rem 0 .4rem 1.7rem; }
.settings-field-label { display: block; font-size: .8rem; color: var(--text-3); margin: .5rem 0 .25rem; }
.settings-text-input {
    width: 100%; padding: .45rem .6rem; font-size: .9rem;
    border-radius: 6px; border: 1.5px solid var(--border-soft); background: var(--bg-input); color: var(--text);
    outline: none; font-family: monospace;
}
.settings-text-input:focus { border-color: #1565c0; }

/* display screen — pattern + QR side by side */
.pattern-qr-row {
    display: flex; flex-direction: row; align-items: flex-start;
    gap: .75rem; justify-content: center; flex-wrap: wrap;
}

/* QR card — SVG sized to match the pattern grid (5 × 2vh cols + 1.5vh header + gaps + padding) */
.display-qr-card svg {
    display: block;
    /* pattern grid: 5×2vh wide + 4×2px gaps + 2×0.6vw card padding */
    width:  calc(10vh + 8px + 1.2vw);
    height: calc(10vh + 8px + 1.2vw);
    border-radius: 4px;
}
@media (max-width: 768px) { .pattern-wrap:has(.display-qr-card) { display: none; } }

/* ────────────────────────────────────────────
   BINGO CARD PAGE  (/card)
─────────────────────────────────────────────*/
.card-layout { background: var(--bg-page); min-height: 100vh; }

.bcard-loading {
    display: flex; align-items: center; justify-content: center;
    height: 100vh; font-size: 2rem; color: var(--text-4);
}

.bcard-page {
    display: flex; flex-direction: column; align-items: center;
    padding: 1rem .75rem 2rem; min-height: 100vh;
    background: var(--bg-page); color: var(--text);
    font-family: system-ui, sans-serif;
}

.bcard-tabs {
    display: flex; gap: .5rem; margin-bottom: .75rem;
}
.bcard-tab {
    padding: .45rem 1.4rem; border-radius: 8px;
    border: 2px solid var(--border-soft); background: transparent;
    color: var(--text-4); font-size: .95rem; cursor: pointer; transition: all .15s;
}
.bcard-tab--on { border-color: var(--n); color: var(--text); background: rgba(42,157,143,.15); }

.bcard-id-row {
    display: flex; align-items: center; gap: .6rem; margin-bottom: .85rem;
}
.bcard-id-label { font-size: .72rem; color: var(--text-4); text-transform: uppercase; letter-spacing: 1px; }
.bcard-id-value {
    font-family: monospace; font-size: 1.35rem; letter-spacing: .25em;
    font-weight: 700; color: var(--text-2);
}

.bcard-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    width: 100%; max-width: 380px;
}

.bcard-head {
    padding: .45rem 0; text-align: center;
    font-weight: 900; font-size: 1.15rem; border-radius: 6px;
}

.bcard-cell {
    aspect-ratio: 1;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.05rem; font-weight: 700;
    border-radius: 8px; border: none;
    background: var(--bg-page); color: var(--text-4);
    cursor: pointer; transition: background .12s, color .12s;
    position: relative; user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.bcard-cell:active { transform: scale(.93); }

.bcard-free {
    background: var(--bg-panel); color: var(--text-4);
    font-size: .72rem; pointer-events: none; cursor: default;
}

/* Dabbed by player: fill with column colour */
.bcard-cell.bcard-marked.col-b { background: var(--b); color: #fff; }
.bcard-cell.bcard-marked.col-i { background: var(--i); color: #fff; }
.bcard-cell.bcard-marked.col-n { background: var(--n); color: #fff; }
.bcard-cell.bcard-marked.col-g { background: var(--g); color: #fff; }
.bcard-cell.bcard-marked.col-o { background: var(--o); color: #fff; }

.bcard-hint {
    margin-top: 1rem; font-size: .75rem; color: var(--text-4); text-align: center;
}

.bcard-sponsor-bar {
    width: 100%;
    max-width: 380px;
    margin-top: 1rem;
    border-top: 2px solid var(--bg-uncalled);
    border-radius: 8px;
    background: var(--bg-inset);
}

/* ── Settings: cards row & count toggle ──────────────────────────────── */
.settings-cards-row {
    display: flex; align-items: center; flex-wrap: wrap; gap: .5rem;
}
.settings-card-count { display: flex; gap: .3rem; margin-left: .25rem; }
.btn-count {
    width: 2rem; height: 2rem; border-radius: 6px;
    border: 1.5px solid var(--border-soft); background: var(--bg-input); color: var(--text-4);
    font-size: .9rem; font-weight: 700; cursor: pointer; transition: all .15s;
}
.btn-count--on { border-color: var(--n); color: var(--text); background: rgba(42,157,143,.2); }

.settings-note { font-size: .78rem; color: var(--text-4); font-style: italic; }
.settings-tunnel-label { font-size: .75rem; color: var(--text-4); margin-bottom: .2rem; text-align: center; }
.settings-tunnel-active { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: .6rem; }

/* ── Verify modal: card ID row ───────────────────────────────────────── */
.verify-card-id-row { margin-bottom: .75rem; }
.verify-card-id-label { display: block; font-size: .78rem; color: var(--text-4); margin-bottom: .3rem; }
.verify-card-id-input-wrap { display: flex; gap: .4rem; align-items: center; }
.verify-card-id-input {
    width: 110px; padding: .4rem .6rem; font-size: 1rem; letter-spacing: .15em;
    text-align: center; border-radius: 6px; border: 1.5px solid var(--border-soft);
    background: var(--bg-input); color: var(--text); outline: none; text-transform: uppercase;
}
.verify-card-id-input:focus { border-color: var(--n); }

.btn-update {
    background: #2e7d32;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s;
    animation: update-pulse 2s ease-in-out infinite;
}
.btn-update:hover { background: #1b5e20; animation: none; }
@keyframes update-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(46,125,50,.7); }
    50%       { box-shadow: 0 0 0 6px rgba(46,125,50,0); }
}

/* ────────────────────────────────────────────
   GAME SETUP SPLIT BUTTON + TEMPLATE DROPDOWN
─────────────────────────────────────────────*/
.btn-split-wrap {
    display: inline-flex;
    border-radius: 8px;
    overflow: visible;
}

.btn-game-setup-main {
    background: #e76f51;
    color: #fff;
    border: none;
    border-radius: 8px 0 0 8px;
    padding: .55rem 1rem;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    border-right: 1px solid rgba(255,255,255,.3);
    white-space: nowrap;
}
.btn-game-setup-main:hover { background: #c7543a; }

.btn-game-setup-arrow {
    background: #e76f51;
    color: #fff;
    border: none;
    border-radius: 0 8px 8px 0;
    padding: .55rem .55rem;
    font-size: .75rem;
    cursor: pointer;
    transition: background .15s;
    line-height: 1;
    position: relative;
}
.btn-game-setup-arrow:hover { background: #c7543a; }

.btn-template-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: var(--bg-panel);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    z-index: 50;
    min-width: 175px;
    box-shadow: 0 6px 20px rgba(0,0,0,.55);
    overflow: hidden;
}

.btn-template-dropdown button {
    display: block;
    width: 100%;
    background: transparent;
    color: var(--text);
    border: none;
    border-bottom: 1px solid var(--bg-uncalled);
    padding: .5rem 1rem;
    cursor: pointer;
    text-align: left;
    font-size: .9rem;
    font-family: inherit;
    transition: background .1s, color .1s;
}
.btn-template-dropdown button:last-child { border-bottom: none; }
.btn-template-dropdown button:hover { background: #e76f51; color: #fff; }

.btn-template-dropdown-sep {
    height: 1px;
    background: var(--bg-uncalled);
    margin: 0;
}

/* ────────────────────────────────────────────
   SETTINGS MODAL
─────────────────────────────────────────────*/
.modal-box--settings {
    max-width: 500px; width: 95vw;
    max-height: 88vh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.modal-box--sponsors {
    max-width: 500px; width: 95vw;
}

.settings-section {
    margin-bottom: 1.2rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid var(--bg-uncalled);
}
.settings-section:last-of-type { border-bottom: none; margin-bottom: 0; }

.settings-section-title {
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #9b5de5;
    margin-bottom: .6rem;
}

.settings-toggle {
    display: flex;
    align-items: center;
    gap: .6rem;
    cursor: pointer;
    font-size: .95rem;
    color: var(--text-2);
    user-select: none;
}
.settings-toggle input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: #9b5de5;
    cursor: pointer;
}

.settings-section--about { margin-bottom: 0; }
.settings-about-text { font-size: .9rem; color: var(--text-3); line-height: 1.7; }

.settings-link {
    color: #9b5de5;
    text-decoration: none;
}
.settings-link:hover { color: #bb7fff; text-decoration: underline; }

/* ── Theme picker (settings modal) ── */
.theme-picker {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.theme-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    background: var(--bg-inset);
    border: 2px solid var(--color-border);
    border-radius: 10px;
    padding: .45rem .55rem;
    cursor: pointer;
    transition: border-color .15s, transform .1s;
    min-width: 64px;
}
.theme-swatch:hover { border-color: var(--text-3); transform: scale(1.04); }
.theme-swatch--active { border-color: var(--text) !important; }

.theme-swatch-name {
    font-size: .72rem;
    font-weight: 700;
    color: var(--text-2);
    letter-spacing: .5px;
    text-transform: capitalize;
    white-space: nowrap;
}

.theme-swatch-preview {
    display: flex;
    gap: 2px;
    border-radius: 4px;
    overflow: hidden;
    height: 18px;
    width: 55px;
}
.theme-swatch-preview span {
    flex: 1;
    display: block;
}

/* Per-theme preview colours */
.theme-preview-b--classic  { background: #e63946; }
.theme-preview-i--classic  { background: #f4a261; }
.theme-preview-n--classic  { background: #2a9d8f; }
.theme-preview-g--classic  { background: #457b9d; }
.theme-preview-o--classic  { background: #9b5de5; }

.theme-preview-b--midnight { background: #ff3b6b; }
.theme-preview-i--midnight { background: #ff9f43; }
.theme-preview-n--midnight { background: #00d2d3; }
.theme-preview-g--midnight { background: #54a0ff; }
.theme-preview-o--midnight { background: #c56cf0; }

.theme-preview-b--forest   { background: #ff6b6b; }
.theme-preview-i--forest   { background: #ffd43b; }
.theme-preview-n--forest   { background: #51cf66; }
.theme-preview-g--forest   { background: #20c997; }
.theme-preview-o--forest   { background: #74c0fc; }

.theme-preview-b--sunset   { background: #ff4757; }
.theme-preview-i--sunset   { background: #ffa502; }
.theme-preview-n--sunset   { background: #eccc68; }
.theme-preview-g--sunset   { background: #ff6b81; }
.theme-preview-o--sunset   { background: #a29bfe; }

.theme-preview-b--white    { background: #d62839; }
.theme-preview-i--white    { background: #d9720d; }
.theme-preview-n--white    { background: #1f8a7a; }
.theme-preview-g--white    { background: #2c5f82; }
.theme-preview-o--white    { background: #7c3fc0; }

.language-picker {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
}

.language-btn {
    background: var(--bg-inset);
    border: 2px solid var(--color-border);
    border-radius: 8px;
    padding: .5rem 1rem;
    color: var(--text-3);
    cursor: pointer;
    font-weight: 500;
    transition: all .15s;
}
.language-btn:hover { border-color: var(--text-4); color: var(--text-2); }
.language-btn--active { border-color: var(--text); color: var(--text); background: rgba(var(--overlay-tint),.05); }

/* ────────────────────────────────────────────
   HELP MODAL
─────────────────────────────────────────────*/
.modal-box--help {
    max-width: 640px;
    width: 95vw;
    max-height: 85vh;
    overflow-y: auto;
}

.help-content { display: flex; flex-direction: column; gap: .8rem; }

.help-feature {
    background: var(--bg-inset);
    border-radius: 8px;
    padding: .75rem 1rem;
    border-left: 3px solid #9b5de5;
}

.help-feature-name {
    font-size: .95rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: .3rem;
}

.help-feature-desc {
    font-size: .875rem;
    color: var(--text-2);
    line-height: 1.55;
}
.help-feature-desc strong { color: var(--text); }

.help-about {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-top: .4rem;
    padding: .6rem .8rem;
    background: var(--bg-inset);
    border-radius: 8px;
    font-size: .875rem;
    color: var(--text-4);
    flex-wrap: wrap;
}

.help-version {
    margin-left: auto;
    font-size: .8rem;
    color: var(--text-4);
    font-family: monospace;
}

.help-update-badge {
    background: #2e7d32;
    color: #fff;
    font-size: .78rem;
    font-weight: 600;
    padding: .15rem .55rem;
    border-radius: 99px;
}

/* ────────────────────────────────────────────
   ANNOUNCEMENT GROUP TABS
─────────────────────────────────────────────*/
.group-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    margin-bottom: .85rem;
    padding-bottom: .7rem;
    border-bottom: 1px solid var(--bg-uncalled);
    align-items: center;
}

.group-tab {
    display: flex;
    align-items: center;
    background: var(--bg-panel);
    border: 1px solid var(--bg-uncalled);
    border-radius: 6px;
    overflow: hidden;
    transition: border-color .13s;
}

.group-tab--active {
    border-color: #9b5de5;
    background: #1a1035;
}

.group-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-3);
    padding: .32rem .75rem;
    cursor: pointer;
    font-size: .82rem;
    font-family: inherit;
    transition: color .13s;
}

.group-tab--active .group-tab-btn {
    color: #e0c6ff;
    font-weight: 700;
}

.group-tab-btn:hover { color: var(--text); }

.group-tab-close {
    background: transparent;
    border: none;
    color: var(--text-4);
    padding: .28rem .45rem .28rem 0;
    cursor: pointer;
    font-size: .75rem;
    line-height: 1;
    transition: color .13s;
}
.group-tab-close:hover { color: #ef5350; }

.group-tab-add {
    background: transparent;
    border: 1px dashed #3d3d55;
    color: #9b5de5;
    border-radius: 6px;
    padding: .28rem .65rem;
    cursor: pointer;
    font-size: .95rem;
    font-family: inherit;
    line-height: 1;
    transition: background .13s, border-color .13s, color .13s;
}
.group-tab-add:hover {
    border-color: #9b5de5;
    background: rgba(155, 93, 229, .1);
    color: #bb7fff;
}

.group-name-row {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-bottom: 1rem;
}

.group-name-label {
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: 1.2px;
    color: #9b5de5;
    text-transform: uppercase;
    white-space: nowrap;
}

.group-name-input {
    flex: 1;
    background: var(--bg-inset);
    border: 1px solid var(--bg-uncalled);
    border-radius: 6px;
    color: var(--text);
    padding: .38rem .7rem;
    font-family: inherit;
    font-size: .9rem;
    transition: border-color .13s;
}
.group-name-input:focus { outline: none; border-color: #9b5de5; }

/* ────────────────────────────────────────────
   ANNOUNCEMENTS MODAL
─────────────────────────────────────────────*/
.modal-box--announcements {
    max-width: 680px;
    width: 95vw;
    max-height: 88vh;
    overflow-y: auto;
}

.slide-editor-block {
    background: var(--bg-inset);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: .85rem;
    border: 1px solid var(--bg-uncalled);
}

.slide-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .55rem;
}

.slide-number {
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #9b5de5;
}

.slide-title-input {
    display: block;
    width: 100%;
    background: var(--bg-panel);
    color: var(--text);
    border: 1.5px solid var(--color-border);
    border-radius: 6px;
    padding: .45rem .7rem;
    font-size: 1rem;
    font-family: inherit;
    margin-bottom: .5rem;
}
.slide-title-input:focus { outline: 2px solid #9b5de5; border-color: transparent; }

.btn-delete-slide {
    background: transparent;
    color: var(--text-4);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: .15rem .5rem;
    font-size: .78rem;
    cursor: pointer;
    transition: color .12s, border-color .12s;
}
.btn-delete-slide:hover { color: #ef5350; border-color: #ef5350; }

.btn-add-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: transparent;
    color: #9b5de5;
    border: 1.5px dashed #9b5de5;
    border-radius: 8px;
    padding: .5rem 1rem;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: .9rem;
    transition: background .13s, color .13s;
}
.btn-add-slide:hover { background: rgba(155,93,229,.12); color: #bb7fff; }

/* ────────────────────────────────────────────
   WYSIWYG EDITOR
─────────────────────────────────────────────*/
.wysiwyg-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .2rem;
    background: var(--bg-panel);
    border: 1.5px solid var(--bg-uncalled);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    padding: .3rem .45rem;
}

.wysiwyg-btn {
    background: transparent;
    color: var(--text-2);
    border: 1px solid transparent;
    border-radius: 4px;
    padding: .18rem .4rem;
    font-size: .83rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.4;
    transition: background .1s, color .1s;
    min-width: 1.8rem;
    text-align: center;
}
.wysiwyg-btn:hover { background: #2d2d4a; color: #fff; }
.wysiwyg-btn.active { background: #9b5de5; color: #fff; border-color: #7b3db5; }

.wysiwyg-sep {
    width: 1px;
    background: var(--color-border);
    margin: .15rem .1rem;
    align-self: stretch;
}

.wysiwyg-editor {
    background: var(--bg-panel);
    color: var(--text);
    border: 1.5px solid var(--bg-uncalled);
    border-radius: 0 0 6px 6px;
    padding: .6rem .8rem;
    min-height: 90px;
    font-size: .93rem;
    line-height: 1.6;
    font-family: inherit;
    outline: none;
}
.wysiwyg-editor:focus { border-color: #9b5de5; }
.wysiwyg-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--text-4);
    pointer-events: none;
}
.wysiwyg-editor h1, .wysiwyg-editor h2 { color: var(--text); margin: .3em 0; }
.wysiwyg-editor ul, .wysiwyg-editor ol { padding-left: 1.4em; }

/* ────────────────────────────────────────────
   SLIDESHOW OVERLAY (display page)
─────────────────────────────────────────────*/
.slideshow-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 6vh;
    background: var(--bg-display);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4vh 8vw 4vh;
}

.slideshow-header {
    width: 100%;
    text-align: center;
    padding-bottom: 2.5vh;
    border-bottom: 2px solid rgba(155, 93, 229, 0.35);
    margin-bottom: 3vh;
    flex-shrink: 0;
}

.slideshow-title {
    font-size: clamp(1.8rem, 4.5vw, 4rem);
    font-weight: 900;
    color: var(--text);
    letter-spacing: .04em;
    margin: 0;
    line-height: 1.15;
}

.slideshow-body {
    flex: 1;
    width: 100%;
    overflow-y: auto;
    font-size: clamp(1rem, 2.2vw, 1.8rem);
    line-height: 1.7;
    color: var(--text-2);
    text-align: center;
}
.slideshow-body h1, .slideshow-body h2, .slideshow-body h3 { color: var(--text); margin: .4em 0; }
.slideshow-body ul, .slideshow-body ol { text-align: left; display: inline-block; }
.slideshow-body strong { color: var(--text); }
.slideshow-body p { margin: .4em 0; }

.slideshow-counter-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    padding-top: 2vh;
    flex-shrink: 0;
}

.slideshow-dot {
    width: clamp(6px, 1vw, 12px);
    height: clamp(6px, 1vw, 12px);
    border-radius: 50%;
    background: rgba(155, 93, 229, 0.3);
    transition: background .3s, transform .3s;
}

.slideshow-dot.dot-active {
    background: #9b5de5;
    transform: scale(1.35);
}

/* ────────────────────────────────────────────
   SLIDESHOW CALLER COVER
─────────────────────────────────────────────*/
.slideshow-caller-cover {
    position: absolute;
    inset: 0;
    z-index: 20;
    background: var(--bg-display);
    backdrop-filter: blur(3px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.1rem;
    border-radius: 8px;
}

.slideshow-cover-icon {
    font-size: 3rem;
    color: rgba(155, 93, 229, 0.6);
}

.slideshow-cover-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-3);
    letter-spacing: .5px;
    text-transform: uppercase;
}

.btn-start-game {
    background: #2a9d8f;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: .8rem 2.4rem;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    transition: background .15s, transform .1s;
}
.btn-start-game:hover { background: #21867a; transform: scale(1.03); }
.btn-start-game:active { transform: scale(.98); }

/* ────────────────────────────────────────────
   KEYBOARD SHORTCUTS MODAL
─────────────────────────────────────────────*/
.modal-box--shortcuts { max-width: 480px; width: 95vw; }

.shortcuts-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .45rem 1.2rem;
    align-items: center;
}

.shortcut-key {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    white-space: nowrap;
}

.kbd {
    background: var(--bg-panel);
    border: 1.5px solid var(--color-border);
    border-bottom-width: 3px;
    border-radius: 5px;
    padding: .15rem .45rem;
    font-size: .8rem;
    font-family: 'Consolas', monospace;
    color: var(--text-2);
    line-height: 1.4;
}

.shortcut-desc {
    font-size: .9rem;
    color: var(--text-2);
}

.shortcuts-section-title {
    grid-column: 1 / -1;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #9b5de5;
    margin-top: .6rem;
    padding-bottom: .3rem;
    border-bottom: 1px solid var(--bg-uncalled);
}
.shortcuts-section-title:first-child { margin-top: 0; }

/* ── slideshow: QR codes in lower-right corner ── */
.slideshow-qr-group {
    position: absolute;
    bottom: 1.8vh;
    right: 1.8vw;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 1.5vw;
    opacity: .88;
}

.slideshow-card-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35vh;
    flex-shrink: 0;
}

.slideshow-card-qr-label {
    font-size: clamp(.55rem, .9vw, .85rem);
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-3);
    white-space: nowrap;
}

.slideshow-card-qr svg {
    display: block;
    width: clamp(90px, 12vw, 160px);
    height: clamp(90px, 12vw, 160px);
    border-radius: 6px;
    background: #fff;
    padding: 3px;
}

/* ────────────────────────────────────────────
   SLIDESHOW PROGRESS BAR (display page)
─────────────────────────────────────────────*/
.slideshow-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #9b5de5, #457b9d);
    border-radius: 0 2px 0 0;
    animation: slideshow-fill 30s linear forwards;
}

@keyframes slideshow-fill {
    from { width: 0; }
    to   { width: 100%; }
}

/* ────────────────────────────────────────────
   SLIDESHOW CALLER PREVIEW
─────────────────────────────────────────────*/
.slideshow-caller-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
    width: min(380px, 80vw);
}

.scp-label {
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-3);
}

.scp-screen {
    width: 100%;
    background: var(--bg-display);
    border: 2px solid rgba(155, 93, 229, 0.45);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,.35),
                0 0 0 1px rgba(155,93,229,.15);
    display: flex;
    flex-direction: column;
}

.scp-title {
    padding: .5rem .8rem .35rem;
    font-size: .85rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: .03em;
    border-bottom: 1px solid rgba(155, 93, 229, 0.25);
    background: rgba(0,0,0,.1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scp-body {
    padding: .45rem .8rem .35rem;
    font-size: .72rem;
    color: var(--text-2);
    line-height: 1.5;
    text-align: center;
    max-height: 5rem;
    overflow: hidden;
}
.scp-body img {
    max-width: 60%;
    max-height: 2.8rem;
    width: auto;
    height: auto;
    object-fit: contain;
    vertical-align: middle;
}
.scp-body h1, .scp-body h2 { font-size: .8rem; color: var(--text); margin: .15em 0; }
.scp-body ul, .scp-body ol  { text-align: left; padding-left: 1em; }

.scp-counter {
    padding: .25rem .8rem;
    font-size: .6rem;
    color: var(--text-3);
    text-align: right;
    border-top: 1px solid var(--color-border);
    background: rgba(0,0,0,.06);
}

/* ────────────────────────────────────────────
   WYSIWYG IMAGE POPUP
─────────────────────────────────────────────*/
.wysiwyg-img-popup {
    position: fixed;
    z-index: 400;
    background: var(--bg-panel);
    border: 1.5px solid var(--color-border);
    border-radius: 10px;
    padding: .75rem;
    box-shadow: 0 8px 28px rgba(0,0,0,.6);
    min-width: 290px;
    display: flex;
    flex-direction: column;
    gap: .45rem;
}

.wysiwyg-img-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #9b5de5;
}

.wysiwyg-img-url {
    width: 100%;
    background: var(--bg-inset);
    color: var(--text);
    border: 1.5px solid var(--color-border);
    border-radius: 6px;
    padding: .4rem .6rem;
    font-size: .85rem;
    font-family: inherit;
}
.wysiwyg-img-url:focus { outline: 2px solid #9b5de5; border-color: transparent; }

.wysiwyg-img-actions {
    display: flex;
    gap: .4rem;
    justify-content: flex-end;
}

.wysiwyg-img-insert {
    background: #9b5de5;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: .3rem .85rem;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background .12s;
}
.wysiwyg-img-insert:hover { background: #7b3db5; }

.wysiwyg-img-cancel {
    background: var(--color-border);
    color: var(--text);
    border: none;
    border-radius: 6px;
    padding: .3rem .85rem;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background .12s;
}
.wysiwyg-img-cancel:hover { background: #4d4d70; }

/* ── images inside the editor and slideshow body ── */
.wysiwyg-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    vertical-align: middle;
}

.slideshow-body img {
    max-width: 80%;
    max-height: 35vh;
    height: auto;
    border-radius: 6px;
    object-fit: contain;
}

/* ── hide fullscreen button while in fullscreen (JS class + native CSS) ── */
body.is-fullscreen .btn-fullscreen { display: none !important; }

/* ── help modal additions ── */
.help-section-heading {
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #9b5de5;
    padding-bottom: .3rem;
    border-bottom: 1px solid var(--bg-uncalled);
    margin-top: .4rem;
}

.help-kbd {
    display: inline-block;
    background: var(--bg-panel);
    border: 1.5px solid var(--color-border);
    border-bottom-width: 3px;
    border-radius: 4px;
    padding: .05rem .35rem;
    font-size: .75rem;
    font-family: 'Consolas', monospace;
    color: var(--text-2);
    white-space: nowrap;
    vertical-align: baseline;
}

.help-shortcuts-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .35rem .9rem;
    align-items: center;
    background: var(--bg-inset);
    border-radius: 8px;
    padding: .7rem .9rem;
    font-size: .85rem;
    color: var(--text-2);
}

/* ── winner / trophy button ── */
.btn-winner {
    background: #7a5800;
    color: #ffd700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s, color .15s, box-shadow .15s;
}
.btn-winner:hover {
    background: #5c4000;
    color: #ffe44d;
    box-shadow: 0 0 10px rgba(255,215,0,.4);
}

/* ────────────────────────────────────────────
   ADD SLIDE SPLIT BUTTON
─────────────────────────────────────────────*/
.btn-add-slide-wrap {
    display: flex;
    position: relative;
    margin-bottom: .9rem;
    border: 1.5px dashed #9b5de5;
    border-radius: 8px;
}

.btn-add-slide-main {
    flex: 1;
    background: transparent;
    color: #9b5de5;
    border: none;
    border-right: 1.5px dashed rgba(155,93,229,.5);
    border-radius: 8px 0 0 8px;
    padding: .5rem 1rem;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background .13s, color .13s;
}
.btn-add-slide-main:hover { background: rgba(155,93,229,.1); color: #bb7fff; }

.btn-add-slide-arrow {
    background: transparent;
    color: #9b5de5;
    border: none;
    border-radius: 0 8px 8px 0;
    padding: .5rem .8rem;
    font-size: .72rem;
    cursor: pointer;
    font-family: inherit;
    transition: background .13s, color .13s;
}
.btn-add-slide-arrow:hover { background: rgba(155,93,229,.1); color: #bb7fff; }

.btn-slide-template-dropdown {
    position: absolute;
    bottom: calc(100% + 5px);
    left: 0;
    right: 0;
    background: var(--bg-panel);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    z-index: 50;
    box-shadow: 0 -6px 20px rgba(0,0,0,.55);
    max-height: 260px;
    overflow-y: auto;
}

.btn-slide-template-dropdown button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: transparent;
    color: var(--text);
    border: none;
    border-bottom: 1px solid var(--bg-uncalled);
    padding: .5rem 1rem;
    cursor: pointer;
    text-align: left;
    font-size: .88rem;
    font-family: inherit;
    transition: background .1s, color .1s;
}
.btn-slide-template-dropdown button:last-child { border-bottom: none; }
.btn-slide-template-dropdown button:hover { background: rgba(155,93,229,.18); color: #bb7fff; }

.slide-count-badge {
    font-size: .68rem;
    color: #9b5de5;
    background: rgba(155,93,229,.15);
    border: 1px solid rgba(155,93,229,.3);
    border-radius: 10px;
    padding: .08rem .45rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ────────────────────────────────────────────
   COUNTDOWN OVERLAY (display page)
─────────────────────────────────────────────*/
.countdown-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 6vh;
    background: rgba(14, 14, 36, 0.97);
    z-index: 201;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5vh;
}

.countdown-label {
    font-size: clamp(1.2rem, 3vw, 2.8rem);
    font-weight: 800;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: #888;
}

.countdown-number {
    font-size: clamp(7rem, 22vw, 20rem);
    font-weight: 900;
    color: #fff;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    animation: cd-pulse 1s ease-in-out infinite;
}

.countdown-urgent {
    color: #e63946;
    animation: cd-urgent .5s ease-in-out infinite !important;
}

@keyframes cd-pulse {
    0%, 100% { transform: scale(1);    opacity: 1;    }
    50%       { transform: scale(1.03); opacity: .92; }
}

@keyframes cd-urgent {
    0%, 100% { transform: scale(1);    opacity: 1;   }
    50%       { transform: scale(1.1); opacity: .75; }
}

/* ── caller cover countdown preview ── */
.scp-countdown-num {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 900;
    color: #fff;
    padding: .3rem .8rem .5rem;
    font-variant-numeric: tabular-nums;
}
.scp-urgent { color: #e63946; }

/* ────────────────────────────────────────────
   START GAME SPLIT BUTTON (modal footer)
─────────────────────────────────────────────*/
.btn-start-game-wrap {
    display: inline-flex;
    border-radius: 8px;
    overflow: visible;
}

.btn-start-game-main {
    background: var(--color-border);
    color: var(--text);
    border: none;
    border-radius: 8px 0 0 8px;
    padding: .5rem 1rem;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    border-right: 1px solid rgba(var(--overlay-tint),.15);
    transition: background .13s;
    white-space: nowrap;
}
.btn-start-game-main:hover { background: #4d4d70; color: #fff; }

.btn-start-game-arrow {
    background: var(--color-border);
    color: var(--text);
    border: none;
    border-radius: 0 8px 8px 0;
    padding: .5rem .6rem;
    font-size: .72rem;
    cursor: pointer;
    font-family: inherit;
    transition: background .13s;
}
.btn-start-game-arrow:hover { background: #4d4d70; color: #fff; }

.btn-start-game-dropdown {
    position: absolute;
    bottom: calc(100% + 5px);
    right: 0;
    background: var(--bg-panel);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    z-index: 50;
    min-width: 140px;
    box-shadow: 0 -6px 20px rgba(0,0,0,.55);
    overflow: hidden;
}

.btn-start-game-dropdown button {
    display: block;
    width: 100%;
    background: transparent;
    color: var(--text);
    border: none;
    border-bottom: 1px solid var(--bg-uncalled);
    padding: .5rem 1rem;
    cursor: pointer;
    text-align: left;
    font-size: .9rem;
    font-family: inherit;
    transition: background .1s, color .1s;
}
.btn-start-game-dropdown button:last-child { border-bottom: none; }
.btn-start-game-dropdown button:hover { background: #2a9d8f; color: #fff; }

/* ────────────────────────────────────────────
   COVER SPLIT START GAME BUTTON
─────────────────────────────────────────────*/
.btn-cover-start-wrap {
    display: inline-flex;
    border-radius: 10px;
    overflow: visible;
}

.btn-cover-start-main {
    background: #2a9d8f;
    color: #fff;
    border: none;
    border-radius: 10px 0 0 10px;
    padding: .8rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    font-family: inherit;
    border-right: 1px solid rgba(255,255,255,.25);
    transition: background .15s;
}
.btn-cover-start-main:hover { background: #21867a; }

.btn-cover-start-arrow {
    background: #2a9d8f;
    color: #fff;
    border: none;
    border-radius: 0 10px 10px 0;
    padding: .8rem .9rem;
    font-size: .78rem;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s;
}
.btn-cover-start-arrow:hover { background: #21867a; }

.btn-cover-countdown-dropdown {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-panel);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    z-index: 50;
    min-width: 160px;
    box-shadow: 0 -6px 24px rgba(0,0,0,.6);
    overflow: hidden;
}

.btn-cover-countdown-dropdown button {
    display: block;
    width: 100%;
    background: transparent;
    color: var(--text);
    border: none;
    border-bottom: 1px solid var(--bg-uncalled);
    padding: .55rem 1.2rem;
    cursor: pointer;
    text-align: center;
    font-size: .95rem;
    font-family: inherit;
    transition: background .1s, color .1s;
}
.btn-cover-countdown-dropdown button:last-child { border-bottom: none; }
.btn-cover-countdown-dropdown button:hover { background: #2a9d8f; color: #fff; }

/* ── font-size toolbar buttons ── */
.wysiwyg-btn--fontsize { line-height: 1; padding-bottom: .3rem; }
.wysiwyg-btn--fontsize sup { font-size: .6em; vertical-align: super; }

/* ── Hosted: caller header additions ─────────────────────────────────────── */
.caller-game-code {
    font-size: .55em;
    font-weight: 700;
    letter-spacing: .12em;
    padding: .15em .5em;
    margin-left: .4rem;
    border-radius: 6px;
    background: var(--bg-inset);
    color: var(--text-3);
    vertical-align: middle;
}

.btn-home {
    background: #455a64;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
}
.btn-home:hover { background: #37474f; color: #fff; }

.settings-share { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.settings-share-links { flex: 1; min-width: 200px; }
.settings-share-links .settings-tunnel-url { margin-bottom: .5rem; word-break: break-all; }
.settings-share-code { margin-bottom: .5rem; }
.settings-share-code strong { letter-spacing: .12em; }

/* ── Hosted: player join messages ────────────────────────────────────────── */
.bcard-message { text-align: center; padding: 3rem 1.5rem; }
.bcard-message h2 { font-size: 1.5rem; margin-bottom: .75rem; }
.bcard-message p { color: var(--text-3); margin-bottom: 1.5rem; }
.bcard-message-btn {
    display: inline-block; padding: .7rem 1.4rem; border-radius: 8px;
    background: #1565c0; color: #fff; font-weight: 600; text-decoration: none;
}

/* ── Hosted: landing + host dashboard ────────────────────────────────────── */
.portal-layout {
    min-height: 100vh;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 24px 16px; gap: 1.5rem;
    background: #1a1a2e; color: #eee;
}
.portal-card {
    background: #222; border-radius: 12px; padding: 2rem;
    width: 100%; max-width: 400px; box-shadow: 0 8px 32px #0005;
}
.portal-card--wide { max-width: 640px; }
.portal-title {
    font-size: 1.6rem; font-weight: 700; text-align: center; margin-bottom: 1.5rem;
    display: flex; align-items: center; justify-content: center; gap: .5rem;
    color: #eee; text-decoration: none;
}
.portal-title--small { font-size: 1.15rem; margin: 0; }
.portal-logo { height: 1.2em; width: auto; }
.portal-heading { font-size: 1rem; font-weight: 600; color: #bbb; margin: 1.5rem 0 .6rem; }
.portal-card > .portal-heading:first-of-type { margin-top: 0; }
.portal-join { display: flex; gap: .5rem; }
.portal-input {
    flex: 1; min-width: 0; padding: .65rem .8rem; font-size: 1rem;
    border-radius: 8px; border: 1.5px solid #444; background: #111; color: #fff; outline: none;
}
.portal-input:focus { border-color: #1565c0; }
.portal-code-input { text-transform: uppercase; letter-spacing: .2em; font-weight: 600; text-align: center; }
.portal-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .65rem 1.2rem; font-size: 1rem; font-weight: 600;
    background: #1565c0; color: #fff; border: none; border-radius: 8px;
    cursor: pointer; text-decoration: none; white-space: nowrap;
}
.portal-btn:hover { background: #0d47a1; color: #fff; }
.portal-btn--alt { background: #333; }
.portal-btn--alt:hover { background: #444; }
.portal-btn--danger { background: #5d2a2a; }
.portal-btn--danger:hover { background: #8e2b2b; }
.portal-btn--google { background: #fff; color: #222; }
.portal-btn--google:hover { background: #e8e8e8; color: #222; }
.portal-btn--small { padding: .4rem .8rem; font-size: .85rem; }
.portal-card > .portal-btn--alt { width: 100%; }
.portal-divider { display: flex; align-items: center; gap: .75rem; margin: 1.4rem 0; color: #666; font-size: .8rem; }
.portal-divider::before, .portal-divider::after { content: ""; flex: 1; height: 1px; background: #3a3a3a; }
.portal-topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.portal-signout { display: flex; align-items: center; gap: .6rem; font-size: .85rem; color: #999; }
.portal-link-btn { background: none; border: none; color: #90caf9; cursor: pointer; padding: 0; font-size: .85rem; }
.portal-link-btn:hover { text-decoration: underline; }
.portal-notice {
    display: flex; flex-direction: column; gap: .8rem; align-items: flex-start;
    background: #1b2a41; border-radius: 8px; padding: 1rem; font-size: .9rem; color: #cfd8dc;
}
.portal-error { color: #ef9a9a; font-size: .85rem; margin-top: .6rem; }
.portal-games { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.portal-game {
    display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap;
    background: #2a2a2a; border-radius: 8px; padding: .7rem .9rem;
}
.portal-game-info { display: flex; flex-direction: column; min-width: 0; }
.portal-game-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-game-code { font-size: .8rem; color: #999; letter-spacing: .15em; }
.portal-game-actions { display: flex; gap: .4rem; align-items: center; }
.portal-game-actions form { margin: 0; }
.portal-footer { font-size: .75rem; color: #666; }

/* ── Hosted: trial banner states ─────────────────────────────────────────── */
.trial-watermark--interactive { pointer-events: auto; }
.trial-watermark--over { border-color: rgba(239,154,154,.6); }
.trial-watermark--over .trial-watermark-count { color: #ef9a9a; font-weight: 600; }
.trial-watermark-link {
    font-size: .75rem; font-weight: 600; color: #ffca28; text-decoration: none;
    border-left: 1px solid rgba(255,255,255,.25); padding-left: .5rem;
}
.trial-watermark-link:hover { text-decoration: underline; color: #ffd54f; }

/* ── Hosted: account + admin pages ───────────────────────────────────────── */
.portal-card--admin { max-width: 1000px; }
.portal-nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; font-size: .9rem; }
.portal-nav a { color: #90caf9; text-decoration: none; }
.portal-nav a:hover { text-decoration: underline; }
.portal-nav form { margin: 0; }
.portal-form { display: flex; flex-direction: column; gap: .8rem; }
.portal-form .portal-btn { align-self: flex-start; }
.portal-label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: #bbb; }
.portal-hint { font-size: .9rem; color: #aaa; margin: 0 0 .6rem; }
.portal-hint--small { font-size: .8rem; color: #888; margin: 0; }
.portal-alt { font-size: .85rem; color: #aaa; margin-top: 1.2rem; text-align: center; }
.portal-alt a { color: #90caf9; }
.portal-alt--muted { color: #777; margin-top: .4rem; }
.portal-success {
    background: #1b3a26; color: #a5d6a7; border-radius: 8px;
    padding: .7rem .9rem; font-size: .9rem; margin: 0 0 .8rem;
}
.portal-plan { display: flex; flex-direction: column; gap: .8rem; align-items: flex-start; background: #2a2a2a; border-radius: 8px; padding: 1rem; }
.portal-plan form { margin: 0; }
.portal-plan-status { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.portal-plan-detail { font-size: .9rem; color: #ccc; }
.portal-plan-badge { font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: .25rem .6rem; border-radius: 999px; }
.portal-plan-badge--ok   { background: #1b3a26; color: #a5d6a7; }
.portal-plan-badge--warn { background: #3e3214; color: #ffca28; }
.portal-plan-badge--bad  { background: #3e1b1b; color: #ef9a9a; }
.portal-details { margin: 0 0 1rem; }
.portal-details summary { cursor: pointer; color: #90caf9; font-size: .9rem; margin-bottom: .8rem; }
.portal-table-wrap { overflow-x: auto; }
.portal-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.portal-table th { text-align: left; color: #999; font-weight: 600; padding: .5rem; border-bottom: 1px solid #3a3a3a; white-space: nowrap; }
.portal-table td { padding: .6rem .5rem; border-bottom: 1px solid #2f2f2f; vertical-align: top; }
.portal-row--disabled td { opacity: .55; }
.portal-tag { display: inline-block; font-size: .7rem; font-weight: 600; padding: .1rem .45rem; border-radius: 999px; background: #333; color: #ccc; margin-left: .3rem; }
.portal-tag--ok  { background: #1b3a26; color: #a5d6a7; margin-left: 0; }
.portal-tag--bad { background: #3e1b1b; color: #ef9a9a; }
.portal-actions { display: flex; flex-wrap: wrap; gap: .3rem; }
.portal-actions form { margin: 0; }
.portal-check { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: #bbb; }
.portal-code { display: block; background: #111; border-radius: 6px; padding: .6rem .8rem; font-size: .8rem; color: #ddd; word-break: break-all; }

/* ── Hosted: trial bar (caller, bottom) and Trial Over lock screen ───────── */
.trial-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 1vw;
    background: var(--bg-inset);
    border-top: 2px solid var(--bg-uncalled);
    padding: .5vh 1vw;
    min-height: 5vh;
    margin: 1vh -1vw -1vh;   /* full width, flush with the bottom edge like the display's sponsor bar */
}
.trial-bar-label {
    font-size: 1.4vh;
    font-weight: 800;
    letter-spacing: 2px;
    color: #ffca28;
    white-space: nowrap;
    text-transform: uppercase;
}
.trial-bar-text { flex: 1; font-size: 1.8vh; color: var(--text-3); }
.trial-bar-time { color: #ffca28; font-variant-numeric: tabular-nums; }
.trial-bar--over .trial-bar-text { color: #ef9a9a; font-weight: 600; }
.trial-bar-link {
    font-size: 1.6vh; font-weight: 700; color: #1a1a2e; background: #ffca28;
    padding: .5vh 1vw; border-radius: 999px; text-decoration: none; white-space: nowrap;
}
.trial-bar-link:hover { background: #ffd54f; color: #1a1a2e; }

.trial-over-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10000;   /* above every page element, modal and animation */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(20, 20, 30, .55);
    backdrop-filter: grayscale(1) blur(2px);
    -webkit-backdrop-filter: grayscale(1) blur(2px);
}
.trial-over-modal {
    width: 100%;
    max-width: 440px;
    background: #222;
    color: #eee;
    border-radius: 14px;
    padding: 2rem 2rem 1.6rem;
    text-align: center;
    box-shadow: 0 12px 48px #000a;
    font-family: system-ui, sans-serif;
}
.trial-over-badge { display: inline-block; font-size: .75rem; font-weight: 800; letter-spacing: .1em; color: #ffca28; border: 1px solid #ffca2866; border-radius: 999px; padding: .15rem .7rem; }
.trial-over-title { font-size: 2rem; font-weight: 800; margin: .7rem 0 .5rem; }
.trial-over-text { font-size: 1rem; color: #bbb; margin: 0 0 1.4rem; }
.trial-over-actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }
.trial-over-btn {
    display: inline-block; padding: .7rem 1.4rem; border-radius: 8px; font-weight: 700;
    background: #ffca28; color: #1a1a2e; text-decoration: none;
}
.trial-over-btn:hover { background: #ffd54f; color: #1a1a2e; }
.trial-over-btn--alt { background: #333; color: #eee; }
.trial-over-btn--alt:hover { background: #444; color: #fff; }
