:root,
[data-theme="light"] {
    --ink: #172033;
    --muted: #647084;
    --body-bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f4f7fb;
    --surface-strong: #f8faff;
    --line: #dfe6f0;
    --brand: #3157d5;
    --brand-dark: #203b9f;
    --success: #178653;
    --success-soft: #dff6e9;
    --marked: #ffe28a;
    --marked-border: #e4ad20;
    --sidebar-bg: #172033;
    --sidebar-muted: #cbd5e8;
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    --sidebar-active: rgba(255, 255, 255, 0.12);
    --brand-soft: rgba(49, 87, 213, 0.1);
    --current-bg: #e8edff;
    --current-border: #bdcaff;
    --warning-soft: #fff0c2;
    --warning-ink: #805f00;
    --hero-start: #233d9c;
    --hero-end: #4673ed;
    --shadow: rgba(38, 55, 89, 0.08);
    color-scheme: light;
}

[data-theme="dark"] {
    --ink: #e7edf8;
    --muted: #a8b4c6;
    --body-bg: #0f141d;
    --surface: #171d26;
    --surface-soft: #121923;
    --surface-strong: #1b2430;
    --line: #2f4058;
    --brand: #79a7ff;
    --brand-dark: #b6cbff;
    --success: #65dba5;
    --success-soft: #153a2d;
    --marked: #674d00;
    --marked-border: #d9a928;
    --sidebar-bg: #0a101b;
    --sidebar-muted: #cbd5e8;
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    --sidebar-active: rgba(255, 255, 255, 0.14);
    --brand-soft: rgba(121, 167, 255, 0.14);
    --current-bg: #1c3155;
    --current-border: #4168ae;
    --warning-soft: #463600;
    --warning-ink: #f5d773;
    --hero-start: #1c327d;
    --hero-end: #3157d5;
    --shadow: rgba(0, 0, 0, 0.3);
    color-scheme: dark;
}

html, body {
    background: var(--body-bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    min-width: 320px;
}

.loading-screen {
    align-items: center;
    background: var(--body-bg);
    color: var(--ink);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
    text-align: center;
}

.loading-card {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 1.5rem;
    box-shadow: 0 0.75rem 2rem var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 22rem;
    padding: 2.5rem 2rem;
    width: 100%;
}

.loading-brand {
    align-items: center;
    display: flex;
    font-size: 1.35rem;
    font-weight: 800;
    gap: 0.75rem;
    letter-spacing: -0.03em;
}

.loading-logo-mark {
    align-items: center;
    background: var(--brand);
    border-radius: 0.75rem;
    color: #fff;
    display: inline-flex;
    font-size: 0.8rem;
    height: 2.25rem;
    justify-content: center;
    letter-spacing: -0.05em;
    width: 2.25rem;
}

.loading-spinner {
    animation: loading-spin 900ms linear infinite;
    border: 0.25rem solid var(--line);
    border-radius: 50%;
    border-top-color: var(--brand);
    height: 2.5rem;
    width: 2.5rem;
}

.loading-card p {
    color: var(--muted);
    margin: 0;
}

.confetti-layer {
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    position: fixed;
    z-index: 2000;
}

.confetti-piece {
    animation: confetti-fall var(--confetti-duration) ease-out var(--confetti-delay) forwards;
    background: var(--confetti-color);
    border-radius: 0.15rem;
    height: 0.9rem;
    left: var(--confetti-left);
    opacity: 0;
    position: absolute;
    top: -1.5rem;
    transform-origin: center;
    width: 0.6rem;
}

.confetti-piece:nth-child(3n) {
    border-radius: 50%;
    height: 0.7rem;
    width: 0.7rem;
}

.confetti-piece:nth-child(3n + 1) {
    height: 0.5rem;
    transform: skewX(-12deg);
    width: 1rem;
}

@keyframes confetti-fall {
    0% {
        opacity: 1;
        transform: translate3d(0, -5vh, 0) rotate(0);
    }

    50% {
        opacity: 1;
        transform: translate3d(var(--confetti-mid-drift), 50vh, 0) rotate(calc(var(--confetti-spin) / 2));
    }

    100% {
        opacity: 0;
        transform: translate3d(var(--confetti-drift), 110vh, 0) rotate(var(--confetti-spin));
    }
}

@keyframes loading-spin {
    to {
        transform: rotate(360deg);
    }
}

a {
    color: var(--brand);
}

.page {
    min-height: 100vh;
}

.sidebar {
    background: var(--sidebar-bg);
}

.top-row {
    min-height: 4.5rem;
}

.navbar-brand {
    font-weight: 800;
    letter-spacing: -0.03em;
}

.nav-link {
    color: var(--sidebar-muted);
    border-radius: 0.75rem;
    margin: 0.15rem 0;
}

.nav-link.active,
.nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.content {
    box-sizing: border-box;
    max-width: 1180px;
    margin: 0 auto;
    padding-bottom: 3rem;
    width: 100%;
}

.hero-panel {
    background: linear-gradient(135deg, var(--hero-start), var(--hero-end));
    border-radius: 1.5rem;
    color: #fff;
    margin: 1rem 0 1.5rem;
    padding: clamp(1.5rem, 4vw, 3rem);
}

.hero-panel h1 {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 850;
    letter-spacing: -0.07em;
    margin: 0;
}

.hero-copy {
    font-size: 1.1rem;
    margin: 1rem 0 0;
    max-width: 42rem;
}

.eyebrow {
    color: var(--brand);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    margin: 0 0 0.4rem;
    text-transform: uppercase;
}

.hero-panel .eyebrow {
    color: #d6e0ff;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    box-sizing: border-box;
    border-radius: 1.25rem;
    box-shadow: 0 0.75rem 2rem var(--shadow);
    margin-bottom: 1.5rem;
    padding: clamp(1.25rem, 3vw, 2rem);
}

.account-alert {
    margin-top: 1rem;
}

.account-panel h2 {
    margin-bottom: 0.4rem;
}

.account-panel p {
    margin-bottom: 0;
}

.sync-code {
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    color: var(--ink);
    display: inline-block;
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.7rem 0.85rem;
    overflow-wrap: anywhere;
}

.account-panel {
    display: grid;
    gap: 1rem;
}

.sync-code-large {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    justify-self: start;
}

.sync-code-share {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.sync-qr-card,
.qr-scanner-card {
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 1rem;
    display: grid;
    gap: 0.75rem;
    justify-items: start;
    max-width: 24rem;
    padding: 1rem;
}

.sync-qr-card img {
    background: #fff;
    border-radius: 0.5rem;
    max-width: 100%;
    padding: 0.5rem;
}

.sync-qr-card p,
.qr-scanner-actions p {
    margin: 0;
}

.qr-scanner-card {
    max-width: 32rem;
    width: 100%;
}

.qr-scanner-card video {
    aspect-ratio: 4 / 3;
    background: #111;
    border-radius: 0.75rem;
    object-fit: cover;
    width: 100%;
}

.qr-scanner-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
    width: 100%;
}

.account-connect-form {
    border-top: 1px solid var(--line);
    padding-top: 1rem;
}

.profile-replace-warning,
.profile-restore-result {
    display: grid;
    gap: 0.6rem;
    margin: 0;
}

.profile-replace-warning p,
.profile-restore-result span {
    margin: 0;
}

.profile-replace-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}



.account-board-heading p {
    margin: 0;
}

.sync-code-input {
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

.history-header {
    max-width: none;
}

.page-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.play-header-share-message {
    flex-basis: 100%;
    text-align: right;
}

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

.history-card {
    margin-bottom: 0;
}

.history-card-button {
    color: var(--ink);
    cursor: pointer;
    display: block;
    font: inherit;
    text-align: left;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
    width: 100%;
}

.history-card-button:hover:not(:disabled),
.history-card-button:focus-visible {
    border-color: var(--brand);
    box-shadow: 0 0.5rem 1.25rem var(--shadow);
    color: var(--ink);
    outline: none;
    transform: translateY(-1px);
}

.history-card-button:disabled {
    cursor: default;
}

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

.history-card-heading h2 {
    overflow-wrap: anywhere;
}

.history-card-heading p {
    margin-bottom: 0.25rem;
}

.history-stats {
    border-top: 1px solid var(--line);
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin-top: 1rem;
    padding-top: 0.85rem;
}

.history-open-label {
    color: var(--brand);
    font-weight: 700;
}

.home-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.start-panel {
    margin-left: 0;
    margin-right: 0;
    max-width: none;
}

.start-panel > h2 {
    font-size: clamp(1.65rem, 4vw, 2.2rem);
    margin-bottom: 0.5rem;
}

.start-options {
    display: grid;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.start-option {
    align-items: center;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 1rem;
    color: var(--ink);
    display: flex;
    gap: 1rem;
    padding: 1rem 1.1rem;
    text-align: left;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
    width: 100%;
}

.start-option:hover,
.start-option:focus-visible {
    border-color: var(--brand);
    box-shadow: 0 0.5rem 1.25rem var(--shadow);
    color: var(--ink);
    outline: none;
    transform: translateY(-1px);
}

.start-option-icon {
    align-items: center;
    background: var(--brand-soft);
    border-radius: 0.8rem;
    color: var(--brand);
    display: inline-flex;
    flex: 0 0 2.8rem;
    font-size: 1.25rem;
    font-weight: 850;
    height: 2.8rem;
    justify-content: center;
}

.start-option-icon svg {
    fill: none;
    height: 1.35rem;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    width: 1.35rem;
}

.start-option-content {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.start-option-content strong {
    font-size: 1rem;
}

.start-option-content small {
    color: var(--muted);
    font-size: 0.88rem;
}

.start-option-arrow {
    color: var(--brand);
    font-size: 1.4rem;
    margin-left: auto;
}

.flow-panel {
    box-sizing: border-box;
    margin-left: 0;
    margin-right: 0;
    max-width: none;
    min-width: 0;
    overflow-wrap: anywhere;
    width: 100%;
}

.flow-panel form {
    min-width: 0;
    width: 100%;
}

.flow-panel .form-control {
    max-width: 100%;
    width: 100%;
}

.flow-panel p {
    max-width: 100%;
    overflow-wrap: anywhere;
}

.create-round-form {
    max-width: 40rem;
}

.flow-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.flow-heading {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

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

.home-grid h2,
.panel h2 {
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
}

.panel label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    margin: 1rem 0 0.35rem;
}

.form-control {
    border-color: var(--line);
    min-height: 2.8rem;
}

.form-control:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 0.2rem var(--brand-soft);
}

.code-input {
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.resume-panel,
.play-header {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.play-header {
    flex-wrap: wrap;
    margin: 0 auto 1.25rem;
    max-width: none;
}

.play-header > div {
    min-width: 0;
}

.resume-panel p,
.play-header p {
    margin-bottom: 0;
}

.play-header h1 {
    overflow-wrap: anywhere;
}

.board-sessions-panel,
.board-quick-switcher {
    display: grid;
    gap: 1rem;
}

.board-sessions-panel {
    gap: 0.65rem;
}

.board-sessions-empty {
    margin: 0;
}

.completed-rounds-accordion {
    border-top: 1px solid var(--line);
    margin-top: 0.25rem;
}

.completed-rounds-accordion summary {
    align-items: center;
    color: var(--ink);
    cursor: pointer;
    display: flex;
    font-weight: 800;
    justify-content: space-between;
    list-style: none;
    padding: 0.8rem 0;
}

.completed-rounds-accordion summary::-webkit-details-marker {
    display: none;
}

.completed-rounds-accordion summary::after {
    color: var(--brand);
    content: "+";
    font-size: 1.2rem;
    line-height: 1;
    margin-left: 0.75rem;
}

.completed-rounds-accordion[open] summary::after {
    content: "\2212";
}

.completed-rounds-count {
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 999rem;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1;
    margin-left: auto;
    padding: 0.35rem 0.5rem;
}

.completed-rounds-content {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 0.5rem;
    padding-top: 0.65rem;
}

.board-quick-switcher {
    gap: 0.55rem;
    margin: 0 auto 1.25rem;
    max-width: 38rem;
}

.board-quick-switcher-heading {
    align-items: baseline;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
}

.board-quick-switcher-heading .eyebrow {
    margin: 0;
}

.board-quick-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
}

.board-quick-group {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.board-quick-group-label {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.board-quick-option {
    align-items: center;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 999rem;
    color: var(--ink);
    display: inline-flex;
    gap: 0.45rem;
    max-width: 15rem;
    padding: 0.45rem 0.7rem;
    text-align: left;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.board-quick-option:hover:not(:disabled),
.board-quick-option:focus-visible {
    background: var(--surface);
    border-color: var(--brand);
    color: var(--ink);
    outline: none;
}

.board-quick-option.current {
    background: var(--current-bg);
    border-color: var(--current-border);
    font-weight: 700;
}

.board-quick-option span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.board-quick-option small {
    color: var(--brand);
    font-size: 0.7rem;
    margin: 0;
    white-space: nowrap;
}

.board-session-list {
    display: grid;
    gap: 0.5rem;
}

.board-session-group {
    display: grid;
    gap: 0.6rem;
}

.board-session-group h3 {
    color: var(--muted);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    margin: 0;
    text-transform: uppercase;
}

.board-session-option {
    align-items: center;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    color: var(--ink);
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    padding: 0.75rem 0.85rem;
    text-align: left;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
    width: 100%;
}

.board-session-option:hover,
.board-session-option:focus-visible {
    border-color: var(--brand);
    box-shadow: 0 0.5rem 1.25rem var(--shadow);
    color: var(--ink);
    outline: none;
    transform: translateY(-1px);
}

.board-session-option-copy {
    display: block;
    min-width: 0;
}

.board-session-option-copy strong {
    overflow-wrap: anywhere;
}

.board-session-option-copy small {
    color: var(--muted);
    display: block;
    margin-top: 0.15rem;
}

.board-session-option-action {
    align-items: center;
    color: var(--brand);
    display: inline-flex;
    flex-shrink: 0;
    font-size: 0.85rem;
    font-weight: 800;
    gap: 0.35rem;
    white-space: nowrap;
}

.board-session-option.completed .board-session-option-action {
    color: var(--muted);
}

.round-share-panel {
    align-items: center;
    display: flex;
    gap: 1.5rem;
    justify-content: space-between;
}

.round-share-panel h2 {
    margin-bottom: 0.4rem;
}

.round-share-panel p {
    margin-bottom: 0;
}

.round-share-content {
    align-items: flex-end;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    min-width: min(100%, 20rem);
}

.round-share-content .large-code {
    margin: 0;
}

.share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: flex-end;
}

.share-message {
    color: var(--success);
    font-weight: 700;
}

.round-admin-panel {
    overflow: hidden;
    padding: 0;
}

.round-admin-summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    list-style: none;
    padding: 1.25rem 1.5rem;
}

.round-admin-summary::-webkit-details-marker {
    display: none;
}

.round-admin-summary::after {
    color: var(--brand);
    content: "+";
    flex: 0 0 auto;
    font-size: 1.5rem;
    font-weight: 700;
}

.round-admin-panel[open] .round-admin-summary::after {
    content: "\2212";
}

.round-admin-summary-copy {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.round-admin-summary-copy .eyebrow {
    margin-bottom: 0;
}

.round-admin-summary-copy strong,
.round-admin-summary-copy small {
    overflow-wrap: anywhere;
}

.round-admin-summary-copy small {
    color: var(--muted);
}

.round-admin-content {
    border-top: 1px solid var(--line);
    padding: 1.25rem 1.5rem 1.5rem;
}

.round-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
}

.round-admin-content .code-grid {
    margin: 1.25rem 0;
}

.share-link-code {
    background: var(--surface-soft);
    border-radius: 1rem;
    margin-top: 1rem;
    padding: 1rem;
}

.share-link-value {
    font-size: 0.85rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.play-alert {
    align-items: center;
    border-radius: 1rem;
    box-shadow: 0 0.35rem 1rem var(--shadow);
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
    margin-right: auto;
    max-width: 42rem;
    width: 100%;
}

.bingo-status {
    align-items: center;
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin: 0 auto 1.5rem;
    max-width: 38rem;
    text-align: center;
}

.bingo-status strong {
    font-size: 1.1rem;
}

.code-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 1.5rem 0 2rem;
}

.code-grid > div {
    background: var(--surface-soft);
    border-radius: 1rem;
    padding: 1rem;
}

.code-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.large-code {
    display: block;
    font-size: clamp(1.4rem, 5vw, 2rem);
    letter-spacing: 0.14em;
    margin: 0.35rem 0;
}

.code-value-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
}

.code-value-row .large-code {
    margin: 0.35rem 0;
}

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

.code-copy-message {
    color: var(--success);
    display: block;
    font-weight: 700;
    margin-top: 0.45rem;
}

.copy-code-button {
    align-items: center;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 0.65rem;
    color: var(--muted);
    display: inline-flex;
    flex: 0 0 auto;
    height: 2.5rem;
    justify-content: center;
    padding: 0.55rem;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
    width: 2.5rem;
}

.copy-code-button:hover:not(:disabled) {
    background: var(--surface);
    border-color: var(--brand);
    color: var(--brand);
}

.copy-code-button:focus-visible {
    outline: 3px solid var(--brand);
    outline-offset: 2px;
}

.copy-code-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.copy-code-button svg {
    fill: none;
    height: 1.15rem;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    width: 1.15rem;
}

.player-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.participant-list {
    display: grid;
    gap: 0.65rem;
}

.participant-row {
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 0.9rem;
    padding: 0.8rem 1rem;
}

.participant-row.current {
    background: var(--current-bg);
    border-color: var(--current-border);
}

.participant-heading,
.participant-meta {
    align-items: center;
    display: flex;
    gap: 0.6rem;
    justify-content: space-between;
}

.participant-meta {
    color: var(--muted);
    flex-wrap: wrap;
    font-size: 0.85rem;
    justify-content: flex-start;
    margin-top: 0.35rem;
}

.participant-badge {
    background: var(--success-soft);
    border-radius: 99rem;
    color: var(--success);
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.25rem 0.5rem;
    text-transform: uppercase;
}

.player-chip {
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 99rem;
    display: inline-block;
    padding: 0.45rem 0.8rem;
}

.player-chip.current {
    background: var(--current-bg);
    border-color: var(--current-border);
    font-weight: 700;
}

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

.play-panel {
    margin-top: 1.5rem;
}

.board-title-row {
    margin: 1.5rem auto 1rem;
    max-width: 38rem;
}

.board-title {
    overflow-wrap: anywhere;
    text-align: center;
}

.number-entry {
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 1rem;
    margin: 0 auto 2rem;
    max-width: 38rem;
    padding: 1.25rem;
}

.number-section-heading {
    align-items: flex-start;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-start;
}

.number-section-heading > div {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.number-section-heading strong,
.number-section-heading label {
    margin: 0;
}

.number-section-heading small {
    color: var(--muted);
    font-size: 0.78rem;
}

.number-input-section {
    margin-top: 1rem;
}

.number-section-heading .number-range {
    margin-left: auto;
}

.number-range {
    background: var(--brand-soft);
    border-radius: 99rem;
    color: var(--brand-dark);
    font-size: 0.8rem;
    font-weight: 800;
    padding: 0.35rem 0.6rem;
}

.multi-board-selection {
    border-top: 1px solid var(--line);
    margin-top: 0.85rem;
    padding-top: 0.7rem;
}

.multi-board-selection summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    list-style: none;
}

.multi-board-selection summary::-webkit-details-marker {
    display: none;
}

.multi-board-selection-summary-copy {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.multi-board-selection-summary-copy small {
    color: var(--muted);
    font-size: 0.78rem;
}

.multi-board-selection-summary-action {
    align-items: center;
    color: var(--brand);
    display: inline-flex;
    flex-shrink: 0;
    font-size: 0.85rem;
    font-weight: 800;
    gap: 0.35rem;
}

.multi-board-selection-summary-action::after {
    content: "+";
    font-size: 1.1rem;
    line-height: 1;
}

.multi-board-selection[open] .multi-board-selection-summary-action::after {
    content: "\2212";
}

.multi-board-selection-content {
    margin-top: 0.55rem;
}

.multi-board-mode-toggle {
    align-items: flex-start;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0.7rem;
    cursor: pointer;
    display: flex;
    gap: 0.5rem;
    padding: 0.55rem 0.65rem;
}

.multi-board-mode-toggle input {
    accent-color: var(--brand);
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.multi-board-mode-copy {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.multi-board-mode-copy small {
    color: var(--muted);
    font-size: 0.76rem;
}

.multi-board-selection-toolbar {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-start;
}

.multi-board-selection-actions {
    align-items: center;
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.multi-board-selection-count {
    color: var(--muted);
    font-size: 0.78rem;
    white-space: nowrap;
}

.multi-board-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.45rem;
}

.multi-board-option {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0.55rem;
    cursor: pointer;
    display: flex;
    flex: 1 1 12rem;
    gap: 0.45rem;
    margin: 0;
    min-width: 0;
    padding: 0.28rem 0.45rem;
}

.multi-board-option.selected {
    background: var(--current-bg);
    border-color: var(--current-border);
}

.multi-board-option input {
    accent-color: var(--brand);
    flex-shrink: 0;
    height: 0.95rem;
    width: 0.95rem;
}

.multi-board-option-copy {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 0.45rem;
    flex: 1 1 auto;
    min-width: 0;
}

.multi-board-option-copy strong {
    overflow-wrap: anywhere;
}

.multi-board-option-meta {
    color: var(--muted);
    font-size: 0.72rem;
    white-space: nowrap;
}

.entry-row {
    align-items: stretch;
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.number-input {
    font-size: 1.2rem;
    flex: 1;
    min-width: 0;
}

.entry-row .btn {
    min-width: 8rem;
}

.number-entry small {
    display: block;
    margin-top: 0.5rem;
}

.number-entry .play-alert {
    margin-bottom: 0;
    margin-top: 1rem;
    max-width: none;
}

.bingo-board {
    display: grid;
    gap: clamp(0.35rem, 1.5vw, 0.75rem);
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin: 0 auto;
    max-width: 38rem;
}

.bingo-board.miss {
    animation: bingo-miss 600ms ease;
}

.bingo-cell {
    align-items: center;
    aspect-ratio: 1;
    background: var(--surface-strong);
    border: 2px solid var(--line);
    border-radius: 0.9rem;
    display: flex;
    font-size: clamp(1.15rem, 4vw, 2rem);
    font-weight: 800;
    justify-content: center;
    transition: 160ms ease;
}

.bingo-cell.marked {
    background: var(--marked);
    border-color: var(--marked-border);
    box-shadow: inset 0 0 0 0.2rem rgba(255, 255, 255, 0.45);
    transform: translateY(-0.1rem);
}

.bingo-cell.hit {
    animation: bingo-hit 900ms ease;
    position: relative;
    z-index: 1;
}

@keyframes bingo-hit {
    0% {
        box-shadow: 0 0 0 0 rgba(49, 87, 213, 0.6);
        transform: scale(1);
    }

    35% {
        box-shadow: 0 0 0 0.7rem rgba(49, 87, 213, 0.18);
        transform: scale(1.12) rotate(-2deg);
    }

    65% {
        transform: scale(1.06) rotate(2deg);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(49, 87, 213, 0);
        transform: scale(1);
    }
}

@keyframes bingo-miss {
    0%,
    100% {
        transform: translateX(0) rotate(0);
    }

    15% {
        transform: translateX(-0.55rem) rotate(-1deg);
    }

    30% {
        transform: translateX(0.5rem) rotate(1deg);
    }

    45% {
        transform: translateX(-0.4rem) rotate(-0.8deg);
    }

    60% {
        transform: translateX(0.3rem) rotate(0.6deg);
    }

    75% {
        transform: translateX(-0.15rem) rotate(-0.3deg);
    }
}

.board-footer {
    color: var(--muted);
    display: flex;
    font-size: 0.9rem;
    justify-content: space-between;
    margin-top: 1.25rem;
}

.status-pill {
    border-radius: 99rem;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 0.45rem 0.8rem;
}

.status-pill.active {
    background: var(--success-soft);
    color: var(--success);
}

.status-pill.complete {
    background: var(--warning-soft);
    color: var(--warning-ink);
}

.empty-state {
    margin-top: 2rem;
    text-align: center;
}

.empty-state-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1rem;
}

#blazor-error-ui {
    background: #fff3cd;
    bottom: 0;
    box-shadow: 0 -0.2rem 0.75rem rgba(0, 0, 0, 0.12);
    display: none;
    left: 0;
    padding: 0.75rem 1rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

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

@media (max-width: 640px) {
    .content {
        padding: 0.75rem 1rem 2rem !important;
    }

    .resume-panel,
    .play-header,
    .round-share-panel,
    .flow-heading,
    .history-card-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .resume-panel .btn,
    .play-header .btn,
    .flow-heading .btn,
    .page-header-actions .btn {
        width: 100%;
    }

    .page-header-actions,
    .empty-state-actions {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .play-header-share-message {
        text-align: left;
    }

    .round-share-content {
        align-items: stretch;
        min-width: 0;
        width: 100%;
    }

    .round-admin-summary {
        align-items: stretch;
        flex-direction: column;
    }

    .round-admin-summary .status-pill {
        align-self: flex-start;
    }

    .round-admin-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .round-admin-actions .btn,
    .round-admin-content > .btn {
        width: 100%;
    }

    .share-actions {
        justify-content: stretch;
    }

    .share-actions .btn {
        flex: 1;
    }

    .sync-code-share {
        align-items: stretch;
        flex-direction: column;
    }

    .sync-code-share .btn,
    .qr-scanner-actions .btn {
        width: 100%;
    }

    .code-grid {
        grid-template-columns: 1fr;
    }

    .entry-row {
        align-items: stretch;
        flex-direction: column;
    }

    .multi-board-selection-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .multi-board-selection-actions {
        width: auto;
    }

    .multi-board-selection-actions .btn {
        flex: 0 0 auto;
    }

    .number-input {
        max-width: none;
    }

    .board-footer {
        flex-direction: column;
        gap: 0.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .confetti-layer {
        display: none;
    }

    .loading-spinner {
        animation: none;
    }

    .bingo-cell.hit {
        animation: none;
        outline: 0.25rem solid rgba(49, 87, 213, 0.35);
    }

    .bingo-board.miss {
        animation: none;
        outline: 0.25rem solid rgba(214, 69, 69, 0.35);
    }
}
