:root {
  color-scheme: dark;
  --pink: #ff4fa3;
  --cyan: #35d6f0;
  --yellow: #ffd23f;
  --purple: #7b4cff;
  --lime: #6ee787;
  --ink: #2a1552;
  --fom: #1f587f;
  --muted: #ffffffab;
  --face: #ffffff1a;
  --edge: #ffffff2b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  padding: 1.5rem 1rem 3rem;
  font: 16px/1.5 "Baloo 2", system-ui, sans-serif;
  color: #fff;
  background:
    radial-gradient(1200px 600px at 15% -10%, #ff8ac4 0%, transparent 55%),
    radial-gradient(1000px 700px at 90% 0%, #59e3ff 0%, transparent 50%),
    radial-gradient(900px 900px at 50% 110%, #ffe27a 0%, transparent 55%),
    linear-gradient(160deg, #6a3df0, #2a1e6e 70%);
  background-attachment: fixed;
  position: relative;
  overflow-x: hidden;
}

/*
 * The Hex-A-Gone floor. Inset so the drift never uncovers an edge, and masked away down the page
 * so the standings are read against flat gradient rather than through a grid.
 */
body::before {
  content: "";
  position: fixed;
  inset: -10%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.22;
  background-repeat: repeat;
  background-size: 120px 104px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='104' viewBox='0 0 120 104'><g fill='none' stroke='%23ffffff' stroke-width='3'><path d='M30 2 L60 19 L60 53 L30 70 L0 53 L0 19 Z'/><path d='M90 2 L120 19 L120 53 L90 70 L60 53 L60 19 Z'/><path d='M60 53 L90 70 L90 104 L60 121 L30 104 L30 70 Z'/></g></svg>");
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 20%, transparent 78%);
  animation: drift 90s linear infinite;
}

@keyframes drift {
  to { background-position: 120px 104px; }
}

.wrap { max-width: 64rem; margin: 0 auto; position: relative; z-index: 1; }

/* header and navigation */

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.fom {
  font: 400 22px/1 "Bebas Neue", sans-serif;
  letter-spacing: 0.12em;
  background: var(--fom);
  padding: 0.3rem 0.6rem 0.15rem;
  border-radius: 8px;
  border: 3px solid #ffffff33;
}

h1 {
  font-family: "Titan One", cursive;
  font-size: clamp(26px, 4.6vw, 48px);
  margin: 0.5rem 0 0;
  color: var(--yellow);
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 6px 0 var(--ink), 0 10px 18px #0006;
}

.topbar .live {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #0006;
  border: 2px solid #ffffff33;
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font: 600 13px/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 0 var(--lime);
  animation: pulse 2s infinite;
}

.topbar .live.stale { color: #ffb4b4; }
.topbar .live.stale .dot { background: #ff6b6b; box-shadow: none; animation: none; }

@keyframes pulse {
  70% { box-shadow: 0 0 0 8px #6ee78700; }
  100% { box-shadow: 0 0 0 0 #6ee78700; }
}

nav { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 1.1rem 0 1.5rem; }

nav a,
nav [aria-current] {
  color: #ffffffc4;
  font-weight: 800;
  font-size: 15px;
  background: #ffffff17;
  border: 3px solid var(--edge);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  text-decoration: none;
  transition: transform 0.12s, background 0.15s, color 0.15s;
}

nav a:hover { background: #ffffff2e; color: #fff; transform: translateY(-2px); }

nav [aria-current] {
  background: var(--yellow);
  color: var(--ink);
  border-color: var(--ink);
  box-shadow: 0 4px 0 var(--ink);
}

.alert {
  margin: 1rem 0 0;
  padding: 0.7rem 1rem;
  background: linear-gradient(160deg, var(--yellow), #ffb03f);
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: 0 5px 0 var(--ink);
}

.alert[hidden] { display: none; }

.alert p {
  margin: 0;
  color: var(--ink);
  font: 700 clamp(17px, 2.4vw, 22px)/1.25 "Baloo 2", system-ui, sans-serif;
  text-align: center;
}

.masthead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.lobby {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(160deg, var(--pink), var(--purple));
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: 0 5px 0 var(--ink);
  padding: 0.35rem 1.1rem 0.45rem;
}

.lobby[hidden] { display: none; }

/* Hangs off the corner rather than sitting inside it: the code stays the widest thing on the badge. */
.how {
  position: absolute;
  top: -0.7rem;
  right: -0.7rem;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: var(--yellow);
  color: var(--ink);
  font: 800 15px/1 "Baloo 2", system-ui, sans-serif;
  cursor: pointer;
}

.how:hover, .how:focus-visible { background: #fff; }

.join {
  width: min(28rem, calc(100vw - 2rem));
  margin: auto;
  padding: 1.2rem 1.4rem 1.4rem;
  border: 3px solid var(--edge);
  border-radius: 20px;
  background: linear-gradient(160deg, #4a34a8, #2a1e6e 70%);
  color: #fff;
  font: 16px/1.5 "Baloo 2", system-ui, sans-serif;
}

.join::backdrop { background: #150c37cc; backdrop-filter: blur(3px); }

.join h2 { margin: 0 0 0.6rem; }

.join ol { margin: 0; padding-left: 1.2rem; }

.join li { margin: 0.35rem 0; }

.join li b { color: var(--cyan); }

.join li b.code {
  font: 400 26px/1 "Bebas Neue", sans-serif;
  letter-spacing: 0.12em;
  color: var(--yellow);
}

.join button {
  margin-top: 1.1rem;
  width: 100%;
  padding: 0.5rem;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink);
  font: 800 16px "Baloo 2", system-ui, sans-serif;
  cursor: pointer;
}

.join button:hover { background: #fff; }

.lobby small {
  font: 600 13px/1.2 "Barlow Condensed", sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ffffffd6;
}

.lobby b {
  font: 400 34px/1 "Bebas Neue", sans-serif;
  letter-spacing: 0.12em;
  color: var(--yellow);
}

/* shared blocks */

h2 {
  font: 400 24px/1 "Bebas Neue", sans-serif;
  letter-spacing: 0.12em;
  margin: 2rem 0 0.85rem;
  color: #ffffffcc;
}

.lead { color: var(--muted); margin: -0.4rem 0 1.4rem; max-width: 46rem; }

.empty { color: var(--muted); }

.panel {
  background: linear-gradient(#ffffff1f, #ffffff0a);
  border: 3px solid var(--edge);
  border-radius: 22px;
  padding: 1.1rem 1.25rem;
  backdrop-filter: blur(6px);
}

.tag {
  display: inline-block;
  border-radius: 999px;
  padding: 0.12rem 0.65rem;
  font-size: 13px;
  font-weight: 800;
  border: 2px solid #ffffff55;
  background: #ffffff26;
}

.tag.opening, .tag.race { background: var(--cyan); color: var(--ink); }
.tag.middle, .tag.final { background: var(--yellow); color: var(--ink); }
.tag.advanced, .tag.hunt { background: var(--pink); }
.tag.hardest, .tag.survival { background: var(--purple); }
.tag.logic, .tag.team { background: var(--lime); color: var(--ink); }
.tag.unknown { background: #ffffff1f; color: var(--muted); }

.lbl {
  font: 600 12px/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #ffffffaa;
  margin-bottom: 0.3rem;
}

.lbl.spaced { margin-top: 0.5rem; }

.val { font-size: 21px; font-weight: 800; line-height: 1.15; }

.val .by { color: var(--lime); }

/* countdown */

.countdown { margin-bottom: 2rem; text-align: center; }

.countdown .clock { display: flex; gap: 0.75rem; justify-content: center; margin: 0.2rem 0 0.7rem; }

.countdown .u {
  display: grid;
  gap: 0.15rem;
  min-width: 5.2rem;
  padding: 0.5rem 0.7rem;
  border-radius: 16px;
  border: 3px solid var(--ink);
  background: var(--face);
}

.countdown .u b {
  font: 400 44px/1 "Bebas Neue", sans-serif;
  color: var(--yellow);
  font-variant-numeric: tabular-nums;
}

.countdown .u small {
  font: 600 11px/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #ffffffaa;
}

.countdown .when { font-size: 20px; font-weight: 800; }

.countdown .ask { margin: 0.5rem 0 0; color: var(--muted); }
.countdown .ask a { color: var(--cyan); font-weight: 800; }
.countdown .ask b { color: var(--yellow); }

@media (max-width: 560px) {
  .countdown .clock { gap: 0.4rem; }
  .countdown .u { min-width: 0; flex: 1; padding: 0.4rem 0.3rem; }
  .countdown .u b { font-size: 32px; }
}

/* status ribbon */

.status { margin-bottom: 2rem; display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; }

.status .mid { text-align: center; }
.status .right { text-align: right; }

.pips { display: flex; gap: 5px; justify-content: center; margin-top: 0.55rem; }
.pip { width: 22px; height: 8px; border-radius: 4px; background: #ffffff2e; }
.pip.done { background: var(--cyan); }
.pip.now { background: var(--yellow); box-shadow: 0 0 12px var(--yellow); }

/* tabs */

.tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* Kept in the page rather than removed from it: the label is a tab stop only while its radio is. */
.tabs > input { position: absolute; width: 0; height: 0; opacity: 0; }

.tabs > label {
  order: 0;
  cursor: pointer;
  padding: 0.35rem 1.1rem;
  border-radius: 999px;
  border: 3px solid var(--edge);
  background: var(--face);
  font: 700 15px/1.6 "Baloo 2", system-ui, sans-serif;
}

.tabs > label:hover { border-color: var(--cyan); }

.tabs > label:has(+ input:checked) {
  background: var(--yellow);
  color: var(--ink);
  border-color: var(--ink);
  box-shadow: 0 4px 0 var(--ink);
}

.tabs > label:has(+ input:focus-visible) { outline: 3px solid var(--cyan); outline-offset: 3px; }

.tabs > .tabpanel { order: 1; flex: 1 0 100%; display: none; }
.tabs > input:checked + .tabpanel { display: block; }

/* prize podium */

.podium.prizes { align-items: end; margin-top: 2rem; }

.prize .figure img {
  display: block;
  width: 100%;
  max-width: 190px;
  height: 150px;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px #0007);
}

.p1.prize .figure img { max-width: 230px; height: 190px; }

.prize .nm { margin-top: 0.5rem; }
.prize .block .pts { font-size: 24px; padding: 0.15rem 0.5rem; }

/* podium */

.podium { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 0.75rem; align-items: end; margin: 3rem 0 2.25rem; }

.p { text-align: center; position: relative; }

.p .figure { position: relative; z-index: 2; display: grid; place-items: end center; margin-bottom: -0.4rem; animation: bob 2.6s ease-in-out infinite; }
.p2 .figure { animation-delay: 0.35s; }
.p3 .figure { animation-delay: 0.7s; }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.bean { display: block; width: 84px; height: 105px; }
.p1 .bean { width: 108px; height: 135px; }
.bean .body, .bean .limb { fill: currentColor; stroke: var(--ink); stroke-width: 7; stroke-linejoin: round; }
.bean .eye { fill: #fff; stroke: var(--ink); stroke-width: 5; }
.bean .pupil { fill: var(--ink); }
.bean .shine { fill: #ffffff4d; }

.crown {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 54px;
  height: 40px;
  z-index: 2;
}

.crown path { fill: var(--yellow); stroke: var(--ink); stroke-width: 5; stroke-linejoin: round; }
.crown .jewel { fill: var(--pink); }

/*
 * Clipped to the winner's column so glitter never drifts over the standings below, and stacked
 * between the block and the bean: it passes in front of the podium but behind the champion.
 */
.confetti {
  position: absolute;
  inset: -2.5rem 0 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  --drop: 420px;
}

.confetti i {
  position: absolute;
  top: 0;
  left: var(--x);
  width: var(--w);
  height: var(--w);
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 6px var(--c);
  animation:
    drop var(--d) linear var(--delay) infinite,
    twinkle var(--f) ease-in-out var(--delay) infinite alternate;
}

/* Drifts one way then the other on the way down, so the fall never reads as a straight line. */
@keyframes drop {
  0% { transform: translate(0, -2rem); }
  33% { transform: translate(var(--sway), calc(var(--drop) * 0.33)); }
  66% { transform: translate(calc(var(--sway) * -1), calc(var(--drop) * 0.66)); }
  100% { transform: translate(0, var(--drop)); }
}

@keyframes twinkle {
  from { opacity: 0.15; filter: brightness(0.7); }
  to { opacity: 1; filter: brightness(1.6); }
}

.p .nm { display: block; width: 100%; font-size: 19px; font-weight: 800; line-height: 1.1; }

button.nm {
  font-family: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0.1rem 0.3rem;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

button.nm:hover, button.nm:focus-visible { color: var(--yellow); background: #ffffff1f; }
/* Reserves its line so a player with no FOM name does not sit a row shorter than the rest. */
.p .ig { font-size: 13px; opacity: 0.7; font-weight: 600; min-height: 1.3em; }

.p .block {
  display: grid;
  place-items: center;
  position: relative;
  /* Room for the points pill overhanging the top edge and the tally pinned to the bottom. */
  padding: 1.4rem 0.4rem 1.6rem;
  margin-top: 0.9rem;
  border-radius: 14px 14px 6px 6px;
  border: 4px solid var(--ink);
  box-shadow: 0 9px 0 var(--ink), 0 18px 26px #0006;
}

.p1 .block { background: linear-gradient(#fff0b0, var(--yellow)); height: 158px; }
.p2 .block { background: linear-gradient(#f2f7ff, #b9c8dd); height: 128px; }
.p3 .block { background: linear-gradient(#ffc389, #d98442); height: 108px; }

.p .sub {
  position: absolute;
  bottom: 0.55rem;
  left: 0.4rem;
  right: 0.4rem;
  font: 600 12px/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.65;
}

.p .rk {
  font-family: "Titan One", cursive;
  font-size: 40px;
  line-height: 1;
  color: var(--ink);
  text-shadow: 0 3px 0 #ffffff8c;
}

.p .pts {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: "Titan One", cursive;
  font-size: 28px;
  line-height: 1;
  color: var(--ink);
  background: #fff;
  border: 4px solid var(--ink);
  border-radius: 999px;
  padding: 0.1rem 0.7rem;
}


/* field grid */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.65rem; }

.card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--face);
  border: 3px solid var(--edge);
  border-radius: 16px;
  padding: 0.55rem 0.75rem;
}

.card .n { width: 26px; font-family: "Titan One", cursive; font-size: 15px; color: #ffffff8c; }
.card .who { flex: 1; min-width: 0; }
.card .who b { display: block; font-size: 16px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .who small { display: block; color: #ffffff8c; font-size: 12px; min-height: 1.3em; }
.card .v { font-family: "Titan One", cursive; font-size: 22px; color: var(--yellow); }

.card.up, .row.up { border-color: var(--lime); box-shadow: 0 0 0 3px #6ee78733; }

/* standings */

.rows { display: flex; flex-direction: column; gap: 0.5rem; }

.row {
  display: grid;
  grid-template-columns: 3rem 1fr auto auto 2rem;
  gap: 0.75rem;
  align-items: center;
  background: var(--face);
  border: 3px solid var(--edge);
  border-radius: 18px;
  padding: 0.6rem 0.9rem;
}

.row .rk { font-family: "Titan One", cursive; font-size: 20px; color: #ffffff85; text-align: center; }
.row .who b { display: block; font-size: 17px; font-weight: 800; }
.row .who small { display: block; color: #ffffff8c; font-size: 12.5px; min-height: 1.3em; }
.row .stats { display: flex; gap: 0.4rem; }

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 3rem;
  background: #00000026;
  border-radius: 10px;
  padding: 0.2rem 0.4rem;
}

.stat b { font-size: 16px; font-weight: 800; line-height: 1.1; }

.stat span {
  font: 600 10px/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ffffff85;
}

.row .pts { font-family: "Titan One", cursive; font-size: 26px; color: var(--yellow); min-width: 2.6rem; text-align: right; }
.row .pen { color: #ff9d9d; font-weight: 700; }
.row .crown-rank { color: var(--yellow); font-weight: 700; white-space: nowrap; }

.row.r1 { border-color: var(--yellow); background: linear-gradient(90deg, #ffd23f2e, var(--face)); }
.row.r2 { border-color: var(--cyan); }
.row.r3 { border-color: var(--pink); }
.row.r1 .rk, .row.r2 .rk, .row.r3 .rk { color: #fff; }
.row.pending { opacity: 0.55; border-style: dashed; }

button.row { width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.row:hover, button.row:focus-visible { border-color: #fff; }
button.row:hover .look, button.row:focus-visible .look { border-color: var(--yellow); background: #ffd23f3d; }

/* results */

.show { margin-bottom: 1.1rem; }
.show > .panel > header { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 0.85rem; }

.show .num {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  background: var(--ink);
  border: 3px solid #ffffff33;
  display: grid;
  place-items: center;
  font-family: "Titan One", cursive;
  font-size: 17px;
}

.show h3 { margin: 0; font: 400 26px/1 "Bebas Neue", sans-serif; letter-spacing: 0.06em; }

.show .champ {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--yellow);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 0.25rem 0.85rem;
  font-weight: 800;
}

.show .champ.playing { background: var(--lime); }

button.win {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

/* The pill carries the border, so hovering the name inside it lights the whole badge. */
.show .champ:has(button.win:hover), .show .champ:has(button.win:focus-visible) {
  border-color: #fff;
}

.show.live > .panel { border-color: var(--lime); box-shadow: 0 0 0 4px #6ee78726; }

.rounds { display: flex; flex-direction: column; gap: 0.4rem; }

.rnd {
  display: grid;
  grid-template-columns: 1.7rem auto auto 1fr 5.5rem;
  gap: 0.7rem;
  align-items: center;
  background: #00000026;
  border-radius: 12px;
  padding: 0.4rem 0.7rem;
  font-size: 15px;
}

.rnd .i { color: #ffffff70; font-weight: 800; font-size: 13px; }
.rnd .map { font-weight: 700; font-size: 20px; display: inline-flex; align-items: center; gap: 0.45rem; }
.rnd .map .mapicon { width: 36px; height: 32px; object-fit: contain; flex: none; }
.rnd .map .sangu { color: #ffffff59; line-height: 0; transition: color 0.15s; }
.rnd .map .sangu:hover { color: var(--cyan); }
.rnd .winner { color: var(--lime); font-weight: 800; }
.rnd .winner.none { color: #ffffff5c; font-weight: 600; }
.rnd .winner.missing { color: #ffb4b4; font-weight: 600; }
.rnd .through { color: #ffffff8c; font-weight: 700; font-size: 13px; text-align: right; }
.rnd.final { background: #ffd23f1f; border: 2px solid #ffd23f5c; }
.rnd .beans { grid-column: 1 / -1; margin-top: 0.15rem; }
.rnd .beans .bn { font-size: 13px; padding: 0.18rem 0.55rem; }

.beans { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.8rem; }

.bn {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 14px;
  border: 2px solid transparent;
  background: #ffffff14;
  color: #ffffffb8;
}

.bn b { font-weight: 800; }
.bn small { font-size: 11px; font-weight: 800; opacity: 0.8; }

.bn .rank {
  font-size: 11px;
  font-weight: 800;
  border-radius: 999px;
  padding: 0.05rem 0.35rem;
  background: #ffd23f2e;
  color: var(--yellow);
}

.bn.won { background: linear-gradient(#ffe27a, var(--yellow)); color: var(--ink); }
.bn.through { background: #6ee78730; border-color: var(--lime); color: #fff; }
.bn.playing { border-color: #ffffff2e; }
.bn.out { background: #ff6b6b3d; border-color: #ff6b6b; color: #fff; }
.bn.first { background: linear-gradient(#ffe27a, var(--yellow)); border-color: var(--ink); color: var(--ink); }
.bn .firsts {
  font-size: 11px;
  font-weight: 800;
  border-radius: 999px;
  padding: 0.05rem 0.35rem;
  background: #6ee7872e;
  color: var(--lime);
}

.bn.won .rank,
.bn.first .rank,
.bn.won .firsts,
.bn.first .firsts { background: #2a15522e; color: var(--ink); }

.shownow { margin-bottom: 1.6rem; }
.shownow > header { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.shownow h3 { margin: 0; font: 400 26px/1 "Bebas Neue", sans-serif; letter-spacing: 0.06em; }

.shownow .num {
  font-family: "Titan One", cursive;
  font-size: 15px;
  color: var(--ink);
  background: var(--cyan);
  border-radius: 8px;
  padding: 0.15rem 0.5rem;
}

.shownow .count { margin-left: auto; font-weight: 800; color: var(--lime); }
.shownow .champ { margin-left: auto; font-weight: 800; }

/* show order */

.orderlist { display: flex; flex-direction: column; gap: 0.5rem; }

.o {
  display: grid;
  grid-template-columns: 2.6rem 1fr auto auto;
  gap: 0.75rem;
  align-items: center;
  background: var(--face);
  border: 3px solid var(--edge);
  border-radius: 18px;
  padding: 0.55rem 0.9rem;
}

.o .n { font-family: "Titan One", cursive; font-size: 18px; color: #ffffff85; text-align: center; }
.o .nm { font-size: 17px; font-weight: 800; }

.o .limits,
.o .state {
  font: 600 12px/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ffffff8c;
}

.o.done { opacity: 0.6; }
.o.done .nm { text-decoration: line-through; }
.o.now { border-color: var(--yellow); background: linear-gradient(90deg, #ffd23f30, var(--face)); box-shadow: 0 0 0 4px #ffd23f1f; }
.o.now .state { color: var(--yellow); }

.odiv {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.6rem 0 0.1rem;
  font: 600 12px/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ffffff8c;
}

.odiv::before,
.odiv::after { content: ""; flex: 1; height: 3px; border-radius: 3px; background: var(--edge); }

/* rules */

.doc { max-width: 46rem; }
.doc h2:first-child { margin-top: 0; }
.doc p { margin: 0 0 0.8rem; line-height: 1.6; color: #ffffffdb; }

.doc .scroll { overflow-x: auto; margin: 0 0 1.2rem; }

.doc table {
  width: 100%;
  border-collapse: collapse;
  background: #00000026;
  border-radius: 14px;
  overflow: hidden;
}

.doc th {
  text-align: left;
  font: 600 11px/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.6rem 0.8rem;
  background: #00000033;
}

.doc td { padding: 0.5rem 0.8rem; border-top: 1px solid #ffffff1a; }
.doc td:last-child, .doc th:last-child { text-align: right; }

/* footer */

footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 3px solid #ffffff26;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

footer a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: #ffffffb3;
  font-weight: 700;
  font-size: 15px;
  background: #ffffff14;
  border: 3px solid #ffffff26;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

footer a:hover { background: #ffffff26; border-color: #ffffff59; color: #fff; }
footer svg { display: block; }
footer .it .mark path { fill: #e78200; }
footer .it .name { font-family: "Bebas Neue", sans-serif; font-size: 21px; letter-spacing: 0.08em; line-height: 1; }

/* player details */

button.bn { font: inherit; cursor: pointer; }

.look {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid #ffffff45;
  background: #ffffff1f;
  font-size: 15px;
  line-height: 1;
  transition: background 0.12s, border-color 0.12s;
}
button.bn:hover, button.bn:focus-visible { border-color: #fff; }

.detail {
  width: min(56rem, calc(100vw - 2rem));
  max-height: calc(100vh - 3rem);
  padding: 1.3rem 1.4rem 1.5rem;
  border: 3px solid var(--edge);
  border-radius: 20px;
  background: linear-gradient(160deg, #4a34a8, #2a1e6e 70%);
  color: #fff;
  font: 16px/1.5 "Baloo 2", system-ui, sans-serif;
  overflow: auto;
}

.detail::backdrop { background: #150c37cc; backdrop-filter: blur(3px); }

.detail > .x {
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: 2px solid var(--edge);
  background: var(--face);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}

.detail > .x:hover { border-color: #fff; }

.detail-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0 2.5rem 1rem 0;
  margin-bottom: 1.1rem;
  border-bottom: 2px solid var(--edge);
}

.detail-head h2 { font-family: "Titan One", cursive; font-size: 30px; margin: 0; line-height: 1.1; }
.detail-head p { margin: 0.1rem 0 0; color: var(--muted); font-size: 15px; font-weight: 700; }
.detail-head .pending { font-style: italic; }
.detail-head .stats { display: flex; gap: 0.45rem; }

.detail-head .s {
  display: grid;
  justify-items: center;
  min-width: 3.9rem;
  padding: 0.35rem 0.5rem;
  border-radius: 12px;
  background: var(--face);
  border: 2px solid var(--edge);
}

.detail-head .s b { font-family: "Titan One", cursive; font-size: 22px; line-height: 1; }
.detail-head .s span { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.detail-head .s.pts b { color: var(--yellow); }
.detail-head .s.pen b { color: #ff6b6b; }

.rgrid { display: flex; flex-direction: column; gap: 0.35rem; }

.gr {
  display: grid;
  grid-template-columns: 1fr auto 6.5rem 2.5rem;
  gap: 0.8rem;
  align-items: center;
  padding: 0.4rem 0.7rem;
  border-radius: 12px;
  background: var(--face);
  border: 2px solid transparent;
}

.gr.head { background: none; padding-top: 0; padding-bottom: 0; }
.gr.won { border-color: var(--yellow); background: #ffd23f1f; }
.gr.finalist { border-color: #35d6f06e; }

.gname { font-weight: 800; font-size: 15.5px; display: flex; align-items: center; gap: 0.5rem; }

.gname i {
  font-family: "Titan One", cursive;
  font-style: normal;
  font-size: 12px;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ffffff1f;
  flex: none;
}

.cells { display: flex; gap: 0.3rem; }

.rh, .c {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
}

.rh { height: 1.1rem; font-size: 10px; letter-spacing: 0.06em; color: var(--muted); }
.c.through { background: #6ee78730; color: var(--lime); }
.c.first, .c.won { background: linear-gradient(#ffe27a, var(--yellow)); color: var(--ink); }
.c.out { background: #ff6b6b3d; color: #ffb4b4; }
.c.unknown { background: #ffffff12; border: 2px dashed var(--edge); color: #ffffff5c; }
.c.none { background: #ffffff0a; color: #ffffff30; }

.badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  border: 2px solid transparent;
  text-align: center;
  white-space: nowrap;
}

.badge.won { background: linear-gradient(#ffe27a, var(--yellow)); color: var(--ink); }
.badge.finalist { background: #35d6f036; border-color: var(--cyan); color: #d8f8ff; }
.badge.playing { background: #6ee78730; border-color: var(--lime); color: #ddffe6; }
.badge.contestant { background: #ffffff12; border-color: var(--edge); color: var(--muted); }

.gr .pt { font-family: "Titan One", cursive; color: var(--yellow); font-size: 18px; text-align: right; }

.legend { display: flex; flex-wrap: wrap; gap: 0.9rem; margin: 1rem 0 0; color: var(--muted); font-size: 13px; }
.legend .key { display: flex; align-items: center; gap: 0.35rem; }
.legend .key i { font-style: normal; width: 1.4rem; height: 1.4rem; font-size: 12px; }
.legend .hint { font-style: italic; }

@media (max-width: 720px) {
  .status { grid-template-columns: 1fr; text-align: center; }
  .status .right { text-align: center; }
}

/* Narrow enough that the wide rows fold onto a second line rather than drop a column. */
@media (max-width: 640px) {
  .podium { grid-template-columns: 1fr; }
  /* The cards are ordered 2-1-3 so the winner sits centre stage; stacked, they read top down. */
  .p1 { order: 1; }
  .p2 { order: 2; }
  .p3 { order: 3; }

  .row {
    grid-template-columns: 2.4rem 1fr auto;
    grid-template-areas: "rk who look" "rk stats pts";
    row-gap: 0.5rem;
  }
  .row .rk { grid-area: rk; }
  .row .who { grid-area: who; }
  .row .stats { grid-area: stats; }
  .row .pts { grid-area: pts; }
  .row .look { grid-area: look; }

  .rnd {
    grid-template-columns: 1.5rem 1fr auto;
    grid-template-areas: "i map type" "i winner winner" "beans beans beans";
    row-gap: 0.2rem;
  }
  .rnd .i { grid-area: i; }
  .rnd .map { grid-area: map; }
  .rnd .type { grid-area: type; }
  .rnd .winner { grid-area: winner; }
  .rnd .beans { grid-area: beans; }

  .o {
    grid-template-columns: 2.2rem 1fr auto;
    grid-template-areas: "n nm state" "n limits state";
    row-gap: 0.2rem;
  }
  .o .n { grid-area: n; }
  .o .nm { grid-area: nm; }
  .o .limits { grid-area: limits; }
  .o .state { grid-area: state; }

  .detail-head { grid-template-columns: 1fr; }
  .detail-head .stats { flex-wrap: wrap; }

  .gr {
    grid-template-columns: 1fr auto;
    grid-template-areas: "gname pt" "cells cells" "badge badge";
    row-gap: 0.4rem;
    justify-items: start;
  }
  .gr .gname { grid-area: gname; }
  .gr .cells { grid-area: cells; }
  .gr .badge { grid-area: badge; }
  .gr .pt { grid-area: pt; }
  /* The round numbers only line up while every row is one grid; folded, they are noise. */
  .gr.head { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  body::before, .p .figure, .confetti i, .topbar .live .dot { animation: none; }
  .confetti { display: none; }
}
