/* Goose: "Clubhouse, not arcade." Calm and well made on the outside, a
   tabloid inside. Daisy's pine is the family nose, cream is the ground, amber
   is reserved for the two things a league needs from you (enter a score,
   confirm one), tennis-ball yellow is a 1% highlight. Full direction in
   docs/ART-DIRECTION.md. Phone first: every rule below is written for 375px
   and widened at the end. */

:root {
  --bg: #f6f3ec;
  --surface: #fffdf8;
  --surface-2: #ebe7dd;
  --line: #d9d4c7;
  --line-strong: #bfb9aa;
  --ink: #1f2a27;
  --ink-2: #3c4a46;
  --muted: #5c6b66;
  --primary: #1f6b58;
  --primary-ink: #ffffff;
  --primary-soft: #dcebe3;
  --accent: #ec7a5f;
  --accent-ink: #1f2a27;
  --accent-soft: #fde0d6;
  --highlight: #ffe066;
  --mint: #bfe7d7;
  --mint-soft: #e2f4ec;
  --sun: #ffe066;
  --sun-soft: #fff4c4;
  --coral: #ec7a5f;
  --coral-soft: #fde0d6;
  --teal: #4aa98f;
  --teal-soft: #d5eee5;
  --win: #1f6b58;
  --win-soft: #dcebe3;
  --loss: #b5452e;
  --loss-soft: #f6ddd5;
  --shadow: 0 1px 2px rgba(31, 42, 39, 0.06), 0 6px 16px rgba(31, 42, 39, 0.06);
  --flock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='64' viewBox='0 0 120 64'%3E%3Cg fill='none' stroke='%231f2a27' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 20l6 5 6-5'/%3E%3Cpath d='M28 12l6 5 6-5'/%3E%3Cpath d='M48 22l6 5 6-5'/%3E%3Cpath d='M78 44l6 5 6-5'/%3E%3Cpath d='M98 36l6 5 6-5'/%3E%3C/g%3E%3C/svg%3E");
  --flock-opacity: 0.08;

  --r-s: 8px;
  --r-m: 14px;
  --r-l: 22px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  --display: "Anton", Impact, "Arial Narrow", sans-serif;
  --body: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141b19;
    --surface: #1d2624;
    --surface-2: #27322f;
    --line: #33403c;
    --line-strong: #47554f;
    --ink: #f1ede4;
    --ink-2: #cfd6d2;
    --muted: #9eaba6;
    --primary: #4fc3a5;
    --primary-ink: #141b19;
    --primary-soft: #1e3d35;
    --accent-soft: #48291f;
    --mint: #2c5a4c;
    --mint-soft: #1d332d;
    --sun: #e8c84a;
    --sun-soft: #3d3820;
    --coral: #ec7a5f;
    --coral-soft: #48291f;
    --teal: #4aa98f;
    --teal-soft: #1f3d35;
    --win: #4fc3a5;
    --win-soft: #1e3d35;
    --loss: #f08a6e;
    --loss-soft: #40261f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 20px rgba(0, 0, 0, 0.35);
    --flock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='64' viewBox='0 0 120 64'%3E%3Cg fill='none' stroke='%23f1ede4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 20l6 5 6-5'/%3E%3Cpath d='M28 12l6 5 6-5'/%3E%3Cpath d='M48 22l6 5 6-5'/%3E%3Cpath d='M78 44l6 5 6-5'/%3E%3Cpath d='M98 36l6 5 6-5'/%3E%3C/g%3E%3C/svg%3E");
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

/* Feel like an app, not a web page. */
html, body { overscroll-behavior-y: none; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: calc(5.75rem + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-font-smoothing: antialiased;
}
.btn, .tabs, .votes, .choice, .brand, .me, .row { -webkit-user-select: none; user-select: none; }
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.18s; }
.tabs { view-transition-name: tabs; }
.topbar { view-transition-name: topbar; }

a { color: inherit; }
img, svg { display: block; }
h1, h2, h3 { line-height: 1.15; margin: 0; text-wrap: balance; }
p { margin: 0; }
.num, table, .score, .sets, .stats b, .pts, .pos { font-variant-numeric: tabular-nums; }

/* ── Chrome ─────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 44rem;
  margin: 0 auto;
  padding: max(0.75rem, env(safe-area-inset-top)) 1rem 0.6rem;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.viewing-as + .topbar { top: 2.6rem; padding-top: 0.6rem; }

.brand { display: flex; align-items: center; gap: 0.45rem; text-decoration: none; font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; }
.brand svg { width: 1.9rem; height: 1.9rem; }

.me {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.25rem 0.8rem 0.25rem 0.3rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.page { max-width: 44rem; margin: 0 auto; padding: 0.5rem 1rem 2rem; }
.page.wide { max-width: 60rem; }
body:has(.page.wide) .topbar, body:has(.page.wide) .flash { max-width: 60rem; }

.stack > * + * { margin-top: 0.75rem; }
.stack-lg > * + * { margin-top: 1.5rem; }

/* Bottom tab bar. Active = pine icon and label with a short bar above. */
.tabs {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  padding: 0.25rem 0.5rem env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.tabs nav { display: flex; width: 100%; max-width: 30rem; }
.tabs a {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 56px;
  text-decoration: none;
  font-size: 0.69rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.12s var(--ease);
}
.tabs a .tab-ico { display: grid; place-items: center; height: 1.5rem; font-size: 1.25rem; line-height: 1; }
.tabs a[aria-current="page"] { color: var(--primary); }
.tabs a[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 0;
  width: 20px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--primary);
}

.flash { max-width: 44rem; margin: 0.25rem auto 0; padding: 0 1rem; }
.flash p {
  padding: 0.75rem 1rem;
  border-radius: var(--r-m);
  font-weight: 500;
  background: var(--primary-soft);
  color: var(--ink);
  animation: enter 0.22s var(--ease);
}
.flash p.alert { background: var(--loss-soft); color: var(--loss); }
@keyframes enter { from { transform: translateY(8px); opacity: 0; } }

/* ── Type ───────────────────────────────────────────────── */

.eyebrow { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.eyebrow a { color: var(--primary); text-decoration: none; }
.title { font-size: 1.75rem; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; font-variation-settings: "opsz" 96; }
.subtitle { font-size: 1.375rem; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.small { font-size: 0.9375rem; }
.tiny { font-size: 0.8125rem; }
.tabloid { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: 0.01em; line-height: 0.98; }

/* ── Surfaces ───────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 1rem;
}
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
.card-head a { font-size: 0.9375rem; font-weight: 600; color: var(--primary); text-decoration: none; }

/* The one hero card on a screen: bigger radius, the only soft shadow, and
   the flock drifting behind its top. */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-l);
  padding: 1.25rem 1rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--ink);
}
.hero::before, .flock::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 96px;
  background: var(--flock) 0 0 / 120px 64px repeat-x;
  opacity: var(--flock-opacity);
  pointer-events: none;
}
.flock { position: relative; }
.hero > * { position: relative; }
.hero .eyebrow { color: var(--muted); }
.hero.beak { background: var(--surface); }

.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty strong { color: var(--ink); }

/* ── Controls ───────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 48px;
  padding: 0 1.25rem;
  border-radius: var(--r-m);
  border: 1px solid transparent;
  background: var(--primary);
  color: var(--primary-ink);
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s var(--ease), filter 0.12s var(--ease), background-color 0.12s var(--ease);
}
.btn:active { transform: scale(0.98); filter: brightness(0.92); }
.btn:focus-visible { outline: 3px solid var(--primary-soft); outline-offset: 2px; }
/* Amber is reserved for the two actions a league needs: enter and confirm a score. */
.btn.accent { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn.green { background: var(--primary); color: var(--primary-ink); }
.btn.danger { background: var(--surface); color: var(--loss); border-color: color-mix(in srgb, var(--loss) 40%, transparent); }
.btn.small { min-height: 40px; padding: 0 0.9rem; font-size: 0.9375rem; border-radius: var(--r-s); }
.btn.block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.link-btn { background: none; border: 0; padding: 0; min-height: 44px; font: inherit; color: var(--primary); font-weight: 600; text-decoration: none; cursor: pointer; }
.link-btn.small, .link-btn.tiny { min-height: 32px; }

form .field + .field { margin-top: 1rem; }
label, .label { display: block; font-weight: 600; font-size: 0.9375rem; margin-bottom: 0.4rem; }
.hint { display: block; font-size: 0.8125rem; color: var(--muted); font-weight: 400; margin-top: 0.3rem; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="search"], select, textarea {
  width: 100%;
  min-height: 48px;
  font: inherit;
  font-size: 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--r-s);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.12s var(--ease), box-shadow 0.12s var(--ease);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea { min-height: 6rem; resize: vertical; }

.code-input { text-align: center; font-size: 2rem !important; letter-spacing: 0.4em; font-weight: 600; padding-left: 1.2rem !important; font-variant-numeric: tabular-nums; }

.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0.5rem; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; }
.choice span {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 52px;
  height: 100%;
  padding: 0.7rem 0.8rem;
  border-radius: var(--r-m);
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.12s var(--ease), background-color 0.12s var(--ease);
}
.choice span small { display: block; font-weight: 400; color: var(--muted); font-size: 0.8125rem; margin-top: 0.15rem; }
.choice input:checked + span { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.choice input:focus-visible + span { outline: 3px solid var(--primary-soft); outline-offset: 2px; }

.emoji-picks { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.emoji-picks .choice span { min-height: 48px; min-width: 48px; padding: 0.4rem; align-items: center; font-size: 1.5rem; line-height: 1; border-radius: 999px; }

.errors { background: var(--loss-soft); color: var(--loss); border-radius: var(--r-m); padding: 0.75rem 1rem; font-weight: 500; font-size: 0.9375rem; }
.errors ul { margin: 0.25rem 0 0; padding-left: 1.1rem; }

.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 0.4rem; }
.checklist label { display: flex; align-items: center; gap: 0.5rem; min-height: 44px; font-weight: 500; padding: 0.4rem 0.7rem; border-radius: var(--r-s); border: 1px solid var(--line); margin: 0; cursor: pointer; }
.checklist label.taken { opacity: 0.45; }

details > summary { cursor: pointer; font-weight: 600; list-style: none; min-height: 44px; display: flex; align-items: center; color: var(--primary); }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "+"; display: inline-block; width: 1.1rem; font-weight: 700; }
details[open] > summary::before { content: "−"; }

/* ── Bits ───────────────────────────────────────────────── */

/* Avatars: the one place emoji live, framed so every phone draws them alike. */
.avatar {
  display: inline-grid;
  place-items: center;
  width: 2.5rem; height: 2.5rem;
  border-radius: 50%;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 1.3rem;
  flex: none;
}
.avatar.lg { width: 4rem; height: 4rem; font-size: 2.1rem; }
.avatar.sm { width: 2.25rem; height: 2.25rem; font-size: 1.15rem; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--ink-2);
  white-space: nowrap;
}
.pill.green { background: var(--win-soft); color: var(--primary); }
.pill.beak { background: var(--accent-soft); color: var(--ink); }
.pill.alert { background: var(--loss-soft); color: var(--loss); }
.pill.ball { background: var(--highlight); color: #1f2a27; }

.row { display: flex; align-items: center; gap: 0.75rem; min-height: 60px; padding: 0.6rem 1rem; text-decoration: none; }
.row + .row { border-top: 1px solid var(--line); }
a.row { transition: background-color 0.12s var(--ease); }
a.row:active { background: var(--surface-2); }
.row .grow { flex: 1; min-width: 0; }
.row .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.grid-2 { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }

.matchup { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.75rem; text-align: center; }
.matchup .side { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; font-weight: 600; }
.matchup .side.won { color: var(--primary); }
.matchup .vs { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.08em; color: var(--muted); }

.sets { display: inline-flex; gap: 0.25rem; }
.sets b {
  display: inline-grid;
  place-items: center;
  min-width: 2.4rem;
  min-height: 1.9rem;
  padding: 0 0.35rem;
  border-radius: var(--r-s);
  background: var(--surface-2);
  font-weight: 600;
  font-size: 0.9375rem;
}
.sets b.w { background: var(--win-soft); color: var(--primary); }

/* Standings. Numbers are tabular so columns never wobble. */
.table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.table th { text-align: right; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 0.6rem 0.5rem; background: var(--surface-2); }
.table td { text-align: right; height: 60px; padding: 0.5rem; border-bottom: 1px solid var(--line); font-weight: 500; color: var(--ink-2); }
.table tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { text-align: left; padding-left: 1rem; }
.table th:last-child, .table td:last-child { padding-right: 1rem; }
.table th.player, .table td.player { text-align: left; width: 100%; }
.table .who { display: flex; align-items: center; gap: 0.65rem; text-align: left; }
.table .who a, .table .who strong { font-weight: 600; text-decoration: none; color: var(--ink); }
.table .who small { display: block; color: var(--muted); font-size: 0.8125rem; font-weight: 500; }
.table tr.you td { background: var(--primary-soft); }
.table tr.you td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.table .pos { width: 1.6rem; font-weight: 500; color: var(--muted); }
.table .pts { font-weight: 700; color: var(--ink); font-size: 1.1rem; }
.table-wrap { overflow-x: auto; }
.form { display: inline-flex; gap: 4px; vertical-align: middle; margin-left: 0.2rem; }
.form i { width: 8px; height: 8px; border-radius: 50%; background: var(--loss); display: inline-block; }
.form i.W { background: var(--win); }

/* The league feed ("Latest"). */
.feed-item { padding: 1rem; }
.feed-item + .feed-item { border-top: 1px solid var(--line); }
.feed-item .tabloid { font-size: 1.625rem; color: var(--ink); }
.feed-item.joined .tabloid { font-size: 1.25rem; }
.feed-item.announcement { box-shadow: inset 4px 0 0 var(--highlight); }
.feed-item a { text-decoration: none; }
.feed-meta { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.6rem; }


/* Player card: the hero of its screen. */
.player-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-l);
  padding: 1.25rem 1rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.player-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 96px;
  background: var(--flock) 0 0 / 120px 64px repeat-x;
  opacity: var(--flock-opacity);
  pointer-events: none;
}
.player-card > * { position: relative; }
.player-card .title { font-size: 1.75rem; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; margin-top: 1rem; }
.stats div { display: flex; flex-direction: column; justify-content: center; min-height: 72px; background: var(--surface-2); border-radius: var(--r-m); padding: 0.5rem 0.25rem; text-align: center; }
.stats b { display: block; font-size: 1.75rem; line-height: 1.1; font-weight: 700; }
.stats small { font-size: 0.6875rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* Score entry: the one place for big numbers. */
.score-grid { display: grid; grid-template-columns: 4.25rem 1fr 1fr; gap: 0.5rem 0.6rem; align-items: center; }
.score-grid .head { font-size: 0.8125rem; font-weight: 600; color: var(--muted); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-grid input { text-align: center; min-height: 64px; font-size: 1.75rem; font-weight: 700; padding: 0.4rem; font-variant-numeric: tabular-nums; border-radius: var(--r-m); }
.score-grid .unit { font-size: 0.8125rem; font-weight: 600; color: var(--muted); }

/* Landing. */
.landing { text-align: center; padding-top: 1.5rem; }
.landing h1 { font-family: var(--display); font-weight: 400; font-size: clamp(2.5rem, 11vw, 4rem); text-transform: uppercase; line-height: 0.95; margin-top: 1.25rem; }
.landing .lede { font-size: 1rem; max-width: 26rem; margin: 0.9rem auto 0; color: var(--ink-2); }
.sport-strip { margin-top: 1rem; font-size: 0.8125rem; color: var(--muted); line-height: 1.6; }
.sport-strip .pill { background: none; padding: 0; font-weight: 500; font-size: 0.8125rem; color: var(--muted); }
.sport-strip .pill + .pill::before { content: "·"; margin: 0 0.35rem; }
.features { display: grid; gap: 0; text-align: left; margin-top: 2rem; }
.features .card { display: grid; grid-template-columns: 2rem 1fr; column-gap: 0.75rem; border: 0; border-radius: 0; background: none; padding: 0.9rem 0; border-top: 1px solid var(--line); }
.features .card .emoji { grid-row: span 2; font-size: 1.4rem; line-height: 1; color: var(--primary); padding-top: 0.15rem; }
.features .card b { display: block; font-size: 1.0625rem; font-weight: 600; }
.features .card p { color: var(--ink-2); font-size: 0.9375rem; }

.divider { display: flex; align-items: center; gap: 0.75rem; color: var(--muted); font-size: 0.8125rem; font-weight: 600; margin: 1.25rem 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.copy-box { display: flex; gap: 0.5rem; }
.copy-box input { font-size: 0.875rem; }
.copy-box .btn { flex: none; }

.round-label { padding: 0.5rem 1rem; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }

/* Staff "view as" bar, shown in the app while impersonating. */
.viewing-as {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center; gap: 0.75rem; white-space: nowrap;
  height: calc(2.6rem + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 1rem 0;
  background: var(--ink); color: var(--bg); font-size: 0.875rem; font-weight: 600;
}
.viewing-as .btn { min-height: 32px; padding: 0 0.75rem; border-color: var(--bg); }

/* Install prompt. */
.install { display: flex; gap: 0.85rem; align-items: center; background: var(--primary); color: var(--primary-ink); border: 0; }
.install[hidden], .install [hidden] { display: none; }
.install img { width: 3rem; height: 3rem; border-radius: 12px; flex: none; }
.install .grow { flex: 1; min-width: 0; }
.install .link-btn { color: var(--primary-ink); opacity: 0.8; }
.install .btn { background: var(--surface); color: var(--ink); }

/* Icons: one switch (config/icons.yml). */
.ico-emoji { font-style: normal; }
.big-ico { font-size: 2.5rem; line-height: 1; color: var(--primary); display: grid; place-items: center; }
.feed-item .feed-ico { float: left; margin: 0.1rem 0.6rem 0 0; font-size: 1.2rem; color: var(--primary); }

/* Phones: long nicknames truncate instead of stacking four lines tall. */
.table .who > span { min-width: 0; }
.table .who a, .table .who strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 11rem; }
@media (max-width: 480px) {
  .table .who a, .table .who strong { max-width: 8.5rem; }
  .hide-phone { display: none; }
}

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

/* Wider than a phone: more room, same app. */
@media (min-width: 720px) {
  .page { padding-top: 1rem; }
  .title { font-size: 2.125rem; }
  .feed-item .tabloid { font-size: 1.875rem; }
  .features { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
  .features .card { border-top: 0; display: block; }
  .features .card .emoji { margin-bottom: 0.5rem; }
}

/* Phosphor, the house icons: inline, currentColor, duotone fill at 20%. */
.ico-ph { display: inline-grid; place-items: center; vertical-align: -0.2em; line-height: 0; }
.ico-ph svg { width: 1.2em; height: 1.2em; }
.tabs a .tab-ico .ico-ph svg { width: 22px; height: 22px; }
.big-ico .ico-ph svg { width: 3.5rem; height: 3.5rem; }
.feed-item .feed-ico .ico-ph svg { width: 1.4rem; height: 1.4rem; }
.features .card .emoji .ico-ph svg { width: 1.6rem; height: 1.6rem; }

/* The goose (shared/_goose_sprite). One line, its own colours, five poses. */
.goose { display: block; width: 4.5rem; height: 4.5rem; overflow: visible; }
.goose-fly { width: 5rem; }
.goose-mark { width: 3.75rem; height: 3.75rem; margin: 0 auto; }
.brand .goose { width: 2.2rem; height: 2.3rem; }
.goose-cool { overflow: hidden; }
.landing .goose-hero { width: 8rem; height: 8rem; margin: 0 auto; animation: settle 0.6s var(--ease) both; }
@keyframes settle { from { transform: translateY(6px); opacity: 0; } }
.empty .goose { width: 4.5rem; height: 4.5rem; margin: 0 auto 0.75rem; }

/* League home: the flock drifts behind the title, and a goose peeks in. */
.league-head { position: relative; padding-right: 3rem; }
.league-head::before { inset: -0.5rem -1rem auto -1rem; height: 72px; }
.league-head > * { position: relative; }
.league-head .peek { position: absolute; right: -1rem; top: 0.25rem; width: 2.5rem; height: 3.25rem; }


/* Score entry: big numbers, steppers, the leading side tinted. */
.score-entry { display: grid; gap: 0.75rem; }
.score-heads { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.score-heads span { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.score-heads b { font-weight: 600; font-size: 0.9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-row .unit { display: flex; align-items: center; gap: 0.4rem; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.35rem; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.cell { display: grid; gap: 0.35rem; border-radius: var(--r-m); transition: background-color 0.15s var(--ease); }
.cell input {
  min-height: 72px; text-align: center; font-size: 2.5rem; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums; border-radius: var(--r-m); padding: 0.25rem;
  -moz-appearance: textfield;
}
.cell input::-webkit-outer-spin-button, .cell input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cell input::placeholder { color: var(--line-strong); }
.cell.leading input { background: var(--win-soft); border-color: var(--primary); color: var(--primary); }
.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem; }
.steps button {
  min-height: 44px; border-radius: var(--r-s); border: 1px solid var(--line); background: var(--surface-2);
  color: var(--ink); font: inherit; font-size: 1.25rem; font-weight: 600; cursor: pointer;
  transition: transform 0.12s var(--ease);
}
.steps button:active { transform: scale(0.95); }

/* The next-match hero on league home. */
.next-match { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.5rem; margin-top: 1rem; text-align: center; }
.next-match .side { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; min-width: 0; }
.next-match .side .avatar { width: 3rem; height: 3rem; font-size: 1.6rem; }
.next-match b { font-size: 1.0625rem; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-match .vs { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* Season so far: the last seven results, oldest first. */
.form-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.35rem; }
.result-chip {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1rem;
  min-height: 52px; border-radius: var(--r-s); text-decoration: none; font-variant-numeric: tabular-nums;
}
.result-chip b { font-size: 0.9375rem; font-weight: 700; }
.result-chip small { font-size: 0.6875rem; font-weight: 600; }
.result-chip.w { background: var(--win-soft); color: var(--primary); }
.result-chip.l { background: var(--loss-soft); color: var(--loss); }

/* Plain landing: one clear sentence, then how it works. */
.landing-title { font-family: var(--body) !important; text-transform: none !important; font-weight: 700 !important; font-size: clamp(1.9rem, 8vw, 2.75rem) !important; line-height: 1.1 !important; letter-spacing: -0.02em; margin-top: 1.25rem; text-wrap: balance; font-variation-settings: "opsz" 96; }
.how { list-style: none; counter-reset: how; padding: 0; margin: 2rem auto 0; max-width: 26rem; text-align: left; display: grid; gap: 1rem; }
.how li { counter-increment: how; display: grid; grid-template-columns: 2rem 1fr; column-gap: 0.75rem; }
.how li::before { content: counter(how); grid-row: span 2; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.how b { font-weight: 600; }
.how span { color: var(--ink-2); font-size: 0.9375rem; }

/* Feed: plain sentences, the result readable at a glance. */
.feed-text { font-size: 1.0625rem; font-weight: 600; line-height: 1.35; color: var(--ink); }
.feed-item.joined .feed-text { font-weight: 500; font-size: 1rem; }

/* Match scoreboard: names down the side, sets across. */
.scoreboard { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.scoreboard th, .scoreboard td { padding: 0.5rem 0.4rem; border-bottom: 1px solid var(--line); }
.scoreboard thead th { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); text-align: center; }
.scoreboard tbody th { text-align: left; font-weight: 500; max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scoreboard tbody td { text-align: center; font-size: 1.25rem; font-weight: 500; color: var(--muted); width: 3rem; }
.scoreboard tbody td.w { color: var(--ink); font-weight: 700; }
.scoreboard tr.won th { font-weight: 700; color: var(--primary); }
.scoreboard tr:last-child th, .scoreboard tr:last-child td { border-bottom: 0; }
.status-note { padding: 0.75rem 0.9rem; border-radius: var(--r-s); background: var(--surface-2); font-size: 0.9375rem; color: var(--ink-2); }

/* Season setup: a numbered checklist. */
.setup { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.setup > li { counter-increment: step; position: relative; display: grid; gap: 0.6rem; padding: 1rem 1rem 1rem 3.25rem; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--surface); }
.setup > li::before { content: counter(step); position: absolute; left: 1rem; top: 1rem; display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); font-weight: 700; font-size: 0.875rem; }
.setup > li.done::before { content: "✓"; background: var(--primary); color: var(--primary-ink); }
.setup-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.setup-head b { font-weight: 600; font-size: 1.0625rem; }
.entrant-row { display: flex; align-items: center; gap: 0.5rem; min-height: 52px; border-bottom: 1px solid var(--line); }
.entrant-row:last-child { border-bottom: 0; }
.btn:disabled, .btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.choices.stacked { grid-template-columns: 1fr; }

/* Roster (admin/members). */
.person-row { display: grid; grid-template-columns: 1fr 1.25fr; gap: 0.4rem; }
.person-row input { min-width: 0; }
.people-rows { display: grid; gap: 0.5rem; }
.roster-item + .roster-item { border-top: 1px solid var(--line); }
.roster-item .row + .row { border-top: 0; }
.roster-sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster-edit { padding: 0 1rem 0.75rem calc(1rem + 44px + 0.75rem); }
.roster-edit summary { font-size: 0.8125rem; color: var(--primary); font-weight: 600; }
.roster-edit[open] summary { margin-bottom: 0.6rem; }
.danger-text { color: var(--loss); }

/* ── Colour (Daisy palette) ─────────────────────────────
   Off-white ground with soft washes of mint, sunshine and coral behind the
   top of every screen; solid colour tiles for leagues and people, like app
   icons. Coral is the call to action (enter and confirm a score). */
body {
  background:
    radial-gradient(60rem 26rem at -10% -8rem, color-mix(in srgb, var(--mint) 70%, transparent), transparent 70%),
    radial-gradient(40rem 22rem at 115% 2rem, color-mix(in srgb, var(--sun) 45%, transparent), transparent 70%),
    radial-gradient(36rem 20rem at 60% 38rem, color-mix(in srgb, var(--coral-soft) 55%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
.topbar { background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.card { border-color: color-mix(in srgb, var(--line) 70%, transparent); box-shadow: 0 1px 2px rgba(31, 42, 39, 0.04); }

.avatar { box-shadow: none; }
.avatar.t-mint { background: var(--mint); }
.avatar.t-sun { background: var(--sun); }
.avatar.t-coral { background: var(--coral-soft); }
.avatar.t-teal { background: var(--teal-soft); }

.league-tile { display: inline-grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 16px; font-size: 1.8rem; flex: none; }
.league-tile.lg { width: 4.5rem; height: 4.5rem; border-radius: 20px; font-size: 2.4rem; }
.league-tile.t-mint { background: var(--mint); }
.league-tile.t-sun { background: var(--sun); }
.league-tile.t-coral { background: var(--coral); }
.league-tile.t-teal { background: var(--teal); }

/* The hero cards each get a colour. */
.hero { background: var(--surface); }
.hero.beak, .hero.sun { background: var(--sun-soft); border-color: color-mix(in srgb, var(--sun) 70%, transparent); }
.player-card { background: var(--mint-soft); border-color: color-mix(in srgb, var(--mint) 80%, transparent); }
.stats div:nth-child(1) { background: var(--mint); }
.stats div:nth-child(2) { background: var(--coral-soft); }
.stats div:nth-child(3) { background: var(--sun); }
.stats div:nth-child(4) { background: var(--teal-soft); }
.stats small { color: var(--ink-2); }

.pill.beak { background: var(--coral-soft); }
.pill.green { background: var(--mint); color: #1f4d40; }
.tabs a[aria-current="page"] .tab-ico { background: var(--mint); border-radius: 999px; padding: 0.1rem 0.9rem; }
.sets b { background: var(--surface-2); }
.sets b.w { background: var(--mint); color: #1f4d40; }
.setup li.done::before { background: var(--teal); border-color: var(--teal); }
.card.sun { background: var(--sun-soft); border-color: color-mix(in srgb, var(--sun) 70%, transparent); }
.card.sun .row + .row { border-color: color-mix(in srgb, var(--sun) 60%, transparent); }
/* On a phone the set scores drop under the names instead of squeezing them. */
@media (max-width: 640px) {
  .row:has(> .score) { flex-wrap: wrap; row-gap: 0.35rem; }
  .row > .score { order: 3; flex-basis: 100%; text-align: left !important; }
}

/* League band: the coloured header on every league page, public or not. */
.league-band { background: var(--teal-soft); border-radius: var(--r-l); padding: 1.1rem 1rem 1rem; display: grid; gap: 0.85rem; }
.league-band-head { display: flex; gap: 0.85rem; align-items: center; }
.league-band .title { font-size: 1.6rem; line-height: 1.15; }
.league-band .small { color: var(--ink-2); margin: 0.15rem 0 0; }
.league-band .chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.league-band .chip { font-size: 0.75rem; font-weight: 600; padding: 0.2rem 0.65rem; border-radius: 999px; background: var(--surface); color: var(--ink-2); }
.league-band .band-cta:empty { display: none; }
.league-band .band-cta { display: grid; gap: 0.4rem; text-align: center; }
.league-band .band-cta .tiny, .league-band .band-cta .small { color: var(--ink-2); margin: 0; }
.result-line { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; }
.card.empty .league-tile { margin: 0 auto; }

/* Up and down votes on the league feed. */
.votes { display: inline-flex; align-items: center; gap: 0.1rem; border-radius: 999px; background: var(--surface-2); padding: 0.1rem; }
.vote { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; transition: transform 0.12s var(--ease), background-color 0.12s var(--ease); }
.vote svg { width: 14px; height: 14px; fill: currentColor; }
.vote:active { transform: scale(0.9); }
.vote.up.on { background: var(--mint); color: #1f4d40; }
.vote.down.on { background: var(--coral-soft); color: var(--loss); }
.vote-score { min-width: 1.5rem; text-align: center; font-size: 0.875rem; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.vote-score.pos { color: var(--primary); }
.vote-score.neg { color: var(--loss); }

/* Line icons (shared/_icon_sprite) and initials avatars. */
.ico { display: inline-block; width: 1.25em; height: 1.25em; vertical-align: -0.25em; flex: none; }
.tabs a .tab-ico .ico { width: 24px; height: 24px; }
.big-ico .ico { width: 3.5rem; height: 3.5rem; color: var(--primary); }
.league-tile .ico { width: 58%; height: 58%; color: #1f2a27; }
.avatar { font-weight: 700; font-size: 0.9rem; letter-spacing: 0.02em; color: #1f2a27; }
.avatar.lg { font-size: 1.4rem; }
.avatar.sm { font-size: 0.8rem; }
.row-actions { display: flex; align-items: center; gap: 0.75rem; }
@media (max-width: 640px) {
  .row:has(> .row-actions) { flex-wrap: wrap; row-gap: 0.5rem; }
  .row > .row-actions { order: 3; flex-basis: 100%; padding-left: calc(3.5rem + 0.75rem); }
}
