:root {
  --ink: #173e34;
  --paper: #faf6e9;
  --orange: #ff744f;
  --yellow: #f8d66c;
  --mint: #c3e7ce;
  --line: #d7daca;
  --muted: #758078;
  font-family:
    ui-rounded,
    "Arial Rounded MT Bold",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input {
  font: inherit;
}
button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  color: var(--ink);
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
a {
  color: inherit;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #509dcd;
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(44px, 4.8vw, 78px);
  line-height: 1.01;
  letter-spacing: -0.065em;
  font-weight: 950;
}
h1 em {
  font-style: normal;
  color: #e66543;
}
h2 {
  font-size: 27px;
  line-height: 1.15;
  letter-spacing: -0.04em;
}
p {
  line-height: 1.6;
}
button {
  border: 0;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.shell {
  max-width: 1640px;
  padding: 0 54px;
  margin: auto;
}
header {
  height: 104px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-size: 22px;
  font-weight: 950;
  letter-spacing: -0.07em;
}
.brand-light {
  display: block;
  font-size: 17px;
  letter-spacing: 0.08em;
  line-height: 1;
}
.brand-mark {
  height: 45px;
  width: 45px;
  background: var(--orange);
  border: 2px solid var(--ink);
  border-radius: 12px;
  transform: rotate(-8deg);
  display: grid;
  place-items: center;
  font-size: 32px;
  position: relative;
  box-shadow: 3px 3px 0 var(--ink);
}
.brand-mark span {
  position: absolute;
  font-size: 24px;
  right: -8px;
  bottom: -12px;
  background: var(--paper);
  border-radius: 50%;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 22px;
}
.eyebrow,
.pill {
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.14em;
}
.pill {
  display: inline-block;
  padding: 9px 13px;
  border: 1px solid currentColor;
  border-radius: 100px;
  letter-spacing: 0.1em;
}
.connection {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}
.connection i,
.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ba374;
  margin-right: 4px;
  box-shadow: 0 0 0 4px #4ba37415;
}
.connection.offline {
  color: #b75030;
}
.connection.offline i {
  background: #e17f42;
}
.icon-button {
  background: transparent;
  font-size: 18px;
  display: flex;
  gap: 7px;
  align-items: center;
}
.icon-button span {
  font-size: 12px;
}
.text-button {
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 12px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.primary,
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  min-height: 51px;
  padding: 14px 22px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 850;
  box-shadow: 3px 4px 0 var(--ink);
  transition:
    transform 0.1s,
    box-shadow 0.1s;
}
.primary {
  background: var(--orange);
}
.secondary {
  background: var(--paper);
}
.primary:hover,
.secondary:hover {
  transform: translateY(-2px);
  box-shadow: 3px 6px 0 var(--ink);
}
.primary:active,
.secondary:active {
  transform: translate(2px, 3px);
  box-shadow: 0 1px 0 var(--ink);
}
.primary span {
  font-size: 20px;
}
.subtle-link {
  font-size: 12px;
  color: #68766c;
  text-underline-offset: 4px;
}
.shell > footer {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding: 22px 0;
  margin-top: 40px;
  font-size: 10px;
  letter-spacing: 0.09em;
  color: var(--muted);
}
.shell > footer span:first-child {
  font-weight: 850;
}
.lobby-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 40px 0 30px;
  gap: 24px;
}
.lobby-title .eyebrow {
  display: block;
  margin-bottom: 18px;
}
.ready-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--yellow);
  width: 165px;
  height: 142px;
  justify-content: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  transform: rotate(6deg);
  box-shadow: 4px 5px 0 var(--ink);
}
.ready-badge > b {
  font-size: 62px;
  line-height: 1;
  letter-spacing: -0.08em;
}
.ready-badge > b > span {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 0;
}
.ready-badge > span {
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.06em;
  margin-top: 8px;
}
.lobby-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
}
.lobby-stage {
  border: 2px solid var(--ink);
  border-radius: 18px;
  overflow: hidden;
  background: var(--mint);
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.lobby-stage canvas {
  height: 300px;
  flex: 1;
  min-height: 270px;
}
.canvas-label {
  display: flex;
  justify-content: space-between;
  padding: 16px 20px;
  font-size: 10px;
  letter-spacing: 0.09em;
  font-weight: 850;
  background: #bce5d4;
  border-bottom: 1px solid #163e3422;
}
.canvas-label span:last-child {
  color: #517963;
}
.warmup-caption {
  padding: 17px 22px;
  display: flex;
  gap: 15px;
  background: #e3efd6;
  border-top: 2px solid var(--ink);
}
.warmup-caption > span {
  font-size: 34px;
}
.warmup-caption strong {
  font-size: 14px;
}
.warmup-caption p {
  font-size: 12px;
  color: #5d7666;
  margin-top: 3px;
}
.join-card {
  background: #fffdf5;
  border: 2px solid var(--ink);
  border-radius: 18px;
  padding: 22px;
  text-align: center;
  box-shadow: 4px 5px 0 #173e3414;
}
.join-card .pill {
  font-size: 9px;
}
.qr {
  display: block;
  width: 175px;
  height: 175px;
  margin: 12px auto;
  border: 1px solid #e2e1d2;
  border-radius: 10px;
}
.join-card h2 {
  font-size: 25px;
}
.domain {
  font-size: 11px;
  font-weight: 700;
  margin: 9px -10px;
  overflow-wrap: anywhere;
}
.join-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  margin: 18px auto 0;
  width: max-content;
  font-size: 11px;
}
.join-steps b {
  display: inline-grid;
  place-items: center;
  background: #f3e9d3;
  border-radius: 50%;
  height: 20px;
  width: 20px;
  margin-right: 9px;
  font-size: 10px;
}
.lineup {
  margin-top: 32px;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}
.section-heading h2 {
  font-size: 23px;
}
.section-heading h2 span {
  font-size: 11px;
  background: #e7eadb;
  padding: 5px 9px;
  border-radius: 30px;
  letter-spacing: 0;
  margin-left: 9px;
  vertical-align: middle;
  font-weight: 650;
}
.section-heading > div {
  display: flex;
  gap: 18px;
  align-items: center;
}
.roster {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.roster-player {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf6;
  min-width: 0;
}
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--runner, var(--orange));
  background: var(--mint);
  flex-shrink: 0;
}
.roster-player strong {
  display: block;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.roster-player small {
  font-size: 10px;
  color: #6f806e;
}
.remove {
  margin-left: auto;
  background: transparent;
  color: #819080;
  font-size: 20px;
  padding: 0 6px;
}
.empty-roster {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px dashed #a8b5a0;
  border-radius: 12px;
  padding: 24px;
  color: #7c8876;
  font-size: 13px;
}
.empty-roster > span {
  font-size: 30px;
}
.empty-roster p {
  font-size: 12px;
}
.stage-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-top: 30px;
}
.stage-card {
  display: flex;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 18px 5px;
}
.stage-card small {
  font-size: 9px;
  letter-spacing: 0.1em;
  display: block;
  color: #7f8b7b;
  margin-bottom: 4px;
  font-weight: 800;
}
.stage-card strong {
  font-size: 13px;
}
.stage-icon {
  font-size: 32px;
  width: 55px;
  height: 55px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 15px;
  border: 1px solid var(--ink);
  background: #f4d573;
  transform: rotate(-7deg);
}
.stage-1 .stage-icon {
  background: #dcc6ec;
}
.stage-2 .stage-icon {
  background: #f2bf91;
}
.stage-3 .stage-icon {
  background: #a7adc9;
}
.entry-layout {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  min-height: 690px;
  gap: 80px;
  align-items: center;
}
.entry-art {
  position: relative;
  padding: 45px 0;
}
.entry-art h1 {
  font-size: clamp(60px, 6vw, 96px);
  margin: 22px 0;
}
.entry-art p {
  font-size: 17px;
  color: #70806d;
}
.art-track {
  height: 240px;
  border: 2px solid var(--ink);
  border-radius: 20px;
  margin-top: 34px;
  overflow: hidden;
}
.sticker {
  position: absolute;
  right: -25px;
  bottom: 255px;
  border: 2px solid var(--ink);
  padding: 18px 15px;
  background: var(--yellow);
  font-size: 11px;
  font-weight: 900;
  transform: rotate(11deg);
  border-radius: 50%;
  box-shadow: 3px 3px 0 var(--ink);
}
.entry-panel {
  border: 2px solid var(--ink);
  background: #fffdf6;
  padding: 40px;
  border-radius: 22px;
  box-shadow: 6px 7px 0 #173e3418;
}
.entry-panel h2 {
  font-size: 37px;
  margin: 20px 0 12px;
}
.entry-panel > p {
  color: #76816f;
  font-size: 14px;
}
.entry-panel form {
  margin: 26px 0 24px;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 750;
  margin: 17px 0;
}
input:not([type="file"]) {
  width: 100%;
  border: 1px solid #b9c4b2;
  background: #fffcf4;
  padding: 14px;
  border-radius: 9px;
  margin-top: 8px;
  font-size: 16px;
  color: var(--ink);
}
.entry-panel .primary {
  width: 100%;
}
.form-error {
  color: #b84730;
  font-size: 13px;
  min-height: 20px;
  margin: 10px 0;
}
.race-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 0 20px;
}
.race-heading h1 {
  font-size: 48px;
  margin-top: 9px;
}
.timer {
  font-size: 38px;
  letter-spacing: -0.06em;
  font-weight: 900;
  border: 1px solid #b9c3b0;
  padding: 9px 17px;
  border-radius: 12px;
}
.race-progress {
  height: 26px;
  background: #e2e7d5;
  border: 2px solid var(--ink);
  border-radius: 30px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
}
.race-progress > div {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--orange);
  transition: width 0.1s linear;
  border-right: 2px solid var(--ink);
}
.race-progress span {
  font-size: 9px;
  font-weight: 850;
  z-index: 1;
  letter-spacing: 0.1em;
}
.race-view {
  height: clamp(400px, 54vh, 700px);
  margin-top: 18px;
  border: 2px solid var(--ink);
  border-radius: 17px;
  overflow: hidden;
  position: relative;
}
.countdown {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #fff6de24;
  font-size: clamp(70px, 10vw, 150px);
  font-weight: 1000;
  text-shadow: 5px 5px 0 #fff5d8;
  color: var(--ink);
  pointer-events: none;
}
.race-label {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #fff8e6e8;
  display: flex;
  justify-content: space-between;
  padding: 10px 18px;
  font-size: 11px;
}
.race-label span:first-child {
  font-weight: 850;
}
.race-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  gap: 20px;
}
.race-bottom p {
  font-size: 14px;
  font-weight: 650;
}
.race-bottom > div {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.race-bottom .secondary {
  min-height: 40px;
  padding: 8px 18px;
}
.mini-scores {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.mini-scores > div {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #fffaf0;
  border: 1px solid var(--line);
  padding: 6px 9px;
  border-radius: 30px;
  font-size: 11px;
}
.mini-scores .avatar {
  width: 26px;
  height: 26px;
  border-width: 2px;
}
.mini-scores strong {
  font-size: 10px;
  color: #76866d;
}
.results-screen {
  text-align: center;
  padding: 35px 0 0;
}
.winner-portrait {
  position: relative;
  width: 100px;
  margin: 25px auto 16px;
}
.winner-portrait .avatar {
  width: 100px;
  height: 100px;
  border-width: 6px;
  box-shadow: 4px 4px 0 var(--ink);
}
.winner-portrait > span {
  position: absolute;
  font-size: 48px;
  color: #b78318;
  left: 29px;
  top: -39px;
  transform: rotate(-12deg);
}
.results-screen h1 {
  font-size: 52px;
}
.results-screen > p {
  color: #78806e;
  font-size: 13px;
  margin-top: 13px;
}
.results-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
  text-align: left;
  max-width: 1000px;
  margin: 30px auto;
}
.leaderboard {
  background: #fffcf3;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 22px;
}
.leaderboard .section-heading > span {
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.06em;
}
.result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid #e3e6d6;
}
.place {
  font-size: 17px;
  font-weight: 900;
  color: #9fa991;
  width: 23px;
}
.result-row strong {
  font-size: 14px;
  flex: 1;
}
.result-row strong small {
  font-size: 8px;
  background: var(--yellow);
  border-radius: 5px;
  padding: 3px;
}
.result-row .result-detail {
  font-size: 11px;
  color: #87907b;
}
.result-row > b {
  font-size: 21px;
  text-align: center;
  min-width: 40px;
}
.result-row > b small {
  display: block;
  font-size: 8px;
  letter-spacing: 0.1em;
}
.is-me {
  background: #eff1dd;
}
.next-card {
  background: var(--mint);
  border: 2px solid var(--ink);
  border-radius: 17px;
  padding: 30px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 17px;
}
.next-card h2 {
  font-size: 35px;
}
.next-card p {
  font-size: 14px;
}
.next-card .stage-icon {
  width: 75px;
  height: 75px;
  font-size: 45px;
}
.next-card .primary {
  width: 100%;
  margin-top: 7px;
}
.big-trophy {
  font-size: 90px;
  color: #e3aa28;
  line-height: 1;
}
.scoring-note {
  font-size: 10px !important;
}
.center-message {
  padding: 70px 0;
  text-align: center;
}
.center-message p {
  margin: 25px;
}
.center-message h1 {
  margin-top: 25px;
}
#toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translate(-50%, 30px);
  opacity: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 15px 22px;
  border-radius: 12px;
  font-size: 13px;
  z-index: 100;
  max-width: 90vw;
  width: max-content;
  transition: 0.2s;
  pointer-events: none;
  box-shadow: 0 5px 20px #0002;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
/* The phone is a physical controller: generous targets, no scrolling during play. */
.phone {
  max-width: 520px;
  padding: 0 20px;
}
.phone header {
  height: 76px;
  gap: 12px;
}
.phone .brand {
  font-size: 17px;
}
.phone .brand-light {
  font-size: 12px;
}
.phone .brand-mark {
  width: 34px;
  height: 34px;
  font-size: 25px;
}
.phone .header-actions {
  gap: 8px;
}
.phone .icon-button span {
  display: none;
}
.phone .connection {
  font-size: 10px;
}
.phone > footer {
  display: block;
  text-align: center;
  margin-top: 24px;
  line-height: 1.7;
  font-size: 8px;
}
.phone > footer span {
  display: block;
}
.phone-entry {
  text-align: center;
  padding: 28px 0 0;
}
.phone-entry h1 {
  font-size: 51px;
  margin: 19px 0 16px;
}
.phone-entry .intro {
  font-size: 13px;
  color: #788271;
}
.phone-entry form {
  text-align: left;
}
.phone-entry .pill {
  font-size: 9px;
}
.selfie-area {
  text-align: center;
  margin: 23px 0;
}
.selfie-preview {
  height: 145px;
  width: 145px;
  border: 2px dashed var(--ink);
  border-radius: 50%;
  margin: 0 auto 16px;
  background: #e2edce;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 6px 5px 0 #ede4ca;
}
.selfie-preview > span {
  font-size: 66px;
  line-height: 1;
}
.selfie-preview > small {
  font-size: 8px;
  font-weight: 900;
  margin-top: 7px;
}
.selfie-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
video {
  height: 220px;
  width: 220px;
  object-fit: cover;
  border: 3px solid var(--ink);
  border-radius: 50%;
  transform: scaleX(-1);
  margin: auto auto 15px;
  display: block;
}
.selfie-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}
.selfie-actions button {
  min-height: 43px;
  font-size: 12px;
}
.upload-label {
  position: relative;
  overflow: hidden;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 10px;
  cursor: pointer;
  color: #77826e;
  padding: 8px;
  margin: 0;
}
.upload-label input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  font-size: 0;
}
.join-button {
  width: 100%;
}
.privacy {
  font-size: 10px;
  text-align: center;
  color: #86907c;
  margin: 15px 0 22px;
}
.phone-entry .subtle-link {
  font-size: 10px;
}
.controller {
  padding: 20px 0 0;
  touch-action: manipulation;
}
.player-strip {
  display: flex;
  align-items: center;
  gap: 10px;
}
.player-strip small {
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: #859078;
}
.player-strip h2 {
  font-size: 18px;
  margin-top: 4px;
}
.player-strip .avatar {
  width: 43px;
  height: 43px;
}
.player-number {
  margin-left: auto;
  border: 1px solid #c9d2bf;
  border-radius: 10px;
  padding: 10px;
  font-size: 18px;
  font-weight: 850;
}
.phone-title {
  text-align: center;
  margin: 23px 0 15px;
}
.phone-title .pill {
  font-size: 9px;
  background: var(--yellow);
}
.phone-title h1 {
  font-size: 46px;
  margin: 14px 0;
}
.phone-title p {
  font-size: 12px;
  color: #7a8572;
}
.phone-track {
  height: 175px;
  border: 2px solid var(--ink);
  border-radius: 15px;
  overflow: hidden;
  margin: 20px 0;
}
.run-button {
  background: var(--orange);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 23px;
  min-height: 150px;
  width: 100%;
  box-shadow: 0 7px 0 var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  user-select: none;
  touch-action: none;
  -webkit-user-select: none;
}
.run-button > span {
  font-size: 48px;
  font-weight: 1000;
  letter-spacing: -0.05em;
}
.run-button > small {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.warmup-button {
  min-height: 100px;
  border-radius: 17px;
}
.warmup-button > span {
  font-size: 28px;
}
.emotes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 23px 0;
}
.emotes button {
  background: #fff9e9;
  border: 1px solid #c5ceba;
  border-radius: 12px;
  padding: 11px;
  font-size: 24px;
}
.emotes span {
  display: block;
  font-size: 10px;
  font-weight: 750;
  margin-top: 5px;
}
.waiting-label {
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  margin: 15px 0;
  color: #728466;
}
.controller > #leave {
  display: block;
  margin: auto;
  font-size: 11px;
}
.race-controller .race-progress {
  margin: 18px 0 13px;
  height: 21px;
}
.race-controller .race-progress span {
  font-size: 7px;
}
.phone-race-view {
  height: 200px;
  border: 2px solid var(--ink);
  border-radius: 15px;
  overflow: hidden;
  position: relative;
}
.phone-race-view .countdown {
  font-size: 80px;
}
.phone-cue {
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  min-height: 42px;
  display: grid;
  place-items: center;
  padding: 9px 0;
}
.controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
  touch-action: none;
}
.controls.has-actions {
  grid-template-columns: 1.5fr 1fr;
}
.controls.has-actions .run-button {
  grid-row: span 2;
  min-height: 150px;
}
.action-button {
  border: 2px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--ink);
  min-height: 66px;
  font-size: 11px;
  font-weight: 900;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1px;
  user-select: none;
  touch-action: none;
}
.action-button > span {
  font-size: 25px;
}
.jump-button {
  background: var(--yellow);
}
.duck-button {
  background: #abdbb2;
}
.rocket-button {
  background: #c7b4e9;
}
.controls:has(.jump-button):not(:has(.duck-button)):not(:has(.rocket-button))
  .jump-button {
  grid-row: span 2;
}
.action-button.held {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
  filter: brightness(0.9);
}
.control-help {
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  color: #718169;
  margin: 19px 8px 10px;
}
.phone-stats {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.06em;
  font-weight: 850;
  color: #849076;
}
.charge-wrap {
  text-align: center;
  font-size: 9px;
  margin: 0 0 15px;
  color: #6c7862;
  font-weight: 750;
}
.charge-meter {
  height: 17px;
  background: #e9e1f2;
  border: 2px solid var(--ink);
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  margin-bottom: 5px;
}
.perfect-zone {
  position: absolute;
  left: 65%;
  width: 25%;
  height: 100%;
  background: #79c888;
}
.charge-meter i {
  position: absolute;
  left: 0;
  width: 0;
  height: 100%;
  background: #825db69c;
  border-right: 3px solid #513777;
}
.paused-notice {
  background: var(--yellow);
  border-radius: 10px;
  padding: 15px;
  font-size: 13px;
  font-weight: 750;
  text-align: center;
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  z-index: 5;
}
.phone-results h1 {
  font-size: 40px;
}
.phone-results .results-layout {
  display: flex;
  flex-direction: column;
}
.phone-results .leaderboard {
  padding: 15px;
}
.phone-results .section-heading h2 {
  font-size: 20px;
}
.phone-results .result-row .avatar {
  width: 33px;
  height: 33px;
}
.phone-results .result-row {
  gap: 8px;
}
.phone-results .result-detail {
  font-size: 9px;
}
.phone-results .result-row strong {
  font-size: 12px;
}
.phone-results .next-card {
  padding: 23px;
}
.phone-results .next-card h2 {
  font-size: 28px;
}
.pop {
  animation: tap 0.12s ease-out;
}
@keyframes tap {
  50% {
    transform: translateY(4px);
    box-shadow: 0 2px 0 var(--ink);
  }
}
.disconnected .controller .controls {
  opacity: 0.5;
}
.disconnected .connection {
  color: #b64e32;
}
@media (min-width: 1800px) {
  .shell {
    max-width: 1800px;
  }
  .lobby-stage canvas {
    min-height: 390px;
  }
  .lobby-grid {
    grid-template-columns: 1fr 330px;
  }
  .join-card .qr {
    width: 205px;
    height: 205px;
  }
  .lobby-title {
    padding-top: 45px;
  }
  .lobby-title h1 {
    font-size: 90px;
  }
}
@media (max-width: 1000px) {
  .shell {
    padding: 0 28px;
  }
  .header-actions {
    gap: 14px;
  }
  .header-actions > .eyebrow {
    display: none;
  }
  .lobby-grid {
    grid-template-columns: 1fr 255px;
    gap: 18px;
  }
  .join-card {
    padding: 18px;
  }
  .qr {
    width: 150px;
    height: 150px;
  }
  .roster {
    grid-template-columns: repeat(3, 1fr);
  }
  .stage-card {
    gap: 10px;
  }
  .stage-card strong {
    font-size: 11px;
  }
  .stage-icon {
    width: 42px;
    height: 42px;
    font-size: 26px;
  }
  .entry-layout {
    gap: 35px;
  }
  .entry-panel {
    padding: 28px;
  }
  .entry-art h1 {
    font-size: 68px;
  }
  .section-heading > div {
    gap: 7px;
  }
  .section-heading .primary {
    font-size: 12px;
    padding: 12px;
  }
  .race-label span:last-child {
    display: none;
  }
  .race-heading h1 {
    font-size: 38px;
  }
  .race-bottom {
    align-items: flex-start;
  }
  .race-bottom p {
    font-size: 12px;
  }
  .phone {
    padding: 0 20px;
  }
}
@media (max-width: 700px) {
  .host {
    padding: 0 18px;
  }
  .host header {
    height: 80px;
  }
  .host .brand {
    font-size: 18px;
  }
  .host .brand-light {
    font-size: 13px;
  }
  .host .icon-button span {
    display: none;
  }
  .host .header-actions {
    gap: 5px;
  }
  .host .text-button {
    font-size: 10px;
  }
  .lobby-title {
    padding: 28px 0 22px;
  }
  .lobby-title h1 {
    font-size: 42px;
  }
  .ready-badge {
    width: 98px;
    height: 91px;
    flex-shrink: 0;
  }
  .ready-badge > b {
    font-size: 38px;
  }
  .ready-badge > b > span {
    font-size: 17px;
  }
  .ready-badge > span {
    font-size: 6px;
  }
  .lobby-grid {
    grid-template-columns: 1fr;
  }
  .lobby-stage canvas {
    height: 250px;
    min-height: 250px;
  }
  .join-card {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 8px 14px;
    align-items: center;
    text-align: left;
  }
  .join-card .qr {
    grid-column: 1;
    grid-row: 1/5;
    width: 140px;
    height: 140px;
    margin: 0;
  }
  .join-card .pill {
    grid-column: 2;
    font-size: 7px;
    text-align: center;
  }
  .join-card h2 {
    grid-column: 2;
    font-size: 23px;
  }
  .join-card .domain {
    grid-column: 2;
    font-size: 9px;
    margin: 0;
  }
  .join-steps {
    display: none;
  }
  .lineup .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .section-heading h2 {
    font-size: 21px;
  }
  .section-heading > div {
    width: 100%;
    justify-content: space-between;
  }
  .roster {
    grid-template-columns: repeat(2, 1fr);
  }
  .roster-player {
    padding: 8px;
    gap: 7px;
  }
  .roster-player .avatar {
    width: 34px;
    height: 34px;
  }
  .roster-player strong {
    max-width: 90px;
    font-size: 11px;
  }
  .roster-player small {
    font-size: 8px;
  }
  .empty-roster {
    flex-wrap: wrap;
    padding: 18px;
  }
  .empty-roster p {
    width: 100%;
  }
  .stage-cards {
    grid-template-columns: 1fr 1fr;
    gap: 5px 16px;
  }
  .warmup-caption {
    padding: 15px;
  }
  .warmup-caption p {
    font-size: 10px;
  }
  .host > footer {
    gap: 18px;
    line-height: 1.7;
    font-size: 8px;
  }
  .entry-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .entry-art {
    padding: 35px 0 22px;
  }
  .entry-art h1 {
    font-size: 60px;
  }
  .entry-art p {
    font-size: 14px;
  }
  .art-track {
    height: 180px;
  }
  .sticker {
    right: -5px;
    bottom: 190px;
  }
  .entry-panel {
    margin-top: 10px;
  }
  .entry-panel h2 {
    font-size: 30px;
  }
  .race-heading h1 {
    font-size: 31px;
  }
  .race-heading .eyebrow {
    font-size: 8px;
  }
  .timer {
    font-size: 27px;
  }
  .race-view {
    height: 57vh;
    min-height: 380px;
  }
  .race-bottom {
    flex-direction: column;
  }
  .mini-scores {
    gap: 7px;
  }
  .results-layout {
    grid-template-columns: 1fr;
  }
  .results-screen h1 {
    font-size: 42px;
  }
  .results-screen .leaderboard {
    padding: 18px;
  }
  .results-screen .result-row {
    gap: 9px;
  }
  .results-screen .result-detail {
    font-size: 10px;
  }
  .header-actions .connection {
    font-size: 10px;
  }
}
@media (max-height: 760px) and (max-width: 550px) {
  .race-controller {
    padding-top: 12px;
  }
  .phone-race-view {
    height: 155px;
  }
  .race-controller .race-progress {
    margin: 12px 0 10px;
  }
  .race-controller .run-button {
    min-height: 125px;
  }
  .race-controller .action-button {
    min-height: 55px;
  }
  .race-controller .control-help {
    font-size: 10px;
    margin-top: 14px;
  }
  .race-controller .phone-cue {
    min-height: 35px;
    font-size: 11px;
  }
  .race-controller .player-strip h2 {
    font-size: 16px;
  }
  .race-controller .charge-wrap {
    margin-bottom: 10px;
  }
  .race-controller .phone-stats {
    font-size: 9px;
  }
  .phone:has(.race-controller) > footer {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Explicit canvas height prevents its pixel buffer changing the grid’s intrinsic size. */
.lobby-stage canvas {
  height: clamp(260px, 32vh, 390px);
  min-height: 0;
  flex: none;
}

@media (min-width: 900px) {
  .host .results-layout {
    max-width: 1300px;
    grid-template-columns: 2fr 1fr;
  }
  .host .leaderboard {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 22px;
    align-content: start;
  }
  .host .leaderboard .section-heading {
    grid-column: 1/-1;
  }
  .host .result-row {
    padding: 9px 0;
    gap: 9px;
  }
  .host .result-row .avatar {
    width: 34px;
    height: 34px;
  }
  .host .result-row strong {
    font-size: 12px;
  }
  .host .result-row .result-detail {
    font-size: 10px;
  }
  .host .result-row > b {
    font-size: 18px;
  }
  .host .results-screen h1 {
    font-size: 44px;
  }
}
