/* EFS — floodlit night pitch.
   Base is a green-cast black (grass under sodium light), the single bold
   colour is floodlight amber, and everything else stays quiet. */

:root {
  --night: #0b1512;
  --turf: #122019;
  --turf-raised: #16281f;
  --chalkline: #22362c;
  --chalk: #e6efe8;
  --mute: #8aa396;
  --floodlight: #f5c451;
  --rise: #5bd6a0;
  --fall: #ff7a6b;
  --radius: 10px;
  --gutter: 16px;
  --maxw: 720px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--night);
  color: var(--chalk);
  font-family: Chivo, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--floodlight);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- masthead ---------- */

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 18px var(--gutter) 12px;
  max-width: var(--maxw);
  margin: 0 auto;
}

.wordmark { display: flex; align-items: baseline; gap: 10px; min-width: 0; }

.wordmark-mark {
  font-weight: 900;
  font-size: 26px;
  letter-spacing: -0.04em;
  border-bottom: 3px solid var(--floodlight);
  line-height: 1.05;
}

.wordmark-full {
  color: var(--mute);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.masthead-league {
  color: var(--mute);
  font-size: 13px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40%;
}

/* ---------- tabs ---------- */

.tabs {
  display: flex;
  gap: 4px;
  padding: 0 var(--gutter);
  max-width: var(--maxw);
  margin: 0 auto 8px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--chalkline);
}
.tabs::-webkit-scrollbar { display: none; }

.tabs a {
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--mute);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tabs a[aria-current="page"] {
  color: var(--chalk);
  border-bottom-color: var(--floodlight);
}

/* ---------- layout ---------- */

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px var(--gutter) 48px;
}

.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter) 32px;
  color: var(--mute);
  font-size: 12px;
}
.footer p { margin: 4px 0; }

h1 { font-size: 22px; font-weight: 900; letter-spacing: -0.02em; margin: 20px 0 4px; }
h2 { font-size: 15px; font-weight: 700; margin: 28px 0 10px; }

.sub { color: var(--mute); font-size: 14px; margin: 0 0 4px; }

/* ---------- matchday strip (the hero) ---------- */

.matchday {
  border: 1px solid var(--chalkline);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(245,196,81,0.07), rgba(245,196,81,0) 60%),
    var(--turf);
  padding: 20px 18px;
}

.matchday-gw {
  font-size: clamp(34px, 11vw, 52px);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 0.95;
  margin: 0;
}

.matchday-state {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--mute);
  font-size: 14px;
  margin-top: 10px;
}

.countdown {
  color: var(--chalk);
  font-weight: 700;
}

.pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mute);
  flex: none;
}
.pip.live { background: var(--fall); animation: pulse 2s ease-in-out infinite; }
.pip.settled { background: var(--rise); }

@keyframes pulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) {
  .pip.live { animation: none; }
}

.matchday-stats {
  display: flex;
  gap: 24px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--chalkline);
  font-size: 14px;
  color: var(--mute);
}
.matchday-stats b { color: var(--chalk); font-weight: 700; }

/* ---------- table ---------- */

.table { width: 100%; border-collapse: collapse; font-size: 15px; }

.table th {
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--mute);
  padding: 6px 8px;
  border-bottom: 1px solid var(--chalkline);
}
.table th.num, .table td.num { text-align: right; }

.table td {
  padding: 11px 8px;
  border-bottom: 1px solid var(--chalkline);
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }

.rankcell { width: 46px; color: var(--mute); font-weight: 700; }
.rankcell.podium { color: var(--floodlight); }

.who { min-width: 0; }
.who .name { font-weight: 700; display: block; }
.who .team {
  color: var(--mute);
  font-size: 13px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pts { font-weight: 700; }
.pts-sub { color: var(--mute); font-size: 13px; }

.move { font-size: 13px; font-weight: 700; width: 52px; }
.move.up { color: var(--rise); }
.move.down { color: var(--fall); }
.move.flat, .move.new { color: var(--mute); font-weight: 400; }

/* ---------- controls ---------- */

.searchbar { display: flex; gap: 8px; margin: 8px 0 4px; }

input[type="search"], input[type="text"] {
  flex: 1;
  min-width: 0;
  background: var(--turf);
  border: 1px solid var(--chalkline);
  border-radius: var(--radius);
  color: var(--chalk);
  font: inherit;
  padding: 11px 12px;
}
input::placeholder { color: var(--mute); }

.btn {
  background: var(--floodlight);
  color: #14200f;
  border: none;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 700;
  padding: 11px 16px;
  cursor: pointer;
}
.btn.ghost {
  background: transparent;
  color: var(--chalk);
  border: 1px solid var(--chalkline);
}
.btn:disabled { opacity: 0.5; cursor: default; }

.pager { display: flex; gap: 8px; align-items: center; margin-top: 16px; }
.pager .spacer { flex: 1; }

/* ---------- manager profile ---------- */

.profile-head { margin: 16px 0 4px; }
.profile-head h1 { margin-bottom: 2px; }

.statgrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--chalkline);
  border: 1px solid var(--chalkline);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 16px;
}
@media (min-width: 520px) {
  .statgrid { grid-template-columns: repeat(4, 1fr); }
}

.stat { background: var(--turf); padding: 12px 14px; }
.stat dt { color: var(--mute); font-size: 12px; margin: 0 0 2px; }
.stat dd { margin: 0; font-size: 20px; font-weight: 900; letter-spacing: -0.02em; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip {
  border: 1px solid var(--chalkline);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 13px;
  color: var(--mute);
}
.chip.active { border-color: var(--floodlight); color: var(--floodlight); }

/* ---------- pitch ---------- */

.pitch {
  margin-top: 12px;
  border: 1px solid var(--chalkline);
  border-radius: var(--radius);
  padding: 16px 8px 8px;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255,255,255,0.018) 0 44px,
      rgba(0,0,0,0) 44px 88px
    ),
    radial-gradient(120% 60% at 50% -10%, rgba(245,196,81,0.10), rgba(0,0,0,0) 70%),
    var(--turf);
  position: relative;
  overflow: hidden;
}

.pitch::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 128px;
  height: 128px;
  margin: -64px 0 0 -64px;
  border: 1px solid rgba(230,239,232,0.08);
  border-radius: 50%;
  pointer-events: none;
}

.pitch-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 14px;
  position: relative;
}

.bench {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px dashed var(--chalkline);
}
.bench-label { color: var(--mute); font-size: 12px; font-weight: 700; margin: 0 0 8px 4px; }

.player {
  width: 74px;
  text-align: center;
  position: relative;
}

.player .shirt {
  height: 34px;
  border-radius: 6px 6px 3px 3px;
  background: var(--turf-raised);
  border: 1px solid var(--chalkline);
  border-top-width: 3px;
  border-top-color: var(--mute);
  margin: 0 auto 5px;
  width: 40px;
}
.player.is-captain .shirt { border-top-color: var(--floodlight); }

.player .pname {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player .ppts {
  font-size: 13px;
  font-weight: 900;
  color: var(--floodlight);
}

.player .badge {
  position: absolute;
  top: -4px;
  right: 12px;
  background: var(--floodlight);
  color: #14200f;
  font-size: 10px;
  font-weight: 900;
  border-radius: 50%;
  width: 17px;
  height: 17px;
  line-height: 17px;
}
.player .badge.vice { background: var(--chalkline); color: var(--chalk); }

.player.doubt .pname { color: var(--fall); }

/* ---------- ownership ---------- */

.progress {
  height: 4px;
  background: var(--chalkline);
  border-radius: 2px;
  overflow: hidden;
  margin: 10px 0 6px;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--floodlight);
  width: 0;
  transition: width 240ms ease;
}

.ownrow { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--chalkline); }
.ownrow:last-child { border-bottom: none; }

.ownrow .who { flex: 1; }
.ownrow .bar {
  height: 6px;
  background: var(--chalkline);
  border-radius: 3px;
  margin-top: 5px;
  overflow: hidden;
}
.ownrow .bar span { display: block; height: 100%; background: var(--floodlight); }
.ownrow .pctwrap { text-align: right; width: 90px; }
.ownrow .pct { font-weight: 900; font-size: 17px; }
.ownrow .frac { color: var(--mute); font-size: 12px; }

/* ---------- states ---------- */

.notice {
  border: 1px solid var(--chalkline);
  border-left: 3px solid var(--floodlight);
  border-radius: var(--radius);
  background: var(--turf);
  padding: 14px 16px;
  margin: 16px 0;
}
.notice h2 { margin: 0 0 4px; font-size: 15px; }
.notice p { margin: 0; color: var(--mute); font-size: 14px; }

.skeleton {
  background: var(--turf);
  border-radius: var(--radius);
  height: 56px;
  margin-bottom: 8px;
  opacity: 0.6;
}

.muted { color: var(--mute); font-size: 14px; }
