/* ---------------------------------------------------------------- tokens */
/* Look: a night-match pitch (deep green) with chalk lines and cream "tactics sheet" cards.
   Page text sits on the green; everything inside a card uses the ink-on-cream tokens. */
:root {
  --page: #2a7535;
  --page-deep: #1d5a27;
  --page-text: #f4efdc;
  --page-muted: #e6f1dc;
  --chalk: rgba(244, 239, 220, 0.4);
  --yellow: #ffd24a;
  --bg: var(--page);
  --surface: rgba(251, 247, 230, 0.84);
  --surface-2: #ede6cf;
  --border: rgba(120, 130, 100, 0.3);
  --text: #10251c;
  --text-muted: #3f5246;
  --accent: #14503b;
  --accent-strong: #0e3b2c;
  --accent-soft: #dde9d4;
  --on-accent: #f4efdc;
  --highlight: var(--yellow);
  --good: #146036;
  --good-bg: #d6eddb;
  --warn: #8a5a00;
  --warn-bg: #fbe8b4;
  --bad: #a8281f;
  --bad-bg: #f5d6d0;
  --rival: #d9542b;
  --pill-bg: #e6dec4;
  --shadow: none;
  --radius: 14px;
  --radius-sm: 9px;
  --serif: Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  /* mown-grass stripes over the grass green */
  background: repeating-linear-gradient(90deg, transparent 0 70px, rgba(255, 255, 255, 0.05) 70px 140px), var(--page);
  background-attachment: fixed;
  color: var(--page-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.45;
}
button { font-family: inherit; }
[hidden] { display: none !important; }  /* class rules like .field { display: flex } must not un-hide hidden elements */
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; box-shadow: 0 0 0 2px #10251c; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px 72px; position: relative; z-index: 1; }
/* faint pitch markings behind everything */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.3;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 640' preserveAspectRatio='xMidYMid slice'%3E%3Cg fill='none' stroke='%23f4efdc' stroke-width='1.4'%3E%3Crect x='12' y='12' width='276' height='616'/%3E%3Cline x1='12' y1='320' x2='288' y2='320'/%3E%3Ccircle cx='150' cy='320' r='48'/%3E%3Crect x='70' y='12' width='160' height='70'/%3E%3Crect x='70' y='558' width='160' height='70'/%3E%3Crect x='108' y='12' width='84' height='28'/%3E%3Crect x='108' y='600' width='84' height='28'/%3E%3C/g%3E%3C/svg%3E") center / cover no-repeat;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.card {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* a single flag on <body> decides which of the two screens shows */
body[data-view="landing"] .view-report { display: none; }
body[data-view="report"] .view-landing { display: none; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em;
  color: var(--text); text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer;
}
.brand-mark {
  width: 28px; height: 28px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--highlight));
  display: grid; place-items: center; color: #052e2b; font-size: 0.9rem; font-weight: 900;
}
.topbar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 999px; font-weight: 650; font-size: 0.86rem; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: transform 0.08s ease, border-color 0.15s, background 0.15s;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn.ghost { color: var(--text-muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.large { padding: 14px 26px; font-size: 1rem; }

/* ---------------------------------------------------------------- landing */
.landing-hero { text-align: center; padding: 44px 0 26px; }
.eyebrow {
  display: inline-block; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent-strong); background: var(--accent-soft); padding: 5px 12px; border-radius: 999px;
}
.landing-hero h1 {
  font-size: clamp(2rem, 6.4vw, 3.4rem); line-height: 1.05; letter-spacing: -0.03em; margin: 18px auto 14px; max-width: 16ch;
}
.landing-hero h1 em {
  font-style: normal;
  background: linear-gradient(180deg, transparent 62%, var(--highlight) 62%);
  padding: 0 4px;
}
.lead { color: var(--text-muted); font-size: clamp(1rem, 2.6vw, 1.15rem); max-width: 54ch; margin: 0 auto; }

.lookup { padding: 22px; margin: 28px auto 0; max-width: 640px; text-align: left; }
.lookup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .lookup-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 0.78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.field input, .field select {
  padding: 12px 13px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: 1rem; width: 100%;
}
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; background: var(--surface); }
.field small { color: var(--text-muted); font-size: 0.74rem; }
.lookup-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 18px; }
.remember { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--text-muted); }
.help-box { margin-top: 16px; font-size: 0.88rem; color: var(--text-muted); }
.help-box summary { cursor: pointer; font-weight: 650; color: var(--accent-strong); }
.help-box ol { margin: 10px 0 0; padding-left: 20px; }
.help-box li { margin: 5px 0; }
.help-box code { background: var(--pill-bg); padding: 1px 6px; border-radius: 6px; font-size: 0.82rem; word-break: break-all; }
.form-error { color: var(--bad); background: var(--bad-bg); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 0.88rem; margin-top: 14px; }
.form-error[hidden] { display: none; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 44px; }
@media (max-width: 760px) { .features { grid-template-columns: 1fr; } }
.feature { padding: 20px; }
.feature .icon { width: 38px; height: 38px; border-radius: 11px; background: var(--accent-soft); display: grid; place-items: center; font-size: 1.15rem; margin-bottom: 12px; }
.feature h3 { margin: 0 0 6px; font-size: 1.02rem; }
.feature p { margin: 0; color: var(--text-muted); font-size: 0.9rem; }

.how { margin-top: 44px; }
.how h2 { text-align: center; font-size: 1.35rem; margin: 0 0 20px; letter-spacing: -0.01em; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; counter-reset: step; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.step { padding: 18px 18px 18px 64px; position: relative; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 18px; top: 18px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 800;
}
.step h3 { margin: 0 0 4px; font-size: 0.98rem; }
.step p { margin: 0; color: var(--text-muted); font-size: 0.88rem; }

.honest { margin: 44px auto 0; max-width: 700px; padding: 18px 20px; border-left: 4px solid var(--warn); background: var(--warn-bg); border-radius: var(--radius-sm); font-size: 0.88rem; }
.honest strong { display: block; margin-bottom: 4px; }

/* ------------------------------------------------------------------ loader */
.loader { display: none; text-align: center; padding: 60px 20px; }
.loader.visible { display: block; }
.spinner {
  width: 42px; height: 42px; border-radius: 50%; margin: 0 auto 18px;
  border: 4px solid var(--accent-soft); border-top-color: var(--accent); animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader p { margin: 0; font-weight: 650; }
.loader small { color: var(--text-muted); }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

/* ------------------------------------------------------------ report hero */
.hero-card { padding: 22px; margin-bottom: 18px; background: linear-gradient(160deg, var(--surface), var(--accent-soft)); }
.hero-top { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.hero-team h2 { margin: 0; font-size: 1.35rem; letter-spacing: -0.015em; }
.hero-team .sub { color: var(--text-muted); font-size: 0.86rem; margin-top: 2px; }
.rank-pill {
  display: inline-flex; align-items: baseline; gap: 6px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 14px;
}
.rank-pill b { font-size: 1.4rem; color: var(--accent-strong); letter-spacing: -0.02em; }
.rank-pill span { color: var(--text-muted); font-size: 0.8rem; }
.hero-line { margin: 14px 0 0; font-size: 0.95rem; color: var(--text-muted); }
.hero-line strong { color: var(--text); }

.odds { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 18px; }
.odd { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.odd .v { font-size: 1.9rem; font-weight: 850; line-height: 1.05; letter-spacing: -0.03em; }
.odd .v small { font-size: 0.95rem; font-weight: 700; color: var(--text-muted); margin-left: 2px; }
.odd .l { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 750; color: var(--text-muted); margin-top: 4px; }
.odd.highlight { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.odd.highlight .v { color: var(--accent-strong); }

.stance {
  margin-top: 16px; display: flex; gap: 12px; align-items: flex-start; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; font-size: 0.92rem;
}
.stance-badge {
  flex: 0 0 auto; font-size: 0.7rem; font-weight: 850; letter-spacing: 0.07em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; background: var(--accent); color: var(--on-accent); margin-top: 1px;
}
.stance-badge.protect, .stance-badge.defend { background: var(--good); color: #fff; }
.stance-badge.contend { background: var(--accent); }
.stance-badge.chase, .stance-badge.long-shot { background: var(--warn); color: #fff; }

.banner { padding: 12px 16px; margin-bottom: 16px; border-left: 4px solid var(--warn); background: var(--warn-bg); border-radius: var(--radius-sm); font-size: 0.9rem; }

/* ------------------------------------------------------------------- tabs */
.tabs {
  display: flex; gap: 6px; margin: 0 0 18px; padding: 5px; background: var(--pill-bg); border-radius: 999px;
  overflow-x: auto; scrollbar-width: none; position: sticky; top: 8px; z-index: 5;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  flex: 1 0 auto; padding: 10px 16px; border: 0; background: transparent; color: var(--text-muted);
  font-weight: 700; font-size: 0.88rem; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.tab-btn.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(14, 26, 43, 0.14); }
.tab-panel[hidden] { display: none; }

/* --------------------------------------------------------------- sections */
section.block { margin-bottom: 18px; padding: 20px; }
section.block h3 { margin: 0 0 4px; font-size: 1.05rem; letter-spacing: -0.01em; }
section.block .sub { color: var(--text-muted); font-size: 0.84rem; margin-bottom: 14px; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }
.win-sub-h { font-size: 0.76rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 800; margin: 22px 0 10px; }
.win-sub-h:first-child { margin-top: 0; }
.win-note { font-size: 0.8rem; color: var(--text-muted); margin-top: 14px; }
details.more { margin-top: 12px; }
details.more > summary { cursor: pointer; font-weight: 700; font-size: 0.86rem; color: var(--accent-strong); padding: 6px 0; }

/* ------------------------------------------------------------- move cards */
.moves { display: flex; flex-direction: column; gap: 12px; }
.move { border: 1px solid var(--border); border-radius: 14px; padding: 14px; background: var(--surface); }
.move.hit { border-color: var(--warn); background: var(--warn-bg); }
.move-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.move-n { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 800; font-size: 0.82rem; }
.move-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.move-swap { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch; }
.swap-card { border-radius: 12px; padding: 10px 12px; min-width: 0; }
.swap-card.out { background: var(--bad-bg); }
.swap-card.in { background: var(--good-bg); }
.swap-card .lbl { font-size: 0.66rem; font-weight: 850; letter-spacing: 0.08em; text-transform: uppercase; }
.swap-card.out .lbl { color: var(--bad); }
.swap-card.in .lbl { color: var(--good); }
.swap-card .nm { font-weight: 800; font-size: 1.02rem; margin-top: 2px; overflow-wrap: anywhere; }
.swap-card .mt { font-size: 0.76rem; color: var(--text-muted); margin-top: 1px; }
.swap-arrow { align-self: center; font-size: 1.3rem; color: var(--text-muted); }
@media (max-width: 460px) {
  .move-swap { grid-template-columns: 1fr; }
  .swap-arrow { transform: rotate(90deg); justify-self: center; }
}
.move-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.stat-pill { background: var(--pill-bg); border-radius: 999px; padding: 4px 11px; font-size: 0.78rem; color: var(--text-muted); }
.stat-pill b { color: var(--text); font-weight: 750; }
.stat-pill.up b { color: var(--good); }
.stat-pill.down b { color: var(--bad); }
.move-why { font-size: 0.88rem; margin: 12px 0 0; color: var(--text); }

.tag { font-size: 0.72rem; font-weight: 750; padding: 3px 9px; border-radius: 999px; white-space: nowrap; background: var(--pill-bg); color: var(--text-muted); }
.tag.good { background: var(--good-bg); color: var(--good); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }
.tag.accent { background: var(--accent-soft); color: var(--accent-strong); }
.role-tag { display: inline-block; font-size: 0.7rem; font-weight: 750; border-radius: 999px; padding: 3px 9px; margin-left: 6px; background: var(--pill-bg); color: var(--text-muted); text-transform: capitalize; }
.role-tag.differential { background: var(--good-bg); color: var(--good); }
.role-tag.cover { background: var(--warn-bg); color: var(--warn); }
.hit-tag { font-size: 0.7rem; font-weight: 800; color: var(--warn); background: var(--warn-bg); border-radius: 999px; padding: 3px 9px; }
.free-tag { font-size: 0.7rem; font-weight: 800; color: var(--good); background: var(--good-bg); border-radius: 999px; padding: 3px 9px; }
.forced-tag { font-size: 0.7rem; font-weight: 800; color: var(--bad); background: var(--bad-bg); border-radius: 999px; padding: 3px 9px; margin-left: 6px; }

/* ------------------------------------------------------------- lookup extras */
.lookup .field + .field, .lookup .field + details, .lookup details + .form-error { margin-top: 14px; }
.found { font-size: 0.86rem; min-height: 1.2em; color: var(--text-muted); }
.found.ok { color: var(--good); font-weight: 650; }
.found.bad { color: var(--bad); }
.bad-note { color: var(--bad) !important; }
.linklike { background: none; border: 0; padding: 0; color: var(--accent-strong); text-decoration: underline; cursor: pointer; font: inherit; }
.privacy { margin: 0 0 10px; }
.shirt { display: block; flex: 0 0 auto; }
.player-card .shirt { margin: 0 auto 3px; }
.swap-top { display: flex; align-items: center; gap: 8px; }

/* ------------------------------------------------------- style + roll card */
.style-switch { display: inline-flex; gap: 4px; padding: 4px; background: var(--pill-bg); border-radius: 999px; margin-bottom: 8px; max-width: 100%; overflow-x: auto; }
.style-switch button { border: 0; background: transparent; color: var(--text-muted); font-weight: 700; font-size: 0.82rem; padding: 8px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.style-switch button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(14, 26, 43, 0.14); }
.style-blurb { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 14px; min-height: 1.2em; }
.roll-card { margin-top: 12px; border: 2px dashed var(--accent); border-radius: 14px; padding: 14px 16px; background: var(--accent-soft); }
.roll-card[hidden] { display: none; }
.roll-card .roll-title { font-weight: 800; font-size: 1.02rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.roll-card p { margin: 6px 0 0; font-size: 0.88rem; }
.roll-card .roll-next { margin-top: 8px; font-size: 0.8rem; color: var(--text-muted); }
.roll-card.warn { border-color: var(--warn); background: var(--warn-bg); }
.urgent-tag { font-size: 0.7rem; font-weight: 800; color: var(--bad); background: var(--bad-bg); border-radius: 999px; padding: 3px 9px; }

/* ----------------------------------------------------------------- rows */
.row-list { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 13px;
  border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid transparent; flex-wrap: wrap;
}
.row .name { font-weight: 700; }
.row .meta { font-size: 0.79rem; color: var(--text-muted); }
.win-delta { font-weight: 800; white-space: nowrap; }
.win-delta.up { color: var(--good); }
.win-delta.down { color: var(--bad); }

.bar-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
@media (max-width: 520px) { .bar-row { grid-template-columns: 1fr auto; } .bar-row .bar { grid-column: 1 / -1; order: 3; } }
.bar { height: 8px; background: var(--pill-bg); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--highlight)); border-radius: 999px; }

.plan-list { display: flex; flex-direction: column; }
.plan-item { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.plan-item:last-child { border-bottom: none; }
.plan-week { flex: 0 0 56px; text-align: center; font-weight: 800; font-size: 0.9rem; color: var(--accent-strong); padding-top: 2px; }
.plan-week .n { display: block; font-size: 1.3rem; }
.plan-body { flex: 1 1 auto; min-width: 0; }
.plan-swap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.plan-swap .out { color: var(--bad); font-weight: 700; }
.plan-swap .in { color: var(--good); font-weight: 700; }
.plan-swap .arrow { color: var(--text-muted); }
.plan-reason { font-size: 0.86rem; margin-bottom: 3px; }
.plan-rival-note { font-size: 0.78rem; color: var(--text-muted); font-style: italic; margin-bottom: 3px; }
.plan-cost { font-size: 0.78rem; color: var(--text-muted); }
.hot-item { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.hot-item:last-child { border-bottom: none; }
.hot-item .who { color: var(--text-muted); }

/* ------------------------------------------------------------ pitch/cards */
.pitch {
  background: repeating-linear-gradient(180deg, #1f7a45, #1f7a45 42px, #24864d 42px, #24864d 84px);
  border: 2px solid rgba(255, 255, 255, 0.3); border-radius: 14px; padding: 22px 8px 26px;
  display: flex; flex-direction: column; gap: 16px;
}
.pitch-row { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.player-card {
  position: relative; background: rgba(255, 255, 255, 0.97); color: #0e1a2b; border-radius: 10px; padding: 7px 8px;
  min-width: 78px; max-width: 100px; text-align: center; font-size: 0.7rem; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  border: 2px solid transparent;
}
.player-card.flag-sell { border-color: var(--bad); }
.player-card .pc-name { font-weight: 750; font-size: 0.76rem; line-height: 1.2; overflow-wrap: anywhere; }
.player-card .pc-meta { color: #566; font-size: 0.64rem; margin-top: 3px; }
.player-card .pc-badge, .player-card .pc-sell-badge, .player-card .pc-rival-badge {
  position: absolute; font-size: 0.58rem; font-weight: 800; color: #fff; border-radius: 999px; padding: 2px 6px;
}
.player-card .pc-badge { top: -8px; right: -8px; background: #0f766e; }
.player-card .pc-sell-badge { top: -8px; left: -8px; background: var(--bad); }
.player-card .pc-rival-badge { bottom: -8px; right: -8px; background: var(--warn); text-transform: uppercase; letter-spacing: 0.02em; }
.bench-strip { margin-top: 16px; }
.bench-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; font-weight: 800; }
.bench-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ------------------------------------------------------------ chip builder */
.chip-builder-controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.chip-builder-controls .field { flex: 1 1 180px; }
button.submit {
  padding: 12px 22px; border: none; border-radius: 999px; background: var(--accent); color: var(--on-accent);
  font-weight: 700; font-size: 0.95rem; cursor: pointer; flex: 0 0 auto;
}
button.submit:hover { filter: brightness(1.06); }
button.submit:disabled { opacity: 0.6; cursor: default; }
.week-nav { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 16px; }
.week-arrow {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 1.15rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.week-arrow:hover:not(:disabled) { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.week-arrow:disabled { opacity: 0.3; cursor: default; }
.week-label { font-weight: 800; font-size: 1.1rem; min-width: 170px; text-align: center; }
.week-label .week-pts { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-muted); margin-top: 2px; }
.transfer-visual { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 18px; flex-wrap: wrap; }
.transfer-visual .tv-side { text-align: center; }
.transfer-visual .tv-label { font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.transfer-visual .tv-out .tv-label { color: var(--bad); }
.transfer-visual .tv-in .tv-label { color: var(--good); }
.transfer-visual .tv-arrow { font-size: 1.6rem; color: var(--text-muted); }
.transfer-visual .tv-reason { flex-basis: 100%; text-align: center; font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.week-actions { display: flex; justify-content: center; gap: 12px; margin-top: 18px; }
.week-decision-btn { padding: 10px 20px; border-radius: 999px; font-weight: 700; font-size: 0.88rem; cursor: pointer; border: 1px solid var(--border); }
.week-decision-btn.accept { background: var(--good); color: #fff; border-color: var(--good); }
.week-decision-btn.reject { background: var(--surface); color: var(--text-muted); }
.week-decision-btn:disabled { opacity: 0.5; cursor: default; }

.name-mode-toggle { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: 0.8rem; font-weight: 650; cursor: pointer; }
.name-mode-toggle:hover { border-color: var(--accent); color: var(--accent-strong); }

footer { text-align: center; color: var(--text-muted); font-size: 0.78rem; margin: 44px auto 0; max-width: 720px; }

/* ----------------------------------------------------------- compact phones */
@media (max-width: 440px) { body[data-view="report"] .brand-name { display: none; } }
@media (max-width: 520px) {
  .topbar-actions { flex-wrap: nowrap; gap: 6px; }
  .topbar-actions .btn, .name-mode-toggle { padding: 8px 12px; font-size: 0.78rem; white-space: nowrap; }
  .tab-btn { padding: 10px 12px; }
  .wrap { padding: 0 12px 64px; }
  .hero-card, section.block { padding: 16px; }
  .odd .v { font-size: 1.6rem; }
  .landing-hero { padding-top: 30px; }
}


/* =====================================================================================
   Night-match theme: page-level elements (on the green) and the new data-viz components
   ===================================================================================== */
h1, h2, .hero-team h2, .landing-hero h1, .how h2 { font-family: var(--serif); }
.brand { color: var(--page-text); }
.brand-mark { background: transparent; border: 2px solid var(--yellow); color: var(--yellow); border-radius: 50%; font-family: var(--serif); font-weight: 700; }
.topbar .btn, .name-mode-toggle { background: transparent; color: var(--page-text); border: 1px solid var(--chalk); }
.topbar .btn:hover, .name-mode-toggle:hover { border-color: var(--yellow); color: var(--yellow); }
.btn.primary { background: var(--yellow); border-color: var(--yellow); color: var(--accent-strong); font-weight: 800; }
.btn.primary:hover { filter: brightness(1.05); }
button.submit { background: var(--yellow); color: var(--accent-strong); font-weight: 800; }

/* ------- landing */
.eyebrow { background: transparent; color: var(--yellow); letter-spacing: 0.16em; padding: 0; font-size: 0.72rem; border-radius: 0; }
.landing-hero h1 { font-weight: 700; letter-spacing: -0.015em; line-height: 1.06; max-width: 15ch; color: var(--page-text); }
.landing-hero h1 em { background: none; color: var(--yellow); font-style: italic; padding: 0; }
.lead { color: var(--page-muted); }
.lookup { box-shadow: none; border: 0; background: var(--surface); }
.field label { color: var(--text-muted); }
.field input, .field select { background: rgba(255, 254, 247, 0.62); border: 1.5px solid var(--border); color: var(--text); font-weight: 600; }
.field input:focus, .field select:focus { outline: 2px solid var(--accent); background: #fff; }
.found.ok { color: var(--good); }
.help-box summary, details.more > summary { color: var(--accent); }
.remember { color: var(--text-muted); }

/* sample result: the tactics sheet and the scoreboard figures, labelled as an example */
.demo { max-width: 640px; margin: 28px auto 0; text-align: left; }
.demo-tag { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.14em; color: var(--yellow); margin-bottom: 8px; }
.demo-sheet { border: 1.5px dashed var(--chalk); border-radius: 16px; padding: 16px; display: grid; gap: 16px; }
.demo-swap { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; text-align: center; }
.demo-swap .who { font-weight: 700; font-size: 0.95rem; }
.demo-swap .act { font-size: 0.68rem; letter-spacing: 0.14em; font-weight: 800; }
.demo-swap .act.sell { color: #ffb4a8; }
.demo-swap .act.buy { color: #a7e9b8; }
.demo-note { text-align: center; font-size: 0.82rem; color: var(--page-muted); margin-top: 4px; }
.demo-odds { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.demo-odds .lbl { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.14em; color: var(--page-muted); }
.demo-odds .big { font-family: var(--mono); font-size: clamp(2.6rem, 9vw, 3.6rem); line-height: 1; font-weight: 700; color: var(--yellow); }
.demo-odds .big small { font-size: 0.45em; }
.demo-odds .delta { text-align: right; font-family: var(--mono); font-size: 0.78rem; color: var(--page-muted); }
.demo-odds .delta b { color: #a7e9b8; font-weight: 700; }
.race { display: grid; gap: 7px; }
.race-row { display: grid; grid-template-columns: minmax(70px, 140px) 1fr 46px; gap: 10px; align-items: center; font-family: var(--mono); font-size: 0.74rem; }
.race-row .nm { color: var(--page-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.race-row .trk { height: 9px; background: rgba(244, 239, 220, 0.14); border-radius: 3px; overflow: hidden; }
.race-row .trk i { display: block; height: 100%; background: var(--rival); border-radius: 3px; }
.race-row.me .nm, .race-row.me .pc { color: var(--yellow); }
.race-row.me .trk i { background: var(--yellow); }
.race-row .pc { text-align: right; color: var(--page-text); }

.feature, .step { background: transparent; border: 1.5px dashed var(--chalk); color: var(--page-text); }
.feature p, .step p { color: var(--page-muted); }
.feature .icon { background: rgba(255, 210, 74, 0.14); color: var(--yellow); font-family: var(--serif); font-weight: 700; }
.step::before { background: var(--yellow); color: var(--accent-strong); font-family: var(--mono); }
.how h2 { color: var(--page-text); }
.honest { background: transparent; border: 1.5px dashed var(--yellow); border-left-width: 1.5px; color: var(--page-text); border-radius: 12px; }
.loader { color: var(--page-text); }
.spinner { border-color: rgba(244, 239, 220, 0.2); border-top-color: var(--yellow); }
footer { color: var(--page-muted); }
footer a, .linklike { color: var(--yellow); }
.privacy { color: var(--page-muted); }

/* ------- report */
.hero-card { background: var(--surface); border: 0; }
.hero-team h2 { font-weight: 700; }
.rank-pill { background: var(--accent); border: 0; color: var(--on-accent); }
.rank-pill b { color: var(--yellow); font-family: var(--mono); }
.rank-pill span { color: #cfe3d6; }
.odd { background: rgba(255, 254, 247, 0.62); border: 1.5px solid var(--border); }
.odd .v { font-family: var(--mono); letter-spacing: -0.04em; }
.odd.highlight { background: var(--yellow); border-color: var(--yellow); box-shadow: none; }
.odd.highlight .v { color: var(--accent-strong); }
.odd.highlight .l { color: #4a4300; }
.stance { background: rgba(255, 254, 247, 0.62); border: 1.5px solid var(--border); }
.stance-badge { background: var(--accent); color: var(--on-accent); }
.stance-badge.chase, .stance-badge.long-shot { background: var(--warn); color: #fff; }
.banner { background: var(--warn-bg); color: var(--text); }
.tabs { background: var(--page-deep); border: 1px solid var(--chalk); }
.tab-btn { color: var(--page-muted); }
.tab-btn.active { background: var(--surface); color: var(--text); box-shadow: none; }
.win-delta, .stat-pill b, .tag, .pc { font-variant-numeric: tabular-nums; }
.win-delta { font-family: var(--mono); }
.move { background: rgba(255, 254, 247, 0.62); }
.move.hit { background: var(--warn-bg); }
.move-n { background: var(--accent); color: var(--yellow); font-family: var(--mono); }
.swap-card.out { background: var(--bad-bg); }
.swap-card.in { background: var(--good-bg); }
.swap-card .nm { font-family: var(--serif); }
.swap-arrow { align-self: center; display: grid; place-items: center; color: var(--accent); }
.swap-arrow svg { display: block; }
.stat-pill { background: var(--pill-bg); }
.row { background: rgba(255, 254, 247, 0.62); border: 1px solid var(--border); }
.bar-row { background: rgba(255, 254, 247, 0.62); border: 1px solid var(--border); }
.bar { background: var(--pill-bg); }
.bar > i { background: var(--rival); }
.bar-row.me .bar > i { background: var(--good); }
.bar-row .pc { font-family: var(--mono); font-weight: 700; white-space: nowrap; }
.style-switch { background: var(--pill-bg); }
.style-switch button[aria-checked="true"] { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.roll-card { background: var(--accent-soft); border: 2px dashed var(--accent); }
.pitch { border-color: rgba(244, 239, 220, 0.6); }
.player-card .pc-badge { background: var(--accent); }
section.block h3 { font-family: var(--serif); font-size: 1.12rem; }
.win-sub-h { color: var(--accent); letter-spacing: 0.1em; }
.plan-week { color: var(--accent); font-family: var(--mono); }
.week-arrow { background: var(--surface); }
.form-error { background: var(--bad-bg); color: var(--bad); }

.demo-swap .shirt { margin: 0 auto 4px; }

.bar-row .name { font-weight: 700; }
.bar-row .meta { font-size: 0.79rem; color: var(--text-muted); }
.bar-row.me { border-color: var(--good); }

/* landing layout: copy, then the form, then the example on phones; copy + form beside the example on desktop */
.landing-hero { display: grid; grid-template-columns: minmax(0, 1fr); text-align: center;
  grid-template-areas: "eyebrow" "h1" "lead" "form" "demo"; }
.landing-hero .eyebrow { grid-area: eyebrow; justify-self: center; }
.landing-hero h1 { grid-area: h1; }
.landing-hero .lead { grid-area: lead; }
.landing-hero .lookup { grid-area: form; width: 100%; }
.landing-hero .demo { grid-area: demo; width: 100%; }
@media (min-width: 920px) {
  .landing-hero { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); column-gap: 40px; text-align: left; align-items: start;
    grid-template-areas: "eyebrow demo" "h1 demo" "lead demo" "form demo"; padding-top: 36px; }
  .landing-hero .eyebrow { justify-self: start; }
  .landing-hero h1 { margin-left: 0; margin-right: 0; max-width: 13ch; }
  .landing-hero .lead { margin-left: 0; margin-right: 0; }
  .landing-hero .lookup { margin-left: 0; max-width: none; }
  .landing-hero .demo { margin: 0; align-self: center; max-width: none; }
}

/* football loader: the ball bounces on its shadow while it spins */
.ball-wrap { position: relative; width: 70px; height: 92px; margin: 0 auto 10px; }
.ball-bounce { position: absolute; left: 8px; top: 0; animation: ball-drop 0.58s cubic-bezier(0.4, 0, 0.9, 0.6) infinite alternate; }
.ball { display: block; animation: ball-spin 1.1s linear infinite; filter: none; }
.ball-shadow { position: absolute; left: 11px; bottom: 2px; width: 48px; height: 9px; border-radius: 50%; background: rgba(0, 0, 0, 0.35); animation: ball-shadow 0.58s cubic-bezier(0.4, 0, 0.9, 0.6) infinite alternate; }
@keyframes ball-drop { from { transform: translateY(0); } to { transform: translateY(32px); } }
@keyframes ball-spin { to { transform: rotate(360deg); } }
@keyframes ball-shadow { from { transform: scaleX(0.5); opacity: 0.35; } to { transform: scaleX(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .ball-bounce, .ball-shadow { animation: none; }
  .ball { animation-duration: 3s; }
}

/* loading: a centred overlay, so it can't be missed however far down the page the form is */
.loader { position: fixed; inset: 0; z-index: 50; padding: 0; background: rgba(10, 44, 33, 0.92); text-align: center; }
.loader.visible { display: grid; align-content: center; justify-items: center; }
.loader p { font-family: var(--serif); font-size: 1.25rem; font-weight: 700; margin: 0 16px; }
.loader small { color: var(--page-muted); margin: 6px 16px 0; }

.banner[hidden] { display: none; }
.banner > div + div { margin-top: 6px; }

/* names are user-typed: a long unbroken one must wrap inside its card instead of widening the page */
.wrap { overflow-wrap: anywhere; }
.row > div, .bar-row > div, .move-head, .hero-top > div, .swap-card, .plan-body, .win-note { min-width: 0; }

.field input::placeholder { color: #66766b; opacity: 1; font-weight: 500; }

/* =========================================================== fixture difficulty page */
.topbar-actions a.btn[aria-current="page"] { border-color: var(--yellow); color: var(--yellow); }
.fx-hero { text-align: center; padding: 30px 0 18px; }
.fx-hero h1 { font-size: clamp(2rem, 6vw, 3rem); margin: 12px 0 10px; font-weight: 700; letter-spacing: -0.015em; }
.fx-hero .lead { max-width: 60ch; }
.fx-controls { display: flex; flex-wrap: wrap; gap: 14px 24px; padding: 16px 18px; margin-bottom: 14px; align-items: flex-end; }
.fx-control { display: flex; flex-direction: column; gap: 6px; }
.fx-label { font-size: 0.74rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.seg { display: inline-flex; gap: 3px; padding: 3px; background: var(--pill-bg); border-radius: 999px; }
.seg button { border: 0; background: transparent; color: var(--text-muted); font-weight: 700; font-size: 0.86rem; padding: 7px 13px; border-radius: 999px; cursor: pointer; min-width: 34px; }
.seg button[aria-checked="true"] { background: var(--accent); color: var(--on-accent); }
.fx-controls select { padding: 9px 12px; border-radius: 10px; border: 1.5px solid var(--border); background: #fffdf4; color: var(--text); font-weight: 600; font-size: 0.92rem; }
.fx-legend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 1 1 100%; padding-top: 4px; }
.leg { font-size: 0.74rem; font-weight: 700; padding: 3px 9px; border-radius: 6px; }
.leg-note { font-size: 0.78rem; color: var(--text-muted); margin-left: 8px; }
.d1 { background: #58c27d; color: #0b2418; }
.d2 { background: #a9db83; color: #16260c; }
.d3 { background: #f2e08e; color: #2b2508; }
.d4 { background: #f0a45e; color: #2d1604; }
.d5 { background: #c0392b; color: #ffffff; }
.diamond { font-style: normal; font-size: 0.7em; }

.fx-gridcard { padding: 0; overflow: hidden; margin-bottom: 18px; }
.fx-scroll { overflow-x: auto; }
table.fx { border-collapse: separate; border-spacing: 3px; width: 100%; min-width: 640px; }
table.fx th, table.fx td { padding: 0; vertical-align: middle; text-align: center; }
table.fx thead th { padding: 10px 2px 6px; font-size: 0.8rem; font-weight: 800; color: var(--text); position: sticky; top: 0; }
table.fx thead th small { display: block; font-weight: 600; font-size: 0.68rem; color: var(--text-muted); }
table.fx .team-col { position: sticky; left: 0; z-index: 2; background: #e9e8d6; text-align: left; padding: 6px 10px; min-width: 128px; }
.fx-team { display: flex; align-items: center; gap: 8px; }
.fx-team .nm { font-weight: 800; font-size: 0.9rem; }
.fx-team .full { font-size: 0.72rem; color: var(--text-muted); font-weight: 500; }
.fx-match { position: relative; display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 40px; border-radius: 7px; padding: 4px 6px; font-size: 0.8rem; font-weight: 800; }
.fx-match .ven { font-size: 0.66rem; font-weight: 700; opacity: 0.8; }
.fx-match .rt { font-family: var(--mono); font-size: 0.72rem; margin-left: 3px; opacity: 0.85; }
.fx-match .diamond { position: absolute; top: 1px; right: 4px; font-size: 0.62rem; }
td.fx-double .fx-match + .fx-match { margin-top: 3px; }
td.fx-blank { background: repeating-linear-gradient(135deg, rgba(16, 37, 28, 0.12) 0 5px, transparent 5px 10px); color: var(--text-muted); font-size: 0.68rem; font-weight: 600; border-radius: 7px; }
table.fx .run-col { min-width: 84px; padding: 4px 8px; }
table.fx thead .run-col { text-align: center; }
.run-num { font-family: var(--mono); font-weight: 800; font-size: 0.95rem; }
.run-bar { height: 6px; background: var(--pill-bg); border-radius: 3px; overflow: hidden; margin: 3px 0; }
.run-bar i { display: block; height: 100%; }
.run-sub { font-size: 0.66rem; color: var(--text-muted); }
.fx-foot { font-size: 0.78rem; color: var(--text-muted); margin: 0; padding: 10px 14px 12px; }
.fx-strength, .fx-how { margin-bottom: 18px; }
.fx-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .fx-two { grid-template-columns: 1fr; } }
.strength-list { display: grid; gap: 5px; }
.strength-row { display: grid; grid-template-columns: 78px 1fr 84px; gap: 8px; align-items: center; font-size: 0.78rem; }
.strength-row .trk { height: 9px; background: var(--pill-bg); border-radius: 3px; overflow: hidden; }
.strength-row .trk i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
#attack-list .trk i { background: #c28a00; }
.strength-row .pc { font-family: var(--mono); text-align: right; font-weight: 700; }
.fx-bullets { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 8px; font-size: 0.92rem; }
.fx-cta { margin: 16px 0 0; }
.fx-cta .btn { text-decoration: none; }
a.btn { text-decoration: none; }
.fx-hero + .fx-controls { margin-top: 0; }
@media (max-width: 520px) { .fx-controls { padding: 14px; } table.fx .team-col { min-width: 92px; } .fx-team .full { display: none; } }

/* cells: two tidy lines, never broken mid-word (the global long-name wrapping must not apply here) */
table.fx, table.fx * { overflow-wrap: normal; word-break: normal; }
.fx-match { flex-direction: column; gap: 0; min-height: 44px; padding: 5px 4px; line-height: 1.15; white-space: nowrap; }
.fx-match .opp { font-size: 0.84rem; }
.fx-match .ven { font-size: 0.66rem; opacity: 0.85; }
.fx-match .rt { margin-left: 0; font-size: 0.7rem; }
.fx-match { text-align: center; }
table.fx .team-col .nm, table.fx .team-col .full { white-space: nowrap; }

.fx-match .sub { display: block; font-size: 0.7rem; }

@media (max-width: 980px) { .fx-team .full { display: none; } table.fx .team-col { min-width: 84px; padding: 6px 8px; } table.fx .run-col { min-width: 76px; padding: 4px 4px; } .run-sub { display: none; } }

.fx-swipe { display: none; text-align: center; font-size: 0.8rem; color: var(--page-muted); margin: 0 0 8px; }
@media (max-width: 700px) { .fx-swipe { display: block; } }

/* ================= the next four gameweeks under every player ================= */
.fxs { display: flex; gap: 2px; margin-top: 6px; align-items: stretch; }
.fxs-box { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 1px; border-radius: 4px; overflow: hidden; }
.fxs-m { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3px 1px; line-height: 1.05; font-size: 0.6rem; font-weight: 800; letter-spacing: 0; overflow-wrap: normal; word-break: normal; }
.fxs-m .h { font-size: 0.5rem; font-weight: 700; opacity: 0.85; }
.fxs-box.blank { background: repeating-linear-gradient(135deg, rgba(16, 37, 28, 0.18) 0 4px, transparent 4px 8px); align-items: center; justify-content: center; color: #566; font-size: 0.7rem; font-weight: 800; min-height: 26px; }
.fxs.wide .fxs-m { font-size: 0.72rem; padding: 4px 2px; }
.fxs.wide .fxs-m .h { font-size: 0.62rem; }
.fxs.wide .fxs-box.blank { min-height: 32px; }
.fxs-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.fxs-name { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fxs-col .fxs { margin-top: 2px; }
.fxs-col { min-width: 0; }
.swap-card .fxs { margin-top: 8px; }
@media (max-width: 420px) { .fxs-pair { gap: 6px; } .fxs.wide .fxs-m { font-size: 0.64rem; } }

/* pitch cards carry the strip too, so they get a little wider and the tiny strip a little tighter */
.player-card { min-width: 100px; max-width: 112px; }
.fxs.tiny { gap: 1px; margin-top: 5px; }
.fxs.tiny .fxs-m { font-size: 0.52rem; padding: 3px 0; letter-spacing: -0.03em; }
.fxs.tiny .fxs-m .h { font-size: 0.46rem; }
.fxs.tiny .fxs-box.blank { min-height: 22px; font-size: 0.6rem; }

.pitch-row { gap: 6px; }
.player-card { flex: 0 1 102px; min-width: 90px; max-width: 102px; }

@media (max-width: 480px) {
  .player-card { flex: 0 1 90px; min-width: 84px; max-width: 94px; padding: 6px 4px; }
  .pitch { padding-left: 4px; padding-right: 4px; }
  .pitch-row { gap: 5px; }
  .fxs.tiny { gap: 1px; }
  .fxs.tiny .fxs-m { font-size: 0.47rem; letter-spacing: -0.04em; }
  .fxs.tiny .fxs-m .h { font-size: 0.42rem; }
}

/* ============ softer difficulty colours (everywhere) and smaller boxes under players ============ */
.d1 { background: #c3e6cf; color: #123a24; }
.d2 { background: #dcefc9; color: #25390f; }
.d3 { background: #f6edc3; color: #3a3410; }
.d4 { background: #f7d6b6; color: #4a2a0c; }
.d5 { background: #edb9b0; color: #5a1a12; }
.d1.leg, .d2.leg, .d3.leg, .d4.leg, .d5.leg { border: 1px solid rgba(16, 37, 28, 0.12); }

.fxs { gap: 1px; margin-top: 4px; }
.fxs-box { border-radius: 3px; }
.fxs-m { font-size: 0.5rem; padding: 2px 0; font-weight: 700; }
.fxs-m .h { font-size: 0.42rem; font-weight: 600; opacity: 0.75; }
.fxs-box.blank { min-height: 18px; font-size: 0.55rem; }
.fxs.tiny .fxs-m { font-size: 0.44rem; padding: 2px 0; letter-spacing: -0.04em; }
.fxs.tiny .fxs-m .h { font-size: 0.38rem; }
.fxs.tiny .fxs-box.blank { min-height: 16px; font-size: 0.5rem; }
.fxs.wide .fxs-m { font-size: 0.6rem; padding: 2px 1px; }
.fxs.wide .fxs-m .h { font-size: 0.5rem; }
.fxs.wide .fxs-box.blank { min-height: 22px; }
.swap-card .fxs { margin-top: 6px; }
@media (max-width: 480px) {
  .fxs.tiny .fxs-m { font-size: 0.42rem; }
  .fxs.tiny .fxs-m .h { font-size: 0.36rem; }
  .fxs.wide .fxs-m { font-size: 0.54rem; }
}

.topbar { flex-wrap: wrap; gap: 8px 12px; }
.topbar .btn, .name-mode-toggle { white-space: nowrap; }
.topbar-actions { margin-left: auto; }
.topbar-nav { margin-left: auto; }
body[data-view="report"] .topbar .topbar-nav { margin-left: 0; }
@media (max-width: 760px) { body[data-view="report"] .brand-name { display: none; } }

.fxs-box { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7); }
.fxs { padding: 1px; }

/* plain text pages (privacy) */
.fx-para { margin: 6px 0 0; font-size: 0.95rem; }
.prose-page .block { margin-bottom: 16px; }
footer a { color: var(--yellow); }

/* players only mentioned in passing: small tiles with their next four games */
.ptiles { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.ptile { width: 118px; max-width: 100%; }
.ptile-name { font-size: 0.78rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptile-note { font-size: 0.66rem; color: var(--text-muted); line-height: 1.2; max-height: 4.8em; overflow: hidden; }
.hot-item .fxs { max-width: 150px; }

/* rival move forecast */
.rm-card { background: rgba(255, 254, 247, 0.62); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 13px; margin-bottom: 10px; }
.rm-head { margin-bottom: 6px; }
.rm-move { padding: 8px 0; border-top: 1px solid var(--border); }
.rm-top { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-weight: 800; }
.rm-top .out { color: var(--bad); }
.rm-top .in { color: var(--good); }
.rm-top .arrow { color: var(--text-muted); }
.rm-chance { margin-left: auto; font-family: var(--mono, monospace); font-weight: 800; }
.rm-why { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; line-height: 1.35; }
.rm-head .name { font-weight: 800; font-size: 1.02rem; overflow-wrap: anywhere; }
.rm-head .meta { font-size: 0.8rem; color: var(--text-muted); }
.odd .gain { font-size: 0.74rem; font-weight: 750; color: var(--good); margin-top: 3px; }
.odd.highlight .gain { color: #2e4a00; }

/* gameweek header buttons: click to order the teams by that week */
table.fx thead .gw-btn { all: unset; box-sizing: border-box; display: block; width: 100%; cursor: pointer; padding: 2px 0; border-radius: 6px; font-weight: 800; font-size: 0.8rem; text-align: center; }
table.fx thead .gw-btn:hover { background: rgba(20, 80, 59, 0.12); }
table.fx thead .gw-btn:focus-visible { outline: 3px solid var(--yellow); box-shadow: 0 0 0 2px #10251c; }
table.fx thead .gw-btn.active { background: var(--accent); color: var(--on-accent); }
table.fx thead .gw-btn.active small { color: var(--on-accent); opacity: 0.85; }
table.fx thead .gw-btn small { display: block; font-weight: 600; font-size: 0.68rem; color: var(--text-muted); }

/* week-by-week move / roll timeline */
.plan-weeks-h { margin: 18px 0 8px; font-size: 0.92rem; }
.plan-weeks { display: grid; gap: 4px; }
.pw-row { display: grid; grid-template-columns: 52px 108px 1fr; gap: 8px; align-items: baseline; padding: 6px 10px; border-radius: var(--radius-sm); background: rgba(255, 254, 247, 0.5); border: 1px solid var(--border); font-size: 0.82rem; }
.pw-row.moved { background: var(--good-bg); }
.pw-gw { font-weight: 800; }
.pw-ft { color: var(--text-muted); }
@media (max-width: 520px) { .pw-row { grid-template-columns: 46px 1fr; } .pw-what { grid-column: 1 / -1; } }

/* decision strip under each move */
.decision { margin-top: 8px; }
.decision .move-stats { margin-top: 0; }
details.more.small { margin-top: 6px; font-size: 0.82rem; }
details.more.small summary { cursor: pointer; font-weight: 700; color: var(--accent); }
.change-list { margin: 6px 0 0; padding-left: 18px; color: var(--text-muted); }
.change-list li { margin-bottom: 3px; }

.mw-card { background: rgba(255, 254, 247, 0.62); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 13px; margin-bottom: 8px; }
.mw-card .fxs { max-width: 220px; }
.asof { margin-top: 10px; font-size: 0.8rem; color: var(--text-muted); }

/* predicted points above the fixtures: a number and a bar per gameweek, then the fixture box */
.fxs.with-pts { align-items: flex-end; gap: 3px; }
.fxs-col1 { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fxs.with-pts .fxs-box { flex: none; }
.pts-n { text-align: center; font-weight: 800; font-size: 0.74rem; line-height: 1; }
.pts-bar { height: 34px; display: flex; align-items: flex-end; background: rgba(20, 80, 59, 0.08); border-radius: 4px; overflow: hidden; }
.pts-bar i { display: block; width: 100%; background: var(--accent); border-radius: 3px 3px 0 0; }
.fxs.tiny.with-pts .pts-n { font-size: 0.62rem; }
.fxs.tiny.with-pts .pts-bar { height: 24px; }
.fxs-block { margin-top: 6px; }
.fxs-block .fxs { margin-top: 3px; }
.fxs-cap { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 0.68rem; color: var(--text-muted); font-weight: 600; }
.fxs-cap b { color: var(--text); font-weight: 800; }
.fxs-pair .fxs-block { margin-top: 2px; }
