:root {
    --bg: #f6f5f2;
    --surface: #ffffff;
    --text: #1c1b19;
    --muted: #6b6760;
    --border: #e2dfd8;
    --accent: #3d5afe;
    --accent-text: #ffffff;
    --error: #c62828;
    --danger: #c62828;
    --warning: #8a5a00;
    --warning-bg: #fff4d6;
    --success: #2e7d32;
    --radius: 10px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #141413;
        --surface: #1f1e1c;
        --text: #f0eee9;
        --muted: #a39f97;
        --border: #34322e;
        --accent: #7b8cff;
        --accent-text: #0d0d0c;
        --error: #ff7a73;
        --danger: #ff7a73;
        --warning: #ffcf70;
        --warning-bg: #3a2e12;
        --success: #81c784;
        color-scheme: dark;
    }
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
}

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

h1 {
    font-size: 1.75rem;
    margin: 0 0 0.5rem;
}

h1:focus {
    outline: none;
}

h2 {
    font-size: 1.15rem;
    margin: 0 0 0.5rem;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.topbar nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.25rem 1rem;
}

.topbar nav a,
.topbar nav button,
.brand {
    white-space: nowrap;
}

/* phones: smaller header text */
@media (max-width: 600px) {
    .topbar {
        padding: 0.6rem 0.75rem;
        font-size: 0.9rem;
    }

    .topbar nav {
        gap: 0.25rem 0.75rem;
    }

    .page {
        padding: 1rem 0.75rem 2rem;
    }

    h1 {
        font-size: 1.5rem;
    }
}

.brand {
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}

.page {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

.lead {
    color: var(--muted);
    margin: 0 0 1.5rem;
}

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

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.card.narrow {
    max-width: 420px;
    margin: 1rem auto;
}

.card.empty {
    text-align: center;
    padding: 2.5rem 1.25rem;
}

form {
    display: grid;
    gap: 0.9rem;
}

label {
    display: grid;
    gap: 0.3rem;
    font-weight: 600;
    font-size: 0.95rem;
}

input, select, textarea {
    font: inherit;
    font-weight: 400;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
}

input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.button {
    display: inline-block;
    font: inherit;
    font-weight: 600;
    padding: 0.6rem 1.1rem;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: var(--accent-text);
    text-decoration: none;
    cursor: pointer;
}

.button:disabled {
    opacity: 0.6;
    cursor: default;
}

.link {
    font: inherit;
    padding: 0;
    border: none;
    background: none;
    color: var(--accent);
    text-decoration: underline;
    cursor: pointer;
}

.hint {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.error {
    margin: 0;
    color: var(--error);
}

.switch {
    margin: 1rem 0 0;
    font-size: 0.95rem;
}

.small {
    font-size: 0.875rem;
}

.grow {
    flex: 1 1 auto;
    min-width: 0;
}

.warning {
    margin: 0.5rem 0;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: var(--warning-bg);
    color: var(--warning);
}

textarea {
    resize: vertical;
}

/* buttons */

.button.secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.button.danger {
    background: var(--danger);
    color: #ffffff;
}

.button.danger-outline {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--border);
}

.icon-button {
    font: inherit;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.icon-button:disabled {
    opacity: 0.35;
    cursor: default;
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

/* page layout */

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.page-header.sticky {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 0.75rem 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.save-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.inline-form input {
    flex: 1 1 16rem;
}

.badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.05rem 0.5rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
    vertical-align: middle;
}

.warning-badge {
    background: var(--warning-bg);
    color: var(--warning);
    border-color: transparent;
}

/* game lists */

.game-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

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

.game-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text);
}

/* game editor */

.card + .card,
.card + .button,
.round + .round {
    margin-top: 1rem;
}

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

.span-2 {
    grid-column: span 2;
}

@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .span-2 {
        grid-column: auto;
    }
}

label.checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 400;
}

.round-header {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.round-name {
    flex: 1 1 auto;
    font-size: 1.1rem;
    font-weight: 700;
}

.question-list {
    list-style: none;
    margin: 0 0 0.75rem;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}

.question-item {
    border: 1px solid var(--border);
    border-radius: 8px;
}

.question-item.open {
    border-color: var(--accent);
}

.question-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
}

.summary-toggle {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem;
    border: none;
    background: none;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.question-number {
    font-weight: 700;
    color: var(--muted);
}

.question-editor {
    display: grid;
    gap: 0.9rem;
    padding: 0.75rem 1rem 1rem;
    border-top: 1px solid var(--border);
}

.field-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.narrow-field {
    flex: 0 0 8rem;
}

fieldset {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    /* a fieldset won't shrink below its content by default, which breaks a phone-width layout */
    min-width: 0;
}

legend {
    padding: 0 0.25rem;
    font-weight: 600;
}

.list-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* a text input's own width would stop the row, and so a phone-width card, from shrinking; it fills the row instead */
.list-row input.grow {
    width: 0;
}

.list-row input[type=radio] {
    width: 1.1rem;
    height: 1.1rem;
}

/* read-only game */

.question-view-list {
    margin: 0;
    padding-left: 1.25rem;
    display: grid;
    gap: 0.9rem;
}

.question-prompt {
    font-weight: 600;
}

.answer-list {
    margin: 0.25rem 0 0;
    padding-left: 1.1rem;
}

.answer-list .correct {
    color: var(--success);
    font-weight: 600;
}

/* confirmation dialog */

.dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.45);
}

.dialog {
    width: min(26rem, 100%);
    display: grid;
    gap: 0.75rem;
    padding: 1.25rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
}

.dialog p {
    margin: 0;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    color: #1c1b19;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: var(--border);
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--accent);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

/* live game, shared */

.question-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
    font-weight: 600;
}

.countdown {
    display: grid;
    gap: 0.35rem;
    margin: 1rem 0;
}

.countdown-time {
    font-size: 2.5rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.countdown.stopped .countdown-time {
    font-size: 1.25rem;
    color: var(--muted);
}

.countdown.ending .countdown-time {
    color: var(--danger);
}

.countdown-bar {
    height: 0.5rem;
    border-radius: 999px;
    background: var(--border);
    overflow: hidden;
}

.countdown-bar > div {
    height: 100%;
    background: var(--accent);
    transition: width 0.25s linear;
}

.countdown.ending .countdown-bar > div {
    background: var(--danger);
}

.ranking {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: grid;
    gap: 0.4rem;
}

.ranking li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.ranking li.winner {
    border-color: var(--accent);
    font-weight: 700;
}

.ranking li.mine {
    background: var(--bg);
    outline: 2px solid var(--accent);
}

.rank {
    min-width: 1.75rem;
    font-weight: 800;
    color: var(--muted);
}

.score {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.team-code {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-weight: 700;
    letter-spacing: 0.1em;
}

/* host console */

.live-status {
    min-height: 1.2em;
}

.console {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr);
    gap: 1rem;
    align-items: start;
}

@media (max-width: 800px) {
    .console {
        grid-template-columns: minmax(0, 1fr);
    }
}

.console-side {
    display: grid;
    gap: 1rem;
}

.console-side .card + .card {
    margin-top: 0;
}

.console-prompt {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0.75rem 0 0.25rem;
}

.answer-key {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: var(--bg);
}

.answer-key h3 {
    margin: 0;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

/* the host's question buttons, kept clear of the edit links above them */
.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.button.big {
    font-size: 1.1rem;
    padding: 0.75rem 1.5rem;
}

/* a page title with its ⋯ menu beside it */
.title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.title-row h1 {
    margin: 0;
}

/* the title is on the left of the page, so its menu's list lines up with the button's left edge and opens rightward */
.title-row .menu {
    right: auto;
    left: 0;
}

.menu-item:disabled {
    opacity: 0.45;
    cursor: default;
    background: transparent;
}

.menu-note {
    margin: 0.25rem 0.75rem 0.4rem;
}

.join-card {
    text-align: center;
}

.join-code {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    font-variant-numeric: tabular-nums;
}

.team-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}

.team-row {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.team-row:last-child {
    border-bottom: none;
}

.team-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.team-name {
    font-weight: 600;
}

.presence {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background: var(--border);
    flex: none;
}

.presence.online {
    background: var(--success);
}

.team-code-line {
    margin: 0.25rem 0 0 1.1rem;
}

/* the "⋯" menu: the list opens under the button, lined up with its right edge */
.action-menu {
    position: relative;
    flex: none;
}

.menu-button {
    font-size: 1.1rem;
    line-height: 1;
}

.menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
}

.menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.25rem);
    z-index: 21;
    min-width: 10rem;
    padding: 0.25rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.menu-item {
    display: block;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}

.menu-item:hover,
.menu-item:focus-visible {
    background: var(--border);
}

.menu-item.danger {
    color: var(--error);
}

.danger-link {
    color: var(--danger);
}

/* team screen */

.team-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.team-title {
    font-size: 1.4rem;
    font-weight: 800;
}

.team-code-chip {
    display: grid;
    justify-items: end;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.play-prompt {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0.75rem 0 0.25rem;
}

.waiting {
    margin: 1rem 0 0;
    color: var(--muted);
    font-size: 1.05rem;
}

.choice-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}

.choice-list li {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-weight: 600;
}

.choice-list li.correct {
    border-color: var(--success);
    color: var(--success);
}

.match-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.match-grid ol,
.match-grid ul {
    margin: 0;
    padding-left: 1.25rem;
    display: grid;
    gap: 0.4rem;
}

.reveal {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: var(--bg);
}

.reveal h2 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.leave {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
}

.choice-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
}

/* answering */

.answer-input {
    display: grid;
    gap: 0.9rem;
}

.choice-buttons {
    display: grid;
    gap: 0.5rem;
}

.choice-button {
    font: inherit;
    font-weight: 600;
    text-align: left;
    padding: 0.85rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}

.choice-button.selected {
    border-color: var(--accent);
    background: var(--bg);
}

.match-inputs {
    display: grid;
    gap: 0.75rem;
}

.lock-in {
    width: 100%;
}

.choice-list li.mine {
    border-color: var(--accent);
}

.my-answer {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 2px solid var(--border);
}

.my-answer.correct {
    border-color: var(--success);
}

.my-answer.partial {
    border-color: var(--warning);
}

.my-answer.incorrect {
    border-color: var(--danger);
}

.my-answer-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.my-answer-head h2 {
    margin: 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.badge.result-correct {
    color: var(--success);
    border-color: var(--success);
}

.badge.result-partial,
.badge.result-needsreview {
    color: var(--warning);
    background: var(--warning-bg);
    border-color: transparent;
}

.badge.result-incorrect {
    color: var(--danger);
    border-color: var(--danger);
}

/* live question edits */

.live-edit {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.live-edit .question-editor {
    border: 1px solid var(--accent);
    border-radius: 8px;
}

.edit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

/* the host's answers */

.answers {
    margin-top: 1.25rem;
}

.answers h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.answer-rows {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}

.answer-row {
    display: grid;
    grid-template-columns: minmax(6rem, 1fr) minmax(0, 2fr) auto;
    gap: 0.5rem 0.75rem;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.answer-row.result-needsreview {
    border-color: var(--warning);
}

.answer-team {
    font-weight: 700;
}

.answer-text {
    overflow-wrap: anywhere;
}

.answer-grade {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.answer-grade .badge {
    margin-left: 0;
}

.points-input {
    width: 4rem;
    padding: 0.35rem 0.5rem;
}

@media (max-width: 600px) {
    .answer-row {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* admin */

.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.admin-tabs a {
    padding: 0.4rem 0;
    margin-bottom: -1px;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    text-decoration: none;
}

.admin-tabs a.active {
    color: var(--text);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

.invite-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
}

.invite-form label {
    flex: 1 1 12rem;
}

.new-key {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.new-key-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.new-key .key {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    overflow-wrap: anywhere;
}

.page-footer {
    margin-top: 1.5rem;
}

/* kept in the page for password managers, but neither seen nor reached by tab */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* accounts */

.card.narrow-left {
    max-width: 32rem;
}

/* first and last name side by side, stacked on a phone */
.form-pair {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 0 0.75rem;
}

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

.played-rank {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    white-space: nowrap;
}

.rank-number {
    font-size: 1.4rem;
    font-weight: 700;
}

/* earlier questions on the host console */

.console-column {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.console-column .card + .card {
    margin-top: 0;
}

.question-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.5rem 0 1rem;
}

.question-picker .button {
    min-width: 2.75rem;
    padding: 0.4rem 0.6rem;
}

.question-picker .button.active {
    border-color: var(--accent);
    color: var(--accent);
}

/* a team's answer the host released for it to change */
.unlocked-note {
    margin: 0.75rem 0 0;
    padding: 0.5rem 0.75rem;
    border-left: 3px solid var(--accent);
    background: var(--surface);
    border-radius: 4px;
}

/* a section heading that opens and closes the section, such as Earlier questions on the host console */
.section-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.toggle-arrow {
    display: inline-block;
    transition: transform 0.15s;
}

.open > h2 .toggle-arrow {
    transform: rotate(90deg);
}

.card.earlier > h2 {
    margin: 0;
}

.card.earlier.open > h2 {
    margin-bottom: 0.5rem;
}

/* the signed in user's menu in the top bar: an avatar with their initials */
.menu-custom-button {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.menu-custom-button:hover,
.menu-custom-button[aria-expanded="true"] {
    color: var(--text);
}

.menu-custom-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.avatar {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-text);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.chevron {
    width: 0.75rem;
    height: 0.75rem;
}

.menu-header {
    padding: 0.5rem 0.75rem 0.6rem;
    white-space: nowrap;
}

.menu-header-name {
    font-weight: 600;
}

.menu-header,
.menu-separator {
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.25rem;
}

.menu-separator {
    margin-top: 0.25rem;
}

a.menu-item {
    text-decoration: none;
}

/* confidence points: a round's values in the editor, the team's pick when answering, and the value on an answer */
.confidence-setting {
    display: grid;
    gap: 0.4rem;
    margin: 0 0 0.75rem;
}

.confidence-values {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.6rem;
}

.confidence-value {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.confidence-value input {
    width: 4.5rem;
}

.confidence-pick {
    margin-top: 0.75rem;
}

.choice-buttons.confidence-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.confidence-buttons .choice-button {
    flex: 0 0 auto;
    width: auto;
    min-width: 3.5rem;
    text-align: center;
}

.badge.confidence-badge {
    color: var(--accent);
    border-color: var(--accent);
}

/* scoring: the game's settings for every round, a round's overrides, and a team's wager */
.scoring-setting {
    display: grid;
    gap: 0.4rem;
    margin-top: 1rem;
}

.round-settings {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin: 0 0 0.75rem;
}

.round-settings label {
    flex: 1 1 14rem;
}

.wager-pick {
    margin-top: 0.75rem;
}

.wager-pick input {
    max-width: 8rem;
}

.time-choice {
    flex: 0 0 10rem;
}

.session-round + .session-round {
    margin-top: 1rem;
}

.session-round h3 {
    margin: 0 0 0.4rem;
    font-size: 1rem;
}

.session-question-list {
    list-style: none;
    margin: 0 0 0.4rem;
    padding: 0;
    display: grid;
    gap: 0.3rem;
}

.session-question {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.session-question.current {
    border-color: var(--accent);
}

.session-question .badge {
    margin-left: 0;
}

.session-question-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
}

.session-question-prompt {
    flex: 1 1 10rem;
    min-width: 0;
    overflow-wrap: anywhere;
}

.small-button {
    padding: 0.25rem 0.6rem;
    font-size: 0.875rem;
}

.add-question {
    margin-top: 0.5rem;
}

.add-question h3 {
    margin: 0 0 0.5rem;
}
