/* Inter (body) loads from the CDN when online; the system stacks below keep the
   screens legible and on-feel if the venue has no internet (offline fallback). */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

/* VisbyCF is the real Benefex brand typeface (the live site's heading + body font).
   Self-hosted woff2/woff so the wordmark and headlines are guaranteed on-brand on
   the projector even with no venue internet. The Bold face advertises a 700-900
   weight range so the heavy heading rules (font-weight: 900) resolve to it instead
   of triggering browser faux-bold synthesis. */
@font-face {
    font-family: 'VisbyCF';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/VisbyCF-Regular.woff2') format('woff2'),
         url('fonts/VisbyCF-Regular.woff') format('woff');
}
@font-face {
    font-family: 'VisbyCF';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('fonts/VisbyCF-Medium.woff2') format('woff2'),
         url('fonts/VisbyCF-Medium.woff') format('woff');
}
@font-face {
    font-family: 'VisbyCF';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/VisbyCF-DemiBold.woff2') format('woff2'),
         url('fonts/VisbyCF-DemiBold.woff') format('woff');
}
@font-face {
    font-family: 'VisbyCF';
    font-style: normal;
    font-weight: 700 900;
    font-display: swap;
    src: url('fonts/VisbyCF-Bold.woff2') format('woff2'),
         url('fonts/VisbyCF-Bold.woff') format('woff');
}

/* --- Benifibbers: Benefex-flavoured theme --- */
:root {
    --tol-forest: #0F3D2E;
    --tol-forest-deep: #0a2c20;
    --tol-cream: #F5EFE0;
    --tol-lime: #22D24F;
    --tol-ink: #0b241b;
    --tol-orange: #F58A35;
    --tol-pink: #E94B7B;
    --tol-sky: #6FC7E1;
    --tol-gold: #F4C13B;
    --tol-coral: #E55A4A;
    --tol-display: 'VisbyCF', 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    --tol-body: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

html, body {
    margin: 0;
    font-family: var(--tol-body);
    background: var(--tol-forest);
    color: var(--tol-cream);
}

.tol-page {
    min-height: 100vh;
    box-sizing: border-box;
    padding: clamp(1rem, 4vw, 3rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    text-align: center;
}

.tol-title {
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0;
}

.tol-code {
    font-weight: 800;
    letter-spacing: 0.15em;
    color: var(--tol-lime);
}

.tol-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    border-radius: 999px;
    padding: 0.85rem 1.6rem;
    font-size: 1rem;
    font-weight: 700;
    background: var(--tol-lime);
    color: #06251a;
    cursor: pointer;
}

.tol-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.tol-btn--ghost {
    background: transparent;
    color: var(--tol-cream);
    border: 2px solid rgba(245, 239, 224, 0.6);
}

.tol-input {
    border-radius: 999px;
    border: 2px solid rgba(245, 239, 224, 0.4);
    padding: 0.85rem 1.2rem;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.06);
    color: var(--tol-cream);
    text-align: center;
}

.tol-card {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 1.25rem;
    padding: 1.25rem 1.5rem;
    width: min(560px, 100%);
    box-sizing: border-box;
}

/* --- Home entry chooser: host vs. join are two distinct first-class paths,
   never a shared form, so a room-code habit can't get typed into the wrong
   flow. --- */
.tol-home-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
}

.tol-home-subline {
    opacity: 0.8;
    margin-top: -0.5rem;
}

.tol-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    width: min(560px, 100%);
}

.tol-choice-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(245, 239, 224, 0.25);
    border-radius: 1.25rem;
    padding: 1.75rem 1.25rem;
    color: var(--tol-cream);
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.08s ease;
}

.tol-choice-card:hover {
    border-color: var(--tol-lime);
    background: rgba(34, 210, 79, 0.12);
}

.tol-choice-card:active {
    transform: scale(0.98);
}

.tol-choice-card__icon {
    font-size: 2.5rem;
    line-height: 1;
}

.tol-choice-card__title {
    font-family: var(--tol-display);
    font-weight: 700;
    font-size: 1.2rem;
}

.tol-choice-card__hint {
    opacity: 0.75;
    font-size: 0.9rem;
}

.tol-back-link {
    display: block;
    background: none;
    border: none;
    color: var(--tol-cream);
    opacity: 0.75;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-bottom: 1rem;
}

.tol-back-link:hover {
    opacity: 1;
}

.tol-field-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-align: left;
}

.tol-field-label--stacked {
    margin-top: 1rem;
}

.tol-input--block {
    width: 100%;
    box-sizing: border-box;
}

.tol-btn--block {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
}

.tol-btn--stacked {
    margin-top: 1rem;
}

.tol-option {
    display: block;
    width: 100%;
    text-align: left;
    margin: 0.5rem 0;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    border: 2px solid rgba(245, 239, 224, 0.25);
    background: rgba(255, 255, 255, 0.05);
    color: var(--tol-cream);
    font-size: 1.05rem;
    cursor: pointer;
}

.tol-option--correct {
    border-color: var(--tol-lime);
    background: rgba(34, 210, 79, 0.18);
}

.tol-roster {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.tol-roster li {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
}

.tol-bar {
    height: 1.5rem;
    border-radius: 999px;
    background: var(--tol-sky);
    transition: width 0.6s ease;
}

/* =========================================================================
   Host big-screen (projector) — Phase 5 spectacle. Large scale, branded,
   choreographed reveal. The player surface (Phase 6) keeps the .tol-page
   classes above; these .tol-stage classes are host-only.
   ========================================================================= */
.tol-stage {
    position: relative;
    min-height: 100vh;
    box-sizing: border-box;
    padding: clamp(1.5rem, 4vw, 4rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(1rem, 3vh, 2.5rem);
    text-align: center;
    overflow: hidden;
    background:
        radial-gradient(60vw 60vw at 12% 8%, rgba(245, 138, 53, 0.16), transparent 60%),
        radial-gradient(55vw 55vw at 88% 18%, rgba(233, 75, 123, 0.14), transparent 60%),
        radial-gradient(70vw 70vw at 78% 92%, rgba(111, 199, 225, 0.14), transparent 62%),
        radial-gradient(60vw 60vw at 8% 88%, rgba(244, 193, 59, 0.12), transparent 60%),
        linear-gradient(160deg, var(--tol-forest), var(--tol-forest-deep));
}

/* Benefex paint swish — intertwined brush loops bleeding off the top-right
   corner, mirroring the brand hero. Decorative only; sits behind all content. */
.tol-stage::before {
    content: "";
    position: absolute;
    top: clamp(-14rem, -16vw, -6rem);
    right: clamp(-18rem, -18vw, -8rem);
    width: min(75vw, 1100px);
    aspect-ratio: 1;
    background: url('img/swish.svg') no-repeat center / contain;
    opacity: 0.85;
    pointer-events: none;
    z-index: 0;
}

/* Keep stage content above the decorative swish layer. */
.tol-stage > * {
    position: relative;
    z-index: 1;
}

.tol-connecting {
    font-size: clamp(1.2rem, 3vw, 2rem);
    opacity: 0.8;
}

/* --- Brand / lobby --- */
.tol-brand {
    margin: 0;
}

.tol-wordmark {
    font-family: var(--tol-display);
    font-weight: 900;
    font-size: clamp(3rem, 9vw, 7rem);
    line-height: 0.95;
    letter-spacing: -0.02em;
    margin: 0;
    padding: 0.2em 0.5em;
    border-radius: 1.5rem;
    background: rgba(6, 30, 21, 0.35);
    backdrop-filter: blur(6px);
    color: var(--tol-cream);
    text-shadow: 0 6px 30px rgba(0, 0, 0, 0.35);
}

.tol-amp {
    color: var(--tol-lime);
    font-style: italic;
}

.tol-subline {
    font-size: clamp(1rem, 2.5vw, 1.6rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0.75;
    margin: 0.4rem 0 0;
}

.tol-lobby {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(1.5rem, 4vw, 4rem);
    align-items: center;
    justify-content: center;
    width: 100%;
}

.tol-qr-card {
    background: #fff;
    border-radius: 1.5rem;
    padding: 1.25rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    line-height: 0;
}

.tol-qr-card svg {
    width: clamp(220px, 30vw, 420px);
    height: auto;
    display: block;
}

.tol-join {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.tol-join__label {
    font-size: clamp(1rem, 2.5vw, 1.6rem);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    opacity: 0.75;
    margin: 0;
}

.tol-join__url {
    font-size: clamp(1.4rem, 3.5vw, 2.6rem);
    font-weight: 700;
    margin: 0;
    color: var(--tol-cream);
}

.tol-code-chip {
    font-family: var(--tol-display);
    font-weight: 900;
    font-size: clamp(3rem, 9vw, 6rem);
    letter-spacing: 0.12em;
    color: var(--tol-lime);
    line-height: 1;
}

.tol-roster-block {
    margin-top: 0.5rem;
    max-width: 40rem;
}

.tol-roster-heading {
    font-family: var(--tol-display);
    font-weight: 700;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    margin: 0 0 0.6rem;
}

.tol-host-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    margin-top: 0.5rem;
}

.tol-feature-control {
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.tol-select {
    border-radius: 999px;
    border: 2px solid rgba(245, 239, 224, 0.4);
    background: rgba(255, 255, 255, 0.08);
    color: var(--tol-cream);
    padding: 0.6rem 1rem;
    font-size: 1rem;
    font-weight: 700;
}

.tol-btn--lg {
    font-size: clamp(1.1rem, 2.5vw, 1.6rem);
    padding: 1rem 2.2rem;
}

/* --- Generic phase scaffolding --- */
.tol-phase {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(1rem, 3vh, 2rem);
    width: min(1100px, 100%);
}

.tol-phase--center {
    justify-content: center;
}

.tol-headline {
    font-family: var(--tol-display);
    font-weight: 900;
    font-size: clamp(2.2rem, 6vw, 5rem);
    line-height: 1.02;
    letter-spacing: -0.02em;
    margin: 0;
    padding: 0.2em 0.5em;
    border-radius: 1.5rem;
    background: rgba(6, 30, 21, 0.35);
    backdrop-filter: blur(6px);
}

.tol-target {
    color: var(--tol-lime);
}

.tol-lede {
    font-size: clamp(1.1rem, 3vw, 1.8rem);
    opacity: 0.85;
    margin: 0;
}

.tol-counter {
    font-size: clamp(1.4rem, 4vw, 2.6rem);
    font-weight: 700;
    margin: 0;
}

.tol-counter strong {
    color: var(--tol-lime);
}

.tol-round-badge {
    align-self: center;
    font-family: var(--tol-display);
    font-weight: 700;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    letter-spacing: 0.05em;
    padding: 0.4rem 1.2rem;
    border-radius: 999px;
    background: var(--badge-color, var(--tol-lime));
    color: #06251a;
}

/* --- Option cards (guessing) --- */
.tol-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(0.75rem, 2vw, 1.25rem);
    width: 100%;
}

.tol-option-card {
    text-align: left;
    padding: clamp(1rem, 2.5vw, 1.6rem);
    border-radius: 1.25rem;
    border-left: 8px solid var(--bar-color, var(--tol-sky));
    background: rgba(255, 255, 255, 0.07);
    font-size: clamp(1.1rem, 2.4vw, 1.8rem);
    font-weight: 600;
}

.tol-guess-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

/* --- Countdown ring --- */
.tol-countdown {
    position: relative;
    width: clamp(110px, 16vw, 180px);
    height: clamp(110px, 16vw, 180px);
}

.tol-countdown__ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.tol-countdown__track {
    fill: none;
    stroke: rgba(245, 239, 224, 0.15);
    stroke-width: 7;
}

.tol-countdown__progress {
    fill: none;
    stroke: var(--tol-lime);
    stroke-width: 7;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: calc(283 * (1 - var(--tol-progress, 1)));
    transition: stroke-dashoffset 0.25s linear;
}

.tol-countdown__number {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--tol-display);
    font-weight: 900;
    font-size: clamp(2.5rem, 7vw, 4.5rem);
}

.tol-countdown--urgent .tol-countdown__progress {
    stroke: var(--tol-coral);
}

.tol-countdown--urgent .tol-countdown__number {
    color: var(--tol-coral);
    animation: tol-pulse 0.5s ease-in-out infinite;
}

/* --- Reveal choreography --- */
.tol-reveal__suspense {
    animation: tol-suspense 1.1s ease both;
}

.tol-options--reveal {
    grid-template-columns: 1fr;
    max-width: 900px;
}

.tol-result {
    text-align: left;
    padding: clamp(0.75rem, 2vw, 1.1rem) clamp(1rem, 2.5vw, 1.4rem);
    border-radius: 1.1rem;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid transparent;
}

.tol-result--correct {
    border-color: var(--tol-lime);
    background: rgba(34, 210, 79, 0.16);
    animation: tol-pop 0.6s ease both;
    animation-delay: 2s;
}

.tol-result__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    font-size: clamp(1.05rem, 2.4vw, 1.7rem);
    font-weight: 600;
}

.tol-result__count {
    font-family: var(--tol-display);
    font-weight: 900;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    color: var(--bar-color);
}

.tol-result__track {
    margin-top: 0.5rem;
    height: clamp(0.8rem, 1.8vw, 1.3rem);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.tol-result__bar {
    height: 100%;
    border-radius: 999px;
    background: var(--bar-color, var(--tol-sky));
    transform-origin: left center;
    animation: tol-grow 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-delay: var(--bar-delay, 0.9s);
}

.tol-voters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.6rem;
    animation: tol-fade 0.5s ease both;
    animation-delay: 2.3s;
}

.tol-voter-chip {
    font-size: clamp(0.8rem, 1.6vw, 1.05rem);
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

/* --- Leaderboard --- */
.tol-board {
    list-style: none;
    padding: 0;
    margin: 0;
    width: min(700px, 100%);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.tol-board__row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: clamp(0.7rem, 2vw, 1.1rem) clamp(1rem, 2.5vw, 1.5rem);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.07);
    font-size: clamp(1.1rem, 2.6vw, 1.8rem);
    font-weight: 600;
}

.tol-board__row--winner {
    background: linear-gradient(100deg, rgba(34, 210, 79, 0.25), rgba(244, 193, 59, 0.2));
    border: 2px solid var(--tol-lime);
    animation: tol-winner-glow 1.8s ease-in-out infinite alternate;
}

.tol-board__rank {
    font-family: var(--tol-display);
    font-weight: 900;
    color: var(--tol-lime);
    min-width: 1.5em;
}

.tol-board__name {
    text-align: left;
}

.tol-board__score {
    font-family: var(--tol-display);
    font-weight: 900;
}

/* --- Confetti overlay --- */
.tol-confetti-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1000;
}

/* --- Keyframes --- */
@keyframes tol-suspense {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes tol-grow {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@keyframes tol-pop {
    0% { transform: scale(1); box-shadow: 0 0 0 rgba(34, 210, 79, 0); }
    50% { transform: scale(1.035); }
    100% { transform: scale(1); box-shadow: 0 0 35px rgba(34, 210, 79, 0.5); }
}

@keyframes tol-fade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes tol-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

@keyframes tol-winner-glow {
    from { box-shadow: 0 0 20px rgba(34, 210, 79, 0.3); }
    to { box-shadow: 0 0 45px rgba(244, 193, 59, 0.55); }
}

@media (max-width: 720px) {
    .tol-options {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tol-reveal__suspense,
    .tol-result--correct,
    .tol-result__bar,
    .tol-voters,
    .tol-board__row--winner,
    .tol-countdown--urgent .tol-countdown__number {
        animation: none;
    }
}

/* =========================================================================
   Player surface (Phase 6) — mobile-first with real desktop breakpoints, not a
   stretched phone layout. Namespaced .tol-p-* so it never collides with the
   host .tol-stage tree or the Home .tol-page classes. Shares the .tol-countdown
   ring + brand palette/keyframes defined above.
   ========================================================================= */
.tol-p {
    min-height: 100svh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(1rem, 4vw, 2rem);
    gap: 1rem;
    text-align: center;
    background:
        radial-gradient(48vw 48vw at 8% 4%, rgba(245, 138, 53, 0.12), transparent 60%),
        radial-gradient(52vw 52vw at 92% 12%, rgba(233, 75, 123, 0.10), transparent 62%),
        radial-gradient(60vw 60vw at 88% 96%, rgba(111, 199, 225, 0.10), transparent 64%),
        linear-gradient(165deg, var(--tol-forest), var(--tol-forest-deep));
}

.tol-p-header {
    width: 100%;
}

.tol-p-wordmark {
    font-family: var(--tol-display);
    font-weight: 900;
    font-size: clamp(1.3rem, 5vw, 1.8rem);
    letter-spacing: -0.01em;
    opacity: 0.9;
}

.tol-p-amp {
    color: var(--tol-lime);
    font-style: italic;
}

.tol-p-body {
    width: 100%;
    max-width: 32rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(1rem, 3vh, 1.5rem);
}

.tol-p-body--center {
    justify-content: center;
}

.tol-p-headline {
    font-family: var(--tol-display);
    font-weight: 900;
    font-size: clamp(2rem, 9vw, 3.2rem);
    line-height: 1.04;
    letter-spacing: -0.02em;
    margin: 0;
}

.tol-p-accent {
    color: var(--tol-lime);
}

.tol-p-lede {
    font-size: clamp(1.05rem, 4vw, 1.35rem);
    line-height: 1.4;
    opacity: 0.85;
    margin: 0;
    max-width: 26rem;
}

.tol-p-hint {
    font-size: 0.95rem;
    opacity: 0.6;
    margin: 0;
}

.tol-p-count {
    font-size: clamp(1.1rem, 4vw, 1.4rem);
    margin: 0;
}

.tol-p-count strong {
    color: var(--tol-lime);
}

.tol-p-pulse {
    font-size: clamp(3rem, 16vw, 5rem);
    animation: tol-pulse 1.4s ease-in-out infinite;
}

/* --- Card + inputs --- */
.tol-p-card {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(245, 239, 224, 0.12);
    border-radius: 1.4rem;
    padding: clamp(1.1rem, 4vw, 1.6rem);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tol-p-input,
.tol-p-textarea {
    width: 100%;
    box-sizing: border-box;
    border-radius: 1rem;
    border: 2px solid rgba(245, 239, 224, 0.35);
    background: rgba(255, 255, 255, 0.08);
    color: var(--tol-cream);
    font-family: var(--tol-body);
    font-size: 1.1rem;
    padding: 0.9rem 1.1rem;
}

.tol-p-input {
    border-radius: 999px;
    text-align: center;
}

.tol-p-textarea {
    resize: none;
    min-height: 5.5rem;
    text-align: left;
}

.tol-p-input:focus,
.tol-p-textarea:focus {
    outline: none;
    border-color: var(--tol-lime);
}

.tol-p-charcount {
    align-self: flex-end;
    font-size: 0.8rem;
    opacity: 0.55;
}

/* --- Buttons (large tap targets) --- */
.tol-p-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 3.25rem;
    border: none;
    border-radius: 999px;
    padding: 0.9rem 1.6rem;
    font-family: var(--tol-body);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.08s ease, filter 0.15s ease, background 0.15s ease;
}

.tol-p-btn:active {
    transform: scale(0.97);
}

.tol-p-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tol-p-btn--primary {
    background: var(--tol-lime);
    color: #06251a;
}

.tol-p-btn--primary:not(:disabled):hover {
    filter: brightness(1.06);
}

.tol-p-btn--ghost {
    background: transparent;
    color: var(--tol-cream);
    border: 2px solid rgba(245, 239, 224, 0.55);
}

.tol-p-btn--block {
    width: 100%;
}

.tol-p-btn--sm {
    min-height: 2.5rem;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    flex-shrink: 0;
}

.tol-p-arrow {
    transition: transform 0.15s ease;
}

.tol-p-btn--primary:not(:disabled):hover .tol-p-arrow {
    transform: translateX(3px);
}

/* --- Round badge --- */
.tol-p-badge {
    font-family: var(--tol-display);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    padding: 0.35rem 1rem;
    border-radius: 999px;
    background: var(--badge-color, var(--tol-lime));
    color: #06251a;
}

/* --- Guess options --- */
.tol-p-options {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.tol-p-option {
    width: 100%;
    box-sizing: border-box;
    min-height: 3.5rem;
    text-align: left;
    padding: 1rem 1.2rem;
    border-radius: 1.1rem;
    border: 2px solid rgba(245, 239, 224, 0.2);
    border-left: 7px solid var(--accent, var(--tol-sky));
    background: rgba(255, 255, 255, 0.06);
    color: var(--tol-cream);
    font-family: var(--tol-body);
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease;
}

.tol-p-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tol-p-option:active {
    transform: scale(0.98);
}

/* --- Veto list --- */
.tol-p-veto-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.tol-p-veto-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 1.1rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(245, 239, 224, 0.12);
    text-align: left;
}

.tol-p-veto-text {
    flex: 1;
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.3;
}

/* --- Reveal results --- */
.tol-p-reveal__suspense {
    animation: tol-suspense 0.9s ease both;
}

.tol-p-results {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.tol-p-result {
    position: relative;
    text-align: left;
    padding: 0.85rem 1rem;
    border-radius: 1.1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    animation: tol-fade 0.45s ease both;
    animation-delay: var(--row-delay, 0.4s);
}

.tol-p-result--correct {
    border-color: var(--tol-lime);
    background: rgba(34, 210, 79, 0.16);
}

.tol-p-result--mine {
    box-shadow: inset 0 0 0 2px rgba(245, 239, 224, 0.45);
}

.tol-p-result__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.tol-p-result__count {
    font-family: var(--tol-display);
    font-weight: 900;
    font-size: 1.3rem;
    color: var(--accent);
}

.tol-p-result__track {
    margin-top: 0.45rem;
    height: 0.7rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.tol-p-result__bar {
    height: 100%;
    border-radius: 999px;
    background: var(--accent, var(--tol-sky));
    transform-origin: left center;
    animation: tol-grow 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-delay: var(--bar-delay, 0.5s);
}

.tol-p-result__tag {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: rgba(245, 239, 224, 0.18);
}

/* --- Leaderboard --- */
.tol-p-board {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tol-p-board__row {
    display: grid;
    grid-template-columns: 2.2rem 1fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.06);
    font-size: 1.1rem;
    font-weight: 600;
    text-align: left;
}

.tol-p-board__row--winner {
    background: linear-gradient(100deg, rgba(34, 210, 79, 0.25), rgba(244, 193, 59, 0.2));
    border: 2px solid var(--tol-lime);
    animation: tol-winner-glow 1.8s ease-in-out infinite alternate;
}

.tol-p-board__row--me {
    box-shadow: inset 0 0 0 2px rgba(245, 239, 224, 0.4);
}

.tol-p-board__rank {
    font-family: var(--tol-display);
    font-weight: 900;
    color: var(--tol-lime);
    text-align: center;
}

.tol-p-board__score {
    font-family: var(--tol-display);
    font-weight: 900;
}

/* --- Error toast (shared by host + player) --- */
.tol-toast {
    position: fixed;
    left: 50%;
    bottom: clamp(1rem, 4vh, 2.5rem);
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: max-content;
    max-width: min(92vw, 34rem);
    box-sizing: border-box;
    background: var(--tol-pink);
    color: white;
    border-radius: 999px;
    padding: 0.7rem 1.1rem;
    font-weight: 600;
    box-shadow: 0 0.6rem 1.6rem rgba(0, 0, 0, 0.35);
    animation: tol-toast-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.tol-toast__icon {
    font-size: 1.1rem;
    line-height: 1;
}

.tol-toast__msg {
    flex: 1 1 auto;
}

.tol-toast__dismiss {
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 999px;
    width: 1.8rem;
    height: 1.8rem;
    font-size: 0.9rem;
    cursor: pointer;
    line-height: 1;
}

.tol-toast__dismiss:hover {
    background: rgba(255, 255, 255, 0.35);
}

@keyframes tol-toast-in {
    from { opacity: 0; transform: translate(-50%, 1rem); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* --- Circuit reconnect overlay (on-brand replacement for Blazor's default) --- */
.tol-reconnect {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(10, 44, 32, 0.92);
    backdrop-filter: blur(4px);
    color: var(--tol-cream);
    font-family: var(--tol-body);
}

/* Blazor toggles these state classes on the modal element. */
.tol-reconnect.components-reconnect-show,
.tol-reconnect.components-reconnect-failed,
.tol-reconnect.components-reconnect-rejected {
    display: flex;
}

.tol-reconnect__card {
    text-align: center;
    max-width: 26rem;
}

.tol-reconnect__spinner {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    border: 0.35rem solid rgba(245, 239, 224, 0.25);
    border-top-color: var(--tol-lime);
    animation: tol-spin 0.9s linear infinite;
}

.tol-reconnect__msg {
    display: none;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.tol-reconnect__attempt {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.95rem;
    font-weight: 400;
    opacity: 0.75;
}

.components-reconnect-show .tol-reconnect__msg--show,
.components-reconnect-failed .tol-reconnect__msg--failed,
.components-reconnect-rejected .tol-reconnect__msg--rejected {
    display: block;
}

/* Once retries are exhausted the spinner is misleading — hide it. */
.components-reconnect-failed .tol-reconnect__spinner,
.components-reconnect-rejected .tol-reconnect__spinner {
    display: none;
}

.tol-reconnect__btn {
    display: inline-block;
    margin-top: 1rem;
    background: var(--tol-lime);
    color: var(--tol-forest-deep);
    font-weight: 700;
    border: none;
    border-radius: 999px;
    padding: 0.6rem 1.4rem;
    font-size: 1rem;
    cursor: pointer;
}

.tol-reconnect__btn:hover {
    filter: brightness(1.08);
}

@keyframes tol-spin {
    to { transform: rotate(360deg); }
}

/* --- Desktop breakpoints: real layouts, not a stretched phone --- */
@media (min-width: 640px) {
    .tol-p-body {
        max-width: 40rem;
    }

    .tol-p-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tol-p-headline {
        font-size: clamp(2.6rem, 5vw, 3.4rem);
    }
}

@media (min-width: 1024px) {
    .tol-p {
        padding: 2.5rem;
    }

    .tol-p-body {
        max-width: 52rem;
    }

    .tol-p-headline {
        font-size: 3.6rem;
    }

    .tol-p-lede {
        font-size: 1.45rem;
        max-width: 34rem;
    }

    .tol-p-option {
        font-size: 1.2rem;
        min-height: 4rem;
    }

    .tol-p-result__row {
        font-size: 1.2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tol-p-pulse,
    .tol-p-reveal__suspense,
    .tol-p-result,
    .tol-p-result__bar,
    .tol-p-board__row--winner,
    .tol-toast,
    .tol-reconnect__spinner {
        animation: none;
    }
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}