/* Beat Freeze: neon rooftop at night. Ink outlines, hot pink, cyan and acid lime on deep violet. */
@font-face {
  font-family: "Nunito Sans";
  src: url("/site/brand/NunitoSans-Black.woff2") format("woff2");
  font-weight: 900;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("/site/brand/DMSans-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
:root {
  --ink: #140b26;
  --night: #1d1238;
  --violet: #2a1850;
  --pink: #ff5fa2;
  --red: #ff2e63;
  --cyan: #35e0ff;
  --lime: #b6ff3b;
  --amber: #ffbe28;
  --gold: #ffd23f;
  --paper: #f5ecff;
  --display: "Nunito Sans", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "DM Sans", system-ui, sans-serif;
  --shell-ink: #f5ecff;
  --shell-paper: #1d1238;
  --shell-accent: #ff5fa2;
  --shell-on-accent: #140b26;
  --shell-font: "DM Sans", system-ui, sans-serif;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--ink);
}
body {
  font: 700 15px/1.35 var(--body);
  color: var(--paper);
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
#stage {
  position: fixed;
  inset: 0;
  display: block;
  width: 100vw;
  height: 100vh;
  touch-action: none;
}
body.racing #stage {
  cursor: pointer;
}

/* ---------- menu button ---------- */
.menu-btn {
  position: fixed;
  z-index: 20;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 2px solid var(--ink);
  background: rgba(29, 18, 56, 0.85);
  box-shadow: 0 3px 0 var(--ink);
  display: grid;
  place-items: center;
}
.menu-btn svg {
  width: 24px;
  height: 24px;
  stroke: var(--paper);
  stroke-width: 2.6;
  stroke-linecap: round;
  fill: none;
}

/* ---------- HUD ---------- */
.hud {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}
.hud[hidden] {
  display: none;
}
.hud-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 56px;
}
.hud-stage {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font: 900 16px/1.1 var(--display);
  text-shadow: 0 2px 0 var(--ink);
}
.chip {
  align-self: flex-start;
  font: 700 11px/1 var(--body);
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--cyan);
  color: var(--ink);
  text-shadow: none;
}
.hud-place {
  margin-left: auto;
  font: 900 italic 30px/1 var(--display);
  color: var(--gold);
  text-shadow: 0 3px 0 var(--ink), 0 0 12px rgba(255, 210, 63, 0.5);
}
.hud-place small {
  font-size: 14px;
  color: var(--paper);
  opacity: 0.8;
}
.progress {
  position: relative;
  margin: 20px 26px 0 6px; /* clear of the menu button: the drone marker sits under its corner */
  height: 8px;
  border-radius: 99px;
  background: rgba(20, 11, 38, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.15);
}
#progress-dots i {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  transition: opacity 0.3s;
}
#progress-dots i.me {
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  z-index: 2;
  box-shadow: 0 0 0 2px #fff;
}
#progress-dots i.out {
  opacity: 0.25;
}
.progress-drone {
  position: absolute;
  right: -24px;
  top: -8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--red) 0 28%, #2a1850 30%);
  border: 2px solid var(--ink);
}
.beats {
  position: absolute;
  left: 50%;
  bottom: calc(max(12px, env(safe-area-inset-bottom)) + 62px);
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}
.beats i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  border: 2px solid var(--ink);
  transition: transform 0.08s;
}
.beats i.on {
  background: var(--lime);
  transform: scale(1.35);
  box-shadow: 0 0 10px var(--lime);
}
.beats.warn i.on {
  background: var(--amber);
  box-shadow: 0 0 12px var(--amber);
}
.beats.turning i.on,
.beats.watch i.on {
  background: var(--red);
  box-shadow: 0 0 12px var(--red);
}
.coach {
  position: absolute;
  left: 50%;
  top: 49%;
  transform: translateX(-50%);
  width: min(92vw, 420px);
  margin: 0;
  text-align: center;
  font: 900 20px/1.2 var(--display);
  text-shadow: 0 2px 0 var(--ink), 0 0 10px var(--ink);
}
.coach:empty {
  display: none;
}
.hint {
  position: absolute;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 24px);
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(20, 11, 38, 0.75);
  font-size: 13px;
  text-align: center;
  transition: opacity 0.6s;
}
.hint.gone {
  opacity: 0;
}

/* ---------- panels ---------- */
.panel {
  position: fixed;
  z-index: 15;
  inset: 0;
  display: flex;
  /* One card, placed by its auto margins (bottom, or centred). Reversed so a card taller than the
     screen (landscape phones) still opens at its bottom (the buttons) and scrolls up to its top:
     justify-content: flex-end pushed the overflow above the top, where nothing could reach it. */
  flex-direction: column-reverse;
  align-items: center;
  padding: max(64px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  overflow-y: auto;
  pointer-events: none;
}
.panel[hidden] {
  display: none;
}
.card {
  pointer-events: auto;
  width: min(440px, 100%);
  margin-top: auto;
  background: rgba(29, 18, 56, 0.92);
  border: 3px solid var(--ink);
  border-radius: 24px;
  box-shadow: 0 6px 0 var(--ink), 0 20px 50px rgba(0, 0, 0, 0.45);
  padding: 16px;
  display: grid;
  gap: 10px;
  backdrop-filter: blur(6px);
  animation: rise 0.25s ease-out;
}
.panel.center .card {
  margin: auto;
}
@keyframes rise {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
}
h1,
h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
}
.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.86;
  font-size: 58px;
  font-style: italic;
  letter-spacing: -1px;
  margin-top: -2px;
}
.logo span:first-child {
  color: var(--pink);
  text-shadow: 0 4px 0 var(--ink), 0 0 18px rgba(255, 95, 162, 0.7);
}
.logo span:last-child {
  color: var(--cyan);
  text-shadow: 0 4px 0 var(--ink), 0 0 18px rgba(53, 224, 255, 0.7);
}
.tag {
  margin: 0;
  text-align: center;
  opacity: 0.85;
}
.event {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(53, 224, 255, 0.2), rgba(255, 95, 162, 0.2));
  border: 2px solid rgba(53, 224, 255, 0.5);
}
.event b {
  font-family: var(--display);
  font-weight: 900;
  color: var(--cyan);
}
.event span {
  font-size: 13px;
  opacity: 0.9;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.row > .btn {
  flex: 1 1 0;
}
.row > .btn.wide {
  flex-basis: 100%;
}
.row.head h2 {
  margin-right: auto;
}
.stats {
  justify-content: center;
}
.tier {
  font: 900 13px/1 var(--display);
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--tier);
  color: var(--ink);
  border: 2px solid var(--ink);
}
.rp {
  font-family: var(--display);
  font-weight: 900;
}
.rp.neg {
  color: #ff9ec7;
}
.coins {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--display);
  font-weight: 900;
  color: var(--gold);
}
.coin {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff4b0, var(--gold) 45%, #c88a00);
  border: 2px solid var(--ink);
  vertical-align: -2px;
}
.btn {
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 3px solid var(--ink);
  background: var(--violet);
  box-shadow: 0 4px 0 var(--ink);
  font-weight: 700;
  transition: transform 0.06s;
}
.btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}
.btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.btn.primary {
  background: var(--pink);
  color: var(--ink);
}
.btn.big {
  min-height: 60px;
  font: 900 22px/1 var(--display);
  font-style: italic;
}
.stages {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.stage {
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 7px 2px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: rgba(20, 11, 38, 0.6);
  min-height: 64px;
}
.stage b {
  font: 900 18px/1 var(--display);
}
.stage span {
  font-size: 11px;
  line-height: 1.1;
  text-align: center;
}
.stage small {
  font-size: 10px;
  opacity: 0.7;
}
.stage.on {
  border-color: var(--lime);
  box-shadow: 0 0 0 2px var(--lime) inset;
}
.stage:disabled {
  opacity: 0.5;
}
.how {
  margin: 0;
  padding-left: 22px;
  font-size: 13px;
  opacity: 0.9;
}
.result {
  text-align: center;
  font-size: 42px;
  font-style: italic;
  color: var(--gold);
  text-shadow: 0 4px 0 var(--ink);
}
.result.zapped {
  color: var(--red);
}
.sub {
  margin: 0;
  text-align: center;
  font-size: 13px;
  opacity: 0.85;
}
.rewards {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  font-size: 20px;
}
.note {
  margin: 0;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(182, 255, 59, 0.14);
  font-size: 13px;
  text-align: center;
}
.table {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 3px;
}
.table li {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 10px;
  background: rgba(20, 11, 38, 0.55);
  font-size: 14px;
}
.table li.me {
  background: rgba(255, 95, 162, 0.3);
  outline: 2px solid var(--pink);
}
.table li.zapped em {
  color: var(--red);
}
.table small {
  font-size: 11px;
  opacity: 0.65;
}
.table b {
  font-family: var(--display);
}
.table em {
  font-style: normal;
  opacity: 0.9;
}
.ladder-list {
  max-height: 38vh;
  overflow-y: auto;
}
.meter {
  height: 12px;
  border-radius: 99px;
  background: rgba(20, 11, 38, 0.7);
  border: 2px solid var(--ink);
  overflow: hidden;
}
.meter i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--pink), var(--cyan));
}
.preview {
  width: 100%;
  height: 170px;
  border-radius: 16px;
  background: radial-gradient(circle at 50% 80%, rgba(255, 95, 162, 0.35), transparent 60%), rgba(20, 11, 38, 0.6);
}
.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.tab {
  min-height: 40px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  font-size: 12px;
  line-height: 1.1;
}
.tab.on {
  background: var(--cyan);
  color: var(--ink);
  border-color: var(--ink);
}
.items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.item {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 8px 4px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: rgba(20, 11, 38, 0.6);
  min-height: 62px;
}
.item b {
  font-size: 12px;
  line-height: 1.1;
}
.item small {
  font-size: 11px;
  opacity: 0.8;
}
.item.on {
  border-color: var(--pink);
  box-shadow: 0 0 0 2px var(--pink) inset;
}
.item.eq small {
  color: var(--lime);
  opacity: 1;
}
.swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--ink);
}
.pause {
  text-align: center;
}
.pause p {
  margin: 0;
}

@media (min-width: 900px) {
  .panel {
    padding-top: 24px;
  }
  .card {
    margin: auto;
  }
  .panel.title {
    align-items: flex-start;
    padding-left: 5vw;
  }
  .panel.title .card {
    margin: auto 0;
    width: min(400px, 34vw);
  }
  .coach {
    font-size: 26px;
  }
}
@media (max-height: 700px) {
  .how {
    display: none;
  }
  .logo {
    font-size: 44px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .card {
    animation: none;
  }
  .beats i {
    transition: none;
  }
}

/* ---------- accessibility, daily streak, desktop keys ---------- */
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 3px;
}
.streak {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.streak .dots {
  display: flex;
  gap: 3px;
}
.streak .dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--gold);
}
.streak .dots i.on {
  background: var(--gold);
}
.streak small {
  font-size: 12px;
  line-height: 1.3;
}
.streak small .coin {
  width: 11px;
  height: 11px;
  margin-right: 2px;
}
.streak small b {
  white-space: nowrap;
}
.keys {
  margin: 0;
  text-align: center;
  font-size: 12px;
  opacity: 0.8;
}
kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 1px 5px;
  margin: 0 1px;
  border-radius: 6px;
  border: 2px solid rgba(245, 236, 255, 0.5);
  font: 700 11px/1.3 var(--body);
  text-align: center;
}

/* ---------- pushing ---------- */
.push {
  position: absolute;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(64px, calc(env(safe-area-inset-bottom) + 52px));
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: rgba(42, 24, 80, 0.9);
  box-shadow: 0 4px 0 var(--ink);
  font: 900 italic 18px/1 var(--display);
  color: var(--paper);
  pointer-events: auto;
  touch-action: none;
  display: grid;
  place-content: center;
  gap: 2px;
  opacity: 0.6;
}
.push[hidden] {
  display: none;
}
.push.ready {
  background: var(--amber);
  color: var(--ink);
  opacity: 1;
  animation: pushpulse 0.5s ease-in-out infinite alternate;
}
.push small {
  font-size: 13px;
}
@keyframes pushpulse {
  to {
    transform: scale(1.08);
    box-shadow: 0 4px 0 var(--ink), 0 0 18px var(--amber);
  }
}
@media (prefers-reduced-motion: reduce) {
  .push.ready {
    animation: none;
  }
}

/* ---------- online rounds ---------- */
.panel.lobby .card,
.panel.results .card.online {
  animation: none;
}
.code-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.code-row span {
  opacity: 0.75;
}
.code {
  font: 900 34px/1 var(--display);
  letter-spacing: 0.12em;
  color: var(--lime);
  text-shadow: 0 3px 0 var(--ink);
  user-select: text;
  -webkit-user-select: text;
}
.code-row .btn {
  margin-left: auto;
  min-height: 42px;
}
.seats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.seats li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 6px;
  border-radius: 999px;
  background: rgba(53, 224, 255, 0.16);
  outline: 2px solid rgba(53, 224, 255, 0.5);
}
.seats li.me {
  background: rgba(255, 95, 162, 0.3);
  outline-color: var(--pink);
}
.seats li.bots {
  background: none;
  outline: 2px dashed rgba(255, 255, 255, 0.25);
  padding-left: 10px;
  opacity: 0.8;
}
.seats .swatch {
  width: 16px;
  height: 16px;
}
.round-clock {
  margin: 0;
  text-align: center;
  font: 900 italic 20px/1.2 var(--display);
  color: var(--amber);
  text-shadow: 0 2px 0 var(--ink);
}
.round-clock:empty {
  display: none;
}
.name-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.name-row span {
  opacity: 0.75;
  white-space: nowrap;
}
.name-row input,
.join-row input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 3px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font: 700 17px/1 var(--body);
  user-select: text;
  -webkit-user-select: text;
}
.join-row {
  display: flex;
  gap: 8px;
}
.join-row input {
  font: 900 22px/1 var(--display);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.table li.human span {
  color: var(--cyan);
}
.table li.friend span {
  color: var(--lime);
}
.panel.results .table {
  max-height: 34vh;
  overflow-y: auto;
}
.seats li.friend {
  background: rgba(182, 255, 59, 0.16);
  outline-color: rgba(182, 255, 59, 0.6);
}
.seats li.away {
  opacity: 0.6;
}
.seats li small {
  font-size: 11px;
  opacity: 0.8;
}
#party-status small {
  opacity: 0.7;
}

/* Short phones (320x568): a tighter results card, so the usual one fits under the menu button
   (its heading used to open behind it). Longer ones (tutorial notes, "Next" stage) still scroll. */
@media (max-height: 620px) {
  .panel.results .card {
    gap: 7px;
    padding: 12px;
  }
  .panel.results .result {
    font-size: 32px;
  }
  .panel.results .table li {
    padding-block: 3px;
  }
  .panel.results .row > .btn {
    padding-inline: 6px;
  }
}
