/* Pick'em Live. The broadcast score bug is the visual idea: each game wears its two teams' colors, and the
   yellow first-down line is the one accent, reserved for "you" (your row, your pick, your rooting call). */

:root {
    --bg: #eef1f5;
    --surface: #ffffff;
    --surface-2: #f5f7fa;
    --line: #d6dce5;
    --text: #142031;
    --muted: #5a6a7f;
    --you: #ffd60a;
    --you-ink: #2a2200;
    --you-wash: rgba(255, 214, 10, 0.2);
    --gain: #17804a;
    --gain-wash: rgba(23, 128, 74, 0.12);
    --loss: #c4362c;
    --loss-wash: rgba(196, 54, 44, 0.1);
    --live: #d92d20;
    --focus: #1f5fbf;
    --shadow: 0 1px 2px rgba(20, 32, 49, 0.06);
    --font-display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
    --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
    --topbar: 52px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1828;
        --surface: #172339;
        --surface-2: #1c2a44;
        --line: #2a3a57;
        --text: #e8edf5;
        --muted: #97a5bc;
        --you-wash: rgba(255, 214, 10, 0.1);
        --gain: #3fcf7f;
        --gain-wash: rgba(63, 207, 127, 0.14);
        --loss: #ff6d60;
        --loss-wash: rgba(255, 109, 96, 0.13);
        --live: #ff4a3d;
        --focus: #ffd60a;
        --shadow: none;
        color-scheme: dark;
    }
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.45;
    font-variant-numeric: tabular-nums;
}

a {
    color: inherit;
    text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
    text-underline-offset: 2px;
}

a:hover {
    text-decoration-color: currentColor;
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

h1, h2, h3 {
    line-height: 1.15;
    margin: 0;
}

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

h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 1.5rem 0 0.4rem;
}

p {
    margin: 0.5rem 0;
}

code {
    font-size: 0.9em;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0.05em 0.35em;
    word-break: break-all;
}

.display {
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: 0.005em;
    line-height: 0.95;
}

h1.display {
    font-size: clamp(2.2rem, 7vw, 3.4rem);
    margin-bottom: 0.5rem;
}

.lede {
    font-size: 1.1rem;
    max-width: 60ch;
}

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

.small {
    font-size: 0.875rem;
}

.strong {
    font-weight: 700;
}

.gain-text {
    color: var(--gain);
}

.loss-text {
    color: var(--loss);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Top bar and page frame ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: var(--topbar);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1.45rem;
    letter-spacing: 0.01em;
}

.brand-mark {
    width: 26px;
    height: 26px;
}

.brand-mark ellipse {
    fill: #8a4b22;
}

.brand-mark path {
    stroke: #fff;
    stroke-width: 1.6;
    fill: none;
}

.topnav {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.topnav a {
    text-decoration: none;
}

.inline-form {
    display: inline;
    margin: 0;
}

.link-button {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    font-weight: 600;
    color: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
    text-underline-offset: 2px;
}

.topnav .link-button {
    text-decoration: none;
}

.page {
    max-width: 1320px;
    margin: 0 auto;
    padding: 20px 16px 64px;
}

.narrow {
    max-width: 680px;
    margin: 0 auto;
}

.page-message {
    max-width: 680px;
    margin: 2rem auto;
}

/* ---------- Buttons and forms ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.btn:hover {
    border-color: var(--muted);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--text);
    border-color: var(--text);
    color: var(--bg);
}

.btn-primary:hover {
    background: color-mix(in srgb, var(--text) 85%, var(--bg));
}

.btn-danger {
    background: var(--loss);
    border-color: var(--loss);
    color: #fff;
}

.btn-danger-quiet {
    color: var(--loss);
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    margin: 0.75rem 0;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.25rem 0;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.field.inline input[type=number] {
    width: 6rem;
}

.field.grow {
    flex: 1;
}

input:not([type=checkbox]),
select,
textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-weight: 400;
}

input[readonly] {
    background: var(--surface-2);
    color: var(--muted);
}

textarea {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.85rem;
    resize: vertical;
}

.code-input {
    font-family: var(--font-display) !important;
    font-size: 2.2rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.4em;
    text-align: center;
}

.validation-message,
.form-error {
    color: var(--loss);
    font-weight: 600;
}

.form-ok {
    color: var(--gain);
    font-weight: 600;
}

.notice {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 14px;
    margin: 0.75rem 0;
}

.callout {
    border-left: 4px solid var(--you);
    background: var(--you-wash);
    padding: 10px 12px;
    border-radius: 0 8px 8px 0;
}

/* ---------- Chips and tags ---------- */

.chip {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    vertical-align: 0.1em;
}

.chip.gain {
    background: var(--gain-wash);
    color: var(--gain);
}

.chip.loss {
    background: var(--loss-wash);
    color: var(--loss);
}

.chip.flag {
    background: var(--you);
    color: var(--you-ink);
}

.chip.quiet {
    background: var(--surface-2);
    color: var(--muted);
    border: 1px solid var(--line);
}

.live-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--live);
    font-weight: 700;
    font-size: 0.85rem;
}

.live-tag::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--live);
    animation: live-pulse 1.6s ease-in-out infinite;
}

.live-tag.small {
    font-size: 0.75rem;
}

@keyframes live-pulse {
    50% { opacity: 0.3; }
}

/* ---------- Auth and landing ---------- */

.auth {
    max-width: 440px;
    margin: 6vh auto 0;
}

.landing {
    max-width: 820px;
    margin: 6vh auto 0;
}

.landing-title {
    font-size: clamp(3rem, 11vw, 6.5rem);
    line-height: 0.9;
    margin-bottom: 1.25rem;
}

/* The first-down line, drawn across the field under the headline. */
.landing-title::after {
    content: "";
    display: block;
    width: min(70%, 520px);
    height: 12px;
    margin-top: 18px;
    background: var(--you);
    transform: skewX(-24deg);
    transform-origin: left;
}

.landing .btn {
    margin: 1rem 0 2rem;
}

.landing-points {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 1rem;
    max-width: 62ch;
}

.landing-points li {
    border-top: 1px solid var(--line);
    padding-top: 0.9rem;
}

.pool-list,
.claim-list,
.session-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    display: grid;
    gap: 0.5rem;
}

.pool-list a {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    text-decoration: none;
}

.pool-list a:hover {
    border-color: var(--muted);
}

.pool-name {
    font-weight: 700;
    font-size: 1.1rem;
}

.claim-list li {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 14px;
}

.claim-list li.is-mine {
    box-shadow: inset 5px 0 0 var(--you);
}

.claim-list label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 600;
}

.claim-list input {
    width: 22px;
    height: 22px;
    accent-color: var(--text);
}

.session-list li {
    display: flex;
    flex-direction: column;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.session-device {
    font-weight: 600;
}

/* ---------- Dashboard frame ---------- */

.dash-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
}

.dash-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 1rem;
}

.dash-title {
    margin: 0;
}

.week-nav {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    font-weight: 700;
}

.week-step {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 36px;
    font-size: 1.4rem;
    text-decoration: none;
}

.week-step.disabled {
    pointer-events: none;
    opacity: 0.3;
}

.week-label {
    padding: 0 4px;
    min-width: 4.5rem;
    text-align: center;
}

.dash-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 1rem;
}

.viewing {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    margin: 0.75rem 0 0;
}

.pickset-switch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.pickset-switch select {
    width: auto;
    min-height: 36px;
    padding: 4px 8px;
}

/* ---------- The "you" hero ---------- */

.you {
    display: grid;
    gap: 1rem 2rem;
    margin: 1rem 0;
    padding: 18px 18px 18px 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 8px solid var(--you);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.you-headline {
    font-size: clamp(2rem, 6.5vw, 3.2rem);
}

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

.you-why {
    max-width: 62ch;
    margin-top: 0.6rem;
}

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

.you-stats div {
    border-top: 1px solid var(--line);
    padding-top: 0.4rem;
}

.you-stats dt {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 600;
}

.you-stats dd {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 2.4rem;
    line-height: 1;
}

.you-stats small {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted);
}

@media (min-width: 900px) {
    .you {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
        align-items: center;
    }
}

/* ---------- Tabs (phones) and grid (desktop) ---------- */

.tabs {
    position: sticky;
    top: var(--topbar);
    z-index: 10;
    display: flex;
    gap: 4px;
    margin: 0 -16px 1rem;
    padding: 8px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}

.tabs button {
    flex: 1;
    min-height: 40px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: none;
    color: var(--muted);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.tabs button.on {
    background: var(--surface);
    border-color: var(--line);
    color: var(--text);
}

.panel {
    display: none;
    min-width: 0;
}

.dash[data-tab="games"] .panel-games,
.dash[data-tab="standings"] .panel-standings,
.dash[data-tab="insights"] .panel-insights {
    display: block;
}

@media (min-width: 1100px) {
    .tabs {
        display: none;
    }

    .dash-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 400px;
        grid-template-rows: auto 1fr;
        gap: 0 24px;
        align-items: start;
    }

    .dash .panel {
        display: block;
    }

    .panel-games {
        grid-row: 1 / span 2;
    }

    .panel-standings,
    .panel-insights {
        grid-column: 2;
    }
}

.panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.panel-head h2 {
    margin: 0;
    font-size: 1.3rem;
}

.group-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.6rem;
    margin: 1rem 0 0.6rem;
}

.group-title:first-child {
    margin-top: 0.25rem;
}

.game-grid {
    display: grid;
    gap: 14px;
}

@media (min-width: 720px) {
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    }
}

/* ---------- Game card (score bug) ---------- */

.game {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.game.is-live {
    border-color: color-mix(in srgb, var(--live) 45%, var(--line));
}

.game-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.75rem;
    padding: 10px 14px 6px;
    font-size: 0.9rem;
}

.status-text {
    font-weight: 700;
}

.spread {
    margin-left: auto;
}

.score-bug {
    display: grid;
}

.team-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding-right: 14px;
}

.team-row + .team-row {
    border-top: 1px solid var(--line);
}

.team-swatch {
    align-self: stretch;
    flex: none;
    width: 6px;
    background: var(--team);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.team-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.team-code {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.35rem;
    min-width: 2.6rem;
}

.team-name {
    flex: 1;
    min-width: 0;
    color: var(--muted);
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-record {
    font-size: 0.85rem;
}

.team-score {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 2.1rem;
    line-height: 1;
    min-width: 2.2ch;
    text-align: right;
    border-radius: 4px;
}

.is-live .team-score {
    animation: score-flash 1.4s ease-out;
}

@keyframes score-flash {
    from { background: var(--you); color: var(--you-ink); }
}

.team-row.lost {
    opacity: 0.55;
}

.team-row.won .team-code,
.team-row.won .team-score {
    color: var(--text);
}

.possession {
    width: 16px;
    height: 10px;
    border-radius: 50%;
    background: #8a4b22;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
    flex: none;
}

.situation {
    margin: 0;
    padding: 6px 14px 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.red-zone {
    color: var(--live);
    margin-left: 0.4rem;
}

.win-bar {
    display: flex;
    height: 6px;
    margin: 10px 14px 0;
    border-radius: 3px;
    overflow: hidden;
    background: var(--bottom);
}

.win-top {
    background: var(--top);
    border-right: 2px solid var(--surface);
}

.win-bottom {
    flex: 1;
}

.win-labels {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 4px 14px 0;
    font-size: 0.8rem;
    font-weight: 600;
}

.my-pick {
    margin: 12px 14px 0;
    padding: 10px 12px;
    background: var(--you-wash);
    border-left: 4px solid var(--you);
    border-radius: 0 8px 8px 0;
}

.my-line {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.4rem;
}

.you-marker {
    font-weight: 600;
    color: var(--muted);
}

.field-line {
    margin: 0.35rem 0 0;
    font-size: 0.9rem;
}

.outcomes {
    width: 100%;
    margin-top: 0.5rem;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.outcomes th,
.outcomes td {
    padding: 3px 4px;
    text-align: right;
}

.outcomes th[scope=row] {
    text-align: left;
    font-weight: 600;
    color: var(--muted);
}

.outcomes thead th {
    font-weight: 700;
    border-bottom: 1px solid color-mix(in srgb, var(--text) 18%, transparent);
}

.outcomes .net-row td {
    font-weight: 700;
}

.root-call {
    margin: 0.5rem 0 0;
    font-weight: 600;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.5rem;
}

.root-call strong {
    font-size: 1.05rem;
}

.pool-split {
    padding: 10px 14px 0;
}

.split-bar {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--bottom);
}

.split-bar span {
    background: var(--top);
    border-right: 2px solid var(--surface);
}

.split-labels {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 4px;
    font-size: 0.85rem;
}

.pool-split p {
    margin: 4px 0 0;
}

.all-picks {
    margin: 10px 0 0;
    border-top: 1px solid var(--line);
}

.all-picks summary {
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
}

.all-picks ol {
    list-style: none;
    margin: 0;
    padding: 0 14px 12px;
    display: grid;
}

.all-picks li {
    display: grid;
    grid-template-columns: 1fr auto 2.2rem 3rem;
    align-items: center;
    gap: 8px;
    padding: 5px 6px;
    font-size: 0.9rem;
    border-radius: 6px;
}

.all-picks li.is-mine,
.all-picks li.is-focus {
    background: var(--you-wash);
    box-shadow: inset 4px 0 0 var(--you);
}

.pick-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pick-team {
    font-weight: 700;
    padding-left: 8px;
    border-left: 4px solid var(--team);
}

.pick-conf {
    text-align: right;
    color: var(--muted);
}

.pick-points {
    text-align: right;
    font-weight: 700;
}

.pick-points.gain {
    color: var(--gain);
}

.pick-points.loss {
    color: var(--loss);
}

.game:not(:has(.all-picks)) {
    padding-bottom: 12px;
}

/* ---------- Standings ---------- */

.standings,
.insights {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px 14px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.toggle {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.toggle button {
    border: 0;
    background: none;
    color: var(--muted);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 6px 10px;
    cursor: pointer;
}

.toggle button.on {
    background: var(--text);
    color: var(--bg);
}

.table-wrap {
    overflow-x: auto;
    margin: 0.5rem -6px 0;
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.standings-table th {
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 700;
    text-align: left;
    padding: 6px;
    border-bottom: 1px solid var(--line);
}

.standings-table td {
    padding: 8px 6px;
    border-bottom: 1px solid var(--line);
}

.standings-table tbody tr {
    cursor: pointer;
}

.standings-table tbody tr:hover {
    background: var(--surface-2);
}

.standings-table .num {
    text-align: right;
    white-space: nowrap;
}

.standings-table .rank {
    color: var(--muted);
    font-weight: 600;
}

.standings-table .name {
    font-weight: 600;
    max-width: 14rem;
}

.standings-table .name > span:first-child {
    margin-right: 0.35rem;
}

.standings-table tr.is-mine {
    background: var(--you-wash);
}

.standings-table tr.is-mine td:first-child {
    box-shadow: inset 5px 0 0 var(--you);
}

.standings-table tr.is-focus:not(.is-mine) td {
    background: var(--surface-2);
}

.standings-table tr.is-focus:not(.is-mine) td:first-child {
    box-shadow: inset 5px 0 0 var(--muted);
}

.standings-table tr.is-out td {
    color: var(--muted);
}


/* ---------- Insights ---------- */

.insights h3:first-of-type {
    margin-top: 0.75rem;
}

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

.root-list li {
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.root-list li.against {
    border-color: color-mix(in srgb, var(--you) 70%, var(--line));
    background: var(--you-wash);
}

.root-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.5rem;
}

.root-detail {
    font-size: 0.875rem;
}

.scenarios {
    margin: 0.5rem 0;
    display: grid;
    gap: 6px;
}

.scenarios div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.925rem;
    padding: 4px 0;
    border-bottom: 1px solid var(--line);
}

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

.scenarios dd {
    margin: 0;
    text-align: right;
}

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

.rival-head {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.rival-diffs {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.rival-diffs th {
    text-align: left;
    color: var(--muted);
    font-weight: 600;
    border-bottom: 1px solid var(--line);
    padding: 3px 4px;
}

.rival-diffs td {
    padding: 3px 4px;
}

.rival-diffs .num {
    text-align: right;
    white-space: nowrap;
}

.rival-diffs .swing span {
    display: block;
}

.rival-diffs td {
    vertical-align: top;
}

/* ---------- Admin ---------- */

.admin h2 {
    margin-top: 2.25rem;
}

.copy-row code {
    display: block;
    padding: 10px 12px;
    user-select: all;
}

.howto {
    margin: 0.75rem 0;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.howto summary {
    cursor: pointer;
    font-weight: 600;
}

.howto ol {
    padding-left: 1.25rem;
}

.danger {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.danger .btn {
    margin-right: 0.5rem;
}

/* ---------- Blazor chrome ---------- */

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 12px 16px;
    background: var(--loss);
    color: #fff;
    font-weight: 600;
}

#blazor-error-ui .reload {
    color: #fff;
    margin-left: 0.5rem;
}

#blazor-error-ui .dismiss {
    position: absolute;
    right: 16px;
    cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

.topnav,
.brand {
    white-space: nowrap;
}

@media (max-width: 520px) {
    .brand span {
        display: none;
    }

    .topnav {
        gap: 0.9rem;
        font-size: 0.9rem;
    }
}

#components-reconnect-modal {
    background: var(--surface) !important;
    color: var(--text);
    border: 1px solid var(--line) !important;
    font-family: var(--font-body);
}
