/* ==========================================================================
   Shuttlera design system
   Minimal and calm: neutral greys, one teal accent, hairline borders, soft
   radii, Inter. Light and dark tokens; "dark" class is set on <html>.
   ========================================================================== */

:root {
    --bg: #fafafa;
    --surface: #ffffff;
    --surface-2: #f4f4f5;
    --border: #e4e4e7;
    --border-strong: #d4d4d8;
    --text: #111827;
    --text-muted: #6b7280;
    --text-subtle: #6b7280;
    --accent: #0f766e;
    --accent-hover: #115e59;
    --accent-soft: rgba(15, 118, 110, 0.08);
    --accent-ring: rgba(15, 118, 110, 0.25);
    --amber: #f59e0b;
    --danger: #dc2626;
    --danger-soft: rgba(220, 38, 38, 0.08);
    --success: #16a34a;
    --success-soft: rgba(22, 163, 74, 0.08);
    --warning-soft: rgba(217, 119, 6, 0.1);
    --info-soft: rgba(37, 99, 235, 0.08);
    --radius-sm: 8px;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 16px rgba(16, 24, 40, 0.06);
    --shadow-lg: 0 12px 40px rgba(16, 24, 40, 0.12);
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color-scheme: light;
}

html.dark {
    --bg: #0b0d10;
    --surface: #131619;
    --surface-2: #1a1d22;
    --border: #23272e;
    --border-strong: #2e333b;
    --text: #f4f4f5;
    --text-muted: #a1a1aa;
    --text-subtle: #8f8f99;
    --accent: #2dd4bf;
    --accent-hover: #5eead4;
    --accent-soft: rgba(45, 212, 191, 0.1);
    --accent-ring: rgba(45, 212, 191, 0.3);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.1);
    --success: #4ade80;
    --success-soft: rgba(74, 222, 128, 0.1);
    --warning-soft: rgba(251, 191, 36, 0.12);
    --info-soft: rgba(96, 165, 250, 0.12);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
}

/* ---------- Base ---------- */

html, body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "cv11", "ss01";
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

h1:focus { outline: none; }

::selection { background: var(--accent-soft); }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

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

/* ---------- App shell ---------- */

/* Phones with a notch, dynamic island or home bar: the installed app draws edge to edge, so everything that touches an
   edge leaves room for it. One header height everywhere (MudBlazor's own changes with size and orientation). */
:root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --topbar-h: 56px;
}

.topbar.mud-appbar {
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
    color: var(--text);
    padding-top: var(--safe-top);
    padding-left: max(8px, var(--safe-left));
    padding-right: max(8px, var(--safe-right));
}
.topbar .mud-toolbar-appbar { height: var(--topbar-h) !important; min-height: var(--topbar-h) !important; }
.main.mud-main-content { padding-top: calc(var(--topbar-h) + var(--safe-top)) !important; }
.sidebar.mud-drawer.mud-drawer-fixed { top: calc(var(--topbar-h) + var(--safe-top)) !important; height: calc(100% - var(--topbar-h) - var(--safe-top)) !important; padding-left: var(--safe-left); }
.mud-snackbar-provider[class*="mud-snackbar-location-top"] { top: calc(var(--topbar-h) + var(--safe-top) + 8px) !important; }

.topbar .mud-toolbar { gap: 4px; }

.topbar-icon { color: var(--text-muted) !important; }
.topbar-icon:hover { color: var(--text) !important; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 650;
    font-size: 1.0625rem;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-left: 4px;
}
.brand:hover { color: var(--text); }

.sidebar.mud-drawer {
    border-right: 1px solid var(--border);
}

.nav .mud-nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    padding: 7px 10px;
    color: var(--text-muted);
    transition: background-color 0.15s ease, color 0.15s ease;
}
.nav .mud-nav-link:hover { color: var(--text); }
.nav .mud-nav-link .mud-nav-link-icon { font-size: 1.15rem; }
.nav .mud-nav-link.active { font-weight: 600; }

.nav-section {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-subtle);
    padding: 18px 10px 6px;
}

.main.mud-main-content { background: var(--bg); min-height: 100dvh; }

.page-container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 32px max(24px, calc(var(--safe-right) + 12px)) 64px max(24px, calc(var(--safe-left) + 12px));
}

@media (max-width: 600px) {
    .page-container { padding: 20px max(16px, calc(var(--safe-right) + 12px)) 96px max(16px, calc(var(--safe-left) + 12px)); }
}

/* ---------- Page headers ---------- */

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

.page-title {
    font-size: 1.625rem;
    font-weight: 650;
    letter-spacing: -0.025em;
    line-height: 1.2;
    margin: 0;
    color: var(--text);
}

.page-subtitle {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Surfaces ---------- */

.card, .mud-paper.mud-paper-outlined {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.mud-card.mud-paper-outlined { box-shadow: var(--shadow-sm); }

.surface {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.stat {
    padding: 18px 20px;
}
.stat__label { color: var(--text-muted); font-size: 0.8125rem; font-weight: 500; }
.stat__value { font-size: 1.75rem; font-weight: 650; letter-spacing: -0.03em; margin-top: 4px; }
.stat__hint { color: var(--text-subtle); font-size: 0.8125rem; margin-top: 2px; }

/* Tables: quiet header, hairline rows */
.mud-table.mud-table-outlined,
.table-card.mud-table {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.mud-table .mud-table-head .mud-table-cell {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: var(--surface-2);
}
.mud-table .mud-table-cell { border-bottom-color: var(--border); }

/* Buttons: no shadows, crisp */
.mud-button-root { border-radius: var(--radius-sm) !important; }
.mud-button-filled { box-shadow: none !important; }
.mud-button-filled:hover { box-shadow: none !important; filter: brightness(1.05); }
.mud-button-outlined { border-color: var(--border-strong) !important; }

.mud-chip { font-weight: 500; }
.mud-chip.mud-chip-size-small { height: 24px; font-size: 0.75rem; }

.mud-dialog { border: 1px solid var(--border); border-radius: var(--radius-lg) !important; box-shadow: var(--shadow-lg) !important; }
.mud-popover { border: 1px solid var(--border); box-shadow: var(--shadow-lg) !important; border-radius: var(--radius) !important; }
.mud-snackbar { border-radius: var(--radius) !important; box-shadow: var(--shadow-lg) !important; }
.mud-alert { border-radius: var(--radius) !important; }

/* ---------- User menu ---------- */

.user-avatar.mud-avatar {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
    font-size: 0.75rem;
    border: 1px solid var(--border);
}

.user-menu { min-width: 230px; }
.user-menu__header { padding: 12px 16px 10px; }
.user-menu__name { font-weight: 600; font-size: 0.875rem; color: var(--text); }
.user-menu__sub { font-size: 0.8125rem; color: var(--text-muted); }
.user-menu__logout { margin: 0; width: 100%; align-self: stretch; }
.user-menu__logout-btn {
    display: flex; align-items: center; justify-content: flex-start; gap: 12px;
    width: 100%;
    padding: 6px 16px;
    background: none; border: 0;
    color: var(--text);
    font: inherit; font-size: 0.875rem;
    cursor: pointer;
    text-align: left;
}
.user-menu__logout-btn:hover { background: var(--surface-2); }

/* ---------- Empty states ---------- */

.empty-state {
    text-align: center;
    padding: 56px 24px;
    max-width: 420px;
    margin: 0 auto;
}
.empty-state__icon {
    width: 48px; height: 48px;
    margin: 0 auto 16px;
    border-radius: 12px;
    display: grid; place-items: center;
    background: var(--surface-2);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.empty-state__title { font-size: 1.0625rem; font-weight: 600; margin: 0 0 6px; color: var(--text); }
.empty-state__message { color: var(--text-muted); margin: 0 0 16px; }

/* ---------- Auth pages (login, invites, setup) ---------- */

.auth-shell {
    position: relative;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: calc(40px + var(--safe-top)) max(16px, var(--safe-right)) calc(40px + var(--safe-bottom)) max(16px, var(--safe-left));
    background: var(--bg);
    overflow: hidden;
}

.auth-glow {
    position: absolute;
    inset: -40% -20% auto;
    height: 70%;
    background: radial-gradient(closest-side, var(--accent-soft), transparent 70%);
    pointer-events: none;
}

.auth-brand {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 24px;
}
.auth-brand:hover { color: var(--text); }

.auth-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 32px;
}

@media (max-width: 480px) {
    .auth-card { padding: 24px 20px; border-radius: 14px; }
}

.auth-card h1, .auth-card .h3 {
    font-size: 1.375rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
    color: var(--text);
}
.auth-card h2 { font-size: 1.0625rem; font-weight: 600; color: var(--text); }
.auth-card h3, .auth-card h4 { font-size: 1rem; font-weight: 600; color: var(--text); }
.auth-card .row, .auth-card [class*="col-"] { margin: 0; padding: 0; width: 100%; max-width: 100%; flex: 1 1 100%; }
.auth-card hr { border-color: var(--border); opacity: 1; }
.auth-card p, .auth-card li, .auth-card label { color: var(--text-muted); }
.auth-card ol, .auth-card ul { padding-left: 1.2rem; }

.auth-footer {
    position: relative;
    margin-top: 24px;
    font-size: 0.8125rem;
    color: var(--text-subtle);
}

/* ---------- Bootstrap form overrides (static account pages) ---------- */

.form-label, label { font-size: 0.8125rem; font-weight: 500; color: var(--text); }

.form-control, .form-select {
    background-color: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control:focus, .form-select:focus {
    background-color: var(--surface);
    color: var(--text);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
}
.form-control::placeholder { color: var(--text-subtle); }
.form-control:disabled, .form-control[readonly] { background-color: var(--surface-2); }

/* Floating labels: hide the example placeholder until focus */
.form-floating > .form-control { height: 52px; min-height: 52px; padding-top: 1.35rem; padding-bottom: 0.35rem; }
.form-floating > .form-control::placeholder { color: transparent; }
.form-floating > .form-control:focus::placeholder { color: var(--text-subtle); }
.form-floating > label { color: var(--text-muted); font-weight: 400; padding: 0.9rem 0.85rem; }
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label { color: var(--text-muted); transform: scale(0.82) translateY(-0.6rem) translateX(0.15rem); }
.form-floating > .form-control:focus ~ label::after,
.form-floating > .form-control:not(:placeholder-shown) ~ label::after { background-color: transparent; }

.form-check-input { border-color: var(--border-strong); background-color: var(--surface); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-check-input:focus { box-shadow: 0 0 0 3px var(--accent-ring); border-color: var(--accent); }
.darker-border-checkbox.form-check-input { border-color: var(--border-strong); }

.btn {
    border-radius: var(--radius-sm);
    font-weight: 550;
    font-size: 0.9375rem;
    letter-spacing: -0.005em;
    transition: background-color 0.15s ease, border-color 0.15s ease, filter 0.15s ease;
}
.btn-lg { padding: 0.65rem 1rem; font-size: 0.9375rem; }
.btn-primary, .btn-primary:disabled {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
html.dark .btn-primary { color: #042f2e; }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: var(--accent-hover) !important;
    border-color: var(--accent-hover) !important;
}
.btn-danger { background-color: var(--danger); border-color: var(--danger); }
.btn-link { color: var(--accent); text-decoration: none; }
.btn:focus-visible { box-shadow: 0 0 0 3px var(--accent-ring); }

.alert {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: 0.875rem;
}
.alert-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.alert-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.alert-warning { background: var(--warning-soft); color: var(--text); border-color: transparent; }
.alert-info { background: var(--info-soft); color: var(--text); border-color: transparent; }

.text-danger, .validation-message { color: var(--danger) !important; font-size: 0.8125rem; }
.text-secondary { color: var(--text-muted) !important; }
.valid.modified:not([type=checkbox]) { outline: none; }
.invalid { outline: none; border-color: var(--danger) !important; }

kbd {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 0.8125rem;
}

/* ---------- Account settings ---------- */

.settings-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    align-items: start;
}
@media (max-width: 800px) {
    .settings-grid { grid-template-columns: minmax(0, 1fr); }
    .settings-nav-wrap, .settings-panel { min-width: 0; }
}

.settings-nav {
    list-style: none;
    margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: 2px;
}
@media (max-width: 800px) {
    .settings-nav { flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
}
.settings-nav__link {
    display: block;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}
.settings-nav__link:hover { background: var(--surface-2); color: var(--text); }
.settings-nav__link.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.settings-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}
.settings-panel h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 16px; color: var(--text); }
.settings-panel .row > [class*="col-"] { width: 100%; max-width: 560px; flex: 0 0 auto; }

/* ---------- Errors ---------- */

#blazor-error-ui {
    color-scheme: light only;
    background: #fef2f2;
    color: #991b1b;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.75rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 1rem; top: 0.6rem; }

.blazor-error-boundary {
    background: var(--danger-soft);
    color: var(--danger);
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
}
.blazor-error-boundary::after { content: "Something went wrong."; }

/* ---------- Layout helpers ---------- */

.form-stack { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }

.two-col { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 960px) { .two-col { grid-template-columns: 1fr; } }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.stat__value--text { font-size: 1.25rem; }

.text-muted, .text-secondary { color: var(--text-muted) !important; } /* beats Bootstrap's fixed dark grey, which vanishes in dark mode */
.text-error { color: var(--danger); }
.text-success { color: var(--success); }
.cursor-pointer { cursor: pointer; }
.font-weight-medium { font-weight: 500; }

.user-avatar--lg.mud-avatar { width: 56px; height: 56px; font-size: 1.125rem; }

.info-row { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 0.875rem; }

/* ---------- Settings ---------- */

.settings-tabs .mud-tabs-tabbar {
    background: transparent;
    border-bottom: 1px solid var(--border);
}
.settings-tabs .mud-tab { text-transform: none; font-weight: 500; min-width: 0; padding: 10px 16px; }

.playday-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.playday--off { opacity: 0.6; }
.playday__day .mud-input { font-weight: 600; font-size: 1.0625rem; }

.rules-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }

/* ---------- Rating chart and history ---------- */

.rating-chart { margin: 0; }
.rating-chart svg { width: 100%; height: 160px; display: block; overflow: visible; }
.rating-chart__grid { stroke: var(--border); stroke-dasharray: 3 4; stroke-width: 1; vector-effect: non-scaling-stroke; }
.rating-chart__line { fill: none; stroke: var(--accent); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.rating-chart__dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.rating-chart__axis { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-subtle); margin-top: 6px; }

.chart-empty {
    display: flex; align-items: center; gap: 10px;
    padding: 28px 16px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.875rem;
}

.history-list { display: flex; flex-direction: column; }
.history-item {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
}
.history-item__title { font-size: 0.875rem; font-weight: 500; }
.history-item__sub { font-size: 0.8125rem; color: var(--text-muted); }
.history-item__value { font-weight: 600; font-variant-numeric: tabular-nums; display: flex; gap: 8px; align-items: baseline; }
.delta-up { color: var(--success); font-size: 0.8125rem; }
.delta-down { color: var(--danger); font-size: 0.8125rem; }

.adjust-box { padding: 16px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }

/* ---------- Choice cards (pick one) ---------- */

.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.choice {
    display: flex; flex-direction: column; gap: 2px;
    text-align: left;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
    font: inherit;
}
.choice:hover { border-color: var(--border-strong); }
.choice--selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.choice__title { font-weight: 600; font-size: 0.875rem; }
.choice__desc { font-size: 0.8125rem; color: var(--text-muted); line-height: 1.4; }

/* ---------- Upload ---------- */

.upload-zone {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    border-style: dashed !important;
    color: var(--text-muted);
}

/* ---------- Sessions ---------- */

.section-title { font-size: 0.8125rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 10px; }

.session-list { display: flex; flex-direction: column; gap: 10px; }

.session-card {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.session-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.session-card--cancelled { opacity: 0.6; }
.session-card__link { position: absolute; inset: 0; border-radius: inherit; z-index: 0; }
.session-card__action { position: relative; z-index: 1; }
.session-card__title { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.session-card__meta { color: var(--text-muted); font-size: 0.8125rem; margin-top: 2px; }
@media (max-width: 560px) {
    .session-card { grid-template-columns: auto 1fr; }
    .session-card__action { grid-column: 1 / -1; }
    .session-card__vote { width: 100%; }
}

.date-tile {
    width: 52px;
    display: flex; flex-direction: column; align-items: center;
    padding: 6px 0;
    border-radius: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    line-height: 1.1;
}
.date-tile__dow { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; color: var(--accent); letter-spacing: 0.04em; }
.date-tile__day { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.03em; }
.date-tile__mon { font-size: 0.6875rem; color: var(--text-muted); }
.date-tile--lg { width: 64px; }
.date-tile--lg .date-tile__day { font-size: 1.75rem; }

.capacity { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.capacity__bar { flex: 1; max-width: 220px; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.capacity__fill { height: 100%; border-radius: inherit; background: var(--accent); transition: width 0.3s ease; }
.capacity__text { font-size: 0.75rem; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.format-badge {
    display: inline-flex; align-items: center;
    height: 20px; padding: 0 8px;
    border-radius: 999px;
    font-size: 0.6875rem; font-weight: 600;
    background: var(--surface-2); color: var(--text-muted);
    border: 1px solid var(--border);
}
.format-badge--tournament { background: rgba(245, 158, 11, 0.12); color: #b45309; border-color: transparent; }
.format-badge--balancedleague { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.format-badge--rotation { background: rgba(99, 102, 241, 0.1); color: #4f46e5; border-color: transparent; }
html.dark .format-badge--tournament { color: #fbbf24; }
html.dark .format-badge--rotation { color: #a5b4fc; }

.status-pill {
    display: inline-flex; align-items: center; gap: 6px;
    height: 28px; padding: 0 10px;
    border-radius: 999px;
    font-size: 0.8125rem; font-weight: 600;
    white-space: nowrap;
}
.status-pill .mud-icon-root { font-size: 1rem; }
.status-pill--in { background: var(--success-soft); color: var(--success); }
.status-pill--waiting { background: var(--warning-soft); color: #b45309; }
html.dark .status-pill--waiting { color: #fbbf24; }
.status-pill--pending { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }

.my-place { border-left: 4px solid var(--border-strong); }
.my-place--in { border-left-color: var(--success); }
.my-place--waiting { border-left-color: var(--amber); }
.my-place--pending { border-left-color: var(--accent); }
.my-place__headline { font-size: 1.25rem; font-weight: 650; letter-spacing: -0.02em; margin-bottom: 4px; }

.chance { display: inline-flex; padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.chance--likely { background: var(--success-soft); color: var(--success); }
.chance--possible { background: var(--warning-soft); color: #b45309; }
.chance--unlikely { background: var(--danger-soft); color: var(--danger); }
html.dark .chance--possible { color: #fbbf24; }

.people { list-style: none; margin: 0; padding: 0; }
.person { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.person:first-child { border-top: 0; }
.person--me { background: var(--accent-soft); margin: 0 -12px; padding: 8px 12px; border-radius: var(--radius-sm); }
.person__pos { width: 32px; color: var(--text-subtle); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.person__name { font-weight: 500; }
.tag { font-size: 0.6875rem; font-weight: 600; padding: 1px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 0.875rem; }
.facts dt { color: var(--text-muted); font-weight: 400; }
.facts dd { margin: 0; text-align: right; font-weight: 500; }

.how-list { padding-left: 1.1rem; margin: 0 0 8px; color: var(--text-muted); font-size: 0.875rem; }
.how-list li { margin-bottom: 4px; }
.small { font-size: 0.8125rem; }

/* ---------- Day preferences ---------- */

.month-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.day-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.day-chip {
    display: flex; flex-direction: column; align-items: flex-start;
    min-width: 108px;
    padding: 10px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
}
.day-chip:hover:not(:disabled) { border-color: var(--border-strong); }
.day-chip:disabled { cursor: not-allowed; opacity: 0.6; }
.day-chip--on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.day-chip__name { font-weight: 600; font-size: 0.9375rem; }
.day-chip__time { font-size: 0.75rem; color: var(--text-muted); }

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

.stat--link { color: var(--text); transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.stat--link:hover { color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow); }

.next-session { display: flex; align-items: center; gap: 18px; padding: 18px 20px; flex-wrap: wrap; }
.next-session__body { flex: 1; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; min-width: 180px; }
.next-session__title { font-size: 1.125rem; font-weight: 650; letter-spacing: -0.015em; }

.callout {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    background: var(--accent-soft);
    border: 1px solid transparent;
    color: var(--text);
}
.callout > div { flex: 1; display: flex; flex-direction: column; min-width: 200px; }
.callout span { color: var(--text-muted); font-size: 0.875rem; }
.callout .mud-icon-root { color: var(--accent); }

.hero { max-width: 760px; margin: 48px auto 0; text-align: center; }
.hero__eyebrow { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 0.8125rem; font-weight: 600; margin-bottom: 18px; }
.hero__title { font-size: clamp(2.25rem, 6vw, 3.5rem); font-weight: 750; letter-spacing: -0.04em; line-height: 1.05; margin: 0 0 16px; }
.hero__text { font-size: 1.125rem; color: var(--text-muted); max-width: 560px; margin: 0 auto 28px; }
.hero__actions { display: flex; justify-content: center; gap: 12px; margin-bottom: 48px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; text-align: left; }
.feature { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); }
.feature .mud-icon-root { color: var(--accent); }
.feature span { color: var(--text-muted); font-size: 0.875rem; }

/* ---------- Notifications ---------- */

.notif-badge .mud-badge { font-size: 0.625rem; min-width: 16px; height: 16px; padding: 0 4px; }
.notif-menu { width: 360px; max-width: calc(100vw - 24px); }
.notif-menu__header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.notif-menu__empty { padding: 28px 16px; text-align: center; color: var(--text-muted); font-size: 0.875rem; }
.notif-menu__list { max-height: 420px; overflow-y: auto; }
.notif-menu__all { display: block; text-align: center; padding: 10px; border-top: 1px solid var(--border); font-size: 0.875rem; font-weight: 500; }

.link-button { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: 0.8125rem; cursor: pointer; }

.notif {
    display: flex; gap: 12px; align-items: flex-start;
    width: 100%;
    padding: 12px 16px;
    background: none; border: 0; border-bottom: 1px solid var(--border);
    text-align: left; font: inherit; color: var(--text);
    cursor: pointer;
}
.notif:hover { background: var(--surface-2); }
.notif:last-child { border-bottom: 0; }
.notif--unread { background: var(--accent-soft); }
.notif--unread .notif__title::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 6px; vertical-align: middle; }
.notif__icon { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-muted); }
.notif__icon--promoted, .notif__icon--dropoutdecided { background: var(--success-soft); color: var(--success); }
.notif__icon--sessioncancelled, .notif__icon--sessionshortofplayers { background: var(--danger-soft); color: var(--danger); }
.notif__icon--allocationresult { background: var(--accent-soft); color: var(--accent); }
.notif__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif__title { font-weight: 600; font-size: 0.875rem; }
.notif__body { color: var(--text-muted); font-size: 0.8125rem; line-height: 1.4; }
.notif__time { color: var(--text-subtle); font-size: 0.75rem; }
.notif-page { overflow: hidden; }

.request { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; }
.request__actions { display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 640px) {
    .request { grid-template-columns: auto 1fr; }
    .request__actions { grid-column: 1 / -1; flex-direction: row; }
}

/* ---------- Memberships ---------- */

.offer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.offer { padding: 18px; display: flex; flex-direction: column; gap: 6px; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.offer:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.offer__head { display: flex; justify-content: space-between; align-items: center; }
.offer__name { font-weight: 650; font-size: 1rem; }
.offer__rank { color: var(--accent); font-size: 0.625rem; letter-spacing: 2px; }
.offer__rank span { color: var(--border-strong); }
.offer__price { font-size: 1.625rem; font-weight: 700; letter-spacing: -0.03em; }
.offer__price span { font-size: 0.8125rem; font-weight: 500; color: var(--text-muted); letter-spacing: 0; }
.offer__desc { color: var(--text-muted); font-size: 0.875rem; }
.offer__breakdown { color: var(--text-subtle); font-size: 0.75rem; }
.offer__foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; padding-top: 10px; }

.membership-card { border-left: 4px solid var(--border-strong); }
.membership-card--paid { border-left-color: var(--success); }
.membership-card--unpaid { border-left-color: var(--accent); }
.membership-card--waiting { border-left-color: var(--amber); }
.membership-card--overdue { border-left-color: var(--danger); }
.membership-card__top { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 12px; }
.membership-card__name { font-size: 1.25rem; font-weight: 650; letter-spacing: -0.02em; margin-bottom: 6px; }

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

.sessions-left { position: relative; width: 72px; height: 72px; flex: none; }
.ring { width: 72px; height: 72px; transform: rotate(-90deg); }
.ring__track { fill: none; stroke: var(--surface-2); stroke-width: 3.5; }
.ring__fill { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; transition: stroke-dasharray 0.4s ease; }
.sessions-left__text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.sessions-left__text strong { font-size: 1.25rem; }
.sessions-left__text span { font-size: 0.6875rem; color: var(--text-muted); }

.pay-box { border-top: 1px solid var(--border); padding-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.pay-box__amount { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.pay-box__amount span { font-size: 0.875rem; font-weight: 500; color: var(--text-muted); letter-spacing: 0; margin-left: 6px; }
.pay-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }

.copy-row { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.copy-row--highlight { background: var(--accent-soft); border-color: transparent; }
.copy-row__label { font-size: 0.75rem; color: var(--text-muted); min-width: 92px; }
.copy-row__value { font-weight: 600; font-variant-numeric: tabular-nums; flex: 1; }

code.ref { font-size: 0.8125rem; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; color: var(--text); }

/* ---------- Game night ---------- */

.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); margin-left: 6px; vertical-align: middle; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.8); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

.court-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.court {
    position: relative;
    padding: 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column; gap: 6px;
}
.court--live { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, var(--shadow-sm); }
.court--proposed { background: var(--surface-2); }
.court__head { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); display: flex; align-items: center; justify-content: space-between; }
.court__gap { font-weight: 500; text-transform: none; letter-spacing: 0; }
.court__team { font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.court__elo { color: var(--text-subtle); font-weight: 500; font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.court__vs { font-size: 0.75rem; color: var(--text-subtle); }

.score-entry { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.score-input {
    width: 64px; height: 44px;
    font-size: 1.25rem; font-weight: 700; text-align: center;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text);
    font-variant-numeric: tabular-nums;
}
.score-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }

.table-wrap { overflow-x: auto; }
.league { width: 100%; border-collapse: collapse; font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.league th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); padding: 10px 14px; background: var(--surface-2); }
.league td { padding: 10px 14px; border-top: 1px solid var(--border); }
.league__leader td { font-weight: 600; }
.league__leader td:first-child::before { content: "🏆 "; }

.result-row { display: grid; grid-template-columns: 40px 1fr auto 1fr; gap: 10px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 0.875rem; }
.result-row:first-child { border-top: 0; }
.result-row__court { color: var(--text-subtle); font-size: 0.75rem; font-weight: 600; }
.result-row__score { font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; }
.result-row > span:last-child { text-align: right; }
.result-row__win { font-weight: 650; }

.tag--muted { background: var(--surface-2); color: var(--text-muted); }
a.callout { color: var(--text); }
a.callout:hover { color: var(--text); filter: brightness(0.98); }

/* ---------- Tournaments ---------- */

.winner-banner { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: var(--radius-lg); background: rgba(245, 158, 11, 0.12); margin-bottom: 16px; }
.winner-banner__trophy { font-size: 2rem; }
.winner-banner__label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #b45309; }
html.dark .winner-banner__label { color: #fbbf24; }
.winner-banner__name { font-size: 1.25rem; font-weight: 700; }

.bracket { display: flex; gap: 20px; overflow-x: auto; padding-bottom: 6px; }
.bracket__round { display: flex; flex-direction: column; justify-content: space-around; gap: 12px; min-width: 200px; }
.bracket__title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.bracket__match { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.bracket__match > div:not(.bracket__court) { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; font-size: 0.875rem; }
.bracket__match > div + div:not(.bracket__court) { border-top: 1px solid var(--border); }
.bracket__match--live { border-color: var(--accent); }
.bracket__win { font-weight: 700; background: var(--accent-soft); }
.bracket__court { font-size: 0.6875rem; color: var(--text-muted); padding: 4px 12px; border-top: 1px solid var(--border); }

.fixtures__round { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); padding: 12px 16px 4px; }

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

.tv { min-height: 100dvh; background: #07090b; color: #f4f4f5; padding: calc(28px + var(--safe-top)) max(40px, var(--safe-right)) calc(28px + var(--safe-bottom)) max(40px, var(--safe-left)); font-size: 1.25rem; --surface: #111418; --surface-2: #171b20; --border: #262b33; --text: #f4f4f5; --text-muted: #a1a1aa; --text-subtle: #71717a; --accent: #2dd4bf; --accent-soft: rgba(45,212,191,0.12); }
.tv__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.tv__brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.5rem; }
.tv__title { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; }
.tv__clock { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-muted); }
.tv__grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 32px; }
@media (max-width: 1000px) { .tv__grid { grid-template-columns: 1fr; } .tv { padding: 20px; } }
.tv__section { font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin: 0 0 12px; }
.tv__courts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.tv__court { background: var(--surface); border: 1px solid var(--accent); border-radius: 18px; padding: 20px 24px; }
.tv__court-no { font-size: 1rem; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px; }
.tv__team { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; }
.tv__vs { font-size: 1rem; color: var(--text-subtle); margin: 4px 0; }
.tv__panel { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 12px; margin-bottom: 24px; font-size: 1.125rem; }
.tv__panel .league { font-size: 1.125rem; }
.tv__queue { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; padding: 16px 20px; }
.tv__note, .tv__empty { color: var(--text-muted); font-size: 1.5rem; padding: 40px 0; }
.tv__empty { text-align: center; padding-top: 30vh; }

/* ---------- Stats, leaderboard, news ---------- */

.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 14px 10px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); }
.badge__icon { font-size: 1.75rem; }
.badge__title { font-weight: 650; font-size: 0.875rem; }
.badge__desc { color: var(--text-muted); font-size: 0.75rem; }

.history-game { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); }
.history-game:first-child { border-top: 0; }
.history-game__result { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 0.8125rem; flex: none; }
.history-game__result--w { background: var(--success-soft); color: var(--success); }
.history-game__result--l { background: var(--danger-soft); color: var(--danger); }
.history-game__body { flex: 1; font-size: 0.875rem; min-width: 0; }

.winbar { display: inline-block; width: 70px; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; vertical-align: middle; margin-right: 8px; }
.winbar--wide { flex: 1; width: auto; }
.winbar__fill { height: 100%; background: var(--accent); border-radius: inherit; }
.leaderboard__me td { background: var(--accent-soft); font-weight: 600; }
.leaderboard__top td:first-child { font-size: 1.125rem; }

/* Manager "rank by skill" list */
.rank-list { padding: 6px; }
.rank-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--radius-sm); cursor: grab; user-select: none; }
.rank-item + .rank-item { border-top: 1px solid var(--border); }
.rank-item:hover { background: var(--surface-2); }
.rank-item--dragging { opacity: 0.5; }
.rank-item__handle { color: var(--text-muted); }
.rank-item__pos { width: 2rem; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-muted); }
.rank-item__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.bar-row__label { width: 90px; font-weight: 500; font-size: 0.875rem; }

.post--pinned { border-color: var(--accent); }
.post__title { font-size: 1.0625rem; font-weight: 650; margin: 0; }
.post__body { white-space: pre-wrap; line-height: 1.6; }

.poll-option { position: relative; display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 10px 14px; margin-bottom: 8px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; overflow: hidden; text-align: left; }
.poll-option:hover:not(:disabled) { border-color: var(--border-strong); }
.poll-option--mine { border-color: var(--accent); }
.poll-option__fill { position: absolute; inset: 0 auto 0 0; background: var(--accent-soft); transition: width 0.4s ease; }
.poll-option__text, .poll-option__count { position: relative; }
.poll-option__count { font-weight: 600; font-variant-numeric: tabular-nums; }
.poll-voters { color: var(--text-subtle); font-size: 0.75rem; margin: -4px 0 8px 4px; }


/* ---------- Accessibility ---------- */

.skip-link {
    position: absolute; left: 12px; top: -48px; z-index: 3000;
    padding: 10px 14px; border-radius: var(--radius-sm);
    background: var(--accent); color: #fff; font-weight: 600;
    transition: top 0.15s ease;
}
.skip-link:focus { top: 12px; color: #fff; }
main:focus { outline: none; }

/* Touch targets at least 44px on phones (UX-12) */
@media (pointer: coarse) {
    .mud-icon-button { min-width: 44px; min-height: 44px; }
    .mud-nav-link { min-height: 44px; }
    .link-button { padding: 8px 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

@media (forced-colors: active) {
    .status-pill, .format-badge, .tag, .chance { border: 1px solid CanvasText; }
}

/* ---------- Help and onboarding ---------- */

.help { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .help { grid-template-columns: 1fr; } .help__toc { display: none; } }
.help__toc { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 4px; }
.help__toc a { color: var(--text-muted); font-size: 0.875rem; padding: 6px 8px; border-radius: var(--radius-sm); }
.help__toc a:hover { background: var(--surface-2); color: var(--text); }
.help__body h2 { font-size: 1.125rem; font-weight: 650; margin: 0 0 10px; scroll-margin-top: 80px; }
.help__body p, .help__body li { line-height: 1.65; }
.help__body section { scroll-margin-top: 80px; }
.help__example { padding: 14px 16px; border-radius: var(--radius); background: var(--accent-soft); font-size: 0.9375rem; }
.help__install { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.help__install > div { padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.help__install p { margin: 4px 0 0; color: var(--text-muted); }

.checklist__item { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: var(--radius-sm); color: var(--text); }
.checklist__item:hover { background: var(--surface-2); color: var(--text); }
.checklist__item--done .checklist__text strong { text-decoration: line-through; color: var(--text-muted); }
.checklist__text { flex: 1; display: flex; flex-direction: column; }
.checklist__text span { color: var(--text-muted); font-size: 0.8125rem; }

/* Avatar that opens the account menu: a real button so it works with keyboard and screen readers */
.user-avatar-btn { background: none; border: 0; padding: 0; border-radius: 50%; cursor: pointer; display: inline-flex; }
.user-avatar-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Phone tab bar: like a native app, thumb-reachable. Sidebar takes over from 1280px (MudBlazor's Lg). */
.bottom-tabs { display: none; }
@media (max-width: 1279.98px) {
    .bottom-tabs {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 1200;
        display: grid; grid-template-columns: repeat(5, 1fr);
        padding: 6px max(4px, var(--safe-right)) calc(6px + var(--safe-bottom)) max(4px, var(--safe-left));
        background: color-mix(in srgb, var(--surface) 92%, transparent);
        backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
        border-top: 1px solid var(--border);
    }
    .bottom-tabs__item {
        display: flex; flex-direction: column; align-items: center; gap: 2px;
        padding: 4px 0; border-radius: 10px;
        color: var(--text-muted); text-decoration: none; font-size: 0.6875rem; font-weight: 500;
        -webkit-tap-highlight-color: transparent;
    }
    .bottom-tabs__item .mud-icon-root { font-size: 1.5rem; }
    .bottom-tabs__item:active { background: var(--surface-2); }
    .bottom-tabs__item--active { color: var(--accent); }
    .page-container { padding-bottom: calc(96px + var(--safe-bottom)); }
}

/* Visitor landing page sections under the hero */
.landing { max-width: 960px; margin: 40px auto 0; }
.landing__title { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 14px; }
.landing__days { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.landing__day { padding: 18px; border-radius: var(--radius-lg); }
.landing__dow { font-weight: 700; font-size: 1.0625rem; }
.landing__time { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; margin: 2px 0; font-variant-numeric: tabular-nums; }
.landing__meta { color: var(--text-muted); font-size: 0.875rem; }
.landing__price { margin-top: 10px; font-weight: 600; }
.landing__price span { color: var(--text-muted); font-weight: 400; font-size: 0.8125rem; }
.landing--split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 48px; }
.landing__steps { padding-left: 1.2rem; margin: 0 0 12px; display: grid; gap: 6px; }
@media (max-width: 720px) { .landing--split { grid-template-columns: 1fr; } }

/* Password rules: compact two-column checklist */
.pw-rules { list-style: none; margin: 6px 0 4px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.pw-rules__item { display: flex; align-items: flex-start; gap: 6px; font-size: 0.8125rem; line-height: 1.3; color: var(--text-muted); }
.pw-rules__item .mud-icon-root { font-size: 1rem; margin-top: 1px; flex: none; }
.pw-rules__item--ok { color: var(--success); }
@media (max-width: 380px) { .pw-rules { grid-template-columns: 1fr; } }

/* Browser autofill: keep MudBlazor floating labels above the autofilled text and stop the yellow/blue fill */
.mud-input-control input:-webkit-autofill,
.mud-input-control input:-webkit-autofill:hover,
.mud-input-control input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
    caret-color: var(--text);
    transition: background-color 9999s ease-out 0s;
}
.mud-input-control:has(input:-webkit-autofill) .mud-input-label-outlined {
    transform: translate(14px, -6px) scale(0.75);
}

.session-card__dot { margin: 0 6px; opacity: 0.6; }
.capacity__fill { transition: width 0.4s ease; }

/* Attendance: venue QR card, stats, visit chips, and a clean printable sheet */
.attendance-top { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 12px; margin-bottom: 20px; }
.attendance-top .stat-grid { margin: 0; grid-template-columns: 1fr; }
.qr-card { display: flex; gap: 18px; align-items: center; }
.qr-card__code { width: 132px; flex: none; background: #fff; border-radius: 10px; padding: 6px; line-height: 0; }
.qr-card__code svg, .print-sheet__code svg { width: 100%; height: auto; }
.visits { padding: 10px 16px !important; background: var(--surface-2); }
.visit { display: inline-block; margin: 3px 6px 3px 0; padding: 3px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 0.8125rem; }
.visit--walkin { border-color: var(--warning, #d97706); }
.print-only { display: none; }
@media (max-width: 800px) { .attendance-top { grid-template-columns: 1fr; } .qr-card { flex-direction: column; text-align: center; } }

/* Check-in result after scanning */
.checkin { text-align: center; }
.checkin__icon .mud-icon-root { font-size: 4rem; }
.checkin--ok .checkin__icon { color: var(--success); }
.checkin--no .checkin__icon { color: var(--danger); }
.checkin__title { font-size: 1.5rem; font-weight: 700; margin: 8px 0 4px; color: var(--text); }
.checkin__time { font-size: 2.5rem; font-weight: 750; letter-spacing: -0.02em; margin: 0; font-variant-numeric: tabular-nums; color: var(--text); }
.checkin__text { color: var(--text-muted); margin: 8px 0 20px; }

@media print {
    body * { visibility: hidden; }
    .print-sheet, .print-sheet * { visibility: visible; }
    .print-only { display: block; }
    .print-sheet { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #000; background: #fff; }
    .print-sheet__code { width: 12cm; }
    .print-sheet h1 { font-size: 32pt; margin: 1cm 0 0.3cm; }
    .print-sheet p { font-size: 14pt; }
}

/* Profile pictures */
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; object-fit: cover; flex: none; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.avatar--sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar--md { width: 44px; height: 44px; font-size: 0.9375rem; }
.avatar--lg { width: 72px; height: 72px; font-size: 1.5rem; }
.avatar-picker { display: flex; align-items: center; gap: 16px; }
.avatar-picker__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.avatar-picker__choose { cursor: pointer; }
.leaderboard__name { display: inline-flex; align-items: center; gap: 10px; }

/* Players entering scores */
.score-lock { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 0.875rem; color: var(--text-muted); }
.result-row__edit { margin-left: auto; font-size: 0.8125rem; }
.result-row__fix { padding: 0 12px 12px; }

/* Home: today's session banner and the managers' "needs you" list */
.today { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-left: 4px solid var(--accent); border-radius: 0 var(--radius-lg) var(--radius-lg) 0; }
.today > .mud-icon-root { color: var(--accent); font-size: 1.75rem; flex: none; }
.today > div { flex: 1; display: flex; flex-direction: column; }
.today span { color: var(--text-muted); font-size: 0.875rem; }
.today--done { border-left-color: var(--success); }
.today--done > .mud-icon-root { color: var(--success); }
.todo { padding: 4px 0; }
.todo__row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; color: var(--text); text-decoration: none; }
.todo__row + .todo__row { border-top: 1px solid var(--border); }
.todo__row:hover { background: var(--surface-2); }
.todo__row > .mud-icon-root:first-child { color: var(--accent); }
.todo__row span { flex: 1; }

.totp-qr { width: 200px; background: #fff; padding: 8px; border-radius: 10px; margin: 8px 0 16px; line-height: 0; }
.totp-qr svg { width: 100%; height: auto; }

/* Privacy page */
.prose { max-width: 720px; }
.prose h2 { font-size: 1.125rem; font-weight: 700; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--text-muted); line-height: 1.65; }
.prose li { margin-bottom: 4px; }

/* Settings-style rows (phone notifications, calendar) */
.setting-row { display: flex; align-items: flex-start; gap: 14px; padding: 14px 0; }
.setting-row + .setting-row { border-top: 1px solid var(--border); }
.setting-row > .mud-icon-root { color: var(--accent); margin-top: 2px; flex: none; }
.setting-row__text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.setting-row__text span { color: var(--text-muted); font-size: 0.875rem; }

/* Skill radar */
.skill-radar { width: 100%; max-width: 340px; display: block; margin: 0 auto; }
.skill-radar__grid { fill: none; stroke: var(--border-strong); stroke-width: 1; }
.skill-radar__current { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; }
.skill-radar__previous { fill: none; stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 4 3; }
.skill-radar__label { fill: var(--text-muted); font-size: 11px; }

/* Head-to-head */
.h2h { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.h2h td { padding: 6px 0; border-top: 1px solid var(--border); }
.h2h tr:first-child td { border-top: 0; }
.h2h__rec { width: 56px; text-align: right; padding-right: 12px !important; font-variant-numeric: tabular-nums; color: var(--text-muted); }
.h2h td:last-child { width: 30%; }

/* Bills */
.bill__top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.bill__amount { font-size: 1.375rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.bill__pay { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 0.875rem; }

.skill-row { display: grid; grid-template-columns: 130px 1fr 32px; align-items: center; gap: 10px; font-size: 0.875rem; padding: 4px 0; }
.skill-row__score { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-muted); }
.skill-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }

/* Ladder and simple list rows */
.ladder__rung { display: flex; align-items: center; gap: 14px; padding: 10px 18px; }
.ladder__rung + .ladder__rung { border-top: 1px solid var(--border); }
.ladder__rung--me { background: var(--accent-soft); }
.ladder__pos { width: 28px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-muted); }
.ladder__name { flex: 1; }
.challenge { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; }
.challenge + .challenge { border-top: 1px solid var(--border); }
.challenge__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* Season summary */
.wrapped { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.wrapped__card { display: flex; flex-direction: column; gap: 4px; padding: 20px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.wrapped__card span { color: var(--text-muted); font-size: 0.875rem; }
.wrapped__card strong { font-size: 1.75rem; font-weight: 750; letter-spacing: -0.02em; }
.wrapped__card--big { grid-column: 1 / -1; background: var(--accent-soft); border-color: transparent; }
.wrapped__card--big strong { font-size: 2.5rem; color: var(--accent); }

/* The court you're playing on, so you can spot it at a glance */
.court--mine { border-color: var(--accent) !important; box-shadow: 0 0 0 1px var(--accent); }
.court__you { margin-left: auto; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.75rem; font-weight: 600; }
