:root {
  --ink: #11192b;
  --paper: #f7f6f1;
  --line: #e2e0d6;
  --pitch: #0e7a45;
  --pitch-soft: #e3f0e8;
  --grey: #b3b8c2;
  --gold: #c9a227;
  --red: #c0392b;
  --radius: 10px;
  font-size: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  padding-bottom: 4rem;
}

.hidden { display: none !important; }

/* ---------- scoreboard header ---------- */
.board {
  position: sticky; top: 0; z-index: 10;
  background: var(--ink);
  color: #f4f2e9;
  padding: 0.7rem 1rem 0.8rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.2rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
  border-bottom: 3px solid var(--pitch);
}
.board-title {
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 800; font-size: 1.5rem; letter-spacing: .04em;
}
.board-sub {
  display: block; font-size: .7rem; font-weight: 600;
  letter-spacing: .12em; color: #8fa0bd; text-transform: uppercase;
}
.board-players { display: flex; gap: .6rem; flex: 1; flex-wrap: wrap; }
.player-chip {
  display: flex; align-items: center; gap: .5rem;
  background: #1d2940; border-radius: 999px;
  padding: .3rem .9rem .3rem .4rem;
  font-family: 'Saira Condensed', sans-serif;
}
.player-chip.leader { outline: 2px solid var(--gold); }
.player-chip .avatar { font-size: 1.4rem; }
.player-chip .pname { font-weight: 600; font-size: 1rem; letter-spacing: .03em; }
.player-chip .pnet { font-weight: 800; font-size: 1.15rem; }
.player-chip .pnet.pos { color: #5fd394; }
.player-chip .pnet.neg { color: #f1948a; }
.player-chip .prec { font-size: .7rem; color: #8fa0bd; }
.board-me button {
  background: none; border: 1px solid #3a4a6b; color: #aab8d0;
  border-radius: 6px; padding: .25rem .6rem; cursor: pointer; font-size: .75rem;
}

/* ---------- auth ---------- */
.auth {
  max-width: 360px; margin: 3rem auto; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; display: flex; flex-direction: column; gap: .8rem;
}
.auth h2 { font-family: 'Saira Condensed', sans-serif; font-weight: 800; }
.auth input {
  border: 1px solid var(--line); border-radius: 8px;
  padding: .6rem .8rem; font-size: 1rem; font-family: inherit;
}
.emoji-row { display: flex; gap: .3rem; flex-wrap: wrap; }
.emoji-row button {
  font-size: 1.3rem; background: var(--paper); border: 1px solid var(--line);
  border-radius: 8px; padding: .25rem .45rem; cursor: pointer;
}
.emoji-row button.sel { border-color: var(--pitch); background: var(--pitch-soft); }
.auth-actions { display: flex; gap: .6rem; }
.auth-actions button {
  flex: 1; padding: .6rem; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; font-weight: 600; cursor: pointer; font-family: inherit;
}
.auth-actions .primary { background: var(--pitch); color: #fff; border-color: var(--pitch); }
.auth-error { color: var(--red); font-size: .85rem; min-height: 1.2em; }

/* ---------- fixtures ---------- */
#fixtures { max-width: 720px; margin: 1.2rem auto 0; padding: 0 .8rem; }

.date-head {
  font-family: 'Saira Condensed', sans-serif; font-weight: 800;
  font-size: 1.05rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--pitch); margin: 1.6rem 0 .5rem;
  display: flex; align-items: center; gap: .6rem;
}
.date-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.match {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: .65rem .8rem; margin-bottom: .5rem;
  display: grid; grid-template-columns: 1fr auto 1fr; gap: .4rem .6rem;
  align-items: center;
}
.match .meta {
  grid-column: 1 / -1; display: flex; justify-content: space-between;
  font-size: .68rem; letter-spacing: .06em; text-transform: uppercase;
  color: #8c8f98; font-weight: 600;
}
.match .meta .live { color: var(--red); }
.match .meta .closing { color: var(--gold); }

.team { display: flex; align-items: center; gap: .5rem; min-width: 0; font-weight: 600; }
.team.right { justify-content: flex-end; text-align: right; }
.team img { width: 24px; height: 24px; object-fit: contain; flex-shrink: 0; }
.team .tname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team.won .tname { font-weight: 800; color: var(--ink); }
.team.lost { color: var(--grey); }
.team.lost img { filter: grayscale(1) opacity(.55); }

.score {
  font-family: 'Saira Condensed', sans-serif; font-weight: 800; font-size: 1.3rem;
  background: var(--ink); color: #f4f2e9; border-radius: 6px;
  min-width: 64px; text-align: center; padding: .15rem .5rem;
}
.score.empty { background: var(--paper); color: #c2c0b4; border: 1px dashed var(--line); }
.score .pens { display: block; font-size: .6rem; font-weight: 600; color: #8fa0bd; }

.pickrow {
  grid-column: 1 / -1; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap;
}
.pickrow button {
  flex: 1; min-width: 70px; padding: .42rem .3rem; font-size: .8rem; font-weight: 600;
  border: 1px solid var(--line); background: var(--paper); border-radius: 8px;
  cursor: pointer; font-family: inherit;
}
.pickrow button.mine { background: var(--pitch); color: #fff; border-color: var(--pitch); }
.pickrow button:disabled { cursor: default; opacity: .55; }
.pick-badges { grid-column: 1 / -1; display: flex; gap: .5rem; flex-wrap: wrap; font-size: .75rem; }
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 999px; padding: .15rem .6rem .15rem .3rem;
}
.badge.correct { border-color: var(--pitch); background: var(--pitch-soft); }
.badge.wrong { color: var(--grey); }
.badge.hidden-pick { font-style: italic; color: #8c8f98; }
.winner-face {
  font-size: 1.3rem; line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.2));
}
.push-tag { font-size: .7rem; font-weight: 700; color: #8c8f98; letter-spacing: .08em; }

.footnote {
  max-width: 720px; margin: 2rem auto 0; padding: 0 .8rem;
  font-size: .75rem; color: #8c8f98;
}

@media (max-width: 480px) {
  .board-title { font-size: 1.2rem; }
  .score { min-width: 52px; font-size: 1.1rem; }
}
