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

/* A class that sets display would otherwise beat the browser's own rule for
   [hidden], putting a hidden control back on the screen. */
[hidden] { display: none !important; }

:root {
  --green: #22c55e;
  --green-dark: #4ade80;
  --green-light: #052e16;
  --gray-50: #0d1117;
  --gray-100: #1c2128;
  --gray-200: #30363d;
  --gray-400: #8b949e;
  --gray-600: #adbac7;
  --gray-800: #e6edf3;
  --red: #f85149;
  --flame: #fb923c;
  /* The pass: every assist, every drag, every line between two cards. */
  --pass: #58a6ff;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  /* The metals a border tier is painted in. Colour lives out here rather than
     in the SVG, which is the whole reason four shapes are twelve tiers. */
  --bronze-light: #e0a26a;  --bronze-dark: #8a4b22;
  --silver-light: #eef2f6;  --silver-dark: #8b98a5;
  --gold-light:   #f7dd8a;  --gold-dark:   #b8860b;
  --white: #161b22;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 8px;
  --header-height: 52px;
  --shadow: 0 1px 4px rgba(0,0,0,0.5);
}

body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-800);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  color-scheme: dark;
}

/* HEADER */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
  /* Zero in a browser, and zero in standalone while the status bar is opaque.
     Here so the header cannot end up under a translucent one. */
  padding-top: env(safe-area-inset-top);
}
.header-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1rem;
  height: var(--header-height);
  display: flex;
  align-items: center;
}
.header-left   { flex: 1; display: flex; align-items: center; }
.header-center { flex: 0; white-space: nowrap; }
.header-right  { flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; }

a.brand {
  color: var(--gray-800);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

/* HAMBURGER NAV */
.nav-menu { position: relative; }
.nav-menu summary { list-style: none; }
.nav-menu summary::-webkit-details-marker { display: none; }

.nav-hamburger {
  width: 36px;
  height: 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  border-radius: var(--radius);
  -webkit-tap-highlight-color: transparent;
}
.nav-hamburger:hover { background: var(--gray-100); }
.nav-hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--gray-800);
  border-radius: 2px;
  transition: opacity 0.15s;
}
.nav-menu[open] .nav-hamburger { background: var(--gray-100); }

.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  min-width: 200px;
  padding: 0.4rem 0;
  z-index: 200;
}
.nav-dropdown-link {
  display: block;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  color: var(--gray-800);
  text-decoration: none;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: var(--font);
}
.nav-dropdown-link:hover { background: var(--gray-50); }
.nav-dropdown-divider { height: 1px; background: var(--gray-200); margin: 0.3rem 0; }
.nav-dropdown-signout { color: var(--red); }

/* USER AVATAR + DROPDOWN */
.user-menu { position: relative; }
.user-menu summary { list-style: none; }
.user-menu summary::-webkit-details-marker { display: none; }

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  letter-spacing: 0.03em;
  -webkit-tap-highlight-color: transparent;
}
.user-menu[open] .user-avatar { background: var(--green-dark); }

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  min-width: 210px;
  padding: 0.5rem 0;
  z-index: 200;
}
.user-dropdown-name  { padding: 0.5rem 1rem 0.1rem; font-weight: 600; font-size: 0.9rem; }
.user-dropdown-email { padding: 0 1rem 0.5rem; font-size: 0.8rem; color: var(--gray-400); }

/* LAYOUT */
/* The side insets are only non-zero in landscape on a notched phone, where
   viewport-fit=cover puts the rounded corner over the first character. */
.container {
  max-width: 640px; margin: 0 auto;
  padding: 1rem max(1rem, env(safe-area-inset-right)) 1rem max(1rem, env(safe-area-inset-left));
}

/* FLASH */
.flash { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.9rem; }
.flash.notice { background: var(--green-light); color: var(--green-dark); }
.flash.alert  { background: #2d1414; color: var(--red); }

/* CARDS */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  margin-bottom: 0.75rem;
}
.card-title { font-weight: 600; font-size: 1rem; margin-bottom: 0.25rem; }
.card-meta  { color: var(--gray-600); font-size: 0.85rem; }

/* BUTTONS */
.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  text-align: center;
}
.btn-primary   { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); color: #0d1117; }
.btn-secondary { background: var(--gray-100); color: var(--gray-800); border: 1px solid var(--gray-200); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-danger    { background: var(--red); color: #fff; }
.btn-sm        { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-full      { display: block; width: 100%; }

/* FORMS */
.form-group { margin-bottom: 1rem; }
label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 0.3rem; color: var(--gray-600); }
input[type=text], input[type=email], input[type=password], input[type=number], select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--gray-100);
  color: var(--gray-800);
}
input:focus, select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 2px rgba(34,197,94,0.2); }
.field-error { color: var(--red); font-size: 0.8rem; margin-top: 0.25rem; }

/* HEADINGS */
h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.5rem; }
h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.75rem; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }

/* BADGE */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-win   { background: var(--green-light); color: var(--green-dark); }
.badge-loss  { background: #2d1414; color: var(--red); }
.badge-draw  { background: var(--gray-100); color: var(--gray-600); }
.badge-tbd   { background: var(--gray-100); color: var(--gray-400); }
.badge-pending  { background: #2d1e00; color: #fbbf24; }
.badge-admin    { background: var(--green-light); color: var(--green-dark); }
.badge-verified { background: var(--green-light); color: var(--green-dark); }
.badge-over     { background: #2d1414; color: var(--red); }
.badge-finals   { background: #2d1a00; color: var(--flame); }

/* LEADERBOARD TABLE */
.leaderboard { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.leaderboard th { text-align: left; padding: 0.5rem 0.5rem; color: var(--gray-600); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 2px solid var(--gray-200); }
.leaderboard td { padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--gray-100); }
.leaderboard tr:last-child td { border-bottom: none; }
.leaderboard .rank { font-weight: 700; color: var(--gray-400); width: 1.5rem; }
.leaderboard .points { font-weight: 700; color: var(--green-dark); }
.leaderboard tr:first-child .rank { color: var(--green); }
.leaderboard .move-col { width: 2.1rem; padding-left: 0; padding-right: 0; }
.move { display: inline-flex; align-items: center; gap: 0.1rem; font-size: 0.72rem; font-weight: 700; line-height: 1; color: var(--gray-400); }
.move-up { color: var(--green); }
.move-down { color: var(--red); }
.flame { display: inline-flex; vertical-align: -0.12em; margin-left: 0.3rem; color: var(--flame); }

/* Labels a column that carries only an icon, for anyone reading by screen
   reader rather than by shape. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }


/* FIXTURE NAVIGATION (prev/next on fixture show) */
.fixture-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.82rem;
}
.fixture-nav-link {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--gray-600);
  text-decoration: none;
  max-width: 38%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fixture-nav-link--right { justify-content: flex-end; }
.fixture-nav-link span { overflow: hidden; text-overflow: ellipsis; }
.fixture-nav-link:hover { color: var(--gray-800); }

/* FIXTURE CARD */
.fixture-card { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; text-decoration: none; color: inherit; }
.fixture-card:hover { background: var(--gray-50); }
.fixture-vs { flex: 1; }
.fixture-vs .opponent { font-weight: 600; }
.fixture-vs .date { font-size: 0.8rem; color: var(--gray-600); }
.fixture-score { font-size: 1.1rem; font-weight: 700; text-align: right; white-space: nowrap; }
.fixture-status { display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem; }

/* Who scored, under the scoreline. flex-basis 100% breaks it onto its own row
   inside the card's wrapping flex box, so the vs/score line above is untouched. */
.fixture-scorers { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 0.4rem 1.15rem; padding-top: 0.6rem; border-top: 1px solid var(--gray-100); font-size: 0.8rem; }
.scorer { display: inline-flex; align-items: center; gap: 0.25rem; }
.scorer-name { color: var(--gray-600); }
.tally { display: inline-flex; align-items: center; gap: 0.05rem; line-height: 0; }
.tally-tries { color: var(--green); }
.tally-assists { color: var(--gray-400); }
.tally-count { font-size: 0.7rem; font-weight: 700; line-height: 1; margin-left: 0.15rem; }

/* RECORD PROMPT — prominent "enter stats" card on season page */
.record-prompt {
  display: block;
  text-decoration: none;
  background: var(--green);
  color: #fff;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.record-prompt-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.75;
  margin-bottom: 0.25rem;
}
.record-prompt-title  { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.2rem; }
.record-prompt-meta   { font-size: 0.85rem; opacity: 0.85; margin-bottom: 0.75rem; }
.record-prompt-cta    { font-size: 0.9rem; font-weight: 600; opacity: 0.9; }
.record-prompt:hover  { background: var(--green-dark); }

/* CLAIM PLAYER PROMPT */
.claim-prompt {
  background: #1c1600;
  border: 1px solid #5c4a00;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.claim-prompt-title    { font-weight: 700; margin-bottom: 0.2rem; }
.claim-prompt-subtitle { font-size: 0.85rem; color: var(--gray-600); margin-bottom: 0.75rem; }
.claim-prompt-list     { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.claim-btn {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: var(--font);
}
.claim-btn:hover { background: var(--gray-100); }


/* PENDING TRL NOTE */
.pending-note { font-size: 0.85rem; color: var(--gray-600); border-left: 3px solid #fbbf24; }
.pending-note strong { color: var(--gray-800); }

/* EMPTY STATE */
.empty { text-align: center; padding: 2rem 1rem; color: var(--gray-400); }
.empty p { margin-bottom: 1rem; }

/* DIVIDER */
.divider { height: 1px; background: var(--gray-200); margin: 1rem 0; }

/* TABS */
.tabs { display: flex; border-bottom: 2px solid var(--gray-200); margin-bottom: 1rem; }
.tab { padding: 0.5rem 1rem; font-size: 0.9rem; color: var(--gray-600); text-decoration: none; }
.tab.active { color: var(--green); border-bottom: 2px solid var(--green); margin-bottom: -2px; font-weight: 600; }

/* LANDING PAGE */
.landing { padding: 0; }

.landing-hero {
  padding: 3.5rem 0 3rem;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 2rem;
}

.landing-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--green);
  margin-bottom: 1rem;
}

.landing-headline {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--gray-800);
  margin-bottom: 1rem;
}

.landing-sub {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--gray-600);
  margin-bottom: 2rem;
  max-width: 480px;
}

.landing-cta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn-landing {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.landing-cta-or {
  font-size: 0.875rem;
  color: var(--gray-400);
  margin-left: 0.25rem;
}

.landing-signin-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-800);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.landing-features {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.landing-feature {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.landing-feature-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 0.25rem;
}

.landing-feature-body {
  font-size: 0.9rem;
  color: var(--gray-600);
  line-height: 1.55;
}

/* SEASON FILTER CHIPS */
.filter-chips {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  margin-bottom: 0.75rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  color: var(--gray-600);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.chip:hover { background: var(--gray-200); color: var(--gray-800); }
.chip-active {
  background: var(--green-light);
  border-color: var(--green-dark);
  color: var(--green-dark);
  font-weight: 600;
}

.leaderboard-player { color: var(--gray-800); text-decoration: none; }
.leaderboard-player:hover { color: var(--green-dark); }


/* STAT TILES (player + profile pages) */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
@media (min-width: 560px) {
  .stat-grid { grid-template-columns: repeat(6, 1fr); }
}
.stat-tile {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.7rem 0.5rem;
  text-align: center;
}
.stat-tile-value { font-size: 1.35rem; font-weight: 700; line-height: 1.1; }
.stat-tile-value.accent { color: var(--green-dark); }
.stat-tile-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-400);
  margin-top: 0.15rem;
}

.average-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.9rem;
}
.average-row:last-child { border-bottom: none; }
.average-row dt { color: var(--gray-600); }
.average-row dd { font-weight: 600; }

.season-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.season-table th { text-align: right; padding: 0.5rem; color: var(--gray-600); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 2px solid var(--gray-200); }
.season-table th:first-child { text-align: left; }
.season-table td { padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--gray-100); text-align: right; }
.season-table td:first-child { text-align: left; }
.season-table tr:last-child td { border-bottom: none; }
.season-table .points { font-weight: 700; color: var(--green-dark); }
.season-table a { color: var(--gray-800); text-decoration: none; }

/* LADDER TABLE — the division standings TRL publishes, all ten-odd columns of
   it on a phone screen, so it scrolls sideways inside its own card rather
   than the page. */
.ladder-table { font-size: 0.8rem; }
.ladder-table th, .ladder-table td { padding: 0.5rem 0.4rem; white-space: nowrap; }
.ladder-table th:nth-child(2), .ladder-table td:nth-child(2) { text-align: left; white-space: normal; }
.ladder-table-us td { background: var(--green-light); color: var(--green-dark); font-weight: 600; }

/* BACK BUTTON — thumb-sized, this app lives on a phone */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  max-width: 100%;
  min-height: 44px;
  padding: 0.5rem 1rem 0.5rem 0.7rem;
  margin-bottom: 0.75rem;
  border-radius: 999px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  color: var(--gray-600);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.btn-back:hover { background: var(--gray-200); color: var(--gray-800); }
.btn-back:active { background: var(--gray-200); transform: scale(0.97); }
.btn-back svg { flex-shrink: 0; }
.btn-back span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* LANDING SCREENSHOTS */
.landing-shots {
  display: flex;
  gap: 0.9rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.5rem;
  margin-bottom: 2.5rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.landing-shots::-webkit-scrollbar { display: none; }

.landing-shot {
  flex: 0 0 auto;
  width: 190px;
  scroll-snap-align: center;
  margin: 0;
}
.phone {
  border-radius: 20px;
  padding: 5px;
  background: linear-gradient(155deg, var(--gray-200), var(--gray-100));
  box-shadow: 0 10px 28px rgba(0,0,0,0.55);
}
.phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 15px;
}
.landing-shot figcaption {
  margin-top: 0.7rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--gray-600);
}
.landing-shot figcaption strong {
  display: block;
  color: var(--gray-800);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.1rem;
}

/* MODAL — a bottom sheet on a phone, a centred panel on a wider screen */
.modal {
  /* the global reset zeroes margin, which is what centres a modal dialog */
  margin: auto;
  border: none;
  padding: 0;
  background: transparent;
  width: 420px;
  max-width: 92vw;
  color: var(--gray-800);
}
.modal::backdrop { background: rgba(0, 0, 0, 0.72); }
.modal-panel {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  padding: 1.15rem 1.15rem 1.35rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.modal-head h2 { margin: 0; }
.modal-close {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.modal-close:hover { background: var(--gray-200); color: var(--gray-800); }

.field-hint { font-size: 0.78rem; color: var(--gray-400); margin-top: 0.35rem; line-height: 1.4; }

@media (max-width: 520px) {
  .modal { width: 100%; max-width: 100%; margin: auto auto 0; }
  .modal-panel {
    border-radius: 16px 16px 0 0;
    border-bottom: none;
    padding-bottom: calc(1.35rem + env(safe-area-inset-bottom));
  }
}




/* ══ THE MATCH LADDER ══════════════════════════════════════════════════════
   The entry screen is a ranked list of the squad, not a pitch: a pitch spends
   most of a phone on turf, while the same space as full-width cards buys a live
   standing — so entering a stat and watching it land are one act.

   One colour, one meaning throughout:
     green  try, positive points      blue  assist, pass, drag
     orange positive play             red   negative
   The column header carries each colour, so the header teaches the palette. */
.ladder {
  position: relative;
  padding-left: 32px;   /* the connection gutter */
}

/* Completed assists, drawn as arcs from the passer's card to the scorer's and
   thickening the more often a pair connect. */
.ladder-gutter {
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 0;
  transition: opacity 260ms ease;
}

.ladder-head {
  position: sticky;
  top: calc(var(--header-height) + env(safe-area-inset-top) + 1px);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.2rem 0.55rem 0.3rem 1.4rem;
  margin-bottom: 0.15rem;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--gray-400);
}
.ladder-head .sp-avatar { width: 38px; flex-shrink: 0; }
.ladder-head .sp-who { flex: 1; min-width: 0; }
.ladder-head .lcard-chips span { min-width: 20px; text-align: center; padding: 0.1rem 0.22rem; }
.ladder-head .h-t { color: var(--green-dark); }
.ladder-head .h-a { color: var(--pass); }
.ladder-head .h-c { color: var(--flame); }
.ladder-head .h-e { color: var(--red); }
.ladder-head .sp-pts { min-width: 2.1rem; text-align: right; flex-shrink: 0; color: var(--gray-600); }

.lcard {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.34rem;
  padding: 0.4rem 0.55rem 0.4rem 1.4rem;   /* room for the rank inside the card */
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  transition: transform 0.22s ease, border-color 0.12s ease;
}
/* Only an editable ladder swallows the browser's own gestures. */
.ladder--editable .lcard {
  touch-action: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.lcard.sidelined { opacity: 0.42; }
.lcard.armed  { border-color: var(--pass); }
.lcard.target { border-color: var(--pass); box-shadow: 0 0 0 2px rgba(88,166,255,0.35); }
.lcard.mvp    { border-color: var(--flame); }

/* A row that just changed says so, so the movement has a cause you can see. */
@keyframes just-touched {
  0%   { box-shadow: 0 0 0 0 rgba(88,166,255,0.55); }
  35%  { box-shadow: 0 0 0 3px rgba(88,166,255,0.40); }
  100% { box-shadow: 0 0 0 0 rgba(88,166,255,0); }
}
.lcard.just { animation: just-touched 820ms ease-out; }
.lcard.just .lcard-rank { color: var(--pass); }
.lcard.just .lcard-pts  { transform: scale(1.12); }

.lcard-rank {
  position: absolute;
  left: 0.4rem; top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--gray-400);
  font-variant-numeric: tabular-nums;
  width: 1.1rem;
  text-align: right;
  z-index: 2;
}
.lcard-avatar {
  position: relative;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 0.76rem;
  font-weight: 800;
  background: var(--gray-200);
  color: var(--gray-800);
  border: 2px solid var(--gray-600);
}
/* An unclaimed roster entry carries no cosmetics at all: banked history earns
   nothing until somebody claims it, and the card has to say so. */
.lcard.unclaimed .lcard-avatar { border-style: dashed; border-color: var(--gray-200); color: var(--gray-400); background: transparent; }

/* The same plaque as .level-badge on the profile, cut down to fit a card 18px
   shorter than the identity portrait it was sized for. */
.lcard-level { position: absolute; right: -3px; bottom: -3px; width: 15px; height: 15px; }
.lcard-level-number {
  position: absolute; right: -3px; bottom: -3px;
  width: 15px; height: 15px;
  display: grid; place-items: center;
  font-size: 0.44rem; font-weight: 800; color: #12161c;
}

.lcard-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lcard-name { font-size: 0.82rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lcard.unclaimed .lcard-name { font-weight: 500; font-style: italic; color: var(--gray-600); }
.lcard-title { font-size: 0.6rem; color: var(--gray-400); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lcard-title.locked { font-style: italic; opacity: 0.7; }
.lcard-crown {
  font-size: 0.54rem; font-weight: 800; letter-spacing: 0.07em; color: #1a0d02;
  background: var(--flame); border-radius: 4px; padding: 0.02rem 0.24rem; margin-left: 0.3rem;
}

.lcard-chips { display: flex; gap: 0.2rem; flex-shrink: 0; }
.lchip {
  min-width: 20px; text-align: center;
  font-family: var(--mono); font-size: 0.64rem; font-weight: 700;
  padding: 0.1rem 0.22rem; border-radius: 4px;
  background: var(--gray-200); color: var(--gray-400);
  font-variant-numeric: tabular-nums;
}
.lchip.t.on { background: var(--green);  color: #04140a; }
.lchip.a.on { background: var(--pass);   color: #05121f; }
.lchip.c.on { background: var(--flame);  color: #1a0d02; }
.lchip.e.on { background: var(--red);    color: #1a0605; }

.lcard-pts {
  font-family: var(--mono); font-size: 0.92rem; font-weight: 800;
  min-width: 2.1rem; text-align: right;
  font-variant-numeric: tabular-nums; flex-shrink: 0;
  transition: transform 260ms cubic-bezier(0.2,0.8,0.2,1);
}
.lcard-pts.up   { color: var(--green-dark); }
.lcard-pts.down { color: var(--red); }
.lcard-pts.zero { color: var(--gray-400); }

.ladder-sideline {
  font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--gray-400); font-weight: 700; margin: 0.55rem 0 0.3rem; padding-left: 0.2rem;
}

/* ── the long-hold menu ── */
.play-menu {
  position: fixed; z-index: 60; width: 214px;
  background: var(--gray-100); border: 1px solid var(--gray-200);
  border-radius: 10px; padding: 0.3rem; box-shadow: 0 10px 30px rgba(0,0,0,0.65);
  /* The Remove items can push this taller than a short phone screen. Rather
     than clip the bottom of the menu off-screen, it scrolls internally — the
     JS caps max-height to the viewport and repositions to fit before this
     ever has to. */
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.play-menu-head {
  font-size: 0.64rem; color: var(--gray-400);
  padding: 0.3rem 0.5rem 0.35rem; border-bottom: 1px solid var(--gray-200); margin-bottom: 0.25rem;
}
.play-menu button {
  display: flex; width: 100%; align-items: center; justify-content: space-between;
  font: inherit; font-size: 0.84rem; background: none; border: 0; color: var(--gray-800);
  padding: 0.58rem 0.5rem; border-radius: 6px; cursor: pointer; text-align: left;
}
.play-menu button:hover { background: var(--gray-200); }
/* The item under the finger, so sliding onto one and releasing is a choice you
   can see being made. */
.play-menu button.hot { background: var(--green-light); box-shadow: inset 0 0 0 1px var(--green); }
.play-menu button .v { font-family: var(--mono); font-size: 0.74rem; font-weight: 700; }
.play-menu .v.plus  { color: var(--green-dark); }
.play-menu .v.minus { color: var(--red); }
.play-menu .v.mute  { color: var(--gray-400); }

/* The Remove items sit below their own divider, so a fast tap near the top of
   the menu can't land on one by accident. */
.play-menu-div { border-top: 1px solid var(--gray-200); margin: 0.25rem 0.1rem; }
.play-menu button.destructive { color: var(--red); }
.play-menu button.destructive:hover { background: #2d1414; }

/* ── live drag feedback ── */
.drag-layer { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 55; pointer-events: none; overflow: visible; }
.drag-chip {
  position: fixed; z-index: 56; pointer-events: none; display: none; align-items: center; gap: 0.4rem;
  background: var(--gray-100); border: 1px solid var(--pass); border-radius: 14px;
  padding: 0.22rem 0.55rem; font-size: 0.7rem; font-weight: 600; white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0,0,0,0.6);
}
.drag-chip.on { display: flex; }
.drag-chip .val { font-family: var(--mono); font-size: 0.64rem; }
.drag-chip .val b { color: var(--pass); font-weight: 700; }
.drag-chip .val i { color: var(--green-dark); font-style: normal; font-weight: 700; }

/* The hold ring: the held finger, drawn as it fills.
   Centred on the icon rather than inset from it — an absolutely positioned
   child measures from its parent's padding box, so the icon's own 2px border
   pushed an inset ring off by exactly that much. */
.hold-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46px;
  height: 46px;
  transform: translate(-50%, -50%);
  overflow: visible;
  pointer-events: none;
  z-index: 3;
}
.hold-ring circle {
  fill: none;
  stroke: var(--pass);
  stroke-width: 3.5;
  stroke-linecap: round;
  transform: rotate(-90deg);    /* start the sweep at twelve o'clock */
  transform-origin: 50% 50%;
  stroke-dasharray: 163.363;    /* 2πr, r = 26 in the viewBox */
  /* An animation, not a transition. A transition has to be started by changing
     a value a frame after the element lands, and if that frame arrives before
     the first style is committed there is nothing to transition from — which
     is how the ring came up already full instead of filling. An animation
     starts when the element does, with nothing to race. */
  animation: hold-fill var(--hold-ms, 400ms) linear forwards;
}
@keyframes hold-fill {
  from { stroke-dashoffset: 163.363; }
  to   { stroke-dashoffset: 0; }
}

/* ── the toast ── */
.ladder-toast {
  position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(0.5rem);
  background: var(--gray-200); color: var(--gray-800);
  border-radius: 999px; padding: 0.4rem 0.9rem; font-size: 0.78rem; font-weight: 600;
  box-shadow: var(--shadow); z-index: 70;
  opacity: 0; pointer-events: none; transition: opacity 0.16s ease, transform 0.16s ease;
}
.ladder-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .lcard, .lcard-pts, .ladder-gutter { transition: none; }
  .lcard.just { animation: none; }
}

.ladder-hint {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  margin-bottom: 0.6rem;
}
.ladder-hint p { font-size: 0.78rem; color: var(--gray-400); flex: 1; }
.ladder-hint-actions { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }

.btn-icon {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid var(--gray-200); background: var(--gray-100); color: var(--gray-600);
  font-size: 0.85rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.btn-icon:hover { background: var(--gray-200); color: var(--gray-800); }

/* Lock swaps every card's touch-action back to a scrollable surface and dims
   them to read as inert — see match_ladder_controller#toggleLock. */
.is-locked .lcard { touch-action: pan-y; opacity: 0.5; }
.is-locked [data-match-ladder-target="lock"] { background: var(--green-light); border-color: var(--green); color: var(--green-dark); }

.tour-list { list-style: none; margin-bottom: 1.1rem; }
.tour-list li {
  display: flex; align-items: baseline; gap: 0.55rem;
  font-size: 0.85rem; color: var(--gray-600); line-height: 1.5;
  padding: 0.4rem 0;
}
.tour-list li + li { border-top: 1px solid var(--gray-100); }
.tour-mark {
  flex-shrink: 0; width: 3.6rem; text-align: center;
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 0.2rem 0; border-radius: 6px;
}
.tour-mark.try    { background: var(--green-light); color: var(--green-dark); }
.tour-mark.assist { background: rgba(88,166,255,0.15); color: var(--pass); }
.tour-mark.hold   { background: rgba(251,146,60,0.15); color: var(--flame); }
.tour-mark.scroll { background: var(--gray-100); color: var(--gray-400); }

/* ══ THE THREE TABS ════════════════════════════════════════════════════════
   Three scopes of one app, not three screens: Team is the board, Season is the
   draw, Profile is you. Fixed to the bottom, where a thumb already is. */
.tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  display: flex;
  /* The floor is not decoration. With no home indicator to inset against, a
     56px tab reaches the very bottom edge — the strip iOS Safari keeps for its
     own controls, where a thumb aiming at Profile expands the browser chrome
     instead. 8px is enough to land the tap inside the tab. */
  height: calc(56px + max(env(safe-area-inset-bottom), 8px));
  padding-bottom: max(env(safe-area-inset-bottom), 8px);
  background: var(--gray-100);
  border-top: 1px solid var(--gray-200);
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--gray-400);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.tab--on { color: var(--green-dark); }
/* A season tab with no season behind it yet. Dim, not hidden: the shape of the
   app should not change while the first sync is still running. */
.tab--dead { opacity: 0.35; }

/* Room for the bar, so the last card is never underneath it. */
.container--tabbed { padding-bottom: calc(56px + 1rem + max(env(safe-area-inset-bottom), 8px)); }

/* ── a tab's own header ── */
.tab-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.tab-head-title { min-width: 0; }
.tab-head-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }

.btn-gear {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  color: var(--gray-400);
  text-decoration: none;
}
.btn-gear:hover { background: var(--gray-100); color: var(--gray-800); }

/* ── the team switcher ──
   Team is global context, and this is where it changes. It offers connecting
   another team even when you have only one, so the control is never dead. */
.team-switch { position: relative; }
.team-switch summary {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  list-style: none;
  color: var(--gray-400);
}
.team-switch summary::-webkit-details-marker { display: none; }
.team-switch summary h1 { color: var(--gray-800); }
.team-switch[open] summary svg { transform: rotate(180deg); }
.team-switch-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 0.35rem);
  z-index: 20;
  min-width: 220px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 0.35rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.team-switch-menu .is-current { color: var(--green-dark); }

/* ── the scope dropdown ──
   Not chips: two seasons a year is seven chips after three years, wrapping
   across a phone. */
.scope-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.scope-select {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
}
.scope-link { font-size: 0.8rem; color: var(--gray-400); text-decoration: none; white-space: nowrap; }
.scope-link:hover { color: var(--green-dark); }

/* ── team settings ── */
.settings-row { display: flex; align-items: center; gap: 0.5rem; }
.count {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gray-400);
  background: var(--gray-100);
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  margin-left: 0.25rem;
}

/* ── the board: the ladder's card, one scope up ──
   Ranked rows carry where they moved as well as where they stand, so the rank
   block holds both. */
/* No arcs are drawn on a board — it spans seasons, not one game — so the 32px
   connection gutter is dead space here, and a name is what wants it. */
.ladder--board { padding-left: 0; }
.ladder--board .lcard { padding-left: 2.9rem; }
.ladder--board .ladder-head { padding-left: 2.9rem; }
.ladder--board .lcard-rank {
  left: 0.4rem;
  width: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  gap: 0.25rem;
}
.ladder-head .sp-rank { width: 0; }
.ladder-head .h-g { color: var(--gray-600); }
.lchip.g { background: var(--gray-200); color: var(--gray-600); font-weight: 800; }

/* ══ COSMETICS ═════════════════════════════════════════════════════════════
   Draw the geometry, borrow the glyphs, let CSS do the colour.

   An SVG referenced with <img src> is a separate document and cannot be
   recoloured from the page, which is exactly why colour lives out here — and
   therefore why four shapes really are twelve tiers. mask-image beats
   currentColor because a mask source's colour is discarded by definition, so
   the background can be the gradient a metal tier wants. */
.border-ring,
.accolade-glyph {
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-position: center;
  mask-position: center;
}

.metal-bronze { background: linear-gradient(140deg, var(--bronze-light), var(--bronze-dark)); }
.metal-silver { background: linear-gradient(140deg, var(--silver-light), var(--silver-dark)); }
.metal-gold   { background: linear-gradient(140deg, var(--gold-light), var(--gold-dark)); }

/* ── card banners ──
   Eight of them and not one file: a banner is a wash behind a name, and a
   gradient over tokens the app already has is the whole of what that needs. */
.banner-green  { --banner: linear-gradient(100deg, rgba(34,197,94,0.16), transparent 62%); }
.banner-blue   { --banner: linear-gradient(100deg, rgba(88,166,255,0.15), transparent 62%); }
.banner-orange { --banner: linear-gradient(100deg, rgba(251,146,60,0.15), transparent 62%); }
.banner-red    { --banner: linear-gradient(100deg, rgba(248,81,73,0.14), transparent 62%); }
.banner-gold   { --banner: linear-gradient(100deg, rgba(247,221,138,0.16), transparent 62%); }
.banner-silver { --banner: linear-gradient(100deg, rgba(238,242,246,0.12), transparent 62%); }
.banner-bronze { --banner: linear-gradient(100deg, rgba(224,162,106,0.14), transparent 62%); }
.banner-slate  { --banner: linear-gradient(100deg, rgba(173,186,199,0.12), transparent 62%); }

/* The banner: a wash behind the name, and only a claimed Player has one.

   Behind, by sitting under the card's own content rather than by lifting every
   child above it. `.lcard > * { position: relative }` did the lifting, and it
   silently outranked .lcard-rank's own `position: absolute` — same specificity,
   written later. The rank is absolute so the name can have its column, so the
   board was spending 46px of a 358px card holding a number twice and leaving a
   name 41px. The card is its own stacking context, so a negative z-index here
   lands between its background and its children and nothing else has to know. */
.lcard::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 10px;
  background: var(--banner, none);
  opacity: 0.55;
  pointer-events: none;
}

/* The border sits on the portrait's own rim, which is why the avatar keeps no
   border of its own once there is a tier to wear. */
.border-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
}
.lcard-avatar:has(.border-ring) { border-color: transparent; }

/* ══ THE PROFILE ═══════════════════════════════════════════════════════════
   Level, showcase, slots, career — the three things a card shows, and where
   they are chosen. */
.identity { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1.25rem; }
.identity-face { position: relative; flex-shrink: 0; width: 64px; height: 64px; display: grid; place-items: center; }
.identity-avatar {
  position: relative;
  width: 56px; height: 56px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--gray-200);
  color: var(--gray-800);
  border: 2px solid var(--gray-600);
  font-weight: 800; font-size: 1.05rem;
}
.identity-avatar:has(.border-ring) { border-color: transparent; }
.identity-avatar .border-ring { inset: -4px; }

/* The level plaque hangs off the portrait, because it is a different fact
   about somebody than the border is. */
.level-badge { position: absolute; right: -2px; bottom: -2px; width: 24px; height: 24px; }
.level-number {
  position: absolute; right: -2px; bottom: -2px;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  font-size: 0.66rem; font-weight: 800; color: #12161c;
}

.identity-who { min-width: 0; flex: 1; }
.identity-title { font-size: 0.85rem; color: var(--gray-600); margin-bottom: 0.4rem; }
.identity-title.locked { font-style: italic; color: var(--gray-400); }

.level-bar { height: 6px; border-radius: 999px; background: var(--gray-200); overflow: hidden; margin-bottom: 0.3rem; }
.level-bar span { display: block; height: 100%; background: var(--green); border-radius: 999px; }

.profile-heading { margin: 1.5rem 0 0.6rem; }
/* A roster's heading is also the way into that team. It stays a heading first:
   a blue underline mid-page reads as a stray link, not a section. */
.profile-heading a { color: inherit; text-decoration: none; }
.profile-heading a:hover { color: var(--green-dark); }
/* Inside a roster's block on the Profile, where the team name is already an h2
   and "This season" is a part of it rather than a peer. */
.profile-subheading {
  margin: 1rem 0 0.4rem;
  font-size: 0.68rem; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--gray-400);
}

/* ── the showcase ──
   Three at a time is what makes it a showcase rather than clutter, and it is
   the only place accolade art appears at all. */
.showcase { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.showcase-slot {
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  padding: 0.75rem 0.4rem;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  text-align: center;
}
.showcase-slot .accolade-glyph { width: 28px; height: 28px; background: var(--gray-400); }
.showcase-slot.filled .accolade-glyph { background: var(--green-dark); }
.showcase-empty {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px dashed var(--gray-200);
}
.showcase-title { font-size: 0.72rem; font-weight: 700; }
.showcase-note { font-size: 0.62rem; color: var(--gray-400); line-height: 1.25; }

/* ── the slots ── */
.slots { margin-bottom: 0.5rem; }
.slot {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 0.75rem;
  margin-bottom: 0.5rem;
}
.slot-label { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gray-400); margin-bottom: 0.35rem; }
.slot-value { font-weight: 600; text-transform: capitalize; }
.slot-note { font-size: 0.7rem; color: var(--gray-400); margin-top: 0.35rem; }

/* ── everything earned ── */
.accolade-row {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-left-width: 3px;
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.4rem;
}
.accolade-row .accolade-glyph { width: 22px; height: 22px; flex-shrink: 0; background: var(--gray-600); }
.accolade-row.rarity-common   { border-left-color: var(--bronze-light); }
.accolade-row.rarity-uncommon { border-left-color: var(--silver-light); }
.accolade-row.rarity-rare     { border-left-color: var(--gold-light); }
.accolade-row.rarity-mvp      { border-left-color: var(--flame); }
.accolade-name { font-weight: 600; font-size: 0.88rem; }
.accolade-xp { font-family: var(--mono); font-size: 0.72rem; font-weight: 700; color: var(--green-dark); flex-shrink: 0; }

/* ── still to earn ──
   Dimmed rather than hidden, and the rarity stripe stays: what it is worth is
   part of what there is to aim at. */
.accolade-row.locked { border-left-style: dashed; background: transparent; }
.accolade-row.locked .accolade-name { color: var(--gray-600); font-weight: 500; }
.accolade-row.locked .accolade-glyph { background: var(--gray-200); }
.accolade-row.locked .accolade-xp { color: var(--gray-400); }

/* A ladder is one row, not five. The rail of thresholds carries the whole
   ladder — passed rungs coloured by rarity, the next one outlined, the rest
   dim — so five accolades cost one row and nothing has to be unfolded. */
.aims { margin-bottom: 0.4rem; }
.aim {
  display: flex; align-items: flex-start; gap: 0.6rem;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.4rem;
}
.aim .accolade-glyph { width: 22px; height: 22px; flex-shrink: 0; background: var(--gray-400); margin-top: 0.1rem; }
.aim.complete .accolade-glyph { background: var(--green-dark); }
.aim-body { flex: 1; min-width: 0; }
.aim-top { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.15rem; }
.aim-name { font-weight: 600; font-size: 0.88rem; flex: 1; min-width: 0; }
.aim-note { font-size: 0.7rem; color: var(--gray-400); margin-bottom: 0.35rem; }
.aim-note strong { color: var(--gray-800); font-weight: 700; }
.aim .level-bar { margin-bottom: 0; }
.aim.complete .level-bar span { background: var(--green-dark); }

.aim-rungs { display: flex; gap: 0.2rem; flex-shrink: 0; }
.rung {
  min-width: 20px; text-align: center;
  font-family: var(--mono); font-size: 0.62rem; font-weight: 700;
  padding: 0.05rem 0.22rem; border-radius: 4px;
  border: 1px solid transparent;
  background: var(--gray-200); color: var(--gray-600);
  font-variant-numeric: tabular-nums;
}
.rung.next { border-color: var(--green); color: var(--green-dark); background: transparent; }
/* Earned rungs wear the rarity they pay, which is the same three metals the
   earned list stripes with. */
.rung.on { color: #11161d; }
.rung.on.rarity-common   { background: var(--bronze-light); }
.rung.on.rarity-uncommon { background: var(--silver-light); }
.rung.on.rarity-rare     { background: var(--gold-light); }

/* ── the claim payoff ── */
.claimed-banner {
  background: var(--green-light);
  border: 1px solid var(--green);
  border-radius: var(--radius);
  padding: 0.9rem;
  margin-bottom: 1.25rem;
}
.claimed-title { font-weight: 700; color: var(--green-dark); margin-bottom: 0.25rem; }
.claimed-note { font-size: 0.82rem; color: var(--gray-600); line-height: 1.45; }

/* ── the form indicator ──
   An arrow and a colour, three states. Green and red say what the arrow means
   for that stat, not which way it points: a rising drop count is a falling
   player. The uncertain marker is deliberately its own shape, because an
   absent arrow reads as "level" rather than "we can't tell". */
.form { display: inline-flex; vertical-align: -0.1em; margin-left: 0.35rem; }
.form-good { color: var(--green-dark); }
.form-bad { color: var(--red); }
.form-level { color: var(--gray-400); }
.form-unknown { color: var(--gray-200); }
.form-note { font-size: 0.72rem; color: var(--gray-400); margin-top: 0.6rem; }

/* ── the FAQ accordion ──
   <details>/<summary> rather than JS: the whole point of a help page is that
   it still works if something else on the screen is broken. */
.faq-group { margin-bottom: 0.5rem; }
.faq-item {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 500;
  font-size: 0.92rem;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  -webkit-tap-highlight-color: transparent;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  flex-shrink: 0;
  color: var(--gray-400);
  font-size: 1.1rem;
  font-weight: 400;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item p {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--gray-600);
}

/* Header-left is otherwise empty — a "?" belongs where a hand already looks
   for it, on every screen, signed in or not. */
.help-link {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--gray-200); background: transparent; color: var(--gray-400);
  font-size: 0.85rem; font-weight: 700; text-decoration: none;
  display: flex; align-items: center; justify-content: center;
}
.help-link:hover { background: var(--gray-100); color: var(--gray-800); }
