:root {
  --ground: #0B0B0D;
  --panel: #15161A;
  --panel-2: #1D1E24;
  --line: #26272D;
  --ink: #F4F2EC;
  --ink-dim: #9A9BA3;
  --ink-faint: #5C5D66;
  --accent: #F5D90A;
  --accent-ink: #15130A;
  --display: 'Anton', 'Arial Narrow', Impact, sans-serif;
  --cond: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Barlow', 'Helvetica Neue', Arial, sans-serif;
  --radius: 24px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
a { color: var(--ink); }

#app {
  height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
@media (min-width: 560px) {
  #app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}

/* ---------- shared bits ---------- */
.eyebrow {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.eyebrow strong { color: var(--ink); font-weight: 700; }
.btn {
  font-family: var(--cond);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 15px;
  background: var(--ink);
  color: var(--ground);
  border-radius: 999px;
  padding: 16px 28px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }

/* ---------- status / empty ---------- */
.status {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 36px;
}
.status-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.wordmark {
  font-family: var(--display);
  font-weight: 400;
  font-size: 56px;
  line-height: .95;
  margin: 0;
  text-transform: uppercase;
  text-wrap: balance;
}
.status-msg { color: var(--ink-dim); margin: 0; font-size: 17px; line-height: 1.45; max-width: 28ch; }
.status .btn { margin-top: 10px; }

/* ---------- pick screen ---------- */
.pick {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.topbar {
  padding: calc(var(--sat) + 16px) 22px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.meta { display: flex; justify-content: space-between; align-items: baseline; }
.prog { display: grid; gap: 3px; }
.prog i { height: 4px; background: var(--line); border-radius: 2px; display: block; }
.prog i.done { background: var(--accent); }
.prog i.now { background: var(--ink); }

.arena {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin: auto 12px;
  max-height: 115vw;   /* keeps each panel near 1:2.4 so landscape photos are not reduced to a sliver */
  width: calc(100% - 24px);
  position: relative;
}
.pick { justify-content: space-between; }
.side {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  display: block;
  width: 100%;
  height: 100%;
  text-align: left;
  transition: transform .18s ease, filter .35s ease, opacity .35s ease;
}
.side:active { transform: scale(.985); }
.side img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.side::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,.78) 100%);
  pointer-events: none;
}
/* Away team on the left, home on the right; names centered at the foot of each panel. */
.side .name {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 16px;
  z-index: 2;
  text-align: center;
  font-family: var(--display);
  font-size: clamp(22px, 8.2vw, 40px);
  line-height: .92;
  text-transform: uppercase;
  letter-spacing: .005em;
  text-shadow: 0 2px 18px rgba(0,0,0,.6);
  overflow-wrap: anywhere;
}
.side .check {
  position: absolute;
  left: 50%;
  top: 16px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateX(-50%) scale(.6);
  transition: opacity .18s ease, transform .22s cubic-bezier(.2,1.4,.4,1);
}
.side.picked { outline: 4px solid var(--accent); outline-offset: -4px; }
.side.picked .check { opacity: 1; transform: translateX(-50%) scale(1); }
.side.lost { filter: grayscale(1) brightness(.45); }
.vs {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--ground);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: .04em;
  pointer-events: none;
}
.kick {
  padding: 14px 22px calc(var(--sab) + 22px);
  text-align: center;
}

/* slide transitions */
.arena.leave { animation: leave .28s ease forwards; }
.arena.enter { animation: enter .32s cubic-bezier(.2,.8,.2,1) both; }
@keyframes leave { to { transform: translateX(-28px); opacity: 0; } }
@keyframes enter { from { transform: translateX(48px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .arena.leave, .arena.enter { animation: none; }
  .side, .side .check { transition: none; }
}

/* ---------- slate ---------- */
.slate {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.rhead {
  padding: calc(var(--sat) + 22px) 22px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rhead h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 40px;
  margin: 0;
  line-height: 1;
  text-transform: uppercase;
}
.list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 14px;
  -webkit-overflow-scrolling: touch;
}
.game {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
  align-items: center;
  padding: 11px 8px;
  border-top: 1px solid var(--line);
  width: 100%;
  text-align: left;
  border-radius: 12px;
}
.game:first-child { border-top: 0; }
.game:active { background: var(--panel); }
.when {
  font-family: var(--cond);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1.15;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}
.when b { display: block; color: var(--ink); font-size: 15px; white-space: nowrap; }
.when.live b { color: var(--accent); }
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; min-width: 0; }
.tm { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tm img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  border: 2px solid transparent;
  background: var(--panel);
}
.tm .n {
  font-family: var(--cond);
  font-weight: 700;
  font-size: clamp(13px, 4vw, 16px);
  text-transform: uppercase;
  letter-spacing: .02em;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tm .o {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  margin-top: 3px;
}
.tm > div { min-width: 0; }
.tm.win img { border-color: var(--accent); }
.tm.win .o { color: var(--accent); }
.tm.out { opacity: .42; }
.tm.out img { filter: grayscale(1); }
.tm.none .o { color: var(--ink-faint); }

.parlay {
  margin: 8px 14px calc(var(--sab) + 14px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px 20px 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  align-items: end;
  flex: none;
}
.parlay .lbl {
  grid-column: 1 / -1;
  font-family: var(--cond);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--ink-dim);
}
.parlay .big {
  font-family: var(--display);
  font-size: 52px;
  line-height: .95;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.parlay .pay {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  text-align: right;
  line-height: 1.2;
}
.parlay .pay small {
  display: block;
  color: var(--ink-dim);
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-top: 2px;
}
.parlay .src {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: .04em;
}
.parlay .src button {
  color: var(--ink);
  font-family: var(--cond);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 13px;
  border-bottom: 1px solid var(--ink-faint);
  padding: 8px 0 1px;
  white-space: nowrap;
}
.parlay .note {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--ink-dim);
  margin-top: 4px;
}
