/* Last Person Standing: matchday programme palette
   ink #1A2238 · paper #EEF1F4 · pitch #2E7D4F · red card #D63A2F · yellow card #F2C230 */
@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-display: swap; src: url("../vendor/fonts/barlow-condensed-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("../vendor/fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("../vendor/fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 800; font-display: swap; src: url("../vendor/fonts/barlow-condensed-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("../vendor/fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("../vendor/fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("../vendor/fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face {
  font-family: "Framework7 Icons";
  font-style: normal; font-weight: 400;
  src: url("../vendor/fonts/Framework7Icons-Regular.woff2") format("woff2");
}

:root {
  --ink: #1A2238;
  --ink-soft: #4A5470;
  --paper: #EEF1F4;
  --surface: #FFFFFF;
  --line: #D5DAE2;
  --pitch: #2E7D4F;
  --pitch-tint: #E2F1E8;
  --red: #D63A2F;
  --red-tint: #FBE6E4;
  --yellow: #F2C230;
  --yellow-tint: #FDF4D6;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, sans-serif;

  --f7-font-family: var(--body);
  --f7-ios-font-family: var(--body);
  --f7-md-font-family: var(--body);
  --f7-page-bg-color: var(--paper);
  --f7-bars-bg-color: var(--ink);
  --f7-bars-text-color: #fff;
  --f7-bars-link-color: #fff;
  --f7-navbar-title-font-size: 22px;
  --f7-navbar-large-title-font-size: 36px;
  --f7-list-bg-color: var(--surface);
  --f7-block-title-text-color: var(--ink-soft);
  --f7-block-title-font-size: 15px;
  --f7-button-font-family: var(--display);
}
:root .md, :root .ios { --f7-theme-color: var(--ink); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #E7EBF3; --ink-soft: #A3ACC2; --paper: #0F1424; --surface: #19203A; --line: #2B3456;
    --pitch: #4FBF7F; --pitch-tint: #173327; --red: #F06A5F; --red-tint: #3A1C1F;
    --yellow-tint: #3A3215;
    --f7-bars-bg-color: #151B31;
  }
}
body { background: var(--paper); color: var(--ink); }
.page { background: var(--paper); }
.navbar .title, .navbar-large .title-large-text {
  font-family: var(--display); font-weight: 700; letter-spacing: .01em;
}
.navbar-bg { background: var(--f7-bars-bg-color); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

h1, h2, h3, .display { font-family: var(--display); font-weight: 700; line-height: 1.05; margin: 0; }

.button {
  font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: .02em;
  text-transform: none; border-radius: 6px; height: 46px;
}
.button-fill { background: var(--ink); color: var(--paper); }
.button-pitch { background: var(--pitch); color: #fff; }
.button-quiet { color: var(--ink); background: transparent; border: 2px solid var(--ink); }
.stack { display: grid; gap: 12px; }
.wrap { padding: 0 16px; max-width: 640px; margin: 0 auto; }
.muted { color: var(--ink-soft); }
.small { font-size: 14px; }

/* ---------- sign in ---------- */
.signin {
  min-height: 100%; display: grid; align-content: center; gap: 28px;
  padding: 32px 20px calc(32px + env(safe-area-inset-bottom)); max-width: 420px; margin: 0 auto;
}
.signin .mark { font-family: var(--display); font-weight: 800; font-size: 56px; line-height: .9; }
.signin .mark span { display: block; }
.signin .mark .out { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: var(--red); text-decoration-thickness: 5px; }
.signin p { font-size: 17px; line-height: 1.5; margin: 0; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 15px; }
.field input, .field select {
  height: 46px; border: 2px solid var(--line); border-radius: 6px; padding: 0 12px;
  font: 17px var(--body); background: var(--surface); color: var(--ink); width: 100%; box-sizing: border-box;
}
.field input:focus, .field select:focus { border-color: var(--ink); outline: none; }
.field .hint { font-size: 14px; color: var(--ink-soft); }
.divider { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-size: 14px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.form-error { color: var(--red); font-weight: 600; }

/* ---------- league list ---------- */
.league-row {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 16px;
  background: var(--surface); border-left: 6px solid var(--line); border-radius: 4px; color: inherit;
}
.league-row.alive { border-left-color: var(--pitch); }
.league-row.eliminated { border-left-color: var(--red); }
.league-row.winner { border-left-color: var(--yellow); }
.league-row h3 { font-size: 24px; }
.league-row .meta { grid-column: 1 / -1; font-size: 15px; color: var(--ink-soft); }
.league-row .nudge { grid-column: 1 / -1; font-weight: 600; }
.league-row .nudge.todo { color: var(--red); }
.league-row .count { font-family: var(--display); font-weight: 700; font-size: 28px; text-align: right; line-height: 1; }
.league-row .count small { display: block; font-family: var(--body); font-weight: 500; font-size: 12px; color: var(--ink-soft); }

.empty { padding: 40px 16px; text-align: center; display: grid; gap: 16px; justify-items: center; }
.empty h2 { font-size: 30px; }
.empty p { max-width: 34ch; margin: 0; line-height: 1.5; }

/* ---------- scoreboard (the signature element) ---------- */
.scoreboard {
  background: var(--ink); color: var(--paper); border-radius: 8px; padding: 18px 18px 16px;
  display: grid; gap: 10px; position: relative; overflow: hidden;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .scoreboard { background: #050811; color: #E7EBF3; } }
.scoreboard .label { font-size: 14px; opacity: .75; }
.scoreboard .team {
  font-family: var(--display); font-weight: 800; font-size: clamp(44px, 14vw, 68px); line-height: .9;
  letter-spacing: -.01em; word-break: break-word;
}
.scoreboard .team.none { opacity: .35; }
.scoreboard .vs { font-size: 16px; opacity: .8; }
.scoreboard .deadline {
  justify-self: start; background: var(--yellow); color: #1A2238; font-weight: 700;
  padding: 4px 10px; border-radius: 3px; font-size: 15px;
}
.scoreboard .deadline.passed { background: transparent; color: inherit; border: 1px solid currentColor; opacity: .7; }
.scoreboard .result { font-family: var(--display); font-weight: 700; font-size: 22px; }
.scoreboard .result.won { color: #7BE0A3; }
.scoreboard .result.lost, .scoreboard .result.drew { color: #FF8A80; }
.scoreboard .button { margin-top: 6px; background: #FFFFFF; color: #1A2238; }

.statline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.statline div { background: var(--surface); padding: 10px 12px; border-radius: 4px; }
.statline b { display: block; font-family: var(--display); font-size: 28px; line-height: 1; }
.statline span { font-size: 13px; color: var(--ink-soft); }

.banner { padding: 14px 16px; border-radius: 4px; font-weight: 600; line-height: 1.4; }
.banner.win { background: var(--yellow-tint); border-left: 6px solid var(--yellow); }
.banner.out { background: var(--red-tint); border-left: 6px solid var(--red); }
.banner.info { background: var(--surface); border-left: 6px solid var(--ink-soft); font-weight: 500; }

/* ---------- players ---------- */
.players { background: var(--surface); border-radius: 4px; }
.player { display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.player:last-child { border-bottom: 0; }
.player .pcard { width: 12px; height: 16px; border-radius: 2px; background: var(--pitch); }
.player.eliminated .pcard { background: var(--red); }
.player.winner .pcard { background: var(--yellow); }
.player.eliminated .name { color: var(--ink-soft); }
.player .name { font-weight: 600; }
.player .note { font-size: 14px; color: var(--ink-soft); text-align: right; }
.player .me { font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-left: 6px; }

/* ---------- pick screen ---------- */
.fixture {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 6px;
  background: var(--surface); border-radius: 4px; padding: 6px;
}
.fixture .when { grid-column: 1 / -1; font-size: 13px; color: var(--ink-soft); padding: 2px 6px; }
.fixture .mid { display: grid; place-items: center; font-family: var(--display); font-weight: 700; color: var(--ink-soft); padding: 0 2px; }
.side {
  appearance: none; border: 2px solid transparent; background: var(--paper); color: var(--ink);
  border-radius: 4px; padding: 12px 8px; font-family: var(--display); font-weight: 700; font-size: 21px;
  line-height: 1.05; cursor: pointer; min-height: 56px; text-align: center;
}
.side.home { text-align: left; } .side.away { text-align: right; }
.side small { display: block; font-family: var(--body); font-weight: 500; font-size: 12px; color: var(--ink-soft); margin-top: 3px; }
.side:disabled { cursor: default; opacity: .45; }
.side.used { text-decoration: line-through; text-decoration-thickness: 2px; }
.side.chosen { background: var(--pitch); color: #fff; border-color: var(--pitch); opacity: 1; }
.side.chosen small { color: rgba(255,255,255,.85); }
.side:not(:disabled):not(.chosen):hover { border-color: var(--ink); }
.used-teams { display: flex; flex-wrap: wrap; gap: 6px; }
.used-teams span { background: var(--surface); padding: 4px 8px; border-radius: 3px; font-size: 14px; text-decoration: line-through; color: var(--ink-soft); }

/* ---------- history ---------- */
.round { background: var(--surface); border-radius: 4px; overflow: hidden; }
.round header { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.round header h3 { font-size: 22px; }
.round .row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); align-items: center; }
.round .row:last-child { border-bottom: 0; }
.tag { font-size: 13px; font-weight: 600; padding: 2px 8px; border-radius: 3px; background: var(--paper); }
.tag.won { background: var(--pitch-tint); color: var(--pitch); }
.tag.lost, .tag.drew { background: var(--red-tint); color: var(--red); }
.tag.passed { background: var(--yellow-tint); }

/* ---------- manage ---------- */
.code {
  font-family: var(--display); font-weight: 800; font-size: 44px; letter-spacing: .12em;
  background: var(--surface); text-align: center; padding: 12px; border-radius: 4px; border: 2px dashed var(--line);
}
.toggle-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.toggle-row:last-child { border-bottom: 0; }
.rules-list { background: var(--surface); border-radius: 4px; padding: 4px 14px; }
.rules-list p { margin: 10px 0; line-height: 1.45; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.loading { text-align: center; padding: 32px 0; margin: 0; }
.round .row .muted.small { white-space: normal; }
.score { white-space: nowrap; }

/* Bars are always ink-dark, in both iOS and Material themes */
.navbar .title, .navbar a.link, .navbar .icon, .navbar .if-not-md { color: #FFFFFF; }
.md .navbar .navbar-bg { background: var(--f7-bars-bg-color); }
.me.bot { background: var(--paper); color: var(--ink-soft); padding: 1px 6px; border-radius: 3px; }
