:root {
  --bg: #0E0E10;
  --panel: #17171A;
  --panel-2: #1F1F23;
  --line: #33302C;
  --line-2: #4A4744;
  --text: #F4F1EA;
  --muted: #A8A49E;
  --gazza: #F2A93B;
  --gazza-bg: #1C1608;
  --exit: #5B9BFF;
  --exit-bg: #0F1626;
  --cta: #12B45C;
  --draw: #8A8680;
  --display: 'Anton', Impact, 'Haettenschweiler', 'Arial Narrow Bold', 'sans-serif-condensed', sans-serif;
  --body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* Type: Anton is kept for the two names, the verdict and the swipe stamps only. Everything else is DM Sans. */
.h1, .h2 { font-family: var(--body); font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.h1 { font-size: 30px; line-height: 1.12; }
.h2 { font-size: 20px; line-height: 1.2; letter-spacing: -0.01em; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body {
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
img { display: block; -webkit-user-drag: none; user-select: none; }

#app { max-width: 480px; margin: 0 auto; }

.screen {
  min-height: 100dvh;
  padding: 24px 20px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.display { font-family: var(--display); font-weight: 400; letter-spacing: 0.02em; line-height: 1; margin: 0; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.14em; color: var(--muted); }
.small { font-size: 13px; color: var(--muted); text-align: center; }
.credit { font-size: 12px; color: var(--muted); text-align: center; text-decoration: none; align-self: center; padding: 10px 12px; margin: -10px -12px; }
.credit b { font-weight: 700; color: var(--text); text-decoration: underline; text-decoration-color: rgba(244,241,234,0.35); text-underline-offset: 3px; }
.c-gazza { color: var(--gazza); }
.c-exit { color: var(--exit); }

/* Buttons */
.btn {
  width: 100%; min-height: 56px; border-radius: 14px; border: 0;
  font-family: var(--body); font-size: 17px; font-weight: 700; letter-spacing: 0;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn.primary { background: var(--cta); color: #08240F; }
.btn.primary:disabled { background: #3A3A3F; color: #8E8A84; }
.btn.ghost { background: transparent; border: 1.5px solid var(--line-2); font-size: 15px; min-height: 50px; }
.bottom { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }

/* ---------- Cover (fight poster) ---------- */
.cover { min-height: 100dvh; display: flex; flex-direction: column; max-width: 480px; margin: 0 auto; }
.poster { position: relative; flex: 1 1 auto; min-height: 60vh; overflow: hidden; }
.side { position: absolute; top: 0; bottom: 0; overflow: hidden; }
.side.g { left: 0; width: 58%; clip-path: polygon(0 0, 96.6% 0, 75.9% 100%, 0 100%); }
.side.e { right: 0; width: 58%; clip-path: polygon(24.1% 0, 100% 0, 100% 100%, 3.4% 100%); }
.side img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) contrast(1.15) brightness(1.05);
  animation: drift 16s ease-in-out infinite alternate;
  color: transparent; font-size: 0;
}
.side.e img { animation-delay: -8s; }
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.08); } }
.tint { position: absolute; inset: 0; mix-blend-mode: multiply; pointer-events: none; }
.side.g .tint { background: var(--gazza); }
.side.e .tint { background: var(--exit); }
.side.emb { z-index: 1; pointer-events: none; }
.emblem {
  position: absolute; bottom: 16px; height: 44%; max-width: 80%; aspect-ratio: 160 / 220;
  /* fade the flat bottom edge into the background so there is no hard line */
  -webkit-mask-image: linear-gradient(to top, transparent 0, #000 30%);
  mask-image: linear-gradient(to top, transparent 0, #000 30%);
}
.side.g .emblem, .side.e .emblem { fill: #070708; stroke-width: 1px; }
.side.g .emblem { left: 3%; stroke: rgba(242,169,59,0.35); }
.side.e .emblem { right: 3%; stroke: rgba(91,155,255,0.35); }
.split { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.fade {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(14,14,16,0.75) 0%, rgba(14,14,16,0) 16%, rgba(14,14,16,0) 50%, rgba(14,14,16,0.7) 78%, #0E0E10 100%);
}
.cover-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  padding: 20px 20px 0; display: flex; justify-content: space-between; align-items: center;
}
.cover-top .eyebrow { color: var(--text); }
.live { display: inline-flex; align-items: center; gap: 6px; }
.live i { width: 8px; height: 8px; border-radius: 4px; background: #FF4D4D; animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

.fightcard {
  position: absolute; left: 0; right: 0; bottom: 18px; z-index: 2;
  padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.fname {
  font-family: var(--display); font-weight: 400; margin: 0;
  font-size: clamp(56px, 17vw, 80px); line-height: 0.9; letter-spacing: 0.01em;
  text-shadow: 0 4px 24px rgba(0,0,0,0.7);
}
.fname.g { color: var(--gazza); }
.fname.e { color: var(--exit); }
.medal {
  width: 52px; height: 52px; border-radius: 26px; flex-shrink: 0;
  background: var(--bg); border: 2px solid var(--text);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800;
  box-shadow: 0 0 0 5px rgba(14,14,16,0.55), 0 0 28px rgba(244,241,234,0.25);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: scale(1.07); } }

.cover-bottom {
  padding: 14px 24px calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: stretch;
}
.question { font-family: var(--body); font-weight: 800; font-size: 28px; line-height: 1.15; letter-spacing: -0.02em; text-align: center; margin: 0; }
.cover-bottom .btn { margin-top: 28px; }
.cover-bottom .credit { margin-top: 10px; }

/* ---------- Question screens ---------- */
.qhead { display: flex; flex-direction: column; gap: 12px; }
.qtop { display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
.back { width: 44px; height: 44px; margin-left: -12px; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; }
.progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.progress span { height: 4px; border-radius: 2px; background: #2A2A2E; }
.progress span.on { background: var(--text); }
.qtitle { font-family: var(--body); font-weight: 800; font-size: 32px; line-height: 1.12; letter-spacing: -0.02em; margin: 0; }
.qsub { margin: 0; font-size: 15px; line-height: 1.45; color: var(--muted); }

.teams { display: flex; flex-direction: column; gap: 12px; }
.team {
  min-height: 92px; padding: 18px 20px; border-radius: 18px; text-align: left;
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
  border: 1.5px solid var(--line-2); background: var(--panel);
}
.team .name { font-weight: 800; font-size: 24px; line-height: 1.1; letter-spacing: -0.01em; }
.team .sub { font-size: 14px; color: var(--muted); }
.team.gazza { border-color: var(--gazza); background: var(--gazza-bg); }
.team.gazza .name { color: var(--gazza); }
.team.exit { border-color: var(--exit); background: var(--exit-bg); }
.team.exit .name { color: var(--exit); }

fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
legend { padding: 0; margin-bottom: 14px; font-weight: 800; font-size: 20px; line-height: 1.2; letter-spacing: -0.01em; }
.chips { display: grid; gap: 8px; }
.chips.age { grid-template-columns: repeat(4, 1fr); }
.chips.region { grid-template-columns: repeat(3, 1fr); }
.chip {
  min-height: 44px; padding: 0 6px; border-radius: 12px; border: 1.5px solid var(--line-2);
  background: transparent; font-size: 13px; font-weight: 700; line-height: 1.15;
}
.chips.age .chip { border-radius: 22px; font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }

/* ---------- Stage (round header + disk), kept alive between screens ---------- */
.stage {
  max-width: 480px; margin: 0 auto;
  position: absolute; left: -10000px; top: 0; width: 390px; /* parked off-screen until rounds start */
}
/* In a round the screen is one column: header on top, disk in the middle, songs at the bottom. */
body.in-round { display: flex; flex-direction: column; min-height: 100dvh; }
body.in-round .stage { position: relative; left: auto; width: 100%; flex: 1 0 auto; display: flex; flex-direction: column; }
body.in-round #app { width: 100%; flex: 0 0 auto; }
.roundbar { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px 12px; }
.roundbar .rl { font-size: 15px; font-weight: 700; }
.score { font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 5px; display: inline-block; }
.dot.g { background: var(--gazza); }
.dot.e { background: var(--exit); }
.pips { display: grid; gap: 6px; padding: 0 24px; }
.pips span { height: 6px; border-radius: 3px; background: #2A2A2E; }
.pips span.cur { background: transparent; box-shadow: inset 0 0 0 1.5px var(--text); }
.pips span.g { background: var(--gazza); }
.pips span.e { background: var(--exit); }
.pips span.d { background: var(--draw); }

/* Disk. The label is fixed at 232px so the 200x200 player inside shows its whole picture. */
.deckzone {
  flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px; padding: 24px 24px 8px;
  --disk: clamp(276px, min(84vw, 42dvh), 340px);
}
.deck { position: relative; width: var(--disk); height: var(--disk); flex-shrink: 0; }
.ring {
  position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(circle closest-side, transparent 0 119px, #2A2A2F 119px 123px, transparent 123px),
    repeating-radial-gradient(circle, #121214 0 1.5px, #1B1B1F 1.5px 3px);
  border: 3px solid #2C2C31;
  box-shadow: 0 18px 50px rgba(0,0,0,0.6);
  animation: spin 3.2s linear infinite; animation-play-state: paused;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.ring.spin { animation-play-state: running; }
.ring.g { border-color: var(--gazza); box-shadow: 0 18px 50px rgba(0,0,0,0.6), 0 0 44px rgba(242,169,59,0.28); }
.ring.e { border-color: var(--exit); box-shadow: 0 18px 50px rgba(0,0,0,0.6), 0 0 44px rgba(91,155,255,0.28); }
@keyframes spin { to { transform: rotate(360deg); } }
.rim { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.rim text { font-family: var(--body); font-weight: 800; font-size: 3.3px; letter-spacing: 0.1px; fill: rgba(244,241,234,0.32); transition: fill 0.3s; }
.ring.g .rim text { fill: rgba(242,169,59,0.75); }
.ring.e .rim text { fill: rgba(91,155,255,0.8); }
/* still highlight on top of the spinning grooves, so it reads as vinyl */
.sheen {
  position: absolute; inset: 3px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 20deg, transparent 0 6%, rgba(255,255,255,0.07) 11%, transparent 17% 52%, rgba(255,255,255,0.05) 58%, transparent 64%);
}
.label {
  position: absolute; left: 50%; top: 50%; width: 236px; height: 236px; margin: -118px 0 0 -118px;
  border-radius: 50%; overflow: hidden; clip-path: circle(50%); background: #000;
}
/* coloured edge of the label: sits outside the video picture, which ends at a 115px radius */
.label::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; z-index: 3;
  box-shadow: inset 0 0 0 3px #2C2C31; transition: box-shadow 0.3s;
}
.ring.g ~ .label::after { box-shadow: inset 0 0 0 3px var(--gazza); }
.ring.e ~ .label::after { box-shadow: inset 0 0 0 3px var(--exit); }
.screenbox { position: absolute; left: 18px; top: 18px; width: 200px; height: 200px; background: #000; }
.pl { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.pl.on { opacity: 1; pointer-events: auto; }
.pl > div, .pl iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tap-play {
  position: absolute; inset: 0; z-index: 2; border: 0; border-radius: 50%;
  background: rgba(14,14,16,0.85);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
}
.tap-play .circle { width: 60px; height: 60px; border-radius: 30px; background: var(--cta); color: #08240F; display: flex; align-items: center; justify-content: center; }
.tap-play .lbl { font-size: 15px; font-weight: 700; }

.np { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.np-line { font-size: 16px; font-weight: 500; color: var(--muted); text-align: center; min-height: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.np-line b { font-weight: 800; }
.bar { width: 180px; height: 4px; border-radius: 2px; background: #2A2A2E; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--text); transition: width 0.15s linear; }
.bar.g i { background: var(--gazza); }
.bar.e i { background: var(--exit); }

/* ---------- Round: two tap-to-vote cards at the bottom ---------- */
.round { padding: 20px 24px calc(22px + env(safe-area-inset-bottom)); }
.picks {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  touch-action: pan-y; user-select: none; -webkit-user-select: none;
  transition: transform 0.26s ease, opacity 0.26s ease;
}
.picks.enter { transform: scale(0.96); opacity: 0; transition: none; }
.picks.fly-g { transform: translateX(-120%) rotate(-10deg); opacity: 0; }
.picks.fly-e { transform: translateX(120%) rotate(10deg); opacity: 0; }
.picks.fly-d { transform: translateY(-40px); opacity: 0; }
.pick {
  display: flex; flex-direction: column; gap: 8px; padding: 14px 12px 12px; text-align: left;
  border-radius: 18px; background: var(--panel); border: 2px solid #2E2E33;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s, transform 0.1s;
}
.pick:active { transform: scale(0.98); }
.ptop { display: flex; align-items: center; justify-content: space-between; min-height: 16px; padding: 0 2px; }
.pwho { font-size: 11px; font-weight: 800; letter-spacing: 0.14em; }
.pick.g .pwho { color: var(--gazza); }
.pick.e .pwho { color: var(--exit); }
/* little equalizer that shows on the song that is playing */
.ptag { display: none; align-items: flex-end; gap: 2px; height: 12px; }
.ptag i { width: 3px; height: 100%; border-radius: 1px; animation: eq 0.9s ease-in-out infinite; }
.ptag i:nth-child(2) { animation-delay: -0.3s; }
.ptag i:nth-child(3) { animation-delay: -0.6s; }
.pick.g .ptag i { background: var(--gazza); }
.pick.e .ptag i { background: var(--exit); }
@keyframes eq { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }
.ptag i { transform-origin: bottom; }
.pick.playing .ptag { display: flex; }
.pick.g.playing { border-color: var(--gazza); background: var(--gazza-bg); box-shadow: 0 10px 30px rgba(242,169,59,0.2); }
.pick.e.playing { border-color: var(--exit); background: var(--exit-bg); box-shadow: 0 10px 30px rgba(91,155,255,0.2); }
.picks.lean-g .pick.g { border-color: var(--gazza); }
.picks.lean-e .pick.e { border-color: var(--exit); }
.pt {
  font-size: 17px; font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; padding: 0 2px; min-height: 41px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pvote {
  margin-top: 4px; padding: 13px 6px; border-radius: 12px; text-align: center;
  font-size: 15px; font-weight: 800; color: var(--bg);
}
.pick.g .pvote { background: var(--gazza); }
.pick.e .pvote { background: var(--exit); }

.vs {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 38px; height: 38px; border-radius: 19px; border: 2px solid var(--text); background: var(--bg);
  font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; z-index: 2; pointer-events: none;
}
.stamp {
  position: absolute; top: 28%; z-index: 3; padding: 2px 12px; border-radius: 8px; border: 3px solid;
  font-family: var(--display); font-size: 30px; letter-spacing: 0.06em; opacity: 0; pointer-events: none; background: rgba(14,14,16,0.7);
}
.stamp.g { left: 10px; color: var(--gazza); border-color: var(--gazza); transform: rotate(-10deg); }
.stamp.e { right: 10px; color: var(--exit); border-color: var(--exit); transform: rotate(10deg); }
.stamp.d { left: 50%; color: var(--text); border-color: var(--text); transform: translateX(-50%); }

.drawbtn {
  display: block; margin: 18px auto 0; min-height: 42px; padding: 0 18px; border-radius: 21px;
  border: 1.5px solid var(--line-2); background: transparent; color: var(--muted); font-size: 14px; font-weight: 700;
}

@media (max-height: 680px) {
  .roundbar { padding-top: 12px; padding-bottom: 10px; }
  .deckzone { gap: 14px; padding: 12px 24px 0; }
  .round { padding-top: 12px; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .pick { padding-top: 12px; gap: 6px; }
  .drawbtn { margin-top: 10px; }
}

/* ---------- Result ---------- */
.result { min-height: 100dvh; display: flex; flex-direction: column; }
.rcard-wrap { background: #16161A; }
.result.win-g .rcard-wrap { background: var(--gazza); }
.result.win-e .rcard-wrap { background: var(--exit); }
.rcard { width: 100%; aspect-ratio: 4 / 5; display: block; object-fit: cover; color: transparent; font-size: 0; }
.rbody {
  padding: 28px 20px calc(28px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: stretch; gap: 12px; text-align: center;
}
.rounds { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 16px; }
.list { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.row { display: grid; grid-template-columns: 1fr 44px 1fr; align-items: center; gap: 6px; font-size: 14px; line-height: 1.3; color: var(--muted); }
.row .l { text-align: right; }
.row .r { text-align: left; }
.row .win { font-weight: 800; }
.row .l.win { color: var(--gazza); }
.row .r.win { color: var(--exit); }
.row .m { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; color: #6E6A64; text-align: center; }
.rbody .credit { margin-top: 0; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 700; z-index: 50;
}

@media (prefers-reduced-motion: reduce) {
  .side img, .medal, .live i, .ring, .ptag i { animation: none; }
  .picks, .bar i { transition: none; }
}
