/* ==========================================================================
   The scorer - every route under /app.

   Linked by ScorerShell, so it only loads on those routes, and everything is
   under `.sc` (the app shell) so nothing leaks onto the landing page. The look
   is score11-mobile's: the same palette, the same bar, cards and keypad, so
   the phone app and the website read as one product.

   Colours are tokens, flipped for dark mode by `body.dark .sc` at the bottom
   of the token block - the same body class the rest of the site keys off
   (see CLAUDE.md, Theming).
   ========================================================================== */

.sc {
    --sc-page: #eef2f7;
    --sc-card: #ffffff;
    --sc-bar: #0288B2;
    --sc-bar-text: #ffffff;
    --sc-sunken: #dff1f8;
    --sc-text: #121212;
    --sc-muted: #6a7580;
    --sc-accent: #0288B2;
    --sc-on-accent: #ffffff;
    --sc-accent-soft: rgba(2, 136, 178, 0.1);
    --sc-green: #32A346;
    --sc-red: #F55B5B;
    --sc-amber: #D8882A;
    --sc-line: rgba(13, 27, 42, 0.1);
    --sc-overlay: rgba(16, 24, 32, 0.45);
    --sc-series-0: #C2700A;
    --sc-series-1: #0288B2;
    --sc-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

body.dark .sc {
    /* Native scrollbars, checkboxes and radios follow the theme too. */
    color-scheme: dark;
    --sc-page: #0b1018;
    --sc-card: #172029;
    --sc-bar: #0a4a60;
    --sc-sunken: #1f3440;
    --sc-text: #ffffff;
    --sc-muted: #9aa6b2;
    --sc-accent: #58D7FF;
    --sc-on-accent: #0b1018;
    --sc-accent-soft: rgba(88, 215, 255, 0.12);
    --sc-green: #5BD177;
    --sc-red: #FA8787;
    --sc-amber: #F2A33C;
    --sc-line: rgba(255, 255, 255, 0.1);
    --sc-overlay: rgba(0, 0, 0, 0.6);
    --sc-series-0: #C97A14;
    --sc-series-1: #2A9CC9;
    --sc-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

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

/*
 * The shell is a fixed-height column and screens scroll inside it, never the
 * shell itself. That is what lets dialogs, the settings sheet, the + button,
 * the wicket animation and the confetti sit `position: absolute` over the
 * frame - on a desktop they belong to the phone, not the window.
 */
.app-shell.sc {
    position: relative;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    background: var(--sc-page);
    color: var(--sc-text);
    font-size: 16px;
    line-height: 1.35;
    -webkit-tap-highlight-color: transparent;
}

@media only screen and (min-width: 480px) {
    .app-shell.sc {
        height: 100%;
        overflow: hidden;
    }
}

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

/* Resets at zero specificity, so any `.sc-*` rule below wins over them. */
:where(.sc) :where(h1, h2, p, dl, dd, ul) {
    margin: 0;
    padding: 0;
}

:where(.sc) :where(button, input) {
    font: inherit;
    color: inherit;
}

:where(.sc) :where(button) {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

:where(.sc) :where(button:disabled) {
    cursor: default;
}

:where(.sc) :where(a) {
    color: inherit;
    text-decoration: none;
}

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

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

.sc-center {
    text-align: center;
}

/* Material Symbols, cut to the glyphs ScorerShell lists. */
.sc-icon {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    direction: ltr;
    flex: none;
    user-select: none;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: 'liga';
    overflow: hidden;
}

/* ----------------------------------------------------------------- screen */

.sc-screen {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.sc-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px 12px 32px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sc-body.sc-flush {
    padding: 0 0 24px;
    gap: 0;
}

.sc-list {
    gap: 12px;
    padding-bottom: 24px;
}

.sc-has-fab {
    padding-bottom: 100px;
}

.sc-form {
    display: contents;
}

.sc-pick {
    padding-inline: 18px;
    gap: 10px;
}

.sc-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sc-gap-top {
    margin-top: 24px;
}

.sc-inset {
    padding: 16px;
}

/* ---------------------------------------------------------------- app bar */

.sc-bar {
    flex: none;
    display: flex;
    align-items: center;
    gap: 4px;
    height: 60px;
    padding: 0 8px;
    background: var(--sc-bar);
    color: var(--sc-bar-text);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 2;
}

.sc-bar-title {
    flex: 1;
    min-width: 0;
    padding: 0 12px;
}

.sc-bar-text {
    font-size: 20px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sc-bar-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--sc-bar-text);
}

.sc-bar-icon:hover {
    background: rgba(255, 255, 255, 0.12);
}

.sc-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.sc-brand-word {
    font-size: 27px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.sc-brand-word span {
    font-weight: 400;
}

.sc-tabs {
    flex: none;
    display: flex;
    padding: 0 8px;
    margin-top: -1px;
    background: var(--sc-bar);
    position: relative;
    z-index: 2;
    overflow-x: auto;
}

.sc-tab {
    padding: 13px 14px;
    border-bottom: 3px solid transparent;
    color: var(--sc-bar-text);
    opacity: 0.72;
    font-size: 17px;
    font-weight: 500;
    white-space: nowrap;
}

.sc-tab.is-on {
    opacity: 1;
    border-bottom-color: var(--sc-bar-text);
}

/* ------------------------------------------------------------- bottom tabs */

.sc-tab-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

.sc-tabbar {
    flex: none;
    display: flex;
    height: 64px;
    background: var(--sc-card);
    border-top: 1px solid var(--sc-line);
}

.sc-tabbar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--sc-muted);
    font-size: 14px;
}

.sc-tabbar-item.is-on {
    color: var(--sc-accent);
}

/* ------------------------------------------------------------------ cards */

.sc-card {
    background: var(--sc-card);
    border-radius: 10px;
    padding: 14px;
    box-shadow: var(--sc-shadow);
}

.sc-section {
    font-size: 19px;
    font-weight: 400;
    color: var(--sc-accent);
    margin: 10px 2px 2px;
    display: block;
}

.sc-note {
    font-size: 15px;
    line-height: 1.4;
    color: var(--sc-muted);
    margin: 4px 2px 0;
}

.sc-empty {
    text-align: center;
    font-size: 15px;
    line-height: 1.45;
    color: var(--sc-muted);
    margin-top: 40px;
    padding: 0 24px;
}

.sc-error {
    color: var(--sc-red);
    font-size: 14px;
    margin-top: 6px;
}

/* --------------------------------------------------------------- controls */

.sc-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 16px;
    border-radius: 8px;
    background: var(--sc-accent);
    color: var(--sc-on-accent);
    font-size: 18px;
    font-weight: 500;
}

.sc-button:hover {
    filter: brightness(1.06);
}

.sc-button:active {
    opacity: 0.85;
}

.sc-button:disabled {
    opacity: 0.45;
}

.sc-text-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 6px;
    color: var(--sc-accent);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.sc-text-button:hover {
    background: var(--sc-accent-soft);
}

.sc-text-button.is-danger {
    color: var(--sc-red);
}

.sc-icon-button {
    width: 40px;
    height: 40px;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--sc-muted);
}

.sc-icon-button:hover {
    background: var(--sc-accent-soft);
}

.sc-field {
    width: 100%;
    background: transparent;
    border: 0;
    border-bottom: 1.5px solid var(--sc-muted);
    border-radius: 0;
    padding: 8px 2px;
    font-size: 17px;
    outline: none;
    color: var(--sc-text);
}

.sc-field::placeholder {
    color: var(--sc-muted);
}

.sc-field:focus {
    border-bottom-color: var(--sc-accent);
}

.sc-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sc-setting-label {
    flex: 1;
}

.sc-setting-field {
    width: 64px;
    text-align: center;
}

.sc-choice {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 17px;
    cursor: pointer;
}

.sc-choice input {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--sc-accent);
    cursor: pointer;
    flex: none;
}

.sc-choice.is-compact {
    gap: 5px;
    font-size: 15px;
}

.sc-choice.is-compact input {
    width: 18px;
    height: 18px;
}

.sc-choice.is-off {
    opacity: 0.4;
}

.sc-row-choices {
    display: flex;
    flex-wrap: wrap;
    column-gap: 24px;
}

.sc-grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.sc-suggest {
    display: flex;
    gap: 8px;
    padding-top: 10px;
    overflow-x: auto;
    scrollbar-width: none;
}

.sc-chip {
    flex: none;
    padding: 7px 14px;
    border-radius: 16px;
    background: var(--sc-accent-soft);
    color: var(--sc-accent);
    font-size: 14px;
    font-weight: 600;
}

.sc-rule {
    border: 0;
    height: 1px;
    background: var(--sc-line);
    margin: 14px -18px 0;
    opacity: 1;
}

/* --------------------------------------------------------------- new match */

.sc-form-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
}

.sc-advanced {
    flex: 1;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 18px;
    text-align: left;
}

.sc-start {
    flex: 1.2;
    width: auto;
}

/* ---------------------------------------------------------- lists & items */

.sc-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 8px 10px 14px;
}

.sc-item-link {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
}

.sc-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sc-item-name {
    flex: 1;
    min-width: 0;
    font-size: 19px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sc-item-sub {
    font-size: 15px;
    color: var(--sc-muted);
}

.sc-item-sub b {
    color: var(--sc-text);
    font-weight: 400;
}

.sc-avatar {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #ffffff;
}

.sc-face {
    flex: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--sc-accent);
    color: var(--sc-on-accent);
}

.sc-order {
    display: flex;
    flex-direction: column;
}

.sc-order button {
    color: var(--sc-muted);
    line-height: 0;
}

.sc-order button:disabled {
    color: var(--sc-line);
}

.sc-fab {
    position: absolute;
    right: 22px;
    bottom: 22px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--sc-accent);
    color: var(--sc-on-accent);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    z-index: 3;
}

/* ------------------------------------------------------------- match card */

.sc-match {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sc-match-when,
.sc-match-status {
    font-size: 15px;
    color: var(--sc-muted);
}

.sc-match-team {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sc-match-name {
    flex: 1;
    min-width: 0;
    font-size: 17px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sc-match-score {
    font-size: 19px;
}

.sc-match-score small {
    font-size: 14px;
    color: var(--sc-muted);
}

.sc-match-actions {
    display: flex;
    align-items: center;
    justify-content: space-around;
}

.sc-match-actions .sc-text-button {
    flex: 1;
}

/* -------------------------------------------------------------- scoring */

.sc-scoring {
    padding: 10px 10px 24px;
    gap: 10px;
}

.sc-score-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.sc-score-team {
    flex: 1;
    min-width: 0;
    font-size: 16px;
}

.sc-rate {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 44px;
}

.sc-rate-label {
    font-size: 14px;
    color: var(--sc-muted);
}

.sc-rate-value {
    font-size: 16px;
    margin-top: 4px;
}

.sc-score-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: -14px;
}

.sc-score {
    font-size: 44px;
    line-height: 1.15;
}

.sc-score-overs {
    font-size: 22px;
    color: var(--sc-muted);
}

.sc-free-hit {
    align-self: center;
    padding: 3px 10px;
    border-radius: 10px;
    background: var(--sc-amber);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
}

.sc-need {
    display: block;
    font-size: 16px;
    margin-top: 4px;
    color: var(--sc-green);
    text-align: left;
}

.sc-need.sc-ended {
    color: var(--sc-red);
}

.sc-live {
    padding: 6px 14px;
}

.sc-live-table,
.sc-card-table,
.sc-overs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.sc-live-table th,
.sc-live-table td {
    padding: 7px 0;
    text-align: center;
    font-weight: 400;
    width: 40px;
}

.sc-live-table th {
    color: var(--sc-muted);
    border-bottom: 1px solid var(--sc-line);
}

.sc-live-table th:first-child,
.sc-live-table td:first-child {
    width: auto;
    text-align: left;
    max-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sc-live-table th:last-child,
.sc-live-table td:last-child {
    width: 56px;
    text-align: right;
}

.sc-live-name {
    color: var(--sc-accent);
    font-size: 16px;
}

.sc-prompt {
    display: block;
    width: 100%;
    padding: 10px;
    margin: 4px 0;
    border-radius: 8px;
    background: var(--sc-accent-soft);
    color: var(--sc-accent);
    font-size: 15px;
    font-weight: 600;
}

.sc-over {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 64px;
}

.sc-over-label {
    flex: none;
}

.sc-over-balls {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}

.sc-ball {
    flex: none;
    min-width: 34px;
    height: 34px;
    padding: 0 6px;
    border-radius: 17px;
    border: 1px solid var(--sc-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}

.sc-ball.is-out,
.sc-ball.is-extra,
.sc-ball.is-boundary {
    color: #ffffff;
}

.sc-ball.is-out {
    background: var(--sc-red);
    border-color: var(--sc-red);
}

.sc-ball.is-extra {
    background: var(--sc-amber);
    border-color: var(--sc-amber);
}

.sc-ball.is-boundary {
    background: var(--sc-green);
    border-color: var(--sc-green);
}

.sc-ticks {
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sc-tick-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    column-gap: 4px;
}

.sc-tick-buttons {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.sc-small {
    padding: 10px;
    border-radius: 6px;
    background: var(--sc-accent);
    color: var(--sc-on-accent);
    font-size: 13px;
    white-space: nowrap;
}

.sc-small:active {
    opacity: 0.8;
}

.sc-pad {
    display: flex;
    gap: 10px;
    padding: 0;
}

.sc-pad-left {
    width: 118px;
    flex: none;
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

.sc-pad-right {
    flex: 1;
    min-width: 0;
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    justify-items: center;
    align-content: center;
}

/* Circles from the column's width, capped, so they stay round at any width. */
.sc-key {
    width: 100%;
    max-width: 64px;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 2px solid var(--sc-accent);
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sc-key:hover {
    background: var(--sc-accent-soft);
}

.sc-key:active {
    background: var(--sc-accent-soft);
    transform: scale(0.96);
}

.sc-gif {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* -------------------------------------------------------------- scoreboard */

.sc-status {
    font-size: 16px;
    padding: 14px;
}

.sc-innings-head {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 10px;
    padding: 14px;
    background: var(--sc-bar);
    color: var(--sc-bar-text);
    font-size: 18px;
    font-weight: 400;
    text-align: left;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sc-innings-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sc-card-table {
    background: var(--sc-card);
}

.sc-card-table th,
.sc-card-table td {
    padding: 10px 4px;
    text-align: center;
    font-weight: 400;
    border-bottom: 1px solid var(--sc-line);
    width: 40px;
    vertical-align: top;
}

.sc-card-table th {
    background: var(--sc-sunken);
    color: var(--sc-muted);
}

.sc-card-table th:first-child,
.sc-card-table td:first-child {
    width: auto;
    text-align: left;
    padding-left: 14px;
    font-size: 16px;
}

.sc-card-table th:last-child,
.sc-card-table td:last-child {
    width: 60px;
    text-align: right;
    padding-right: 14px;
}

.sc-card-table td small {
    display: block;
    margin-top: 2px;
    font-size: 14px;
    color: var(--sc-muted);
}

.sc-card-table .sc-line td:last-child {
    width: auto;
}

.sc-over-row {
    padding: 10px 14px;
    background: var(--sc-card);
    border-bottom: 1px solid var(--sc-line);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sc-over-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sc-over-head b {
    font-weight: 600;
}

.sc-over-bowler {
    flex: 1;
    min-width: 0;
    color: var(--sc-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sc-over-runs {
    color: var(--sc-accent);
    font-weight: 600;
}

.sc-over-row .sc-over-balls {
    flex-wrap: wrap;
}

/* --------------------------------------------------------------- analysis */

.sc-flush-card {
    padding: 4px 14px;
}

.sc-overs-table th,
.sc-overs-table td {
    padding: 8px 0;
    text-align: right;
    border-bottom: 1px solid var(--sc-line);
    font-weight: 400;
}

.sc-overs-table th {
    font-size: 13px;
    color: var(--sc-muted);
    max-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sc-overs-table th:first-child,
.sc-overs-table td:first-child {
    text-align: left;
    width: 56px;
}

.sc-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 0 4px 8px;
    font-size: 14px;
}

.sc-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sc-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex: none;
}

.sc-ring {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--sc-muted);
}

.sc-chart-plot {
    position: relative;
    touch-action: pan-y;
    user-select: none;
}

.sc-chart-plot svg {
    display: block;
    overflow: visible;
}

.sc-chart-grid {
    stroke: var(--sc-line);
    stroke-width: 1;
}

.sc-chart-tick {
    fill: var(--sc-muted);
    font-size: 12px;
}

.sc-chart-end {
    fill: var(--sc-text);
    font-size: 12px;
}

.sc-chart-line {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sc-chart-ring {
    fill: var(--sc-card);
    stroke-width: 2;
}

.sc-chart-dot {
    stroke: var(--sc-card);
    stroke-width: 2;
}

.sc-chart-cursor {
    stroke: var(--sc-muted);
    stroke-width: 1;
    stroke-dasharray: 4 4;
}

.sc-tip {
    position: absolute;
    top: 8px;
    max-width: 200px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--sc-line);
    background: var(--sc-card);
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
}

.sc-tip-head {
    font-size: 12px;
    color: var(--sc-muted);
}

.sc-tip-row {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ----------------------------------------------------------------- player */

.sc-hero {
    flex: none;
    position: relative;
    height: 170px;
    margin-top: -1px;
    padding: 0 24px 16px;
    display: flex;
    align-items: flex-end;
    background: var(--sc-bar);
    color: var(--sc-bar-text);
}

.sc-hero-face {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.7;
}

.sc-hero-name {
    position: relative;
    font-size: 36px;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sc-tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.sc-tile {
    padding: 12px 4px;
    border-radius: 4px;
    background: var(--sc-card);
    box-shadow: var(--sc-shadow);
    text-align: center;
}

.sc-tile dt {
    font-size: 15px;
    color: var(--sc-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sc-tile dd {
    font-size: 20px;
    margin-top: 8px;
}

/* ----------------------------------------------------------------- result */

.sc-result {
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 24px;
    text-align: center;
}

.sc-result-hello,
.sc-result-winner {
    font-size: 36px;
}

.sc-medal {
    flex: none;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 8px 0;
    background: var(--sc-accent);
    color: #FFD54F;
}

.sc-result-text {
    font-size: 18px;
}

.sc-result-tie {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.sc-confetti {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 25;
}

.sc-confetti span {
    position: absolute;
    top: -40px;
    opacity: 0;
    animation-name: sc-fall;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

@keyframes sc-fall {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg);
    }

    92% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translate(var(--drift), calc(100dvh + 60px)) rotate(var(--spin));
    }
}

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

/* ----------------------------------------------------------------- dialogs */

.sc-backdrop {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--sc-overlay);
    animation: sc-fade 0.15s ease-out;
}

.sc-dialog {
    width: 100%;
    max-width: 420px;
    max-height: 85%;
    display: flex;
    flex-direction: column;
    padding: 22px 22px 8px;
    border-radius: 6px;
    background: var(--sc-card);
    color: var(--sc-text);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    outline: none;
}

.sc-dialog-title {
    font-size: 21px;
    font-weight: 700;
    margin-bottom: 10px;
}

.sc-dialog-body {
    overflow-y: auto;
    min-height: 0;
}

.sc-dialog-text {
    font-size: 17px;
    line-height: 1.4;
    margin-bottom: 12px;
}

.sc-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.sc-ask {
    font-size: 17px;
    color: var(--sc-accent);
    margin: 10px 0 2px;
}

.sc-stand {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--sc-line);
    font-size: 16px;
}

.sc-stand small {
    color: var(--sc-muted);
    font-size: 14px;
}

.sc-stand-names {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sc-stand-runs {
    font-size: 20px;
    font-weight: 600;
    color: var(--sc-accent);
}

@keyframes sc-fade {
    from {
        opacity: 0;
    }
}

/* ---------------------------------------------------------- settings sheet */

.sc-sheet-backdrop {
    align-items: flex-end;
    padding: 0;
}

.sc-sheet {
    width: 100%;
    max-height: 82%;
    overflow-y: auto;
    border-radius: 14px 14px 0 0;
    background: var(--sc-card);
    color: var(--sc-text);
    padding-bottom: 8px;
    animation: sc-rise 0.2s ease-out;
}

@keyframes sc-rise {
    from {
        transform: translateY(40px);
        opacity: 0;
    }
}

.sc-account {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--sc-line);
}

.sc-account-who {
    flex: 1;
    min-width: 0;
}

.sc-account-name {
    font-size: 19px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sc-account-sub,
.sc-row-sub {
    font-size: 15px;
    color: var(--sc-muted);
    margin-top: 4px;
    line-height: 1.35;
}

.sc-account-sub {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sc-logout {
    flex: none;
    padding: 9px 20px;
    border-radius: 24px;
    border: 1.5px solid var(--sc-text);
    font-size: 16px;
}

.sc-row {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 12px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--sc-line);
    text-align: left;
}

button.sc-row:hover {
    background: var(--sc-accent-soft);
}

.sc-row-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sc-row-label {
    font-size: 18px;
}

.sc-row.is-danger .sc-row-label {
    color: var(--sc-red);
}

.sc-switch {
    flex: none;
    position: relative;
    width: 42px;
    height: 24px;
    border-radius: 12px;
    background: var(--sc-line);
    transition: background 0.2s;
}

.sc-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.sc-switch.is-on {
    background: var(--sc-accent);
}

.sc-switch.is-on::after {
    transform: translateX(18px);
}

/* --------------------------------------------------------------- licences */

.sc-licences {
    list-style: none;
}

.sc-licences li {
    display: flex;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--sc-card);
    border-bottom: 1px solid var(--sc-line);
}

/* ------------------------------------------------------------------ login */

.sc-login {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 32px;
    background: var(--sc-bar);
    color: var(--sc-bar-text);
    text-align: center;
}

.sc-login-brand {
    font-size: 34px;
    font-weight: 800;
    margin-top: 4px;
}

.sc-login-brand span {
    font-weight: 400;
}

.sc-login-tag {
    font-size: 17px;
    opacity: 0.85;
    margin-top: 6px;
}

.sc-login-buttons {
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 36px;
}

.sc-outline {
    height: 56px;
    border-radius: 28px;
    border: 1.5px solid var(--sc-bar-text);
    color: var(--sc-bar-text);
    font-size: 19px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sc-outline:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
}

.sc-outline:disabled {
    opacity: 0.6;
}

.sc-spinner {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2.5px solid currentColor;
    border-right-color: transparent;
    animation: sc-spin 0.8s linear infinite;
}

.sc-spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 3px;
    margin-bottom: 12px;
}

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