:root {
  --bg: #060b16;
  --panel: #0e1728;
  --panel-2: #16223a;
  --line: #243354;
  --line-soft: #1a2740;
  --text: #e9effa;
  --muted: #7f92b6;
  --accent: #e01b24;
  --accent-ink: #fff5f5;
  --accent-dim: #5a1418;
  --live: #ffb43a;
  --good: #35c77c;
  --radius: 10px;
  --nav-h: 62px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Barlow, system-ui, -apple-system, sans-serif;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body { overscroll-behavior-y: none; }

h1, h2, h3, .cond {
  font-family: 'Barlow Condensed', 'Barlow', sans-serif;
  letter-spacing: 0.02em;
  margin: 0;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }

.app {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 14px calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px);
}

/* ---------------------------------------------------------------- topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 12px;
  background: linear-gradient(var(--bg) 78%, transparent);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.brand em {
  font-style: normal;
  color: var(--accent);
}
.brand .mark { flex: 0 0 auto; display: block; }
.brand .season {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
}
.login-card .brand { justify-content: center; margin-bottom: 6px; }

.whoami {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* the yard-line rule: the one repeating structural motif */
.yardline {
  height: 7px;
  border-top: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(224, 27, 36, 0.35);
  background-image: repeating-linear-gradient(
    to right,
    var(--line) 0 1px,
    transparent 1px 22px
  );
  margin-bottom: 18px;
}

/* ------------------------------------------------------------------ nav */
.nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  background: rgba(10, 14, 19, 0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}

.nav button {
  flex: 1;
  background: none;
  border: 0;
  border-top: 2px solid transparent;
  padding: 11px 4px 12px;
  color: var(--muted);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  min-height: 56px;
}
.nav button[aria-current='true'] {
  color: var(--accent);
  border-top-color: var(--accent);
  background: linear-gradient(rgba(224, 27, 36, 0.09), transparent 70%);
}

/* --------------------------------------------------------------- pieces */
.card {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 22px 0 10px;
}
.section-head h2 {
  font-size: 19px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.eyebrow {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.stack > * + * { margin-top: 10px; }

.chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 0 10px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  min-height: 40px;
}
.chip[aria-pressed='true'] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.chip .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: 6px;
  vertical-align: middle;
}
.chip[aria-pressed='true'] .dot { background: var(--accent-ink); }

.btn {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 16px;
  font-weight: 600;
  min-height: 44px;
}
.btn:hover { border-color: #33414f; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn-danger { color: var(--accent); }
.btn-sm { padding: 7px 11px; min-height: 36px; font-size: 14px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

input[type='text'], input[type='password'], input[type='number'],
input[type='datetime-local'], select {
  width: 100%;
  background: #0d131a;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  min-height: 44px;
}
input:focus-visible, select:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
label.field { display: block; margin-bottom: 12px; }
label.field span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 5px;
}

.row { display: flex; gap: 10px; align-items: center; }
.row-wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* ------------------------------------------------------------- matchups */
.game {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel);
  margin-bottom: 12px;
  overflow: hidden;
}
.game-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line-soft);
}
.badge-live {
  color: var(--live);
  font-weight: 700;
}
.badge-live::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live);
  margin-right: 6px;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.25; } }

/* the signature: two tappable halves split by a hash-mark seam */
.matchup { display: flex; align-items: stretch; }
.side {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 14px 12px;
  text-align: left;
  min-height: 66px;
}
.side.home { flex-direction: row-reverse; text-align: right; }
.side img { width: 30px; height: 30px; object-fit: contain; flex: 0 0 auto; }
.side .abbr {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
}
.side .team-name { font-size: 12px; color: var(--muted); line-height: 1.2; }
.side .score {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}
.side.home .score { margin-left: 0; margin-right: auto; }

.side[data-picked='true'] {
  background: linear-gradient(rgba(224, 27, 36, 0.14), rgba(224, 27, 36, 0.05));
  border-bottom-color: var(--accent);
}
.side[data-picked='true'] .abbr { color: var(--accent); }
.side[data-loser='true'] { opacity: 0.42; }
.side:disabled { cursor: default; }

.seam {
  flex: 0 0 1px;
  background-image: repeating-linear-gradient(
    to bottom,
    var(--line) 0 6px,
    transparent 6px 13px
  );
}

.game-foot {
  padding: 8px 12px 10px;
  border-top: 1px solid var(--line-soft);
  font-size: 12.5px;
  color: var(--muted);
}
.game-foot .hit { color: var(--good); font-weight: 600; }
.pill {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  margin: 3px 4px 0 0;
  font-size: 12px;
}
.pill b { color: var(--text); font-weight: 600; }

/* ------------------------------------------------------------ divisions */
.divgrid { display: grid; gap: 12px; }
@media (min-width: 620px) { .divgrid { grid-template-columns: 1fr 1fr; } }

.divcard { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); }
.divcard h3 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--accent);
}
.slot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--line-soft);
}
.slot:last-child { border-bottom: 0; }
.slot .pos {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--muted);
  width: 18px;
  font-variant-numeric: tabular-nums;
}
.slot img { width: 24px; height: 24px; object-fit: contain; }
.slot .nm { flex: 1; font-size: 15px; }
.slot .arrows { display: flex; gap: 5px; }
.slot .arrows button {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  line-height: 1;
}
.slot[data-correct='true'] { background: rgba(85, 201, 141, 0.09); }
.slot[data-correct='true'] .pos { color: var(--good); }
.slot .actual { font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------------ table */
table.board { width: 100%; border-collapse: collapse; }
.board th, .board td {
  padding: 11px 6px;
  border-bottom: 1px solid var(--line-soft);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.board th {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 600;
}
.board th:nth-child(-n + 2), .board td:nth-child(-n + 2) { text-align: left; }
.board td.rank {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--muted);
  width: 30px;
}
.board tr.me td { background: rgba(224, 27, 36, 0.07); }
.board td.total {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}

/* ------------------------------------------------------------------ misc */
.notice {
  border-left: 3px solid var(--accent);
  background: rgba(224, 27, 36, 0.07);
  padding: 11px 13px;
  border-radius: 0 8px 8px 0;
  font-size: 14px;
  margin-bottom: 14px;
}
.notice.lock { border-left-color: var(--muted); background: var(--panel-2); }
.error { color: var(--accent); font-size: 14px; margin: 8px 0 0; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 18px);
  transform: translate(-50%, 16px);
  z-index: 60;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
  max-width: min(92vw, 460px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { border-color: var(--accent); color: #ff8d94; }

.login-wrap {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card { width: 100%; max-width: 360px; }
.login-card .brand { font-size: 28px; margin-bottom: 4px; }

.sub-tabs { display: flex; gap: 7px; margin-bottom: 14px; }

details.more summary {
  cursor: pointer;
  color: var(--muted);
  font-family: 'Barlow Condensed', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 13px;
  padding: 10px 0;
}

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
.key {
  background: #0d131a;
  border: 1px dashed var(--accent);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 8px;
  word-break: break-all;
}

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

/* ---------------------------------------------------------- live-streifen */
.livebar {
  border: 1px solid var(--line);
  border-left: 3px solid var(--live);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--panel);
  padding: 11px 13px;
  margin-bottom: 14px;
}
.livebar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-family: 'Barlow Condensed', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 13px;
}
.livebar-games { display: grid; gap: 7px; }
.livegame {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}
.livegame .cond {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 17px;
  font-weight: 600;
}
.livegame .cond b { color: var(--live); font-size: 19px; }
.livegame .small { margin-left: auto; text-align: right; }

/* --------------------------------------------------------------- medaillen */
.medals {
  display: inline-flex;
  gap: 3px;
  margin-left: 6px;
  vertical-align: baseline;
}
.medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: #2a1d05;
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.35);
}
.medal.gold   { background: linear-gradient(160deg, #ffdf7a, #c8971d); }
.medal.silver { background: linear-gradient(160deg, #eef2f7, #9aa7b6); }
.medal.bronze { background: linear-gradient(160deg, #e5a878, #97572a); }

.honours { padding: 0; overflow: hidden; }
.honours-year {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.honours-list { padding: 4px 0; }
.honour {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
}
.honour .medal { width: 18px; height: 18px; flex: 0 0 auto; }

/* ------------------------------------------------ wer hat auf wen getippt */
.tally { margin-top: 9px; }

.tally-bar {
  display: flex;
  height: 20px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--line-soft);
}
.tally-bar .seg {
  display: flex;
  align-items: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 26px;
  transition: width 0.3s ease;
}
.tally-bar .seg.away {
  justify-content: flex-start;
  padding-left: 8px;
  background: #2f4a6d;
  color: #cfe0f5;
}
.tally-bar .seg.home {
  justify-content: flex-end;
  padding-right: 8px;
  background: var(--accent-dim);
  color: #ffc9cc;
}

.tally-avs {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}
.avs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.avs.right { justify-content: flex-end; }

.av {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--muted);
  cursor: default;
}
.av.me {
  border-color: var(--accent);
  color: var(--text);
}
.av.hit {
  border-color: var(--good);
  color: var(--good);
  box-shadow: 0 0 0 1px rgba(53, 199, 124, 0.35);
}
.av.miss { opacity: 0.4; }

.tally-empty {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
}
