/* All 22 Pokémon Net — "Broadcast" UI (the builder page only; style.css stays with /draft, /about and /privacy).
   The look comes from the field's own name tags: dark panels, Roboto Condensed caps, gold for offense, blue for
   defense. Phones: the field near the top, settings in a "team sheet", pop-ups as bottom sheets. Wide screens
   (1000px+ and 560px+ tall): a header bar, a 340px control column that never scrolls, and the field. */

:root {
  --bg: #101116;
  --panel: #191b22;
  --tag: #11131a;
  --sheet: #14161d;
  --hover: #242832;
  --line: rgba(255, 255, 255, 0.09);
  --tag-border: rgba(255, 255, 255, 0.22);
  --ghost-border: rgba(255, 255, 255, 0.12);
  --hover-border: rgba(255, 255, 255, 0.3);
  --text: #f3f5f8;
  --muted: #9aa3af;
  --subtle: #7d8794;
  --nav: #d5dae1;
  --gold: #e3350d;
  --gold-hover: #f04b2a;
  --on-gold: #ffffff;
  --on-gold-2: #ffd8cf;
  --off: #e3350d;
  --def: #f3f5f8;
  --st: #b9c0ca;
  --red: #ff6b4a;
  --red-fill: #e3350d;
  --red-hover: #f65f3d;
  --red-light: #ffb1a0;
  --red-small: #ffe0d9;
  --win: #4ade80;
  --hi-stat: #86efac;
  --white-hover: #dfe3e8;
  --open: #4ade80; /* open spots on the field while placing a pick */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --rc: "Roboto Condensed", "Arial Narrow", sans-serif;
  --font-field: "Roboto Condensed", "Arial Narrow", sans-serif;
  --gutter: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
html, body { margin: 0; }
/* Phones: things scrolled into view (the field, when a pick is chosen) clear the sticky mode menu */
html { scroll-padding-top: 72px; }
body {
  min-height: 100vh;
  min-height: 100svh;
  background: radial-gradient(900px 500px at 10% -10%, rgba(227,53,13,.16), transparent 60%), radial-gradient(700px 420px at 92% 0%, rgba(255,203,5,.10), transparent 60%), var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
.nowrap { white-space: nowrap; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
svg { flex: none; }

/* Builder vs. a challenge, and which challenge: 17–0 (region and type rolls) or 151 (one Pokémon a round) */
body.mode-draft .builder-only,
body:not(.mode-draft) .draft-only,
body.game-151 .only-170,
body:not(.game-151) .only-151 { display: none !important; }
/* "Tap" on touch screens, "Click" with a mouse */
.on-mouse { display: none; }
@media (pointer: fine) {
  .on-mouse { display: inline; }
  .on-touch { display: none; }
}

/* ======================================================================================== header + mode menu */
.app { display: flex; flex-direction: column; }
.wordmark {
  font-family: var(--rc);
  font-size: 21px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text);
  text-decoration: none;
}
.wordmark span { color: var(--gold); }
.wordmark::before { content: ""; width: 22px; height: 22px; border-radius: 50%; display: inline-block; margin-right: 8px; background: linear-gradient(to bottom, #e3350d 0 46%, #f3f5f8 46% 54%, #17191f 54% 100%); border: 2px solid #f3f5f8; box-shadow: 0 0 0 1px rgba(0,0,0,.45), inset 0 0 0 2px rgba(0,0,0,.18); vertical-align: -5px; }

.play-team {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 11px 0 9px;
  border-radius: 6px;
  background: var(--text);
  color: var(--bg);
  font-family: var(--rc);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
}
.play-team:hover { background: var(--white-hover); }
.play-team svg { width: 14px; height: 14px; fill: currentColor; }

.modes {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.12fr 1.38fr;
  border: 1px solid var(--tag-border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--tag);
  font-family: var(--rc);
  text-transform: uppercase;
}
.mode {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  height: 46px;
  margin: 0;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--nav);
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}
.mode + .mode { border-left: 1px solid var(--tag-border); }
.mode:hover { background: var(--hover); }
.mode:focus-visible { outline-offset: -3px; }
.mode svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mode > span { font-size: 12.5px; font-weight: 800; }
.mode-board svg { stroke: var(--gold); stroke-width: 2.2; }
.mode-big b { font-size: 18px; font-weight: 800; }
.mode-big > span { font-size: 10.5px; font-weight: 700; color: var(--muted); }
.mode-170 b { color: var(--gold); }
.mode-151 b { color: var(--red); }
.mode-fd b { font-size: 14.5px; color: var(--st); }
.mode[aria-current="page"] { cursor: default; }
.mode-builder[aria-current="page"] { background: var(--text); color: var(--bg); }
.mode-builder[aria-current="page"] svg { stroke: var(--bg); }
.mode-170[aria-current="page"], .mode-board[aria-current="page"] { background: var(--gold); color: var(--on-gold); }
.mode-170[aria-current="page"] b { color: var(--on-gold); }
.mode-170[aria-current="page"] > span { color: var(--on-gold-2); }
.mode-board[aria-current="page"] svg { stroke: var(--on-gold); }
.mode-151[aria-current="page"] { background: var(--red-fill); color: #fff; }
.mode-151[aria-current="page"] b { color: #fff; }
.mode-151[aria-current="page"] > span { color: var(--red-small); }

/* ======================================================================================== layout: phones */
/* The header row (wordmark, Play with your team), then the menu, sticky. */
.site-head { display: contents; }
.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "word play" "nav nav" "main main";
  align-items: center;
}
.wordmark { grid-area: word; padding-left: var(--gutter); height: 56px; line-height: 56px; overflow: hidden; text-overflow: ellipsis; }
.play-team { grid-area: play; margin-right: var(--gutter); justify-self: end; }
.modes-bar {
  grid-area: nav;
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 8px var(--gutter);
  background: rgba(8, 11, 15, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.modes { max-width: 560px; margin: 0 auto; }
.main { grid-area: main; display: flex; flex-direction: column; min-width: 0; }
/* The controls column's pieces join the page flow around the field. */
.panel, .draft-panel, .dp-state { display: contents; }
.o-top { order: 1; }
.stage { order: 2; }
.o-bot { order: 3; }
.main .o-top, .main .o-bot {
  /* page gutters; 600–999px wide: content blocks capped at 560px, centered (the field stays full-bleed) */
  margin-left: max(var(--gutter), calc((100% - 560px) / 2));
  margin-right: max(var(--gutter), calc((100% - 560px) / 2));
}
.stage { margin: 0; }
body.mode-draft .stage { margin-top: 12px; }

/* ======================================================================================== titles, sections */
.title-block { padding: 16px 0 12px; }
/* the title, and in the builder a pair of binoculars: the Scouting Guide in a new tab (the row stays the title's height) */
.title-row { display: flex; align-items: center; gap: 10px; }
.title-row h1 { flex: 1; min-width: 0; }
.scout-link {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  margin: -6px -7px -6px 0;
  border-radius: 6px;
  color: var(--gold);
}
.scout-link:hover { background: var(--hover); color: var(--gold-hover); }
.scout-link:focus-visible { outline: 2px solid var(--gold); outline-offset: 0; }
.scout-link svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.title-block h1 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0;
  font-family: var(--rc);
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}
.title-block h1 .n170 { color: var(--gold); }
.title-block h1 .n151 { color: var(--red); }
body.mode-draft .title-block { padding-bottom: 14px; }
.retro-badge {
  padding: 3px 7px 2px;
  border: 1.5px solid var(--gold);
  border-radius: 5px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.1;
  color: #fde047;
  white-space: nowrap;
}
.desc { margin: 7px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--muted); text-wrap: pretty; }
#dp-setup > .desc { margin-top: -7px; margin-bottom: 12px; }
.sec { display: flex; align-items: center; gap: 10px; margin-top: 26px; padding-bottom: 10px; }
.sec h2 { margin: 0; font-family: var(--rc); font-size: 16px; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase; }
.sec::after { content: ""; flex: 1; order: 1; height: 1px; background: var(--line); }
/* a link at the end of a section's rule (How it works → the Scouting Guide); it never adds height to the row */
.sec-link {
  order: 2;
  font-family: var(--rc);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--gold);
  text-decoration: none;
}
.sec-link:hover, .sec-link:focus-visible { color: var(--gold-hover); text-decoration: underline; text-underline-offset: 3px; }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.lbl { font-family: var(--rc); font-size: 14px; font-weight: 700; text-transform: uppercase; color: var(--muted); }

/* ======================================================================================== buttons */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  height: 46px;
  margin: 0;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  font-family: var(--rc);
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.btn svg.fill { fill: currentColor; stroke: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.white { background: var(--text); color: var(--bg); }
.btn.white:hover:not(:disabled) { background: var(--white-hover); }
.btn.white svg { stroke-width: 2.4; }
.btn.gold { background: var(--gold); color: var(--on-gold); }
.btn.gold:hover:not(:disabled) { background: var(--gold-hover); }
.btn.red { background: var(--red-fill); color: #fff; }
.btn.red:hover:not(:disabled) { background: var(--red-hover); }
.btn.outline { background: var(--tag); border: 1px solid var(--tag-border); color: var(--text); }
.btn.outline:hover:not(:disabled) { background: var(--hover); }
.btn.quiet { background: transparent; border: 1px solid var(--ghost-border); color: var(--muted); height: 44px; font-size: 14px; }
.btn.quiet:hover:not(:disabled) { color: var(--text); border-color: var(--hover-border); }
.btn.big { height: 52px; font-size: 19px; }
.btn small { font-size: 12px; font-weight: 700; text-transform: none; color: var(--muted); }
.text-btn {
  min-height: 44px;
  margin: -12px 0;
  padding: 0;
  background: none;
  border: 0;
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.25);
  text-underline-offset: 3px;
}
.text-btn:hover { color: var(--text); }

/* ======================================================================================== options (radio chips) */
.opts { display: grid; gap: 4px; }
.opts label { position: relative; display: flex; min-width: 0; cursor: pointer; }
.opts input { position: absolute; opacity: 0; pointer-events: none; }
.opts label > span {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 40px;
  padding: 0 4px;
  border: 1px solid var(--ghost-border);
  border-radius: 5px;
  background: var(--tag);
  color: var(--muted);
  font-family: var(--rc);
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  text-transform: uppercase;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.opts label > span small { display: block; margin-top: 2px; font-size: 11px; font-weight: 700; opacity: 0.7; }
.opts label:hover > span { color: var(--text); border-color: var(--hover-border); }
.opts input:checked + span { background: var(--text); border-color: var(--text); color: var(--bg); }
.opts.def input:checked + span { background: rgba(91, 192, 248, 0.14); border-color: var(--def); color: var(--def); }
.opts.off input:checked + span { background: rgba(242, 194, 48, 0.14); border-color: var(--off); color: var(--off); }
.opts.kick input:checked + span { background: rgba(196, 181, 253, 0.14); border-color: var(--st); color: var(--st); }
.opts input:disabled + span { opacity: 0.4; }
.opts label:has(input:disabled) { cursor: not-allowed; }
.opts label:has(input:disabled):hover > span { color: var(--muted); border-color: var(--ghost-border); }
.opts input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 1px; }
.opts.c2 { grid-template-columns: repeat(2, var(--w, 66px)); }
.opts.c3 { grid-template-columns: repeat(3, var(--w, 76px)); }
.opts.w66 { --w: 66px; }
.opts.w76 { --w: 76px; }
.opts.w80 { --w: 80px; }
.opts.w92 { --w: 92px; }

/* A sheet row: label on the left, options on the right */
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 0 10px 0 14px;
}
.row + .row, .pool + .row { border-top: 1px solid var(--line); }
.row .lbl { flex: 1; min-width: 0; }

/* Legendaries on/off */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: -12px 0;
  font-family: var(--rc);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
}
.toggle:hover { color: var(--text); }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.track {
  position: relative;
  flex: none;
  width: 40px;
  height: 24px;
  border-radius: 999px;
  background: var(--hover);
  border: 1px solid var(--tag-border);
  transition: background 0.15s, border-color 0.15s;
}
.track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.15s, background 0.15s;
}
.toggle input:checked + .track { background: var(--gold); border-color: var(--gold); }
.toggle input:checked + .track::after { transform: translateX(16px); background: var(--bg); }
.toggle:has(input:checked) { color: var(--text); }
.toggle input:focus-visible + .track { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ======================================================================================== builder */
.actions { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 12px; }
.actions .s3 { grid-column: span 3; }
.actions .s2 { grid-column: span 2; }
.pool { padding: 12px 12px 12px 14px; }
.pool-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.opts.gens { grid-template-columns: repeat(5, 1fr); }
.opts.gens label > span { min-height: 44px; }
.pool-line { margin: 10px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.retro-note { margin-top: 6px; margin-bottom: 0; font-size: 12px; color: var(--subtle); }
.discord-cta { margin-top: 14px; gap: 9px; font-size: 16px; }
.discord-cta svg { width: 19px; height: 19px; color: #8b95f9; }

/* ======================================================================================== challenges */
.box.setup .row:first-child { border-top: 0; }
#dp-start { width: auto; margin-top: 12px; }
.dp-lb {
  min-height: 1.4em;
  margin-top: 10px;
  margin-bottom: 0;
  overflow: hidden;
  font-size: 12.5px;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--muted);
}
.dp-lb a { color: var(--gold); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* Scorebug: round · region · type · Legendaries (17–0) / round · ORIGINAL 151 · rerolls (151) / the final */
.bug {
  display: flex;
  align-items: stretch;
  height: 44px;
  border: 1px solid var(--tag-border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--tag);
  font-family: var(--rc);
  text-transform: uppercase;
  line-height: 1;
}
.bug small { font-size: 10px; font-weight: 700; }
.bug-round { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 0 10px; background: var(--gold); color: var(--on-gold); }
.bug-round b { font-size: 18px; font-weight: 800; white-space: nowrap; }
.bug-round b small { font-size: 12px; }
body.game-151 .bug-round { background: var(--red-fill); color: #fff; }
.bug-side { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 0 10px; border-left: 1px solid var(--tag-border); text-align: center; }
.bug-side small { color: var(--muted); }
.bug-side b { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bug-name { flex: 1; display: flex; align-items: center; padding: 0 12px; font-size: 16px; font-weight: 800; }
/* The roll's chips are the scorebug's region and type cells. */
.bug .chip { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 0 12px; font-size: 18px; font-weight: 800; white-space: nowrap; }
.bug .chip small { font-size: 12px; font-weight: 700; color: var(--muted); }
.bug .chip.region { flex: 1; overflow: hidden; }
.bug .chip.type { padding: 0 14px; }
.bug .chip.blank { font-size: 17px; color: var(--subtle); }
.bug .chip.blank:first-of-type { flex: 1; }
.bug .chip.blank + .chip.blank { flex: none; border-left: 1px dashed var(--tag-border); }
.bug .chip.blank.spinning { animation: blank-pulse 0.7s ease-in-out infinite alternate; }
@keyframes blank-pulse { to { color: var(--text); } }
.bug.final { height: 58px; border-color: var(--gold); }
.bug-final { display: flex; align-items: center; padding: 0 12px; background: var(--gold); color: var(--on-gold); font-size: 15px; font-weight: 800; }
.bug-record { flex: 1; display: flex; align-items: center; padding: 0 14px; font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bug-record.perfect { color: var(--gold); }
.bug-score { align-items: flex-end; padding: 0 14px; text-align: right; }
.bug-score small { font-size: 11px; }
.bug-score b { font-size: 28px; }

/* 22 ticks, one per round */
.ticks { display: grid; grid-template-columns: repeat(22, 1fr); gap: 2px; margin-top: 8px; }
.ticks i { display: block; height: 4px; background: rgba(255, 255, 255, 0.12); }
.ticks i.done { background: var(--gold); }
.ticks i.now { background: rgba(242, 194, 48, 0.4); }
body.game-151 .ticks i.done { background: var(--red); }
body.game-151 .ticks i.now { background: rgba(248, 113, 113, 0.4); }
/* 17 squares, one per game (gold all round on a perfect season) */
.squares { display: grid; grid-template-columns: repeat(17, 1fr); gap: 3px; margin-top: 8px; }
.squares i { display: block; height: 6px; border-radius: 1px; background: var(--win); }
.squares i.loss { background: var(--red); }
.squares.perfect i { background: var(--gold); }
/* which pieces each state shows (the containers are hidden by app.js; these are the shared ones) */
body:not([data-dp="turn"]):not([data-dp="placing"]) .ticks,
body:not([data-dp="done"]) .squares,
body:not([data-dp="placing"]) .callout,
body:not([data-dp="turn"]) #dp-choose,
body:not([data-dp="turn"]):not([data-dp="placing"]) .meta,
body:not([data-dp="done"]) .done-actions { display: none !important; }

/* The pick waiting to be placed */
.pick-card { display: flex; flex-direction: column; gap: 10px; }
.pc-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pick-card .thumb { width: 52px; height: 52px; flex: none; }
.pc-main { display: flex; flex: 1; flex-direction: column; gap: 5px; min-width: 0; }
.pc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; font-family: var(--rc); text-transform: uppercase; }
.pc-head b { overflow: hidden; font-size: 21px; font-weight: 800; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.pc-num { font-size: 12.5px; font-weight: 700; color: var(--subtle); text-transform: none; }
#dp-change { flex: none; }
body:not(.game-151) .pick-card { min-height: 60px; padding: 4px 6px; border: 1px solid var(--gold); border-radius: 6px; background: var(--tag); justify-content: center; }
body.game-151 .pick-card { padding: 12px; background: var(--panel); border: 1px solid rgba(248, 113, 113, 0.55); border-radius: 8px; }
body.game-151 .pick-card .thumb { width: 64px; height: 64px; }
body.game-151 .pc-row { gap: 12px; }
body.game-151 .pc-main { gap: 6px; }
body.game-151 .pc-head b { font-size: 23px; }
.reroll { height: 44px; font-size: 16px; }
.reroll svg { width: 16px; height: 16px; stroke-width: 2.4; }
.reroll small { padding: 1px 8px; border-radius: 999px; font-family: var(--font); font-size: 11.5px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, 0.25); }
.reroll:disabled { background: var(--tag); border: 1px solid var(--ghost-border); color: var(--muted); }
.reroll:disabled small { background: none; color: var(--subtle); }

.callout {
  margin-top: 12px;
  margin-bottom: 0;
  padding: 12px;
  border: 1px dashed rgba(242, 194, 48, 0.6);
  border-radius: 6px;
  font-family: var(--rc);
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
  color: var(--gold);
}
body.game-151 .callout { border-color: rgba(248, 113, 113, 0.55); color: var(--red-light); }
body.game-151 #dp-choose { background: var(--red-fill); color: #fff; }
body.game-151 #dp-choose:hover:not(:disabled) { background: var(--red-hover); }
#dp-choose { margin-top: 12px; }
.meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
body[data-dp="placing"] .meta { margin-top: 12px; }
.done-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.done-actions #dp-season { grid-column: 1 / -1; }
.done-actions .btn { height: 44px; font-size: 16px; }
.done-actions .btn.big { height: 52px; font-size: 19px; }

/* Bests (Best record gets the widest cell, for "17–0 ×12") */
.bests {
  display: grid;
  grid-template-columns: 1fr 1.35fr 1fr;
  margin-top: 20px;
  margin-bottom: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  font-family: var(--rc);
  text-transform: uppercase;
}
.bests > div { min-width: 0; padding: 10px 12px; }
.bests > div + div { border-left: 1px solid var(--line); }
.bests dt { font-size: 12px; font-weight: 700; color: var(--subtle); white-space: nowrap; }
.bests dd { margin: 2px 0 0; font-size: 28px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bests dd.perfect { color: var(--gold); }
.bests dd small { font-size: 0.6em; }
.draft-panel .sec { margin-top: 24px; }
.rules { margin-top: 0; margin-bottom: 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.rules-sprites { margin-top: 14px; }

/* ======================================================================================== field */
.field-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1536 / 1064;
  overflow: hidden;
  border-block: 1px solid var(--line);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  container-type: inline-size; /* the roll pop-up scales with it */
}
#field { display: block; width: 100%; height: 100%; }
#hotspots { position: absolute; inset: 0; }
.hotspot {
  position: absolute;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 12px;
  cursor: grab;
  touch-action: none;
  -webkit-touch-callout: none; /* a press and hold shows the player's card */
}
/* a spot's name tag takes taps over any other spot that reaches across it (app.js gives the tag's box in fractions
   of the spot's border box: 100% + its 2px borders) */
#hotspots .hotspot::after {
  content: "";
  position: absolute;
  z-index: 1;
  left: calc(var(--tag-l) * (100% + 4px) - 2px);
  bottom: -2px;
  width: calc(var(--tag-w) * (100% + 4px));
  height: calc(var(--tag-h) * (100% + 4px));
}
.hotspot:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.4); }
.hotspot:focus-visible { outline: 2px solid var(--gold); outline-offset: 0; }
.hotspot.drop-target { background: rgba(242, 194, 48, 0.16); border-color: var(--gold); }
.hotspot.dragging { opacity: 0.4; }
/* In a challenge: no dragging (so swipes on the field scroll the page); open spots pulse while placing. */
#hotspots.draft .hotspot { cursor: pointer; touch-action: manipulation; }
#hotspots.draft .hotspot.locked { cursor: default; }
.hotspot.open-slot {
  border-color: rgba(74, 222, 128, 0.7);
  background: rgba(74, 222, 128, 0.07);
  animation: open-pulse 1.6s ease-in-out infinite;
}
.hotspot.open-slot:hover { background: rgba(74, 222, 128, 0.2); border-color: var(--open); }
@keyframes open-pulse { 50% { border-color: rgba(74, 222, 128, 0.22); } }
/* A player's card: hover them on the field (press and hold on a touchscreen) */
.player-card {
  position: fixed;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 248px;
  padding: 9px 10px 8px;
  border: 1px solid var(--tag-border);
  border-radius: 8px;
  background: var(--hover);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.6);
  font-family: var(--rc);
  text-transform: uppercase;
  pointer-events: none;
}
.player-card[hidden] { display: none; }
.player-card .pl-top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.player-card .pos-chip { padding: 2px 6px; font-size: 13px; }
.player-card .nm { min-width: 0; overflow: hidden; font-size: 17px; font-weight: 800; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.player-card .leg { flex: none; font-size: 14px; color: var(--gold); }
.player-card .num { flex: none; margin-left: auto; font-size: 12.5px; font-weight: 700; color: var(--subtle); font-variant-numeric: tabular-nums; }
.player-card .pl-size { font-size: 13px; font-weight: 700; line-height: 1.2; text-align: center; color: var(--muted); }
.ghost {
  position: fixed;
  z-index: 50;
  width: 96px;
  height: 96px;
  pointer-events: none;
  transform: translate(-50%, -60%);
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.5));
}
.ghost.pixelated { image-rendering: pixelated; }

/* ======================================================================================== the roll (reels over the field) */
.roll-pop {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.18));
  cursor: pointer;
  animation: roll-fade 0.18s ease-out;
  transition: opacity 0.18s;
}
.roll-pop.out { opacity: 0; }
@keyframes roll-fade { from { opacity: 0; } }
.roll-card {
  --reel-h: clamp(46px, 6.6cqw, 88px);
  --ring: var(--gold);
  --ring-soft: rgba(242, 194, 48, 0.16);
  --ring-glow: rgba(242, 194, 48, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 1.2cqw, 14px);
  padding: clamp(10px, 2cqw, 24px) clamp(14px, 2.8cqw, 34px);
  border-radius: 8px;
  background: rgba(9, 13, 17, 0.95);
  border: 1px solid var(--tag-border);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
  animation: roll-card-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.25);
}
body.game-151 .roll-card { --ring: var(--red); --ring-soft: rgba(248, 113, 113, 0.16); --ring-glow: rgba(248, 113, 113, 0.25); }
@keyframes roll-card-in { from { transform: scale(0.85); opacity: 0; } }
.roll-title {
  font-family: var(--rc);
  font-size: clamp(11px, 1.3cqw, 15px);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ring);
}
.reels { display: flex; gap: clamp(8px, 1.6cqw, 18px); }
.reel { display: flex; flex-direction: column; align-items: center; gap: clamp(4px, 0.6cqw, 8px); }
.reel-win {
  position: relative;
  width: clamp(112px, 15.5cqw, 210px);
  height: var(--reel-h);
  overflow: hidden;
  border-radius: 6px;
  background: var(--panel);
  border: 1.5px solid var(--tag-border);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.reel-win::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(var(--panel), transparent 20%, transparent 80%, var(--panel));
}
.reel-win.landed, .reel-win.held { border-color: var(--ring); }
.reel-win.landed { box-shadow: 0 0 0 3px var(--ring-soft), 0 0 26px var(--ring-glow); animation: reel-land 0.4s ease-out; }
@keyframes reel-land { 40% { transform: scale(1.07); } }
.reel-strip { position: absolute; top: 0; left: 0; right: 0; }
.reel-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: calc(var(--reel-h) - 3px); /* inside the window's 1.5px border */
  font-family: var(--rc);
  line-height: 1.1;
  text-transform: uppercase;
}
.reel-item b { font-size: clamp(17px, 2.3cqw, 30px); font-weight: 800; }
.reel-item small { font-size: clamp(10px, 1.1cqw, 14px); font-weight: 700; color: var(--muted); }
.reel-item .type { padding: 0.25em 0.65em; border-radius: 5px; font-size: clamp(14px, 1.9cqw, 24px); font-weight: 800; }
.reel.mon .reel-win { width: clamp(200px, 30cqw, 400px); }
.reel-item.mon { flex-direction: row; gap: clamp(6px, 1cqw, 12px); padding: 0 10px; }
.reel-item.mon img { flex: none; width: auto; height: calc(var(--reel-h) * 0.86); }
.reel-item.mon img.pixelated { image-rendering: pixelated; }
.reel-item.mon b { overflow: hidden; font-size: clamp(15px, 2.1cqw, 27px); white-space: nowrap; text-overflow: ellipsis; }
.reel-label, .roll-skip { font-family: var(--rc); font-size: clamp(10px, 1.05cqw, 12.5px); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.reel-label { color: var(--muted); }
.roll-skip { color: var(--subtle); }

/* ======================================================================================== Pokémon types, stats */
.type { background: rgb(var(--t)); color: #16161a; }
.t-normal { --t: 168, 167, 122; }
.t-fire { --t: 238, 129, 48; }
.t-water { --t: 99, 144, 240; }
.t-electric { --t: 247, 208, 44; }
.t-grass { --t: 122, 199, 76; }
.t-ice { --t: 150, 217, 214; }
.t-fighting { --t: 194, 46, 40; }
.t-poison { --t: 163, 62, 161; }
.t-ground { --t: 226, 191, 101; }
.t-flying { --t: 169, 143, 243; }
.t-psychic { --t: 249, 85, 135; }
.t-bug { --t: 166, 185, 26; }
.t-rock { --t: 182, 161, 54; }
.t-ghost { --t: 115, 87, 151; }
.t-dragon { --t: 111, 53, 252; }
.t-dark { --t: 112, 87, 70; }
.t-steel { --t: 183, 183, 206; }
.t-fairy { --t: 214, 133, 173; }
.t-fighting, .t-poison, .t-ghost, .t-dragon, .t-dark { color: #fff; }
.cand-types { display: flex; flex-wrap: wrap; gap: 4px; }
.cand-types .type { padding: 2px 7px; border-radius: 3px; font-family: var(--rc); font-size: 11.5px; font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; }
.cand-stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
  padding: 5px 0;
  border-block: 1px solid var(--line);
  font-family: var(--rc);
}
.cand-stats > span {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.cand-stats i { font-size: 10.5px; font-style: normal; font-weight: 700; text-transform: uppercase; color: var(--subtle); }
.cand-stats .hi { color: var(--hi-stat); }
.cand-stats .lo { color: var(--subtle); }
/* The 151 panel: height and weight under the stats */
.cand-stats .size { display: block; grid-column: 1 / -1; padding-top: 6px; font-size: 13.5px; font-weight: 700; line-height: 1.2; text-align: center; text-transform: uppercase; color: var(--text); }
.cand-stats .size b { font-weight: 700; }
.cand-stats .size i { display: inline; font-size: inherit; font-weight: 700; color: var(--muted); }
[data-tip] { cursor: help; }
@media (hover: none) { [data-tip] { cursor: pointer; } }
.stat-tip {
  position: fixed;
  z-index: 70;
  max-width: 230px;
  padding: 8px 10px;
  border: 1px solid var(--tag-border);
  border-radius: 6px;
  background: var(--hover);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--muted);
  pointer-events: none;
}
.stat-tip[hidden] { display: none; }
.stat-tip b { display: block; margin-bottom: 2px; font-family: var(--rc); font-size: 14px; font-weight: 800; text-transform: uppercase; color: var(--text); }

/* ======================================================================================== pop-ups */
/* Phones: bottom sheets. Wide screens: centered windows (see the wide-screen block). */
dialog.sheet {
  position: fixed;
  inset: auto 0 0 0;
  width: 100%;
  max-width: 100%;
  height: calc(100vh - 64px);
  height: calc(100dvh - 64px);
  max-height: none;
  margin: auto 0 0;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--tag-border);
  border-radius: 12px 12px 0 0;
  background: var(--sheet);
  color: var(--text);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.55);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
dialog.sheet[open] { display: flex; animation: sheet-up 0.2s ease-out; }
@keyframes sheet-up { from { transform: translateY(48px); opacity: 0.4; } }
dialog.sheet::before {
  content: "";
  flex: none;
  width: 36px;
  height: 4px;
  margin: 8px auto 0;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.22);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.62); }
.picker-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 4px 6px 10px var(--gutter);
}
.picker-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.picker-title h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-family: var(--rc);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.picker-title h2 svg.trophy { width: 22px; height: 22px; fill: none; stroke: var(--gold); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.close {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}
.close:hover { background: var(--hover); color: var(--text); }
.close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.pos-chip {
  flex: none;
  padding: 4px 8px;
  border: 1px solid var(--tag-border);
  border-radius: 5px;
  background: var(--tag);
  font-family: var(--rc);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.1;
}
.pos-chip.off { color: var(--off); }
.pos-chip.def { color: var(--def); }
.pos-chip.st { color: var(--st); }
.picker-hint { flex: none; margin: 10px var(--gutter) 6px; font-size: 12.5px; line-height: 1.4; color: var(--muted); }

/* ----- Pokémon picker ----- */
.picker-tools { flex: none; display: flex; gap: 8px; padding: 0 var(--gutter); }
.picker-tools input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--tag-border);
  border-radius: 6px;
  background: var(--tag);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px; /* keeps iOS from zooming */
  transition: border-color 0.15s;
}
.picker-tools input::placeholder { color: var(--subtle); }
.picker-tools input:focus { outline: none; border-color: var(--gold); }
.picker-tools .btn { flex: none; height: 44px; font-size: 15px; }
.grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  gap: 6px;
  padding: 4px var(--gutter) var(--gutter);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.grid .mon {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  margin: 0;
  padding: 6px 2px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  font-family: var(--rc);
  text-transform: uppercase;
  transition: border-color 0.15s;
}
.grid .mon:hover { border-color: var(--hover-border); }
.grid .mon[hidden], .empty-msg[hidden] { display: none; }
.grid .mon img { width: 56px; height: 56px; image-rendering: pixelated; }
.grid .mon .num { font-size: 11.5px; font-weight: 700; color: var(--subtle); text-transform: none; font-variant-numeric: tabular-nums; }
.grid .mon .nm { max-width: 100%; font-size: 13px; font-weight: 800; line-height: 14.3px; text-align: center; overflow-wrap: break-word; }
.grid .mon.current { border-color: var(--gold); background: rgba(242, 194, 48, 0.1); }
.grid .mon .tag {
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 1px 5px;
  border: 1px solid var(--tag-border);
  border-radius: 3px;
  background: var(--tag);
  font-size: 11px;
  font-weight: 800;
}
.grid .mon .tag.off { color: var(--off); }
.grid .mon .tag.def { color: var(--def); }
.grid .mon .tag.st { color: var(--st); }
.grid .mon .leg { position: absolute; top: 3px; left: 6px; font-size: 13px; color: var(--gold); }
/* Base stats (HP Atk Def / SpA SpD Spe: greener when high, dimmer when low) and size, lined up along
   each row's bottom edge whatever the names above them wrap to */
.grid .mon .ms {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px 0;
  width: 100%;
  margin-top: auto;
  padding: 5px 1px 0;
  border-top: 1px solid var(--line);
}
.grid .mon .ms > span {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.grid .mon .ms i { font-size: 9px; font-style: normal; font-weight: 700; color: var(--subtle); }
.grid .mon .ms .hi { color: var(--hi-stat); }
.grid .mon .ms .lo { color: var(--subtle); }
.grid .mon .msz {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 5px;
  margin-top: 3px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.grid .mon .msz span { white-space: nowrap; }
.empty-msg { grid-column: 1 / -1; padding: 24px; font-size: 14px; text-align: center; color: var(--muted); }

/* ----- Choose a Pokémon (17–0) ----- */
.roll-bar { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 0 var(--gutter); }
.roll-bar .bug.roll { width: 100%; }
.rerolls { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.rerolls .btn { height: 44px; padding: 0 10px; font-size: 14px; gap: 6px; }
.rerolls .btn svg { width: 15px; height: 15px; color: var(--muted); }
.rerolls .btn:disabled svg { display: none; }
.cand-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: max-content;
  align-content: start;
  gap: 8px;
  padding: 4px var(--gutter) var(--gutter);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.cand {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  text-align: left;
  transition: border-color 0.15s;
}
.cand:hover:not(:disabled) { border-color: var(--hover-border); }
.cand.current { border-color: var(--gold); background: rgba(242, 194, 48, 0.08); }
.cand.locked { opacity: 0.45; cursor: not-allowed; }
.cand .thumb { width: 64px; height: 64px; flex: none; }
.cand-main { display: flex; flex: 1; flex-direction: column; gap: 6px; min-width: 0; }
.cand-name { display: flex; align-items: baseline; gap: 6px; min-width: 0; font-family: var(--rc); text-transform: uppercase; }
.cand-name .nm { overflow: hidden; font-size: 19px; font-weight: 800; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.cand-name .leg { font-size: 14px; color: var(--gold); }
.cand-name .num { margin-left: auto; font-size: 12.5px; font-weight: 700; color: var(--subtle); text-transform: none; font-variant-numeric: tabular-nums; }
.cand-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-family: var(--rc); font-size: 13px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.cand.locked .cand-foot { color: var(--gold); }

/* ----- Season results ----- */
.season-body { flex: 1; min-height: 0; padding: 0 var(--gutter) 4px; overflow-y: auto; overscroll-behavior: contain; }
.season-card { display: flex; justify-content: center; padding: 0; border-radius: 8px; }
.season-card img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 300px);
  max-height: calc(100svh - 300px);
  border-radius: 8px;
  background: var(--panel);
  -webkit-touch-callout: default;
  user-select: auto;
  -webkit-user-select: auto;
}
.season-card img.loading { animation: card-wait 1s ease-in-out infinite alternate; }
@keyframes card-wait { to { background: var(--hover); } }
.season-hint { margin: 10px 0; font-size: 12.5px; line-height: 1.4; text-align: center; color: var(--muted); }
.season-more summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-family: var(--rc);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  list-style: none;
  cursor: pointer;
}
.season-more summary::-webkit-details-marker { display: none; }
.season-more summary::after { content: ""; flex: 1; order: 1; height: 1px; background: var(--line); }
.season-more summary svg { order: 2; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.15s; }
.season-more[open] summary svg { transform: rotate(180deg); }
.season-more summary:hover svg { stroke: var(--text); }
.season-notes { margin: 4px 0 10px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.season-games { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; margin: 0 0 12px; padding: 0; list-style: none; }
.season-games li {
  display: grid;
  grid-template-columns: 22px 16px 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  font-family: var(--rc);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.season-games .wk, .season-games .ors { font-size: 12px; color: var(--subtle); }
.season-games .res { font-weight: 800; }
.season-games .win .res { color: var(--win); }
.season-games .loss .res { color: var(--red); }
.season-games .opp { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.season-how { margin: 0 0 12px; font-size: 12px; line-height: 1.5; color: var(--subtle); }
.season-actions {
  flex: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px var(--gutter) 16px;
  border-top: 1px solid var(--line);
}
.season-actions .post-btn, .season-actions .post-note { grid-column: 1 / -1; }
.season-actions .btn:not(.post-btn) { height: 46px; font-size: 16px; }
.post-btn { gap: 8px; height: auto; min-height: 44px; padding-block: 6px; font-size: 15px; line-height: 1.15; white-space: normal; text-align: center; }
.post-btn svg { width: 17px; height: 17px; stroke: var(--gold); stroke-width: 2.3; }
.post-btn span { min-width: 0; }
.post-btn.posted { border-color: rgba(242, 194, 48, 0.45); }
.post-note { margin: 0; font-size: 12.5px; line-height: 1.4; text-align: center; color: var(--subtle); }

/* ----- Leaderboard ----- */
.board-tabs { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 0 var(--gutter); }
.tabs-g {
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  border: 1px solid var(--tag-border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--tag);
  font-family: var(--rc);
  text-transform: uppercase;
}
.tabs-g label { position: relative; display: flex; min-width: 0; cursor: pointer; }
.tabs-g label + label { border-left: 1px solid var(--tag-border); }
.tabs-g input { position: absolute; opacity: 0; pointer-events: none; }
.tabs-g span { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; min-height: 48px; line-height: 1; color: var(--nav); }
.tabs-g b { font-size: 17px; font-weight: 800; }
.tabs-g small { font-size: 10.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.tabs-g label:hover span { background: var(--hover); }
.tabs-g input:checked + span { background: var(--gold); color: var(--on-gold); }
.tabs-g input:checked + span small { color: var(--on-gold-2); }
.tabs-g input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: -3px; }
.opts.tabs-s { grid-template-columns: 1fr 1fr; }
.board-note { flex: none; margin: 10px var(--gutter) 6px; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.board-cols {
  flex: none;
  display: grid;
  grid-template-columns: 28px 34px minmax(0, 1fr) 52px 40px;
  gap: 10px;
  padding: 0 calc(var(--gutter) - 2px + 8px) 4px;
  font-family: var(--rc);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--subtle);
}
.board-cols span:first-child { grid-column: 3; }
.board-cols span:not(:first-child) { text-align: right; }
.board-list { flex: 1; min-height: 140px; margin: 0; padding: 0 calc(var(--gutter) - 2px) 6px; list-style: none; overflow-y: auto; overscroll-behavior: contain; }
.board-row {
  display: grid;
  grid-template-columns: 28px 34px minmax(0, 1fr) 52px 40px;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 6px;
}
.board-row:has(.br-remove) { grid-template-columns: 28px 34px minmax(0, 1fr) 52px 40px 30px; }
.board-row + .board-row { border-top: 1px solid var(--line); }
.board-row.me { background: rgba(242, 194, 48, 0.08); box-shadow: inset 0 0 0 1px rgba(242, 194, 48, 0.5); }
.board-row.me + .board-row, .board-row + .board-row.me { border-top-color: transparent; }
.br-rank { font-family: var(--rc); font-size: 19px; font-weight: 800; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.board-row.top1 { --metal: #facc15; --metal-glow: rgba(250, 204, 21, 0.5); --metal-tint: rgba(250, 204, 21, 0.13); }
.board-row.top2 { --metal: #d4d4d8; --metal-glow: rgba(212, 212, 216, 0.4); --metal-tint: rgba(212, 212, 216, 0.1); }
.board-row.top3 { --metal: #e0975e; --metal-glow: rgba(224, 151, 94, 0.45); --metal-tint: rgba(224, 151, 94, 0.12); }
.board-row.top1, .board-row.top2, .board-row.top3 { background: linear-gradient(90deg, var(--metal-tint), transparent 80%); }
.board-row.top1 .br-pic, .board-row.top2 .br-pic, .board-row.top3 .br-pic { box-shadow: 0 0 0 2px var(--sheet), 0 0 0 4px var(--metal); }
.br-trophy { display: block; width: 26px; height: 26px; margin: 0 auto; color: var(--metal); filter: drop-shadow(0 0 5px var(--metal-glow)); }
.br-trophy .tr-body { fill: currentColor; }
.br-trophy .tr-handles { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.br-trophy .tr-shine { fill: none; stroke: #fff; stroke-opacity: 0.6; stroke-width: 1.3; stroke-linecap: round; }
.br-pic {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--hover);
  font-family: var(--rc);
  font-size: 16px;
  font-weight: 800;
  color: var(--muted);
}
.br-pic img { width: 100%; height: 100%; object-fit: cover; }
.br-name { display: flex; flex-direction: column; min-width: 0; }
.br-name b, .br-name small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.br-name b { font-size: 14px; font-weight: 700; }
.br-name small { font-size: 12px; color: var(--subtle); }
.br-rec, .br-score { font-family: var(--rc); font-size: 22px; font-weight: 800; line-height: 1; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.br-rec.perfect { color: var(--gold); }
.br-score { color: var(--muted); }
.br-remove { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--red); }
.br-remove:hover { background: var(--hover); }
.br-remove svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.br-flag { grid-column: 3 / -1; margin: -4px 0 0; font-size: 12px; font-weight: 700; color: var(--red); }
.board-more { padding: 6px 8px 12px; font-size: 12.5px; text-align: center; color: var(--subtle); }
.board-more button {
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  background: none;
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.25);
  text-underline-offset: 3px;
}
.board-more button:hover { color: var(--text); }
.board-foot { flex: none; padding: 10px var(--gutter) 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.board-foot p { margin: 0; }
.board-foot a { color: var(--gold); font-weight: 600; }
.board-foot button { padding: 0; border: 0; background: none; font-size: 13px; color: var(--muted); text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.25); text-underline-offset: 3px; }
.board-foot button:hover { color: var(--text); }
.board-foot .board-fine { margin-top: 6px; font-size: 11.5px; line-height: 1.4; color: var(--subtle); }

/* ======================================================================================== toast */
#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border: 1px solid var(--tag-border);
  border-radius: 6px;
  background: var(--hover);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px);
  transition: opacity 0.2s, transform 0.2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ======================================================================================== footer */
footer {
  margin-top: 28px;
  padding: 18px var(--gutter) 24px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}
footer p { margin: 0; }
footer a { color: var(--text); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.3); text-underline-offset: 3px; }
footer a:hover { text-decoration-color: currentColor; }
footer .fine { margin-top: 10px; font-size: 11px; line-height: 1.5; color: var(--subtle); }
@media (max-width: 999px) {
  footer > * { max-width: 560px; margin-left: auto; margin-right: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .hotspot.open-slot, .bug .chip.blank.spinning, .roll-pop, .roll-card, .reel-win.landed, .season-card img.loading, dialog.sheet[open] { animation: none; }
  .btn, .opts label > span, .track, .track::after, #toast { transition: none; }
}

/* ======================================================================================== small phones */
@media (max-width: 380px) {
  .wordmark { font-size: 18.5px; }
  .picker-title h2 { font-size: min(22px, 5.3vw); } /* "Offense: pick a Pokémon" fits a 320px phone */
  .play-team { gap: 5px; padding: 0 9px 0 8px; font-size: 13px; }
  .modes-bar { padding-inline: 12px; }
  .mode > span { font-size: 11.5px; }
  .mode-big b { font-size: 17px; }
  .mode-fd b { font-size: 13.5px; }
  .mode-big > span { font-size: 10px; }
  .bug .chip { font-size: 16px; padding: 0 10px; }
  .bug .chip.type { padding: 0 10px; }
  .bug-name { font-size: 15px; }
}

/* ======================================================================================== builder flow cue */
.builder-flow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(227, 53, 13, 0.22);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(227, 53, 13, 0.08), rgba(255, 255, 255, 0.62));
}
.builder-flow-copy { display: grid; gap: 5px; min-width: 0; }
.builder-flow-kicker { font-family: var(--rc); font-size: 11px; font-weight: 800; line-height: 1; letter-spacing: .04em; color: var(--gold); }
.builder-flow-copy strong { font-family: var(--rc); font-size: 15px; line-height: 1.1; color: var(--text); }
.builder-flow-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 6px;
  background: var(--gold);
  color: #fff;
  font-family: var(--rc);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}
.builder-flow-cta:hover { background: var(--gold-hover); }
.builder-flow-cta span { font-size: 17px; line-height: 1; }
@media (max-width: 599px) {
  .builder-flow { align-items: stretch; flex-direction: column; gap: 10px; margin-top: 14px; padding: 12px; }
  .builder-flow-cta { justify-content: center; width: 100%; }
}
/* Phones: picker names only as much smaller as the tile needs for the longest ones (Brambleghast,
   Crabominable) to fit whole, so no name breaks mid-word (their line keeps its height) */
@media (max-width: 599px) {
  .grid .mon .nm { font-size: min(13px, calc(3.5vw - 2.6px)); }
}
/* Under 360px the Sprites row's three options would cover its label: narrower options. And the Bests
   strip's numbers would spill out of their cells: smaller ones. The picker has three tiles to a row,
   so names stay readable. */
@media (max-width: 359px) {
  .opts.w76 { --w: 64px; }
  .opts.c3 label > span { padding: 0 2px; font-size: 13.5px; }
  .bests > div { padding-inline: 8px; }
  .bests dd { font-size: 24px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid .mon .nm { font-size: min(13px, calc(4.6vw - 2.8px)); }
}
@media (min-width: 600px) and (max-width: 999px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
  .grid .mon img { width: 64px; height: 64px; }
  .cand-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  .roll-bar { flex-direction: row; align-items: center; }
  .roll-bar .bug.roll { width: auto; flex: 1; min-width: 260px; }
  .season-games { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(9, auto); grid-auto-flow: column; gap: 4px 10px; }
}
/* Phones: the roll fills the field (sizes follow the field's width), so it reads at a glance. */
@media (max-width: 600px) {
  .roll-card { --reel-h: 24cqw; gap: 2.4cqw; padding: 3.2cqw 4cqw; }
  .roll-title { font-size: 3.6cqw; }
  .reels { gap: 2.4cqw; }
  .reel-win { width: 41cqw; }
  .reel.mon .reel-win { width: 84cqw; }
  .reel-item b, .reel-item.mon b { font-size: 7cqw; }
  .reel-item small { font-size: 3.4cqw; }
  .reel-item .type { font-size: 5.8cqw; }
  .reel-label, .roll-skip { font-size: 3.2cqw; }
}

/* ======================================================================================== wide screens */
@media (min-width: 1000px) and (min-height: 560px) {
  :root { --gutter: 22px; }
  html { scroll-padding-top: 0; }
  .app { display: flex; flex-direction: column; align-items: stretch; height: 100vh; height: 100svh; }
  .site-head {
    flex: none;
    display: flex;
    align-items: center;
    gap: 28px;
    height: 64px;
    padding: 0 28px;
    border-bottom: 1px solid var(--line);
  }
  .wordmark { height: auto; padding: 0; font-size: 24px; line-height: 1; overflow: visible; }
  .modes-bar { position: static; padding: 0; background: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .modes { display: flex; height: 40px; max-width: none; margin: 0; }
  .mode { flex-direction: row; gap: 7px; height: 100%; padding: 0 16px; }
  .mode svg { width: 17px; height: 17px; }
  .mode > span, .mode-big > span { font-size: 15px; font-weight: 800; color: inherit; }
  .mode-big b, .mode-fd b { font-size: 17px; }
  .mode-fd b { font-size: 15px; }
  .mode-170[aria-current="page"] > span, .mode-151[aria-current="page"] > span { color: inherit; }
  .play-team { margin: 0 0 0 auto; }

  .main {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 340px minmax(0, calc((100vh - 108px) * 1536 / 1064));
    grid-template-columns: 340px minmax(0, calc((100svh - 108px) * 1536 / 1064));
    grid-template-rows: minmax(0, 1fr);
    justify-content: center;
    gap: 28px;
    padding: 20px 28px 24px;
  }
  /* The controls column: never scrolls at the sizes people use (see the height steps below). */
  .panel { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; scrollbar-width: none; padding-bottom: 4px; }
  .panel > *, .panel .draft-panel > *, .panel .dp-state > * { flex-shrink: 0; }
  .panel::-webkit-scrollbar { display: none; }
  .main .o-top, .main .o-bot { margin-left: 0; margin-right: 0; }
  .stage { order: 0; min-width: 0; align-self: start; margin: 0 !important; }
  .field-wrap { border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6); }

  .title-block { padding: 0 0 14px; }
  .title-block h1 { font-size: 32px; gap: 6px 8px; }
  .retro-badge { padding: 2px 6px 1px; font-size: 12px; }
  .desc { margin-top: 8px; }
  .actions { margin-top: 0; }
  .sec { margin-top: 22px; }
  body.mode-draft .panel > .draft-panel { display: contents; }

  /* Pop-ups: centered windows */
  dialog.sheet {
    inset: 0;
    width: min(880px, calc(100vw - 64px));
    height: min(760px, calc(100vh - 64px));
    height: min(760px, calc(100dvh - 64px));
    margin: auto;
    border: 1px solid var(--tag-border);
    border-radius: 10px;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.7);
  }
  dialog.sheet[open] { animation: dialog-in 0.16s ease-out; }
  @keyframes dialog-in { from { opacity: 0; transform: scale(0.98); } }
  dialog.sheet::before { display: none; }
  dialog.season-sheet { width: min(1040px, calc(100vw - 64px)); height: min(800px, calc(100vh - 64px)); height: min(800px, calc(100dvh - 64px)); }
  dialog.board-sheet { width: min(760px, calc(100vw - 64px)); height: min(820px, calc(100vh - 64px)); height: min(820px, calc(100dvh - 64px)); }
  .picker-head { padding: 14px 10px 12px var(--gutter); }
  .picker-title h2 { font-size: 24px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
  .grid .mon img { width: 64px; height: 64px; }
  .roll-bar { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
  .roll-bar .bug.roll { width: auto; min-width: 300px; }
  .rerolls { display: flex; }
  .rerolls .btn { padding: 0 12px; }
  .cand-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  .season-body { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 24px; align-items: start; padding-bottom: 12px; }
  .season-card img { max-height: calc(min(800px, 100vh - 64px) - 200px); }
  .season-hint { margin-bottom: 0; }
  .season-games { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(9, auto); grid-auto-flow: column; gap: 4px 10px; }
  .season-actions { display: flex; align-items: center; }
  .season-actions .post-btn { flex: 1; min-width: 0; min-height: 46px; }
  .season-actions .post-note { flex: 1 1 100%; order: 3; }
  .season-actions .btn:not(.post-btn) { flex: none; padding: 0 16px; }
  .board-tabs { flex-direction: row; }
  .tabs-g { flex: 1; }
  .opts.tabs-s { grid-template-columns: repeat(2, 96px); }
  .opts.tabs-s label > span { min-height: 50px; }

  footer { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; margin: 0; padding: 22px 28px 28px; }
  footer .fine { max-width: 440px; margin: 0; font-size: 11.5px; text-align: right; }
}
/* Narrower wide screens: the menu drops "Challenge" and the header tightens so it all fits on one bar. */
@media (min-width: 1000px) and (max-width: 1279px) and (min-height: 560px) {
  .site-head { gap: 18px; padding: 0 22px; }
  .mode { padding: 0 12px; }
  .mode-170 > span, .mode-151 > span { display: none; }
  .main { padding-inline: 22px; gap: 22px; }
}

/* ======================================================================================== wide screens: height steps */
/* The controls column never scrolls (the owner asked for that): shorter windows get a tighter column. Measured with
   the column's content height in every state (builder, run setup, a round, placing, season over) from 560px up. */
@media (min-width: 1000px) and (min-height: 560px) and (max-height: 899px) {
  .row { min-height: 48px; }
  .opts label > span { min-height: 36px; }
  .opts.gens label > span { min-height: 40px; }
  .sec { margin-top: 18px; padding-bottom: 8px; }
  .draft-panel .sec { margin-top: 18px; }
  .bests { margin-top: 14px; }
  .bests > div { padding: 8px 12px; }
  .bests dd { font-size: 24px; }
  .discord-cta { margin-top: 8px; }
  .retro-note { margin-top: 4px; line-height: 1.3; }
  .pool-line { margin-top: 8px; line-height: 1.35; }
}
/* Under 800px: Defense, Offense and Kicker share one strip (label over the options) */
@media (min-width: 1000px) and (min-height: 560px) and (max-height: 799px) {
  .team-sheet { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .team-sheet > .pool, .team-sheet > .sprites-row { grid-column: 1 / -1; }
  .team-sheet > .row:not(.sprites-row) { flex-direction: column; align-items: stretch; gap: 6px; min-height: 0; padding: 9px 8px 10px; border-top: 1px solid var(--line); }
  .team-sheet > .row:not(.sprites-row) + .row:not(.sprites-row) { border-left: 1px solid var(--line); }
  .team-sheet > .row:not(.sprites-row) .lbl { font-size: 12.5px; text-align: center; }
  .team-sheet > .row:not(.sprites-row) .opts.c2 { grid-template-columns: 1fr 1fr; }
  .team-sheet > .sprites-row { border-top: 1px solid var(--line); }
  .box.setup .row { min-height: 44px; }
  .title-block h1 { font-size: 28px; }
  .title-block { padding-bottom: 12px; }
  .pool { padding-block: 8px; }
  .pool-head { margin-bottom: 6px; }
  .pool-line { margin-top: 6px; }
  .discord-cta { margin-top: 6px; }
  .actions { gap: 5px; }
  .actions .btn { height: 42px; }
  .actions .btn.quiet { height: 38px; }
  .btn.big { height: 48px; font-size: 18px; }
  .callout { padding: 10px; font-size: 15px; }
  .rules { font-size: 13px; line-height: 1.45; }
  .rules-sprites { margin-top: 10px; }
  body.game-151 .pick-card { gap: 8px; padding: 10px 12px; }
  .reroll { height: 40px; }
}
/* Under 700px: the builder's and the run setup's descriptions make way for the controls */
@media (min-width: 1000px) and (min-height: 560px) and (max-height: 699px) {
  .desc.builder-only, #dp-setup > .desc { display: none; }
  .title-block { padding-bottom: 10px; }
  .pool-line { font-size: 12px; line-height: 1.35; }
  .sec { margin-top: 14px; padding-bottom: 6px; }
  .draft-panel .sec { margin-top: 14px; }
  .bests { margin-top: 12px; }
  .bests dd { font-size: 22px; }
  .rules { font-size: 12.5px; line-height: 1.4; }
  .opts label > span { min-height: 34px; }
  .opts.gens label > span { min-height: 36px; }
  .opts label > span small { margin-top: 1px; font-size: 10.5px; }
  .row { min-height: 44px; }
  .box.setup .row { min-height: 42px; }
  .discord-cta { height: 40px; margin-top: 6px; }
  .retro-note { font-size: 11.5px; }
  .dp-lb { margin-top: 8px; }
  #dp-start { margin-top: 10px; }
  .ticks, .squares { margin-top: 6px; }
  .callout { margin-top: 10px; padding: 8px; }
}
/* Under 620px: How it works keeps its Sprites row; its text and the Team sheet heading go */
@media (min-width: 1000px) and (min-height: 560px) and (max-height: 619px) {
  .title-block h1 { font-size: 26px; }
  .sec.builder-only { display: none; }
  .actions + .sec + .team-sheet, .actions ~ .team-sheet { margin-top: 10px; }
  .pool-line { display: none; }
  .draft-panel .sec, .rules { display: none; }
  .rules-sprites { margin-top: 10px; }
  .bests > div { padding: 6px 10px; }
  .bests dt { font-size: 11px; }
  .bests dd { font-size: 20px; }
  .meta { margin-top: 6px; }
  body[data-dp="placing"] .meta { margin-top: 8px; }
  body.game-151 .pick-card .thumb { width: 52px; height: 52px; }
  body.game-151 .pc-head b { font-size: 20px; }
  .cand-stats > span { font-size: 15px; }
}
/* 151, placing a pick, under 700px: its big pick card needs How it works' room (the Sprites row stays) */
@media (min-width: 1000px) and (min-height: 560px) and (max-height: 699px) {
  body.game-151[data-dp="placing"] .draft-panel .sec, body.game-151[data-dp="placing"] .rules { display: none; }
}

/* ALL 22 POKÉMON NET — spacious arcade HUD refresh */
:root {
  --bg: #080a12;
  --panel: #111522;
  --tag: #0c101b;
  --sheet: #0d1220;
  --hover: #1a2133;
  --line: rgba(202, 220, 255, .14);
  --tag-border: rgba(255,255,255,.26);
  --ghost-border: rgba(255,255,255,.16);
  --text: #f8fbff;
  --muted: #a9b4c8;
  --subtle: #72809a;
  --gold: #ff3d5a;
  --gold-hover: #ff6b80;
  --on-gold: #fff;
  --off: #ff3d5a;
  --def: #7ce7ff;
  --st: #d4b5ff;
  --red-fill: #d92848;
  --red-hover: #f04461;
  --open: #7ce7ff;
}
body { background: radial-gradient(900px 520px at 8% -10%, rgba(255,61,90,.18), transparent 62%), radial-gradient(820px 540px at 94% 3%, rgba(124,231,255,.13), transparent 60%), #080a12; }
body::before { content:""; position:fixed; inset:0; pointer-events:none; opacity:.18; background-image:linear-gradient(rgba(124,231,255,.045) 1px, transparent 1px),linear-gradient(90deg,rgba(124,231,255,.045) 1px,transparent 1px); background-size:48px 48px; mask-image:linear-gradient(to bottom,black,transparent 78%); }
.site-head { min-height:82px; padding:14px 28px; background:rgba(8,10,18,.76); border-bottom:1px solid rgba(124,231,255,.15); box-shadow:0 0 34px rgba(124,231,255,.06); backdrop-filter:blur(16px); }
.wordmark { letter-spacing:.05em; text-transform:uppercase; font-size:15px; }
.wordmark::before { width:26px; height:26px; border-color:#fff; box-shadow:0 0 18px rgba(255,61,90,.4); }
.main { max-width:1500px; padding:38px 34px 90px; gap:32px; }
.panel { max-width:390px; padding:28px; border:1px solid rgba(124,231,255,.18); border-radius:20px; background:linear-gradient(160deg,rgba(17,21,34,.96),rgba(9,12,21,.97)); box-shadow:0 22px 80px rgba(0,0,0,.28),0 0 44px rgba(124,231,255,.05); }
.title-block h1 { font-size:clamp(32px,4vw,50px); line-height:1.02; letter-spacing:-.06em; }
.title-block .desc { max-width:32ch; font-size:15px; line-height:1.6; color:#bac5d8; }
.actions { gap:10px; margin:20px 0 26px; }
.actions .btn { min-height:44px; border-radius:10px; }
.sec { margin-top:27px; margin-bottom:11px; letter-spacing:.13em; }
.box { border-radius:15px; background:rgba(10,14,25,.7); border-color:rgba(124,231,255,.14); }
.team-sheet { padding:17px; }
.pool-head { margin-bottom:14px; }
.opts.gens { gap:8px; }
.opts.gens label span { min-height:45px; border-radius:10px; padding:9px 10px; }
.pool-line { margin-top:15px; font-size:12px; line-height:1.6; }
#field-wrap { border-radius:22px; padding:14px; background:linear-gradient(145deg,rgba(17,22,38,.84),rgba(8,11,20,.9)); border:1px solid rgba(255,61,90,.18); box-shadow:0 0 50px rgba(255,61,90,.07); }
#field { border-radius:14px; box-shadow:0 16px 50px rgba(0,0,0,.32); }
#field-canvas { border-radius:14px; }
.draft-panel, .scorebug, .leaderboard, .guide { border-radius:18px; border-color:rgba(124,231,255,.16); background:linear-gradient(160deg,rgba(17,21,34,.94),rgba(8,11,19,.96)); box-shadow:0 18px 55px rgba(0,0,0,.22); }
.draft-panel { padding:24px; }
.draft-panel h2 { font-size:24px; letter-spacing:-.04em; }
.draft-panel .desc { font-size:14px; line-height:1.6; }
.draft-panel .box { padding:18px; }
.card, .box, .btn, .opts label span, .mode { transition:transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.btn:hover, .mode:hover { transform:translateY(-2px); box-shadow:0 8px 22px rgba(0,0,0,.25); }
.btn.gold, .btn.red { box-shadow:0 0 22px rgba(255,61,90,.2); }
.mode { border-radius:11px; }
.mode[aria-current="page"] { box-shadow:0 0 22px rgba(255,61,90,.24); }
@media (min-width:1100px) {
  .main { grid-template-columns:minmax(360px,400px) minmax(0,1fr); align-items:start; }
  .field-wrap { min-height:720px; }
  #field-wrap { position:sticky; top:22px; }
  .controls { gap:22px; }
}
@media (max-width:900px) {
  .main { padding:24px 16px 60px; }
  .panel { max-width:none; padding:20px; }
  .site-head { padding:12px 16px; }
}

/* Layout pass: controls and field are two deliberate spaces, not one compressed column. */
@media (min-width: 1000px) {
  .main { display:grid; grid-template-columns:minmax(360px,430px) minmax(0,1fr); align-items:start; column-gap:34px; row-gap:34px; }
  .panel { width:100%; max-width:none; }
  .stage { min-width:0; width:100%; }
  .stage .field-wrap { width:100%; min-height:720px; position:sticky; top:24px; }
  .stage #field { width:100%; height:auto; display:block; }
  .site-head { padding-inline:clamp(22px,4vw,64px); }
}
@media (max-width: 999px) {
  .main { display:flex; flex-direction:column; }
  .panel, .stage { width:100%; max-width:none; }
  .stage { order:-1; }
  .stage .field-wrap { min-height:0; }
}
/* Give the roster and setup controls room to breathe. */
.team-sheet .row { min-height:58px; padding-block:10px; }
.team-sheet .opts span { min-height:42px; }
.picker-sheet { width:min(720px,calc(100vw - 32px)); max-height:min(780px,calc(100vh - 32px)); padding:26px; border-radius:22px; }
.picker-sheet .grid { gap:12px; }
.picker-sheet .grid > * { min-height:78px; border-radius:14px; }
.draft-panel { margin-top:8px; }

/* Pokémon-first visual direction: bright red, warm white, playful arcade panels. */
:root {
  --bg: #fff7f2;
  --panel: #ffffff;
  --tag: #ffffff;
  --sheet: #fffdfb;
  --hover: #fff0eb;
  --line: #f0d8d2;
  --tag-border: #e8c8c0;
  --ghost-border: #e6bdb4;
  --text: #32151a;
  --muted: #795d62;
  --subtle: #a88789;
  --nav: #32151a;
  --gold: #e3350d;
  --gold-hover: #c82808;
  --on-gold: #ffffff;
  --off: #e3350d;
  --def: #2f6f86;
  --st: #8055a8;
  --red-fill: #e3350d;
  --red-hover: #c82808;
  --open: #2f6f86;
}
body { color:var(--text); background:linear-gradient(135deg,#fff7f2 0%,#fff 48%,#fff0ea 100%); }
body::before { opacity:.32; background-image:radial-gradient(#efc9be 1px,transparent 1px); background-size:18px 18px; mask-image:linear-gradient(to bottom,black,transparent 88%); }
.site-head { background:#fff; border-bottom:5px solid #e3350d; box-shadow:0 5px 0 rgba(227,53,13,.1); }
.wordmark { color:#32151a; font-weight:900; }
.wordmark span { color:#e3350d; }
.wordmark::before { width:28px; height:28px; margin-right:9px; border:2px solid #32151a; border-radius:50%; background:radial-gradient(circle at 50% 50%,#fff 0 4px,#32151a 4px 7px,transparent 7px),linear-gradient(to bottom,#e3350d 0 46%,#32151a 46% 54%,#fff 54% 100%); box-shadow:0 2px 0 rgba(50,21,26,.15); }
.main { color:var(--text); }
.panel, .draft-panel, .scorebug, .leaderboard, .guide, .box { background:#fff; border:2px solid #f0d8d2; box-shadow:0 12px 0 rgba(227,53,13,.08),0 24px 60px rgba(120,45,30,.1); }
.panel { border-radius:28px; }
.title-block h1 { color:#32151a; font-weight:900; }
.title-block h1::after { content:"✦"; color:#e3350d; font-size:.6em; margin-left:10px; vertical-align:top; }
.title-block .desc, .pool-line, .rules { color:#795d62; }
.sec h2, .draft-panel h2 { color:#e3350d; text-transform:uppercase; letter-spacing:.04em; }
.btn { border:2px solid #e8c8c0; background:#fff; color:#32151a; border-radius:12px; font-weight:800; }
.btn.gold, .btn.red { background:#e3350d; border-color:#e3350d; color:#fff; box-shadow:0 4px 0 #9e220d; }
.btn.gold:hover, .btn.red:hover { background:#c82808; }
.btn.quiet:hover, .btn.outline:hover { background:#fff0eb; border-color:#e3350d; }
.mode { color:#795d62; background:#fff; border:2px solid #f0d8d2; }
.mode[aria-current="page"], .mode:hover { color:#e3350d; background:#fff0eb; border-color:#e3350d; }
.mode-big b { color:#e3350d; }
.opts label span { background:#fff; border:2px solid #f0d8d2; color:#795d62; }
.opts input:checked + span { background:#fff0eb; color:#e3350d; border-color:#e3350d; box-shadow:0 3px 0 rgba(227,53,13,.14); }
.field-wrap { background:#fff; border:2px solid #e8c8c0 !important; box-shadow:0 14px 0 rgba(227,53,13,.08),0 28px 70px rgba(120,45,30,.12) !important; }
.picker-sheet { background:#fffdfb; border:2px solid #e3350d; }
.picker-sheet .picker-head { border-bottom:2px solid #f0d8d2; }
.picker-sheet .grid > *:hover { border-color:#e3350d; background:#fff0eb; }
@media (min-width:1000px) { .main { column-gap:46px; padding-top:52px; } .panel { padding:34px; } }

/* Controls stay above the field and never get hidden by the stage layer. */
.panel { position:relative; z-index:4; overflow:visible; }
.panel .actions, .panel .team-sheet, .panel .title-block { position:relative; z-index:8; }
.panel .actions { isolation:isolate; padding:8px; margin-inline:-8px; border-radius:16px; background:#fff7f2; }
.panel .actions .btn { position:relative; z-index:9; }
.panel .sec { position:relative; z-index:6; }
.panel .title-block { padding-bottom:12px; }
.panel .title-block h1 { max-width:12ch; }
.panel .pool-head .lbl { color:#e3350d; font-weight:900; letter-spacing:.06em; text-transform:uppercase; }
.panel .pool-line { padding:10px 12px; border-radius:10px; background:#fff0eb; color:#8d4a4e; }
.stage, .stage .field-wrap { background:transparent !important; }

/* The pitch stays green; pink is reserved for the lower page modules. */
.stage .field-wrap { background:#fff0eb !important; }
.stage { background:#fff0eb; border-radius:26px; padding:12px; }
/* Selected navigation buttons keep their icons readable on white. */
.mode[aria-current="page"] { color:#e3350d !important; background:#fff0eb !important; border-color:#e3350d !important; }
.mode[aria-current="page"] svg, .mode[aria-current="page"] .trophy { stroke:#e3350d !important; }
.mode[aria-current="page"] b, .mode[aria-current="page"] span { color:#e3350d !important; }
.play-team { color:#fff !important; background:#e3350d !important; border-color:#e3350d !important; }
.play-team svg { stroke:#fff !important; }

/* Game-style command chrome: every navigation/control action has a readable glyph, a stepped hover lift,
   and a clear pressed state. */
.mode-icon { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.mode-icon.trophy { stroke:currentColor; }
.mode:active, .play-team:active { transform:translateY(2px); }
.mode:hover .mode-icon, .mode:focus-visible .mode-icon { transform:scale(1.08); }
.actions-caption { display:flex; align-items:baseline; justify-content:space-between; gap:10px; margin-top:20px; padding:0 4px 8px; border-bottom:2px solid #f0d8d2; color:#a88789; font-size:12px; line-height:1.25; }
.actions-caption-title { color:#e3350d; font-family:var(--rc); font-size:14px; font-weight:900; letter-spacing:.08em; }
.actions .btn { min-height:46px; }
.actions .btn svg { flex:none; }
@media (max-width:599px) {
  .actions-caption { margin-top:16px; font-size:11px; }
  .actions-caption-title { font-size:13px; }
}

/* Keep the desktop composition centered on ultrawide screens instead of pinning the field and command deck to
   the left edge. */
@media (min-width:1600px) {
  .main { margin-inline:auto; }
  .site-head { padding-inline:max(64px, calc((100vw - 1500px) / 2 + 22px)); }
}

/* Lighthouse accessibility pass: this red keeps the arcade palette while meeting WCAG AA
   on the white and blush surfaces used by the builder controls. */
:root {
  --gold: #b42318;
  --gold-hover: #8f1d14;
  --off: #b42318;
  --red-fill: #b42318;
  --red-hover: #8f1d14;
  --red: #b42318;
}
.wordmark span,
.title-block h1::after,
.sec h2, .draft-panel h2,
.panel .pool-head .lbl,
.actions-caption-title,
.mode-big b,
.mode[aria-current="page"],
.mode[aria-current="page"] b,
.mode[aria-current="page"] span,
.mode[aria-current="page"] svg,
.opts input:checked + span { color: #b42318; }
.mode[aria-current="page"] svg { stroke: #b42318 !important; }
.mode[aria-current="page"] b,
.mode[aria-current="page"] span { color: #b42318 !important; }
.play-team { background: #b42318 !important; }
.opts label > span small { color: #795d62 !important; opacity: 1; }
.hotspot { min-height: 24px; }
.hotspot[data-slot="FB"] { z-index: 2; }

/* Crawlable explanation below the interactive builder. It keeps the tool first while giving searchers
   an honest explanation of the roster, formations, challenges, and next step. */
.builder-seo { width: min(1500px, calc(100% - 32px)); margin: 16px auto 0; padding: 42px clamp(22px, 4vw, 64px) 56px; border: 2px solid #f0d8d2; border-radius: 26px; background: rgba(255,255,255,.92); box-shadow: 0 12px 0 rgba(227,53,13,.07), 0 24px 60px rgba(120,45,30,.08); }
.builder-seo-inner { max-width: 1020px; margin: 0 auto; }
.builder-seo-kicker { color: #b42318; font: 900 13px/1 var(--rc); letter-spacing: .12em; }
.builder-seo h2 { margin: 12px 0 10px; color: #32151a; font: 900 clamp(25px, 3vw, 38px)/1.05 var(--rc); letter-spacing: -.03em; }
.builder-seo h3 { margin: 0 0 8px; color: #b42318; font: 900 19px/1.1 var(--rc); }
.builder-seo p { color: #795d62; font-size: 15px; line-height: 1.72; }
.builder-seo-lead { max-width: 820px; margin: 0; }
.builder-seo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 24px 0 34px; }
.builder-seo-grid article { padding: 20px; border: 2px solid #f0d8d2; border-radius: 16px; background: #fff7f2; }
.builder-seo-grid p { margin: 0; }
.builder-seo-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 0; margin: 18px 0 34px; list-style: none; counter-reset: builder-step; }
.builder-seo-steps li { counter-increment: builder-step; padding: 18px 18px 18px 48px; position: relative; border-top: 3px solid #b42318; color: #795d62; line-height: 1.6; }
.builder-seo-steps li::before { content: counter(builder-step); position: absolute; left: 16px; top: 17px; color: #b42318; font: 900 20px/1 var(--rc); }
.builder-seo-steps strong { color: #32151a; }
.builder-seo-faq { border-top: 2px solid #f0d8d2; padding-top: 10px; }
.builder-seo-faq h2 { font-size: 28px; }
.builder-seo-faq details { border-bottom: 1px solid #f0d8d2; }
.builder-seo-faq summary { padding: 14px 0; cursor: pointer; color: #32151a; font: 800 17px/1.3 var(--rc); }
.builder-seo-faq details p { margin: 0 0 16px; }
@media (max-width: 760px) {
  .builder-seo { width: calc(100% - 24px); padding: 32px 20px 40px; }
  .builder-seo-grid, .builder-seo-steps { grid-template-columns: 1fr; }
}
