/* ===========================================================================
   The Redraft Ladder — stylesheet
   All styling lives here (no inline CSS in the JS). Palette + type are tuned to
   feel like Footy Redraft: near-black green-tinted base, soft sage-green accent.
   Edit the variables in :root to re-theme the whole app.
   =========================================================================== */

:root {
  /* Cool, cohesive palette — sage-green accent, no warm/red undertones.
     Positions run a cool ramp: green -> teal -> blue -> violet. */
  /* --- surfaces (neutral charcoal ramp, layered on #262626) --- */
  --bg: #1d1d1d; /* page background */
  --panel: #242424; /* cards / panels (raised above bg) */
  --panel2: #292929; /* insets, hovers, inputs */
  --line: #404040; /* borders / dividers */
  --hover: #343434; /* subtle button/row hover */
  /* --- text (neutral off-white / gray) --- */
  --ink: #ececec; /* primary text */
  --muted: #9b9b9b; /* secondary text */
  --dim: #6b6b6b; /* faint text */
  /* --- accents --- */
  --acc: #72ad62; /* Footy-Redraft green */
  --acc2: #68a158; /* accent hover */
  --acc-ink: #0b1408; /* text on green buttons */
  --gold: #d6d493; /* finals / premiers (cool pale gold) */
  --red: #cf8298; /* losses (cool rose — no orange warmth) */
  --blue: #74a4e6;
  /* --- position chips (cool ramp) --- */
  --fwd: #83cf83; /* green   */
  --mid: #55c3b6; /* teal    */
  --def: #74a4e6; /* blue    */
  --ruc: #ac8fee; /* violet  */
  /* --- type scale --- */
  --fs-h1: 22px;
  --fs-h2: 19px;
  --fs-h3: 13px;
  --fs-body: 15px;
  --fs-sm: 13px;
  --fs-cap: 12px;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  background: var(--bg);
  color: var(--ink);
  font:
    var(--fs-body)/1.5 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---- layout shell ---- */
.wrap {
  max-width: 1360px;
  margin: 0 auto;
  padding: 18px 22px 24px;
  /* full-height column so the footer can sit at the bottom of the page */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
/* consistent gap between content and footer on every page (tall or short) */
#app {
  margin-bottom: 40px;
}
header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.brand {
  display: flex;
  align-items: center;
}
/* ---- brand logo lockup (from the Redraft Ladder Logo design) ---- */
.logoLockup {
  display: flex;
  align-items: center;
  gap: 14px;
}
/* the "ladder" bar mark: two short outer bars, two tall inner bars */
.ladderMark {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 34px;
  flex: none;
}
.ladderMark span {
  width: 6px;
  background: var(--acc);
  border-radius: 1px;
}
.ladderMark span:nth-child(1),
.ladderMark span:nth-child(4) {
  height: 19px;
}
.ladderMark span:nth-child(2),
.ladderMark span:nth-child(3) {
  height: 34px;
}
.logoDivider {
  width: 2px;
  align-self: stretch;
  min-height: 42px;
  background: var(--line);
  flex: none;
}
.logoText {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.logoKicker {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--acc);
}
.logoWord {
  margin: 0;
  cursor: pointer;
  font-size: 26px;
  line-height: 1.02;
  letter-spacing: -0.01em;
  font-weight: 900;
}
.logoWord .lw-the {
  font-weight: 300;
  color: var(--ink);
}
.logoWord .lw-red {
  color: var(--ink);
}
.logoWord .lw-lad {
  color: var(--acc);
}
.logoWord:hover .lw-lad {
  color: var(--acc2);
}
.brand .sub {
  color: var(--dim);
  font-size: var(--fs-cap);
  margin-top: 2px;
}
.career {
  color: var(--muted);
  font-size: var(--fs-cap);
  text-align: right;
}
.career b {
  color: var(--gold);
}

/* ---- headings / text helpers ---- */
h2 {
  font-size: var(--fs-h2);
  margin: 0 0 12px;
  letter-spacing: -0.3px;
}
h3 {
  font-size: var(--fs-h3);
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.muted {
  color: var(--muted);
}
.dim {
  color: var(--dim);
}
.narrow {
  max-width: 660px;
  margin: 0 auto;
}
.fieldLabel {
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}
.textInput.lg {
  font-size: 17px;
  padding: 12px 16px;
  min-width: 320px;
  text-align: center;
}
.cap {
  font-size: var(--fs-cap);
}
.center {
  text-align: center;
}

/* ---- buttons ---- */
button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--ink);
  border-radius: 8px;
  padding: 9px 16px;
  transition: 0.12s;
}
button:hover:not(:disabled) {
  border-color: var(--acc);
  background: var(--hover);
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
button.primary {
  background: var(--acc);
  border-color: var(--acc);
  color: var(--acc-ink);
  font-weight: 650;
}
button.primary:hover:not(:disabled) {
  background: var(--acc2);
  border-color: var(--acc2);
}
button.gold {
  background: var(--gold);
  border-color: var(--gold);
  color: #23260f;
  font-weight: 650;
}
button.gold:hover:not(:disabled) {
  background: #e3e1a6;
  border-color: #e3e1a6;
  color: #23260f;
}
button.ghost {
  background: transparent;
}
button.sm {
  padding: 5px 10px;
  font-size: var(--fs-sm);
  border-radius: 6px;
}

/* ---- primitives ---- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 18px;
  align-items: start;
}
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.spread {
  justify-content: space-between;
}
.rowCenter {
  justify-content: center;
}
.starRow {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0 6px;
}
.textInput {
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 12px;
  min-width: 260px;
}

/* spacing utilities */
.mb0 {
  margin-bottom: 0;
}
.mb4 {
  margin-bottom: 4px;
}
.mb8 {
  margin-bottom: 8px;
}
.mb12 {
  margin-bottom: 12px;
}
.mt4 {
  margin-top: 4px;
}
.mt8 {
  margin-top: 8px;
}
.mt10 {
  margin-top: 10px;
}
.mt12 {
  margin-top: 12px;
}
.mt14 {
  margin-top: 14px;
}
.mt16 {
  margin-top: 16px;
}
.mt18 {
  margin-top: 18px;
}
.mt20 {
  margin-top: 20px;
}
.tm {
  font-size: var(--fs-cap);
  color: var(--dim);
}

/* ---- position chips ---- */
.pos {
  display: inline-block;
  min-width: 34px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  letter-spacing: 0.3px;
}
.pos.DEF {
  background: rgba(116, 164, 230, 0.16);
  color: var(--def);
}
.pos.MID {
  background: rgba(85, 195, 182, 0.16);
  color: var(--mid);
}
.pos.FWD {
  background: rgba(131, 207, 131, 0.16);
  color: var(--fwd);
}
.pos.RUC {
  background: rgba(172, 143, 238, 0.16);
  color: var(--ruc);
}
.posCell {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.posCell .pos {
  min-width: 32px;
  font-size: 10px;
  padding: 1px 4px;
}

/* ---- tables ---- */
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  text-align: left;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
}
th {
  color: var(--dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
tbody tr:hover {
  background: var(--panel2);
}
td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
/* finals zone: top-8 rows tinted a consistent green */
tr.finalsRow {
  background: #263022;
}
/* your team: a green accent bar (works over the finals tint too) */
tr.userRow {
  box-shadow: inset 3px 0 0 var(--acc);
}
tr.userRow:not(.finalsRow) {
  background: rgba(159, 206, 146, 0.08);
}
.formCol {
  letter-spacing: 2px;
}

/* ---- draft board ---- */
.filters {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.filters input {
  flex: 1;
  min-width: 140px;
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 10px;
}
.plist {
  max-height: 62vh;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.pRow {
  display: grid;
  grid-template-columns: 76px 1fr 58px 58px 46px 66px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.pRow:last-child {
  border-bottom: 0;
}
.pRow .scrCol,
.pRow .defCol {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.pRow .scrCol {
  color: var(--fwd);
}
.pRow .defCol {
  color: var(--def);
}
.pRow .nm {
  font-weight: 600;
}
.pRow .tm {
  font-size: var(--fs-cap);
  color: var(--dim);
}
.listHead {
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 1;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.listHead .sortable {
  cursor: pointer;
  user-select: none;
}
.listHead .sortable:hover {
  color: var(--ink);
}
.listLegend {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}
.onclock {
  background: linear-gradient(90deg, rgba(159, 206, 146, 0.16), transparent);
  border: 1px solid var(--acc);
  border-radius: 10px;
  padding: 10px 14px;
}

/* roster progress + slots */
.rosterSlot {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px dashed var(--line);
}
.slotHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0 4px;
}
/* a roster slot the pending multi-position pick can be assigned to */
.slotHead.pickable {
  cursor: pointer;
  border: 1px dashed var(--acc);
  border-radius: 8px;
  padding: 4px 8px;
  margin: 8px 0 4px;
}
.slotHead.pickable:hover {
  background: var(--hover);
}
.pickHint {
  font-size: 11px;
  color: var(--acc);
  font-weight: 600;
}
/* banner prompting the user to choose a slot for a multi-position pick */
.pickPrompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0 4px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--hover);
  border: 1px solid var(--acc);
  font-size: var(--fs-sm);
}
.benchNote {
  font-size: 11px;
}
.bar {
  height: 6px;
  background: var(--panel2);
  border-radius: 4px;
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  background: var(--acc);
  width: var(--w, 0%);
}
.log {
  max-height: 180px;
  overflow-y: auto;
  font-size: var(--fs-cap);
}
.log div {
  padding: 3px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

/* ---- player-info sidebar ---- */
.infoCard {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: var(--panel2);
}
.infoHead {
  display: flex;
  gap: 12px;
  align-items: center;
}
.numBadge {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 20px;
  color: var(--ink);
  background: var(--panel);
  border: 2px solid var(--acc);
}
.infoName {
  font-size: 16px;
  font-weight: 700;
}
.infoMeta {
  font-size: var(--fs-cap);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.infoStats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  margin-top: 12px;
}
.infoStat {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-sm);
  border-bottom: 1px dotted var(--line);
  padding-bottom: 3px;
}
.infoStat b {
  font-variant-numeric: tabular-nums;
}
.infoPlaceholder {
  color: var(--dim);
  font-size: var(--fs-sm);
  text-align: center;
  padding: 20px 0;
}
.infoBig {
  display: flex;
  gap: 14px;
  margin-top: 12px;
}
.infoBig .kpi {
  flex: 1;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}
.infoBig .kpi .v {
  font-size: 18px;
  font-weight: 800;
}
.infoBig .kpi.scr .v {
  color: var(--fwd);
}
.infoBig .kpi.def .v {
  color: var(--def);
}
.infoBig .kpi .l {
  font-size: 10px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ---- trade window ---- */
.tradeSub {
  font-size: 11px;
  color: var(--dim);
  margin: 8px 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tradeList {
  max-height: 210px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
/* your-squad list: show all players, no scrolling */
.tradeList.full {
  max-height: none;
  overflow: visible;
}
.tradeItem {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.tradeItem .nm {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* club name: right-aligned, single line */
.tradeItem .tm {
  text-align: right;
  white-space: nowrap;
}
.tradeItem:last-child {
  border-bottom: 0;
}
.tradeItem:hover {
  background: var(--panel2);
}
.tradeItem.sel {
  background: rgba(159, 206, 146, 0.18);
  box-shadow: inset 3px 0 0 var(--acc);
}
/* proposed-trade summary: one player per line, positions underneath */
.dealPlayer {
  margin-top: 8px;
}
.dealPlayer .nm {
  font-weight: 600;
}
.dealPlayer .posCell {
  margin-top: 3px;
}
.teamSelect {
  background: var(--panel2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}
.offerCard {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  background: var(--panel2);
}
/* trade layout: your squad | acquire (middle) | offers */
.gridTrade {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}
/* below this width the middle would get squeezed — stack instead */
@media (max-width: 1080px) {
  .gridTrade {
    grid-template-columns: 1fr;
  }
}
.tradeSummary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 8px 0 4px;
}
.tradeSummary .tradeSub {
  display: block;
  margin-bottom: 2px;
}
.recvList {
  max-height: 68vh;
  overflow-y: scroll; /* always show the scrollbar */
  border: 1px solid var(--line);
  border-radius: 10px;
}
/* visible custom scrollbar for the scrolling lists */
.recvList::-webkit-scrollbar,
.plist::-webkit-scrollbar {
  width: 10px;
}
.recvList::-webkit-scrollbar-track,
.plist::-webkit-scrollbar-track {
  background: var(--panel);
}
.recvList::-webkit-scrollbar-thumb,
.plist::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 6px;
  border: 2px solid var(--panel);
}
.recvList::-webkit-scrollbar-thumb:hover,
.plist::-webkit-scrollbar-thumb:hover {
  background: var(--dim);
}
.teamGroup {
  border-bottom: 1px solid var(--line);
}
.teamGroup:last-child {
  border-bottom: 0;
}
.teamGroupHead {
  position: sticky;
  top: 0;
  background: var(--panel2);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--acc);
  letter-spacing: 0.3px;
  z-index: 1;
}
.emptyNote {
  padding: 10px;
}
.offerLine {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 2px 0;
}

/* ---- lineup editor ---- */
.pitchLine {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.pitchPos {
  width: 44px;
  flex: none;
}
.slotWrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}
.lineupSlot {
  min-width: 170px;
  min-height: 46px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 3px;
  flex: 1;
  display: flex;
  align-items: center;
}
.lineupSlot.empty {
  justify-content: center;
  color: var(--dim);
  font-size: var(--fs-cap);
}
/* while a player is picked up: eligible positions get a green target ring,
   ineligible ones grey out and don't respond. */
.pitchLine.invalid {
  opacity: 0.35;
}
.pitchLine.target .lineupSlot,
.benchDrop.target {
  border-color: var(--acc);
}
.lineupSlot.invalid {
  opacity: 0.4;
  cursor: not-allowed;
}
.lineupSlot.empty:not(.invalid) {
  cursor: pointer;
}
.lineupCard {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 6px 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.lineupCard.selected {
  border-color: var(--acc);
  box-shadow: 0 0 0 2px var(--acc);
}
.lineupCard .tm {
  text-align: right;
}
.benchDrop {
  min-height: 84px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ---- match cards / results ---- */
/* round results: one game per line (single column) */
.resultsList {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fixtureGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.mCard {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
}
.mCard:hover {
  border-color: var(--acc);
}
.mCard.userMatch {
  border-color: var(--acc);
  background: rgba(159, 206, 146, 0.08);
}
.mLine {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 3px 0;
}
.mLine .tName {
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.mLine.win {
  font-weight: 700;
}
.mLine.win .sc {
  color: var(--acc);
}
/* score: goals.behinds and total in two neat right-aligned columns */
.mLine .sc {
  display: inline-flex;
  align-items: baseline;
  gap: 14px; /* margin between G.B and the total */
  font-variant-numeric: tabular-nums;
}
.mLine .gb {
  min-width: 52px;
  text-align: right;
  font-size: 11px;
  color: var(--dim);
}
.mLine .pts {
  min-width: 34px;
  text-align: right;
  font-weight: 700;
}
.matchDetail {
  display: flex;
  gap: 22px;
}
.matchSide {
  flex: 1;
}
.matchSide .bigScore {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}
.subTag {
  color: var(--acc);
  font-size: 10px;
  font-weight: 700;
}

.badgeW {
  color: var(--acc);
  font-weight: 700;
}
.badgeL {
  color: var(--red);
}
.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--panel2);
  border: 1px solid var(--line);
}
.pillPick {
  padding: 6px 12px;
}
.W {
  color: var(--acc);
}
.L {
  color: var(--red);
}
.D {
  color: var(--gold);
}

/* ---- modal ---- */
.modalBg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}
.modal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  max-width: 680px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  padding: 22px;
}
/* ---- buy-me-a-coffee (persistent, bottom-right) ---- */
.bmc {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--acc);
  border: 1px solid var(--acc);
  color: var(--acc-ink);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
  transition: 0.14s;
}
.bmc:hover {
  background: var(--acc2);
  border-color: var(--acc2);
}
.bmcIcon {
  font-size: 15px;
}

/* ---- site footer ---- */
.siteFooter {
  width: 100%;
  max-width: 720px;
  /* margin-top:auto pushes the footer to the bottom of the page (space above
     it when content is short); auto sides keep it centred */
  margin: auto auto 8px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--dim);
  font-size: var(--fs-cap);
}
.footSocials {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: 16px;
}
.footSocials a {
  color: var(--muted);
  display: inline-flex;
  transition: 0.14s;
}
.footSocials a:hover {
  color: var(--acc);
}
.footSocials svg {
  width: 20px;
  height: 20px;
}
.footLine {
  margin: 4px 0;
  line-height: 1.5;
}
.footLine a {
  color: var(--muted);
  text-decoration: none;
}
.footLine a:hover {
  color: var(--acc);
  text-decoration: underline;
}
.footMeta {
  margin-top: 12px;
  color: var(--dim);
}

/* ---- dev cheat panel (fixed left dock) ---- */
.devPanel {
  position: fixed;
  left: 14px;
  top: 96px;
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 190px;
  padding: 12px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px dashed var(--acc);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
.devHead {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--acc);
  margin-bottom: 4px;
}
.devBtn {
  text-align: left;
  font-size: var(--fs-sm);
  padding: 7px 10px;
}
.devBtn.on {
  background: var(--acc);
  border-color: var(--acc);
  color: var(--acc-ink);
  font-weight: 650;
}

/* ---- first-season tutorial (guided popup) ---- */
.tutBg {
  background: rgba(0, 0, 0, 0.8); /* strong dim so focus is fully on the tutorial */
  z-index: 70;
}
.modal.tutModal {
  max-width: 540px;
  padding: 30px 32px 24px;
  border: 1px solid var(--acc);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
}
.tutTitle {
  font-size: 24px;
  margin: 0 0 12px;
  letter-spacing: -0.3px;
}
.tutText {
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
}
.tutText b {
  color: var(--ink);
}
.tutFoot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 22px;
}

/* ---- premiership confetti (single canvas, drawn via rAF in app.js) ---- */
.confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 60;
}
@media (prefers-reduced-motion: reduce) {
  .confetti {
    display: none;
  }
}

.modal.confirmModal {
  max-width: 420px;
}
.confirmActions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

/* ---- hero / reveal ---- */
.hero {
  text-align: center;
  padding: 40px 20px;
}
.hero .big {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -1px;
}
.revealKicker {
  letter-spacing: 2px;
  font-size: 13px;
}
/* Fixed line-height + tabular figures keep the rolling number from jumping. */
.yearBig {
  font-size: 68px;
  font-weight: 800;
  letter-spacing: -1px;
  margin: 6px 0;
  height: 82px;
  line-height: 82px;
  font-variant-numeric: tabular-nums;
}
/* while spinning: dim only (no scale — the fast text change is the motion) */
.rolling {
  opacity: 0.5;
}
/* on landing: a gentle fade/slide, no bouncy scale */
.landed {
  animation: landPop 0.4s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes landPop {
  0% {
    opacity: 0.35;
    transform: translateY(-6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
.revealNote {
  font-size: var(--fs-cap);
}
.pickReveal {
  font-size: 40px;
  font-weight: 800;
  color: var(--acc);
  height: 52px;
  line-height: 52px;
  font-variant-numeric: tabular-nums;
}
.flag {
  font-size: 64px;
}
.premBig {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -1px;
}
.premSub {
  font-size: 18px;
  margin: 6px 0 2px;
}
.heroMsg {
  margin-top: 14px;
  font-size: 17px;
}

/* ---- shareable card ---- */
.card-share {
  background: linear-gradient(160deg, #2f3b2b, #242424);
  border: 1px solid var(--acc);
  border-radius: 16px;
  padding: 26px;
  max-width: 420px;
  margin: 16px auto;
}
.card-share .kick {
  letter-spacing: 1px;
  font-size: 12px;
}
.card-share .team {
  font-size: 24px;
  font-weight: 800;
  margin: 6px 0;
}
.card-share .placing {
  font-size: 32px;
  font-weight: 800;
  color: var(--gold);
}
.card-share .foot {
  margin-top: 10px;
  font-size: 12px;
}

/* ---- finals bracket ---- */
.bracket {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 16px;
  align-items: stretch;
  overflow-x: auto;
}
.bkCol {
  display: flex;
  flex-direction: column;
  justify-content: center; /* funnel look: fewer games centre vertically */
  gap: 14px;
}
.bkColHead {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 600;
  text-align: center;
  margin-bottom: 2px;
}
.bkMatch {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}
.bkMatch.tbd {
  opacity: 0.45;
}
.bkLabel {
  font-size: 10px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.bkTeam {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 0;
}
.bkTeam.win {
  font-weight: 700;
}
.bkTeam.win .bkName,
.bkTeam.win .bkScore {
  color: var(--acc);
}
.bkTeam.me .bkName::after {
  content: " 🟢";
}
.bkScore {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* ---- flash toast ---- */
.flash {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel2);
  border: 1px solid var(--acc);
  color: var(--ink);
  padding: 10px 18px;
  border-radius: 10px;
  z-index: 99;
  opacity: 0;
  transition: opacity 0.2s;
}
.flash.show {
  opacity: 1;
}

/* ---- responsive ---- */
/* keep iOS from auto-inflating text on rotate, and tame tap flashes */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
button,
a,
.mCard,
.tradeItem,
.lineupCard,
.pRow {
  -webkit-tap-highlight-color: rgba(114, 173, 98, 0.18);
}

@media (max-width: 900px) {
  .grid2,
  .gridTrade {
    grid-template-columns: 1fr;
  }
  .fixtureGrid {
    grid-template-columns: 1fr;
  }
  .matchDetail {
    flex-direction: column;
  }
}

/* phones: tighten the shell, prevent overflow, stop iOS input zoom */
@media (max-width: 640px) {
  .wrap {
    padding: 12px 14px 20px;
  }
  header.top {
    flex-wrap: wrap;
    gap: 8px 14px;
    padding: 10px 0 14px;
  }
  .career {
    text-align: left;
  }
  /* compact the brand lockup so it fits a phone header */
  .logoLockup {
    gap: 11px;
  }
  .logoWord {
    font-size: 20px;
  }
  .ladderMark {
    height: 27px;
    gap: 5px;
  }
  .ladderMark span {
    width: 5px;
  }
  .ladderMark span:nth-child(1),
  .ladderMark span:nth-child(4) {
    height: 15px;
  }
  .ladderMark span:nth-child(2),
  .ladderMark span:nth-child(3) {
    height: 27px;
  }
  .logoDivider {
    min-height: 34px;
  }
  /* inputs must be >=16px or iOS Safari zooms the page on focus */
  .textInput,
  .filters input,
  .teamSelect {
    font-size: 16px;
  }
  /* let wide inputs shrink to the viewport instead of forcing a scroll */
  .textInput {
    min-width: 0;
    width: 100%;
  }
  .textInput.lg {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }
  .panel {
    padding: 14px;
  }
  .modal {
    padding: 18px;
  }
  .modal.tutModal {
    padding: 22px 20px 18px;
  }
  /* wide, many-column tables (ladder) scroll sideways rather than squashing */
  .panel table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  th,
  td {
    padding: 6px 7px;
  }
  /* scale the big reveal/hero type so it never overflows a phone */
  .hero {
    padding: 28px 10px;
  }
  .hero .big,
  .premBig,
  .pickReveal {
    font-size: 30px;
  }
  .yearBig {
    font-size: 52px;
    height: 64px;
    line-height: 64px;
  }
  .flag {
    font-size: 52px;
  }
  .tutTitle {
    font-size: 21px;
  }
  .tutText {
    font-size: 15px;
  }
  /* shrink the floating support pill so it doesn't cover content/actions */
  .bmc {
    right: 10px;
    bottom: 10px;
    padding: 7px 11px;
    font-size: 12px;
  }
  /* dev cheat dock (dev-only) becomes a bottom strip instead of overlapping */
  .devPanel {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: 8px;
    width: auto;
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  .pRow {
    grid-template-columns: 56px 1fr 46px 46px 56px;
    gap: 6px;
  }
  .pRow .num.muted {
    display: none;
  }
  /* lineup slots go full-width so cards stay readable */
  .lineupSlot {
    min-width: 130px;
  }
}
