/* FeltIQ: Clean felt. Tokens first; every colour, radius and shadow below refers to one.
   Light by default, dark when the device is set to dark. Built for phones first. */
:root {
  color-scheme: light;

  /* colour */
  --bg: #F5F4F0;
  --card: #FFFFFF;
  --sunk: #ECEBE6;
  --line: #E2E0DA;
  --line-2: #D3D0C8;
  --ink: #141619;
  --ink-2: #5B6068;
  --accent: #0E6B4C;          /* felt green: the one accent */
  --accent-hover: #0B5A40;
  --on-accent: #FFFFFF;
  --accent-soft: #E2EFE8;
  --accent-ink: #0B5A40;      /* accent as text on the page and on --accent-soft */
  --pos: #0E7A4F;
  --neg: #B83E12;
  --neg-soft: #F8E6DD;
  --felt: #E6F0EA;
  --felt-line: #B9D3C4;
  --chart: #CFE2D7;
  --glass: rgba(255, 255, 255, .86);
  --backdrop: rgba(20, 22, 25, .45);
  --shadow: 0 12px 32px -14px rgba(20, 22, 25, .28);
  --shadow-sm: 0 1px 2px rgba(20, 22, 25, .08);

  /* shape, space, motion */
  --r-1: 6px;
  --r-2: 12px;
  --r-3: 16px;
  --r-4: 20px;
  --r-5: 24px;
  --r-pill: 999px;
  --wrap: 1080px;
  --gutter: 20px;
  --header-h: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t: 160ms;

  /* type: one family, figures set to equal widths so columns of money line up */
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  /* images */
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%235B6068' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E");
  --icon-external: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 2.5h5v5M9.5 2.5 3 9'/%3E%3C/svg%3E");
  --icon-next: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 2.5 8 6l-3.5 3.5'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0D0E10;
    --card: #17191C;
    --sunk: #202327;
    --line: #2A2E33;
    --line-2: #3A3F45;
    --ink: #F2F1ED;
    --ink-2: #A2A7AF;
    --accent: #4CD69F;
    --accent-hover: #6FE0B2;
    --on-accent: #05271A;
    --accent-soft: #143327;
    --accent-ink: #7EE3BA;
    --pos: #5BD8A2;
    --neg: #FF8A5C;
    --neg-soft: #3A1E14;
    --felt: #11281F;
    --felt-line: #24513F;
    --chart: #24443A;
    --glass: rgba(23, 25, 28, .86);
    --backdrop: rgba(0, 0, 0, .6);
    --shadow: 0 12px 32px -14px rgba(0, 0, 0, .7);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%23A2A7AF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E");
  }
}

/* ---------- base */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--bg); font: 400 15px/1.5 var(--sans); }

a { color: inherit; text-decoration-color: var(--line-2); text-underline-offset: 3px; transition: color var(--t) var(--ease), text-decoration-color var(--t) var(--ease); }
a:hover { text-decoration-color: var(--ink-2); }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
main.wrap { padding-top: 32px; padding-bottom: 72px; min-height: 70vh; }
#view.enter > * { animation: view-in 200ms var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }

h1 { margin: 0 0 6px; max-width: 28ch; font: 600 30px/1.12 var(--sans); letter-spacing: -.03em; overflow-wrap: anywhere; }
h2 { margin: 0 0 12px; font: 600 17px/1.3 var(--sans); letter-spacing: -.01em; }
h3 { margin: 0; font: 600 19px/1.3 var(--sans); letter-spacing: -.015em; }
p { max-width: 64ch; }
.sub { margin: 0; max-width: 64ch; color: var(--ink-2); font-size: 14px; line-height: 1.45; }
.lead { margin: 0 0 24px; max-width: 46ch; color: var(--ink-2); font-size: 17px; line-height: 1.5; }
.stat { margin: 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.45; }
.stat b { color: var(--ink); font-weight: 600; }
.stat.inline { display: inline-flex; align-items: center; gap: 8px; }
.stat.inline select { width: auto; height: 36px; }
.hint { margin: 0; max-width: 64ch; color: var(--ink-2); font-size: 13px; line-height: 1.45; }
.notes { margin: 0; color: var(--ink-2); white-space: pre-wrap; }
.none { color: var(--ink-2); }
.grow { flex: 1; }
.up { color: var(--pos); }
.down { color: var(--neg); }

/* every number that is money, a count, a rank or a date */
.tile-value, .rank-n, .rank-val, .col-year, .chart-readout, .stat b, .statline dd, .stepper, .steps li::before,
.seat .n, .seat .earn, .felt .center b, .chip, .pill, .date-tile {
  font-variant-numeric: tabular-nums;
}

/* ---------- surfaces: white cards with a hairline on a warm ground; no boxes inside boxes */
.panel { margin-bottom: 16px; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-4); }
.panel > :last-child { margin-bottom: 0; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.panel-head h2 { flex: 1 1 160px; margin: 0; }
.panel-head > .btn, .panel-head > button { height: 36px; padding: 0 14px; font-size: 14px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.cols .panel { margin-bottom: 0; }

/* ---------- header, navigation and footer */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 8px; height: 44px; margin-right: auto; color: var(--ink); font: 600 19px/1 var(--sans); letter-spacing: -.02em; text-decoration: none; }
.brand img { display: block; width: 28px; height: 28px; }
.brand b { font-weight: 600; color: var(--accent-ink); }
.site-nav { display: flex; gap: 4px; }
.site-nav a {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: var(--r-pill);
  color: var(--ink-2); font: 500 14px/1 var(--sans); text-decoration: none; transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.site-nav a:hover { color: var(--ink); background: var(--sunk); }
.site-nav a[aria-current] { color: var(--accent-ink); background: var(--accent-soft); }
.site-nav svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.site-footer { border-top: 1px solid var(--line); }
.site-footer .wrap { padding-top: 24px; padding-bottom: 32px; }
.site-footer p { margin: 0; max-width: 64ch; color: var(--ink-2); font-size: 12.5px; line-height: 1.5; }

/* ---------- controls */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 16px;
  color: var(--ink); background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r-2);
  font: 500 15px/1 var(--sans); white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease), transform var(--t) var(--ease);
}
button:hover, .btn:hover { background: var(--sunk); }
button:active, .btn:active { transform: scale(.98); }
button:disabled { color: var(--ink-2); cursor: progress; }
button.primary, .btn.primary { color: var(--on-accent); background: var(--accent); border-color: var(--accent); font-weight: 600; }
button.primary:hover, .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.primary:disabled { color: var(--on-accent); opacity: .75; }
button.danger { color: var(--neg); }
button.danger:hover { background: var(--neg-soft); border-color: var(--neg); }
.btn.icon { width: 44px; padding: 0; }
svg.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

input, select, textarea {
  width: 100%; height: 48px; padding: 0 14px; color: var(--ink); background: var(--card);
  border: 1px solid var(--line-2); border-radius: var(--r-2); font: 400 16px/1.3 var(--sans);   /* 16px stops phones zooming in */
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
input:hover, select:hover, textarea:hover { border-color: var(--ink-2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--ink-2); opacity: 1; }
textarea { height: auto; padding: 12px 14px; font-size: 14px; line-height: 1.5; resize: vertical; }
select { -webkit-appearance: none; appearance: none; padding-right: 36px; background-image: var(--chevron); background-repeat: no-repeat; background-position: right 14px center; cursor: pointer; }
select option { color: var(--ink); background: var(--card); }
input[type=checkbox] { width: 20px; height: 20px; padding: 0; accent-color: var(--accent); }
input[type=checkbox]:focus { box-shadow: none; }

.form { display: grid; gap: 16px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 6px; grid-column: 1 / -1; min-width: 0; }
.field.half { grid-column: auto; }
.field > span { font-size: 14px; font-weight: 500; line-height: 1.4; }
.field small { color: var(--ink-2); font-size: 12.5px; line-height: 1.4; }
.field.check { display: flex; flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 10px; min-height: 44px; }
.field.check > span { font-size: 15px; font-weight: 400; }
.form-error, .banner { margin: 0; padding: 12px 14px; color: var(--ink); background: var(--neg-soft); border-radius: var(--r-2); font-size: 14px; line-height: 1.45; }
.form-error:empty { display: none; }
.banner { margin-bottom: 16px; }
.dialog-actions, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* the "…" menu: the less used actions of a page */
details.menu { position: relative; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu[open] > summary { background: var(--sunk); }
.menu-list {
  position: absolute; z-index: 30; top: calc(100% + 6px); right: 0; display: grid; min-width: 232px; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--shadow);
}
.menu-list > button, .menu-list > .btn { justify-content: flex-start; width: 100%; padding: 0 12px; background: none; border: 0; border-radius: 10px; font-weight: 400; }
.menu-list > button:hover, .menu-list > .btn:hover { background: var(--sunk); }

/* ---------- page head */
.intro { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 24px; }
.intro > div:first-child { flex: 1 1 320px; min-width: 0; }
.intro h1:last-child { margin-bottom: 0; }
.back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: -8px 0 4px; color: var(--accent-ink); font-size: 15px; font-weight: 500; text-decoration: none; }
.back::before { content: ""; width: 8px; height: 8px; margin-left: 3px; border: solid currentColor; border-width: 0 0 2px 2px; transform: rotate(45deg); }
.back:hover { text-decoration: underline; }
/* one small icon wherever a link opens a new tab */
a[target="_blank"]::after {
  content: ""; display: inline-block; flex: none; width: 12px; height: 12px; margin-left: 5px; vertical-align: -1px; background: currentColor;
  -webkit-mask: var(--icon-external) center / contain no-repeat; mask: var(--icon-external) center / contain no-repeat;
}
a.btn[target="_blank"]::after { margin-left: 0; }

/* ---------- the dashboard hero: who, then one big figure. Always written section.hero, because a
   player's own seat is .seat.hero. */
section.hero { margin-bottom: 20px; }
.who { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.who > div { flex: 1; min-width: 0; }
.who h1 { margin: 0; font-size: 20px; letter-spacing: -.015em; }
.who .sub { font-size: 13px; }
.avatar { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-ink); font-size: 15px; font-weight: 600; }
section.hero .tile-label { font-size: 14px; }
section.hero .tile-value { margin: 4px 0 0; font-size: clamp(44px, 12vw, 64px); line-height: 1.02; letter-spacing: -.045em; }
.figure-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; color: var(--ink-2); font-size: 13.5px; }
section.hero .stat { margin-top: 12px; }

/* the same big figure on a series page, with its return beside it */
.summary { margin-bottom: 16px; }
.figure-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.summary .tile-value { margin: 4px 0 0; font-size: 40px; line-height: 1.05; letter-spacing: -.04em; }

.pill { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: var(--r-pill); background: var(--sunk); color: var(--ink); font-size: 13px; font-weight: 500; white-space: nowrap; }
.pill.up { background: var(--accent-soft); color: var(--accent-ink); }
.pill.down { background: var(--neg-soft); color: var(--neg); }

/* ---------- stat tiles: small cards in a grid */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin: 0 0 24px; }
.tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile { min-width: 0; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-3); }
.tile-label { color: var(--ink-2); font-size: 13px; line-height: 1.4; }
.tile-value { margin: 4px 0 2px; font-size: 22px; font-weight: 600; line-height: 1.15; letter-spacing: -.02em; overflow-wrap: anywhere; }
.tile-note { color: var(--ink-2); font-size: 12.5px; line-height: 1.4; }
.statline { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 20px 0 0; }
.statline > div { padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-3); }
.statline dt { color: var(--ink-2); font-size: 13px; line-height: 1.4; }
.statline dd { margin: 4px 0 0; font-size: 20px; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; }
.statline .tile-note { display: block; margin-top: 2px; font-weight: 400; letter-spacing: 0; }

/* ---------- lists: rows divided by hairlines */
.rank, .rows { list-style: none; margin: 0; padding: 0; }
.rank li + li, .rows li + li { border-top: 1px solid var(--line); }
.rank li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 12px; align-items: center; min-height: 64px; padding: 12px 0; }
.rank li:has(.rank-n:empty) { grid-template-columns: minmax(0, 1fr) auto; }
.rank-n:empty { display: none; }
.rank-n { display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 6px; border-radius: var(--r-2); background: var(--sunk); color: var(--ink-2); font-size: 13px; font-weight: 600; }
.rank li.win .rank-n { background: var(--accent-soft); color: var(--accent-ink); }
.rank-name { display: block; min-width: 0; font-size: 15px; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.rank-meta { display: block; margin-top: 2px; color: var(--ink-2); font-size: 13px; font-weight: 400; line-height: 1.4; }
.rank-val { font-size: 15px; font-weight: 600; line-height: 1.3; white-space: nowrap; text-align: right; }
.row-link {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: center; min-height: 64px;
  margin: 0 -10px; padding: 10px; color: inherit; text-decoration: none; border-radius: var(--r-2); transition: background var(--t) var(--ease);
}
.row-link:has(> .chip, > .row-icon, > .date-tile) { grid-template-columns: auto minmax(0, 1fr) auto; }
.row-link.static:has(.lookup) { grid-template-columns: auto minmax(0, 1fr) auto auto; }
a.row-link:hover, button.row-link:hover { background: var(--sunk); }
.row-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-2); background: var(--felt); color: var(--accent-ink); }
.date-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 44px; height: 48px; border-radius: var(--r-2); background: var(--sunk); color: var(--ink-2); font-size: 11px; line-height: 1.2; }
.date-tile b { color: var(--ink); font-size: 17px; font-weight: 600; line-height: 1.15; }
.row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.lookup { color: var(--accent-ink); font-size: 13px; text-decoration: none; white-space: nowrap; }
.lookup:hover { text-decoration: underline; }
.pick { max-height: 46vh; overflow-y: auto; }
.pick button.row-link { width: 100%; height: auto; margin: 0; background: none; border: 0; font-weight: 400; text-align: left; white-space: normal; }
.pick .none { padding: 12px 0; }

/* a label in a row (a day, a seat) is a small grey pill; a status is a dot and a word */
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: var(--r-pill); background: var(--sunk); color: var(--ink-2); font-size: 12px; font-weight: 500; white-space: nowrap; }
.chip.playing, .chip.upcoming, .chip.finished { gap: 6px; height: auto; padding: 0; background: none; font-size: 12.5px; }
.chip.playing::before, .chip.upcoming::before, .chip.finished::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--ink-2); }
.chip.upcoming::before { background: none; box-shadow: inset 0 0 0 2px var(--accent); }
.chip.playing { color: var(--pos); }
.chip.playing::before { background: var(--pos); box-shadow: 0 0 0 3px var(--accent-soft); animation: pulse 2s var(--ease) infinite alternate; }
@keyframes pulse { from { opacity: .55; } to { opacity: 1; } }

/* segmented control: filters a list in place */
.seg { display: flex; gap: 4px; margin-bottom: 8px; padding: 4px; background: var(--sunk); border-radius: 14px; }
.seg button { flex: 1 1 0; height: 36px; padding: 0 8px; color: var(--ink-2); background: none; border: 0; border-radius: 10px; font-size: 14px; }
.seg button:hover { color: var(--ink); background: none; }
.seg button[aria-pressed="true"] { color: var(--ink); background: var(--card); box-shadow: var(--shadow-sm); }

/* empty states (an empty seat shares the class name, so it is excluded) */
.empty:not(.seat) { padding: 8px 0; }
.empty:not(.seat)::before { content: ""; display: block; width: 56px; height: 34px; margin-bottom: 16px; background: var(--felt); border: 2px solid var(--felt-line); border-radius: var(--r-pill); }
.empty-title { margin-bottom: 4px; font-size: 16px; font-weight: 600; line-height: 1.3; }
.empty p { margin: 0 0 16px; max-width: 52ch; color: var(--ink-2); }
.empty p:last-child { margin-bottom: 0; }

/* ---------- earnings by year: one bar per year; the chosen year is green and named above */
.chart-readout { color: var(--ink-2); font-size: 14px; }
.chart-readout b { color: var(--ink); font-weight: 600; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 168px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.col { flex: 1 0 28px; min-width: 28px; height: 100%; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px; padding: 0; color: var(--ink-2); background: none; border: 0; border-radius: var(--r-1); }
.col:hover { background: none; }
.col:active { transform: none; }
.col-bar { display: block; width: 100%; max-width: 44px; background: var(--chart); border-radius: var(--r-1); transition: background var(--t) var(--ease); }
.col:hover .col-bar { background: var(--felt-line); }
.col.on .col-bar { background: var(--accent); }
.col-bar.zero { background: var(--line-2); }
.col-year { font-size: 11px; line-height: 1; white-space: nowrap; }
.col.on .col-year { color: var(--ink); font-weight: 600; }

/* ---------- My profile: grouped settings lists, one row per action */
.settings-title { margin: 28px 0 10px; }
.settings-note { margin: -4px 0 12px; }
.panel.settings { padding: 0 16px; overflow: hidden; }
.setting {
  display: flex; align-items: center; justify-content: flex-start; gap: 12px; width: calc(100% + 32px); height: auto; min-height: 64px;
  margin: 0 -16px; padding: 12px 16px; color: var(--ink); background: none; border: 0; border-radius: 0;
  font: inherit; text-align: left; text-decoration: none; white-space: normal;
}
.setting + .setting { border-top: 1px solid var(--line); }
.setting:hover { background: var(--sunk); }
.setting:active { transform: none; }
.setting-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.setting-text b { font-size: 15px; font-weight: 500; line-height: 1.35; }
.setting-text small { color: var(--ink-2); font-size: 13px; line-height: 1.4; }
.setting.danger b { color: var(--neg); }
.setting::after { content: ""; flex: none; width: 14px; height: 14px; background: var(--ink-2); -webkit-mask: var(--icon-next) center / contain no-repeat; mask: var(--icon-next) center / contain no-repeat; }
.setting[target="_blank"]::after { -webkit-mask-image: var(--icon-external); mask-image: var(--icon-external); }

/* ---------- onboarding */
.onboard { max-width: 560px; }
.onboard section.hero { margin-bottom: 16px; }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; color: var(--ink-2); font-size: 13px; line-height: 1; }
.stepper span { display: flex; flex: 0 1 180px; gap: 6px; }
.stepper i { flex: 1; height: 4px; border-radius: var(--r-pill); background: var(--line-2); }
.stepper i[data-on] { background: var(--accent); }
.steps { list-style: none; counter-reset: step; display: grid; gap: 12px; margin: 0; padding: 0; color: var(--ink-2); }
.steps li { counter-increment: step; display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: 12px; align-items: start; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 26px; height: 26px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 600; line-height: 1; }
.steps li > .btn { justify-self: start; }

/* ---------- dialogs */
dialog.dialog {
  width: min(520px, 100vw - 32px); max-height: calc(100vh - 32px); padding: 24px; overflow-y: auto;
  color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-5); box-shadow: var(--shadow);
  animation: dialog-in 200ms var(--ease);
}
dialog.dialog::backdrop { background: var(--backdrop); }
dialog.dialog form { display: grid; gap: 16px; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px); } }

/* ---------- the table: a felt oval, seats as small cards around it */
.felt-wrap { position: relative; aspect-ratio: 2 / 1; min-height: 300px; margin: 48px 32px; }
.felt {
  position: absolute; inset: 9% 12%; display: flex; align-items: center; justify-content: center; text-align: center;
  background: var(--felt); border: 2px solid var(--felt-line); border-radius: var(--r-pill);
}
.felt::before { content: ""; position: absolute; inset: 12px; border: 1px solid var(--felt-line); border-radius: var(--r-pill); opacity: .6; }
.felt .center { position: relative; color: var(--ink-2); font-size: 13px; line-height: 1.4; }
.felt .center b { display: block; margin-top: 4px; color: var(--accent-ink); font-size: 22px; font-weight: 600; line-height: 1; letter-spacing: -.02em; }
.seat {
  position: absolute; display: block; width: 124px; height: auto; min-height: 44px; padding: 8px; transform: translate(-50%, -50%);
  color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--shadow-sm);
  font: 400 13px/1.3 var(--sans); text-align: center; white-space: normal; user-select: none;
}
button.seat:hover { background: var(--card); border-color: var(--line-2); }
button.seat:active { transform: translate(-50%, calc(-50% + 1px)); }
.seat.empty { color: var(--ink-2); background: var(--bg); border: 1.5px dashed var(--felt-line); box-shadow: none; }
.seat.empty:hover { background: var(--sunk); }
.seat.hero { border: 2px solid var(--accent); }
.seat.hero::after { content: "You"; position: absolute; top: -10px; right: -8px; height: 20px; padding: 0 7px; border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent); font-size: 10.5px; font-weight: 600; line-height: 20px; }
.seat .n { color: var(--ink-2); font-size: 11px; line-height: 1.3; }
.seat .nm { overflow: hidden; font-size: 13.5px; font-weight: 600; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.seat.empty .nm { font-weight: 400; }
.seat .earn { color: var(--ink-2); font-size: 12.5px; line-height: 1.3; }
.felt-wrap + .hint { margin: 0 auto; text-align: center; }

/* ---------- wide screens: the header turns to glass; under 1024px columns stack */
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  @media (min-width: 768px) {
    .site-header { background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
  }
}
@media (max-width: 1023px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- phones and small tablets: the navigation is a floating bar at the bottom, in thumb reach.
   The header has no backdrop-filter here, because that would pin the bar to the header instead of the screen. */
@media (max-width: 767px) {
  .site-nav {
    position: fixed; z-index: 20; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); height: 64px; padding: 6px;
    justify-content: space-around; background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-5); box-shadow: var(--shadow);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  }
  .site-nav a { flex: 1 1 0; flex-direction: column; justify-content: center; gap: 3px; height: 52px; padding: 0; border-radius: 18px; font-size: 11px; }
  .site-nav a[aria-current] { font-weight: 600; }
  .site-nav svg { width: 22px; height: 22px; }
  main.wrap { padding-bottom: 48px; }
  .site-footer .wrap { padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
}

/* ---------- under 640px */
@media (max-width: 639px) {
  :root { --gutter: 16px; --header-h: 56px; }
  main.wrap { padding-top: 20px; }
  h1 { font-size: 26px; }
  .panel { padding: 16px; }
  .fields { grid-template-columns: 1fr; }
  /* one wide main button, with the "…" menu beside it */
  .intro .actions { width: 100%; flex-wrap: nowrap; }
  .intro .actions > :first-child { flex: 1; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 20px; }
  .tiles:not(.three) > .tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .tiles.three .tile { padding: 12px; }
  .tiles.three .tile-value { font-size: 18px; }
  .row-link.static:has(.lookup) { grid-template-columns: auto minmax(0, 1fr) auto; }
  .row-link.static .rank-val { grid-area: 1 / 3; }
  .row-link.static .lookup { grid-area: 2 / 2 / 3 / -1; margin-top: 4px; }
  .felt-wrap { aspect-ratio: 3 / 4; margin: 48px 0; }
  .felt { inset: 9% 17%; }
  .felt .center b { font-size: 17px; }
  .seat { width: 96px; padding: 8px 4px; }
  .seat .nm { font-size: 12.5px; }
  /* dialogs are sheets from the bottom; where the main button is last, buttons stack with it on top */
  dialog.dialog {
    width: 100%; max-width: 100%; margin: auto 0 0; padding: 12px 20px calc(20px + env(safe-area-inset-bottom));
    border-width: 1px 0 0; border-radius: var(--r-5) var(--r-5) 0 0; animation-name: sheet-in;
  }
  dialog.dialog::before { content: ""; display: block; width: 36px; height: 4px; margin: 0 auto 16px; border-radius: var(--r-pill); background: var(--line-2); }
  .dialog-actions:has(> .primary:last-child) { flex-direction: column-reverse; align-items: stretch; }
  .dialog-actions:has(> .primary:last-child) > .grow { display: none; }
  .dialog-actions:has(> .primary:last-child) > button, .dialog-actions:has(> .primary:last-child) > .btn { width: 100%; height: 48px; }
}
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }

/* nothing moves for people who ask for less motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
