/* Deskathlon: a track meet. Infield green, track red, white bibs, amber timing board. */
@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-latin-wdth-normal.woff2") format("woff2-variations");
  font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap;
}

:root {
  color-scheme: light;
  --grass: #1d6b47;
  --grass-deep: #14523a;
  --track: #c9502f;
  --track-deep: #a83f22;
  --chalk: #fbfaf5;
  --ink: #14171c;
  --board: #0d0f12;
  --led: #ffb000;
  --font: "Archivo", "Arial Narrow", Arial, system-ui, sans-serif;
  --wrap: 66rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--grass); color: var(--chalk);
  font: 450 1.06rem/1.55 var(--font); font-stretch: 100%;
}
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--led); outline-offset: 2px; }
.skip { position: absolute; left: -999rem; top: 0.5rem; background: var(--chalk); color: var(--ink); padding: 0.5rem 0.9rem; z-index: 50; }
.skip:focus { left: 0.5rem; }

h1, h2, h3 { font-stretch: 68%; font-weight: 850; line-height: 0.98; letter-spacing: 0.005em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 7.2vw, 4.9rem); text-transform: uppercase; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); text-transform: uppercase; }
p, ul, ol { margin: 0.8rem 0 0; }
.lede { font-size: 1.22rem; line-height: 1.45; max-width: 38rem; margin-top: 1rem; }

.top, #main > .content, #app, .foot { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0 0.4rem; }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; font-weight: 850; font-stretch: 68%; font-size: 1.55rem; text-transform: uppercase; letter-spacing: 0.02em; }
.brand svg { width: 1.9rem; height: 1.9rem; }
.nav { display: flex; gap: 1.2rem; font-weight: 650; font-size: 0.98rem; }
.nav a { text-decoration: none; padding: 0.4rem 0; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--chalk); }

/* ---------- buttons and fields ---------- */
.btn {
  font: 750 1.02rem/1.1 var(--font); color: var(--ink); background: var(--chalk);
  border: 2px solid var(--ink); border-radius: 0.4rem; padding: 0.7rem 1.05rem; min-height: 2.9rem;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  box-shadow: 0 3px 0 var(--ink);
}
.btn:hover { background: #fff; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-go { background: var(--led); font-size: 1.2rem; font-stretch: 80%; font-weight: 850; text-transform: uppercase; padding: 0.85rem 1.5rem; min-height: 3.4rem; }
.btn-go:hover { background: #ffc233; }
.btn-small { min-height: 2.5rem; padding: 0.45rem 0.8rem; font-size: 0.93rem; box-shadow: 0 2px 0 var(--ink); }
.btn[aria-pressed="false"] { opacity: 0.75; }
label { font-weight: 700; font-size: 0.95rem; }
input[type="text"], input:not([type]) {
  font: 650 1.1rem/1.2 var(--font); color: var(--ink); background: var(--chalk); border: 2px solid var(--ink);
  border-radius: 0.4rem; padding: 0.6rem 0.7rem; min-height: 2.9rem; width: 100%;
}
.note { background: var(--chalk); color: #8a1f11; border-left: 5px solid var(--track); padding: 0.6rem 0.8rem; font-weight: 700; max-width: 40rem; margin-top: 1rem; }
.waiting { font-weight: 700; font-size: 1.1rem; }

/* ---------- home ---------- */
.hero { padding: 1.6rem 0 0.5rem; }
.start { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem 1.6rem; margin-top: 1.5rem; }
.join { display: grid; grid-template-columns: auto auto; gap: 0.3rem 0.5rem; align-items: center; }
.join label { grid-column: 1 / -1; }
.join input { width: 8.5rem; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 800; }
.practice { margin: 1.8rem 0 0.5rem; }
.practice-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.7rem 1rem; margin-bottom: 0.8rem; }
.practice-head h2 { font-size: clamp(1.25rem, 2.6vw, 1.6rem); }

/* ---------- race stage ---------- */
.stage { background: var(--board); border: 2px solid var(--ink); border-radius: 0.6rem; overflow: hidden; display: flex; flex-direction: column; }
.score {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.55rem 0.9rem;
  color: var(--led); font-weight: 800; font-stretch: 75%; font-variant-numeric: tabular-nums; letter-spacing: 0.04em;
}
.score .clock { font-size: 1.9rem; line-height: 1; min-width: 5.2ch; text-align: right; }
.score .call { font-size: 1.25rem; text-transform: uppercase; }
.track { background: var(--track); position: relative; padding: 0; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.track::after { /* finish line */
  content: ""; position: absolute; top: 0; bottom: 0; right: var(--finish-gap, 2.6rem); width: 6px;
  background: repeating-linear-gradient(var(--chalk) 0 6px, var(--ink) 6px 12px);
}
.lane {
  position: relative; flex: 1 1 0; border-top: 2px solid rgb(251 250 245 / 0.75);
  display: flex; align-items: stretch;
}
.lane:first-child { border-top: 0; }
.lane.is-me { background: var(--track-deep); }
.lane-name {
  flex: 0 0 8.5rem; align-self: center; padding: 0 0.6rem; font-size: 0.86rem; font-weight: 700; color: var(--chalk);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.15;
}
.lane-run { position: relative; flex: 1 1 auto; min-width: 0; min-height: calc(var(--runner, 2.1rem) + 0.5rem); border-left: 4px solid var(--chalk); }
.lane-time { position: absolute; right: 3.4rem; top: 50%; transform: translateY(-50%); font-weight: 850; font-stretch: 75%; font-variant-numeric: tabular-nums; color: var(--chalk); font-size: 1rem; }
.runner { position: absolute; left: 0; bottom: 2px; width: var(--runner, 2.1rem); height: var(--runner, 2.1rem); will-change: transform; }
.runner svg { width: 100%; height: 100%; display: block; overflow: visible; }
.runner .leg-b { display: none; }
.runner.alt .leg-a { display: none; }
.runner.alt .leg-b { display: inline; }
.runner.down { opacity: 0.55; }
.pads { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; padding: 0.6rem; background: var(--board); }
.pad {
  font: 850 1.3rem/1 var(--font); font-stretch: 75%; text-transform: uppercase; color: var(--ink); background: var(--chalk);
  border: 2px solid var(--ink); border-radius: 0.5rem; min-height: 4.2rem; cursor: pointer;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  display: grid; place-items: center; gap: 0.1rem;
}
.pad small { font: 600 0.78rem/1 var(--font); font-stretch: 100%; text-transform: none; opacity: 0.7; }
.pad.is-down { background: var(--led); transform: scale(0.98); }
.pads.is-off .pad { opacity: 0.45; }
.stage-msg { color: var(--chalk); padding: 0.55rem 0.9rem; font-weight: 700; background: var(--board); min-height: 2.5rem; }
.stage-msg strong { color: var(--led); }

/* Full-screen race on small screens so nothing scrolls while tapping. */
@media (max-width: 760px) {
  .lane { flex-direction: column; }
  .lane-name { flex: 0 0 auto; align-self: flex-start; max-width: 100%; padding: 2px 0.5rem 0; font-size: 0.76rem; }
  .lane-run { border-left: 0; flex: 1 1 auto; }
  .stage.is-live { position: fixed; inset: 0; z-index: 40; border-radius: 0; border: 0; padding-bottom: env(safe-area-inset-bottom); }
  .stage.is-live .pad { min-height: 30vh; font-size: 1.8rem; }
  .stage.is-live.is-compact .pad { min-height: 23vh; }
  .stage.is-live .track { flex: 1 1 auto; min-height: 0; }
  .stage.is-live .lane { min-height: 0; overflow: hidden; }
  .stage.is-live .lane-run { min-height: 0; }
  /* More than eight lanes: the name sits over the lane so the runner gets the full height. */
  .stage.is-compact .lane-name { position: absolute; z-index: 1; left: 0; top: 0; padding: 0 0.3rem; font-size: 0.62rem; line-height: 1.1; max-width: 60%; opacity: 0.9; }
}

/* ---------- name panel ---------- */
.panel { max-width: 30rem; padding: 2rem 0 3rem; }

.panel form { display: grid; gap: 0.5rem; margin-top: 1.4rem; }
.panel .btn-go { margin-top: 0.6rem; justify-self: start; }

/* ---------- room ---------- */
.room-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; padding: 0.6rem 0 0.2rem; }
.room-id { font-weight: 700; font-size: 1.05rem; }
.room-id strong { font-stretch: 75%; font-weight: 850; font-size: 1.5rem; letter-spacing: 0.12em; margin-left: 0.3rem; }
.room-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
#lobby, #results { padding: 1rem 0 3rem; }
.title { font-size: clamp(2rem, 5.4vw, 3.4rem); }
.lobby-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
.bibs { list-style: none; padding: 0; margin: 1.3rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(8.6rem, 1fr)); gap: 0.8rem; }
.bib {
  background: var(--chalk); color: var(--ink); border: 2px solid var(--ink); border-radius: 0.3rem; position: relative;
  padding: 0.35rem 0.6rem 0.5rem; text-align: center; border-top: 0.7rem solid var(--bib-color, var(--track));
}
.bib::before, .bib::after { /* safety-pin holes */
  content: ""; position: absolute; top: 0.3rem; width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--grass-deep);
}
.bib::before { left: 0.4rem; } .bib::after { right: 0.4rem; }
.bib-no { display: block; font-stretch: 66%; font-weight: 900; font-size: 3rem; line-height: 0.95; font-variant-numeric: tabular-nums; }
.bib-name { display: block; font-weight: 750; font-size: 0.98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bib-meta { display: block; font-size: 0.8rem; font-weight: 650; min-height: 1.1em; color: #4a4f57; }
.bib.is-me { box-shadow: 0 0 0 3px var(--led); }
.host-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem 1.4rem; margin-top: 1.6rem; }
.check { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 650; cursor: pointer; }
.check input { width: 1.25rem; height: 1.25rem; accent-color: var(--led); }
.rename { display: grid; grid-template-columns: minmax(0, 14rem) max-content; justify-content: start; gap: 0.3rem 0.5rem; align-items: center; margin-top: 2rem; }
.rename label { grid-column: 1 / -1; }
.invite, .board { border: 2px solid var(--ink); border-radius: 0.5rem; padding: 1rem 1.1rem 1.1rem; }
.invite { background: var(--chalk); color: var(--ink); }
.invite h2, .board h2 { font-size: 1.35rem; }
.link { font-weight: 750; overflow-wrap: anywhere; background: #fff; border: 2px dashed var(--ink); border-radius: 0.3rem; padding: 0.45rem 0.6rem; }
.qr { width: 10.5rem; max-width: 100%; margin-top: 0.9rem; background: #fff; padding: 0.4rem; border: 2px solid var(--ink); border-radius: 0.3rem; }
.qr svg { display: block; width: 100%; height: auto; }
.board { background: var(--board); color: var(--led); margin-top: 1.2rem; }
.board ol { list-style: none; padding: 0; margin: 0.7rem 0 0; font-variant-numeric: tabular-nums; font-weight: 750; }
.board li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.22rem 0; border-top: 1px solid rgb(255 176 0 / 0.25); }
.board li:first-child { border-top: 0; }
.board li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- results ---------- */
.banner { background: var(--led); color: var(--ink); font-weight: 850; font-stretch: 80%; text-transform: uppercase; font-size: 1.2rem; padding: 0.5rem 0.9rem; display: inline-block; margin-top: 1rem; border: 2px solid var(--ink); }
.finish { list-style: none; padding: 0; margin: 1.3rem 0 0; max-width: 34rem; }
.finish li {
  display: grid; grid-template-columns: 2.6rem 1fr auto; align-items: center; gap: 0.7rem; background: var(--chalk); color: var(--ink);
  border: 2px solid var(--ink); border-left: 0.7rem solid var(--bib-color, var(--track)); border-radius: 0.3rem; padding: 0.45rem 0.8rem 0.45rem 0.6rem; margin-top: 0.45rem;
}
.finish .place { font-stretch: 66%; font-weight: 900; font-size: 1.9rem; line-height: 1; text-align: center; }
.finish .who { font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finish .who small { font-weight: 650; color: #4a4f57; margin-left: 0.4rem; }
.finish .time { font-stretch: 75%; font-weight: 850; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.finish li.is-me { box-shadow: 0 0 0 3px var(--led); }
.team-result { margin-top: 1.2rem; font-weight: 750; font-size: 1.12rem; max-width: 34rem; }
#results .board { max-width: 22rem; margin-top: 2rem; }

/* ---------- article content ---------- */
.content { padding: 2rem 0 3rem; }
.content.page { padding-top: 1.6rem; }
.content > * { max-width: 42rem; }
.content h2 { margin-top: 2.8rem; }
.content ul, .content ol { padding-left: 1.25rem; }
.content li + li { margin-top: 0.35rem; }
.answer { background: var(--chalk); color: var(--ink); border-left: 6px solid var(--led); padding: 0.95rem 1.15rem; font-size: 1.08rem; }
.answer p { margin: 0; }
.page .answer { margin-top: 1.6rem; }
.steps { list-style: none; counter-reset: step; padding: 0 !important; margin-top: 1.1rem; }
.steps li { counter-increment: step; position: relative; padding-left: 3.1rem; margin-top: 1rem; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -0.15rem; width: 2.2rem; height: 2.4rem; display: grid; place-items: center;
  background: var(--chalk); color: var(--ink); border: 2px solid var(--ink); border-top: 0.4rem solid var(--track); border-radius: 0.2rem;
  font-stretch: 66%; font-weight: 900; font-size: 1.35rem;
}
.steps strong { display: block; font-size: 1.1rem; }
.faq { margin-top: 1rem; border-top: 2px solid rgb(251 250 245 / 0.5); }
.faq details { border-bottom: 2px solid rgb(251 250 245 / 0.5); }
.faq summary { cursor: pointer; padding: 0.85rem 2rem 0.85rem 0; font-weight: 750; font-size: 1.08rem; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0.2rem; top: 0.6rem; font-size: 1.5rem; font-weight: 500; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 0 0 1rem; }
.table-scroll { overflow-x: auto; margin-top: 1rem; }
table { border-collapse: collapse; width: 100%; background: var(--chalk); color: var(--ink); }
th, td { text-align: left; padding: 0.55rem 0.75rem; border: 2px solid var(--ink); vertical-align: top; }
th { font-stretch: 75%; font-weight: 850; text-transform: uppercase; background: var(--led); }
.cta { margin-top: 2rem; }
.updated { font-size: 0.93rem; opacity: 0.85; margin-top: 2.4rem; }

.foot { border-top: 2px solid rgb(251 250 245 / 0.4); padding: 1.4rem 0 2.2rem; font-size: 0.96rem; }
.foot p { margin: 0.3rem 0 0; }
.foot a { margin-right: 1rem; }

/* In a room, the page is the game: hide the article and footer. */
body.in-room #content, body.in-room .foot, body.in-room .nav { display: none; }

@media (max-width: 760px) {
  body { font-size: 1.02rem; }
  .lobby-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .bibs { grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); gap: 0.6rem; }
  .bib-no { font-size: 2.5rem; }
  .start { gap: 1rem; }
  .btn-go { width: 100%; }
  .host-controls .btn-go, .panel .btn-go { width: 100%; }
  .nav { gap: 0.9rem; font-size: 0.92rem; }
  .qr { width: 9rem; }
}
@media (max-width: 400px) {
  .brand { font-size: 1.3rem; }
  .nav a:last-child { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .btn:active { transform: none; }
}

/* ---------- five events: shared stage parts ---------- */
.stage { position: relative; }
.score .ev-name { font-size: 0.95rem; text-transform: uppercase; opacity: 0.85; white-space: nowrap; }
.score .call { flex: 1 1 auto; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arena { flex: 1 1 auto; min-height: 15rem; position: relative; display: grid; place-items: center; background: var(--grass-deep); color: var(--chalk); }
.arena.track { display: flex; min-height: 0; place-items: initial; }
.pads.one { grid-template-columns: 1fr; }
.big {
  position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; pointer-events: none;
  font-stretch: 62%; font-weight: 900; font-size: clamp(6rem, 30vw, 14rem); line-height: 1; color: var(--led);
  text-shadow: 0 6px 0 var(--ink), 0 0 2rem rgb(0 0 0 / 0.5); font-variant-numeric: tabular-nums;
}
.big.pop { animation: pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes pop { from { transform: scale(1.7); opacity: 0.2; } to { transform: scale(1); opacity: 1; } }
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.5rem 0.7rem 0; background: var(--board); }
.chip { display: inline-flex; align-items: center; gap: 0.35rem; background: #1c2026; color: var(--chalk); border-radius: 99rem; padding: 0.15rem 0.6rem 0.15rem 0.15rem; font-size: 0.82rem; font-weight: 650; max-width: 100%; }
.chip b { display: grid; place-items: center; width: 1.45rem; height: 1.45rem; border-radius: 50%; color: var(--ink); font-size: 0.74rem; font-weight: 900; flex: none; }
.chip i { font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 8rem; }
.chip em { font-style: normal; color: var(--led); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chip em:empty { display: none; }
.chip.is-me { box-shadow: 0 0 0 2px var(--led); }

/* Starter's Gun */
.lamp { width: min(62vw, 15rem); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; text-align: center; background: #2a3038; border: 6px solid var(--ink); box-shadow: inset 0 -0.8rem 0 rgb(0 0 0 / 0.25); }
.lamp strong { font-stretch: 68%; font-weight: 900; font-size: clamp(1.6rem, 6vw, 2.4rem); text-transform: uppercase; line-height: 1; padding: 0 0.6rem; }
.lamp.wait { background: #b3261e; }
.lamp.go { background: #2fd45a; color: var(--ink); box-shadow: 0 0 3rem #2fd45a, inset 0 -0.8rem 0 rgb(0 0 0 / 0.15); }
.lamp.hit { background: var(--led); color: var(--ink); }
.lamp.foul { background: #5a2320; }
.rounds { position: absolute; left: 0; right: 0; bottom: 0.7rem; display: flex; justify-content: center; gap: 0.5rem; }
.rounds i { font-style: normal; min-width: 4rem; text-align: center; padding: 0.2rem 0.5rem; border: 2px solid rgb(251 250 245 / 0.5); border-radius: 0.4rem; font-weight: 800; font-variant-numeric: tabular-nums; min-height: 2rem; font-size: 0.95rem; }
.rounds i.hit { background: var(--led); color: var(--ink); border-color: var(--ink); }
.rounds i.foul { background: #5a2320; border-color: #5a2320; }
[data-kind="reaction"] .arena { padding-bottom: 3.2rem; }

/* Blind Ten */
.bigclock { text-align: center; padding: 1rem; }
.bigclock strong { display: block; font-stretch: 62%; font-weight: 900; font-size: clamp(5rem, 24vw, 10rem); line-height: 0.95; color: var(--led); font-variant-numeric: tabular-nums; }
.bigclock strong.great { color: #2fd45a; } .bigclock strong.far { color: #ff8a7a; }
.bigclock span { display: block; font-weight: 750; font-size: 1.15rem; margin-top: 0.4rem; }

/* Javelin */
.jav { width: 100%; align-self: stretch; display: flex; flex-direction: column; gap: 0.6rem; padding: 0.8rem; }
.meter { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0.6rem; font-weight: 800; text-transform: uppercase; font-stretch: 75%; }
.meter .bar { height: 1.5rem; background: #0d0f12; border: 2px solid var(--ink); border-radius: 0.3rem; overflow: hidden; }
.meter .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #2fd45a, var(--led) 70%, #e5484d); }
.field { position: relative; flex: 1 1 auto; min-height: 10rem; border-bottom: 6px solid var(--chalk); margin: 0 1.2rem 1.6rem 1.6rem; }
.marks span { position: absolute; bottom: -1.7rem; transform: translateX(-50%); font-size: 0.78rem; font-weight: 750; white-space: nowrap; }
.marks span::before { content: ""; position: absolute; left: 50%; bottom: 1.25rem; width: 2px; height: 0.6rem; background: var(--chalk); }
.needle { position: absolute; left: 0; bottom: 0; width: 5.5rem; height: 4px; background: rgb(251 250 245 / 0.45); transform-origin: left center; transform: rotate(-45deg); border-radius: 2px; }
.needle.live { background: var(--led); }
.spear { position: absolute; left: -1.2rem; bottom: 0; width: 2.6rem; height: 4px; background: var(--chalk); border-radius: 2px; will-change: transform; }
.spear::after { content: ""; position: absolute; right: -6px; top: -3px; border: 5px solid transparent; border-left-color: var(--led); }
.flags b { position: absolute; bottom: 0; transform: translateX(-50%); width: 1.4rem; height: 1.4rem; border-radius: 50% 50% 50% 0; display: grid; place-items: center; color: var(--ink); font-size: 0.7rem; font-weight: 900; border: 2px solid var(--ink); transition: left 0.3s; }
.flags b.is-me { z-index: 2; box-shadow: 0 0 0 2px var(--led); }

/* Tug of War */
.tug { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.7rem; padding: 0.9rem; }
.side h3 { font-size: 1.15rem; text-transform: uppercase; margin-bottom: 0.35rem; }
.side div { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.side.b { text-align: right; } .side.b div { justify-content: flex-end; }
.side.mine h3 { color: var(--led); } .side.mine h3::after { content: " (you)"; }
.rope { position: relative; height: 4.2rem; }
.rope .cord { position: absolute; left: 0; right: 0; top: 50%; height: 8px; transform: translateY(-50%); border-radius: 4px; background: repeating-linear-gradient(60deg, #d9b56d 0 7px, #a8843f 7px 14px); }
.rope .line-a, .rope .line-b { position: absolute; top: 0; bottom: 0; width: 4px; background: var(--chalk); }
.rope .line-a { left: 8%; } .rope .line-b { right: 8%; }
.rope .knot { position: absolute; top: 50%; left: 50%; width: 1.5rem; height: 2.6rem; background: var(--track); border: 3px solid var(--ink); border-radius: 0.3rem; transform: translate(-50%, -50%); transition: left 0.12s linear; }

/* ---------- lobby and results for the contest ---------- */
.practice-pick { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.2rem 0 0.7rem; }
.events { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.6rem; margin-top: 0.9rem; }
.event-btn { display: block; text-align: left; height: 100%; padding: 0.7rem 0.85rem; }
.event-btn strong { display: block; font-stretch: 72%; font-weight: 850; font-size: 1.2rem; text-transform: uppercase; line-height: 1.05; }
.event-btn span { display: block; font-weight: 550; font-size: 0.86rem; line-height: 1.3; margin-top: 0.25rem; }
.host-controls { display: block; }
.host-controls .or { font-weight: 750; margin-top: 1.3rem; }
.results-actions { display: flex; flex-wrap: wrap; gap: 0.7rem 1rem; align-items: center; margin-top: 1.6rem; }
.results-sub { font-weight: 750; font-size: 1.05rem; margin-top: 0.5rem; }
.finish .time small { display: inline-block; margin-left: 0.5rem; background: var(--led); color: var(--ink); border-radius: 0.3rem; padding: 0 0.35rem; font-size: 0.9rem; }
.finish li.is-win .place { background: var(--led); }
.results-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.5rem 2rem; align-items: start; }
#results .results-grid .board { max-width: none; margin-top: 1.3rem; }
.board li.is-me { color: #fff; }
.emoji-bar { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
.emoji-bar .btn { font-size: 1.25rem; min-width: 2.9rem; padding: 0.3rem 0.5rem; }
.float { position: fixed; bottom: 12vh; z-index: 60; pointer-events: none; text-align: center; animation: rise 2.2s ease-out forwards; }
.float span { display: block; font-size: 2.8rem; line-height: 1; }
.float small { display: inline-block; background: var(--board); color: var(--chalk); border-radius: 99rem; padding: 0.05rem 0.5rem; font-size: 0.75rem; font-weight: 700; }
@keyframes rise { from { transform: translateY(0) scale(0.6); opacity: 0; } 15% { opacity: 1; transform: translateY(-4vh) scale(1.1); } to { transform: translateY(-55vh) scale(1); opacity: 0; } }
.confetti { position: fixed; inset: 0; z-index: 70; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -1rem; width: 0.55rem; height: 0.95rem; animation: fall linear forwards; }
@keyframes fall { to { top: 105%; transform: rotate(720deg) translateX(3rem); } }

@media (max-width: 760px) {
  .results-grid { grid-template-columns: 1fr; }
  .stage.is-live .arena { min-height: 0; }
  .stage.is-live .pads.one .pad { min-height: 26vh; }
  .score .ev-name { display: none; }
  .events { grid-template-columns: 1fr 1fr; }
  .event-btn span { display: none; }
  .chip i { max-width: 5.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .big.pop, .float { animation: none; }
  .rope .knot, .flags b { transition: none; }
}

/* ---------- polish ---------- */
.arena.track { background: var(--track); }
#room-stage .arena { min-height: clamp(15rem, 42vh, 24rem); }
#room-stage .arena.track { min-height: 0; }
#room-stage .lane-run, #practice-stage .lane-run { min-height: calc(var(--runner, 2.1rem) + 0.9rem); }
.rope { height: 6rem; }
.rope .cord { height: 12px; }
.rope::before { content: ""; position: absolute; left: 50%; top: 18%; bottom: 18%; width: 0; border-left: 3px dashed rgb(251 250 245 / 0.55); }
.rope .knot { width: 1.7rem; height: 3.4rem; }
#results { padding-bottom: 1rem; }
.emoji-bar { margin: 1rem 0 2.5rem; }
@media (max-width: 760px) {
  .stage.is-live .lane-run { min-height: 0 !important; }
  #room-stage.is-live .arena { min-height: 0; }
}

/* Big rooms on small screens: the arena keeps its room, the chips shrink to bib and score. */
.arena:not(.track) { overflow: hidden; }
[data-kind="reaction"] .arena { min-height: 20rem; }
#room-stage[data-kind="reaction"] .arena { min-height: clamp(20rem, 42vh, 24rem); }
@media (max-width: 760px) {
  .chips.is-many { gap: 0.25rem; padding-top: 0.35rem; }
  .chips.is-many .chip i { display: none; }
  .chips.is-many .chip { padding-right: 0.15rem; font-size: 0.76rem; }
  .chips.is-many .chip em:not(:empty) { padding-right: 0.35rem; }
  /* The live stage has a fixed height on phones, so the arena can size its contents to itself. */
  .stage.is-live .arena:not(.track), #room-stage.is-live .arena:not(.track) { container-type: size; min-height: 11rem; }
  .stage.is-live .lamp { width: min(62cqw, 15rem, 100cqh - 4.6rem); }
  .stage.is-live .jav { height: 100%; }
  .stage.is-live .field { min-height: 0; }
  .stage.is-live .pads.one .pad { min-height: 22vh; }
}
@media (max-width: 760px) {
  .results-actions { position: sticky; bottom: 0; z-index: 3; background: var(--grass); padding: 0.7rem 0 calc(0.7rem + env(safe-area-inset-bottom)); margin-top: 0.9rem; box-shadow: 0 -0.6rem 0.6rem -0.4rem rgb(0 0 0 / 0.25); }
}

.share { margin-top: 1.1rem; }
