:root {
  --ink: #17142f;
  --paper: #fffaf3;
  --white: #ffffff;
  --pink: #ff4f9a;
  --pink-soft: #ffd5e8;
  --cyan: #42d7d0;
  --cyan-soft: #c9f6f3;
  --yellow: #ffdf54;
  --yellow-soft: #fff2ad;
  --purple: #846df4;
  --purple-soft: #ddd6ff;
  --orange: #ff934f;
  --orange-soft: #ffe0ca;
  --green: #63d48d;
  --green-soft: #d3f7df;
  --blue: #5895ff;
  --coral: #ff746b;
  --lime: #b8e64a;
  --lavender: #bd92ff;
  --danger: #ff6262;
  --shadow: 0 22px 70px rgb(23 20 47 / 18%);
  --shadow-small: 0 10px 28px rgb(23 20 47 / 15%);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 17px;
  --border: 3px solid var(--ink);
}

.language-switch {
  display: flex;
  flex: none;
  gap: 3px;
  margin-left: auto;
  margin-right: 14px;
  padding: 4px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
  box-shadow: 3px 3px 0 var(--ink);
}

.phone-header .language-switch {
  margin-right: 10px;
}

.language-switch button {
  border: 0;
  border-radius: 999px;
  padding: 6px 9px;
  background: transparent;
  font-size: 12px;
  font-weight: 900;
}

.language-switch button.active {
  background: var(--ink);
  color: var(--white);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-rounded, "Arial Rounded MT Bold", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  margin: 0;
}

button,
input {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

[v-cloak] {
  display: none !important;
}

.about-games-link {
  display: inline-block;
  margin-top: 18px;
  padding-block: 8px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 750;
  text-underline-offset: 4px;
}

.about-games-link:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 4px;
}

.brand-lockup {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: block;
  flex: none;
  width: 50px;
  height: 50px;
  transform: rotate(-5deg);
}

.brand-name {
  font-size: 17px;
  font-weight: 1000;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand-lockup-small {
  gap: 9px;
}

.brand-lockup-small .brand-mark {
  width: 39px;
  height: 39px;
}

.brand-lockup-small .brand-name {
  font-size: 13px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  font-size: clamp(12px, 1.15vw, 16px);
  font-weight: 950;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.sticker {
  transform: rotate(-1deg);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 10px 15px;
  box-shadow: 3px 3px 0 var(--ink);
}

.sticker-yellow {
  background: var(--yellow);
}

.sticker-cyan {
  background: var(--cyan);
}

.sticker-pink {
  background: var(--pink);
  color: var(--white);
}

.pulse-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgb(99 212 141 / 65%);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 10px rgb(99 212 141 / 0%);
  }
  100% {
    box-shadow: 0 0 0 0 rgb(99 212 141 / 0%);
  }
}

/* Shared accents */
.accent-pink {
  --accent: var(--pink);
  --accent-soft: var(--pink-soft);
}

.accent-cyan {
  --accent: var(--cyan);
  --accent-soft: var(--cyan-soft);
}

.accent-yellow {
  --accent: var(--yellow);
  --accent-soft: var(--yellow-soft);
}

.accent-purple {
  --accent: var(--purple);
  --accent-soft: var(--purple-soft);
}

.accent-orange {
  --accent: var(--orange);
  --accent-soft: var(--orange-soft);
}

.accent-green {
  --accent: var(--green);
  --accent-soft: var(--green-soft);
}

.accent-blue {
  --accent: var(--blue);
  --accent-soft: #d9e6ff;
}

.accent-coral {
  --accent: var(--coral);
  --accent-soft: #ffd8d4;
}

.accent-lime {
  --accent: var(--lime);
  --accent-soft: #ecf9c9;
}

.accent-lavender {
  --accent: var(--lavender);
  --accent-soft: #eadcff;
}

/* TV */
.tv-body {
  overflow: hidden;
  background:
    linear-gradient(rgb(255 255 255 / 72%), rgb(255 255 255 / 72%)),
    radial-gradient(circle at 20% 20%, var(--pink-soft), transparent 38%),
    radial-gradient(circle at 80% 80%, var(--cyan-soft), transparent 36%),
    var(--paper);
}

.tv-body::before {
  position: fixed;
  z-index: 0;
  inset: 0;
  background-image:
    linear-gradient(rgb(23 20 47 / 4%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(23 20 47 / 4%) 1px, transparent 1px);
  background-size: 42px 42px;
  content: "";
  pointer-events: none;
}

.tv-app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  overflow: hidden;
}

.ambient {
  position: absolute;
  z-index: -1;
  width: 320px;
  height: 320px;
  border: 4px solid var(--ink);
  border-radius: 42% 58% 70% 30% / 39% 35% 65% 61%;
  opacity: 0.15;
  animation: ambient-float 12s ease-in-out infinite alternate;
}

.ambient-one {
  top: -190px;
  left: 36%;
  background: var(--pink);
}

.ambient-two {
  right: -180px;
  bottom: -190px;
  background: var(--yellow);
  animation-delay: -5s;
}

@keyframes ambient-float {
  to {
    transform: translate(20px, 15px) rotate(15deg);
  }
}

.tv-header {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 90px;
  padding: 22px clamp(28px, 4vw, 68px) 0;
}

.tv-room-status {
  display: flex;
  align-items: center;
  gap: 18px;
}

.room-population {
  margin: 0;
  font-size: 14px;
  font-weight: 850;
  white-space: nowrap;
}

.room-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 8px 10px 8px 16px;
  background: rgb(255 255 255 / 82%);
  box-shadow: 3px 3px 0 var(--ink);
  backdrop-filter: blur(12px);
}

.room-pill span {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.room-pill strong {
  border-radius: 999px;
  padding: 7px 13px;
  background: var(--ink);
  color: var(--white);
  font-size: 20px;
  letter-spacing: 0.13em;
}

.connection-banner {
  position: fixed;
  z-index: 20;
  top: 17px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 11px;
  transform: translateX(-50%);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 10px 17px;
  background: var(--white);
  box-shadow: var(--shadow-small);
  font-size: 13px;
  font-weight: 850;
}

.tv-stage {
  position: relative;
  display: grid;
  min-height: calc(100vh - 90px);
  padding: clamp(30px, 4.5vh, 65px) clamp(38px, 6vw, 100px) 55px;
}

.pairing-stage,
.lobby-stage {
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.65fr);
  align-items: center;
  gap: clamp(45px, 7vw, 110px);
}

.hero-copy h1,
.lobby-main h1,
.heist-heading h1,
.result-copy h1,
.resolution-card h1,
.execution-countdown h1 {
  max-width: 900px;
  margin: 24px 0 20px;
  font-size: clamp(54px, 6.8vw, 118px);
  font-weight: 1000;
  letter-spacing: -0.075em;
  line-height: 0.88;
}

.hero-copy h1 em,
.lobby-main h1 em {
  color: var(--pink);
  font-style: normal;
  text-shadow: 4px 4px 0 var(--ink);
  -webkit-text-stroke: 2px var(--ink);
}

.hero-copy > p,
.lobby-deck,
.planning-instruction,
.result-copy > p,
.resolution-card p,
.execution-countdown p {
  max-width: 780px;
  margin: 0;
  font-size: clamp(21px, 2vw, 34px);
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.28;
}

.three-beats {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 35px;
}

.three-beats span {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: clamp(15px, 1.4vw, 22px);
  font-weight: 850;
}

.three-beats b {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--cyan);
}

.qr-card {
  position: relative;
  justify-self: center;
  transform: rotate(1.5deg);
  border: 4px solid var(--ink);
  border-radius: var(--radius-xl);
  padding: 24px;
  background: var(--white);
  box-shadow: 12px 12px 0 var(--ink);
  text-align: center;
}

.qr-card img {
  display: block;
  width: min(28vw, 340px);
  max-width: 100%;
  aspect-ratio: 1;
  border-radius: 19px;
  background: var(--white);
}

.qr-card h2 {
  margin: 18px 0 4px;
  font-size: clamp(23px, 2vw, 35px);
  font-weight: 1000;
  letter-spacing: -0.045em;
}

.qr-card p {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}

.qr-spark {
  position: absolute;
  display: grid;
  width: 55px;
  height: 55px;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 50%;
  font-size: 25px;
  pointer-events: none;
}

.qr-spark-one {
  top: -32px;
  right: -28px;
  transform: rotate(12deg);
  background: var(--pink);
  color: var(--white);
}

.qr-spark-two {
  bottom: -28px;
  left: -28px;
  background: var(--yellow);
}

.lobby-main {
  align-self: center;
}

.lobby-main h1 {
  font-size: clamp(50px, 6.1vw, 105px);
}

/* Shared game browser, controlled from the host phone. */
.game-selection-stage {
  grid-template-columns: minmax(0, 1fr) minmax(230px, 0.36fr);
  align-items: center;
  gap: clamp(28px, 4vw, 70px);
}

.game-picker {
  min-width: 0;
}

.game-picker-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.game-picker-count {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 850;
}

.game-preview {
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 2.4vw, 40px);
  background: var(--white);
  box-shadow: 7px 7px 0 var(--ink);
}

.game-preview-heading {
  display: flex;
  align-items: center;
  gap: 20px;
}

.game-preview-icon {
  flex: none;
  font-size: clamp(42px, 5vw, 76px);
}

.game-preview h1 {
  margin: 8px 0 12px;
  font-size: clamp(32px, 3.7vw, 62px);
  font-weight: 1000;
  letter-spacing: -0.055em;
  line-height: 1.02;
}

.game-player-count {
  display: inline-block;
  border-radius: 8px;
  padding: 5px 9px;
  background: var(--cyan-soft);
  font-size: clamp(13px, 1.2vw, 20px);
  font-weight: 800;
}

.game-preview-description {
  margin: 24px 0;
  font-size: clamp(18px, 1.65vw, 28px);
  font-weight: 700;
  line-height: 1.4;
}

.game-preview h2 {
  margin: 0 0 14px;
  font-size: clamp(17px, 1.5vw, 24px);
}

.game-preview-rules {
  display: grid;
  gap: 14px;
  margin: 0;
  padding-left: 1.4em;
  font-size: clamp(16px, 1.4vw, 23px);
  font-weight: 650;
  line-height: 1.4;
}

.game-preview-rules li::marker {
  color: var(--purple);
  font-weight: 950;
}

.game-picker-hint {
  margin: 22px 0 0;
  font-size: clamp(16px, 1.5vw, 24px);
  font-weight: 800;
  line-height: 1.4;
}

.game-selection-phone-screen .game-picker-heading {
  flex-wrap: wrap;
}

.game-selection-phone-screen .game-preview {
  padding: 20px;
}

.game-selection-phone-screen .game-preview-heading {
  gap: 13px;
}

.game-selection-phone-screen .game-preview h1 {
  font-size: 31px;
}

.game-picker-controls > p {
  margin: 22px 0 0;
  font-weight: 700;
  line-height: 1.4;
}

.game-picker-navigation {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.game-picker-navigation .secondary-button {
  gap: 10px;
  padding: 14px 12px;
  font-size: 15px;
}

.game-picker-controls > small {
  display: block;
  margin-top: 15px;
  line-height: 1.4;
}

.game-picker-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.game-picker-controls button:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 5px;
}

@media (max-height: 800px) and (min-width: 901px) {
  .game-selection-stage {
    padding-top: 22px;
    padding-bottom: 28px;
  }

  .game-selection-stage .game-preview {
    padding: 22px;
  }

  .game-selection-stage .game-preview h1 {
    font-size: 40px;
  }

  .game-selection-stage .game-preview-description {
    margin: 16px 0;
    font-size: 20px;
  }

  .game-selection-stage .game-preview-rules {
    gap: 10px;
    font-size: 18px;
  }
}

@media (max-width: 900px) {
  .game-selection-stage {
    grid-template-columns: minmax(0, 1fr);
  }

  .game-selection-stage .join-card {
    width: min(100%, 340px);
    justify-self: center;
  }
}

.game-guide {
  width: 100%;
  margin-top: 20px;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: var(--yellow-soft);
  box-shadow: 4px 4px 0 var(--ink);
  text-align: left;
}

.lobby-main .game-guide {
  max-width: 800px;
}

.join-panel .game-guide {
  max-width: 480px;
}

.game-guide summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 17px;
  cursor: pointer;
  font-size: 17px;
  font-weight: 950;
  list-style: none;
}

.game-guide summary::-webkit-details-marker {
  display: none;
}

.game-guide summary:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 2px;
}

.game-guide summary span {
  font-size: 23px;
  line-height: 1;
  transition: transform 150ms ease;
}

.game-guide[open] summary span {
  transform: rotate(45deg);
}

.game-guide-content {
  display: grid;
  gap: 15px;
  border-top: 2px solid var(--ink);
  padding: 17px;
}

.game-guide-content h3 {
  margin: 0 0 5px;
  font-size: 15px;
  font-weight: 950;
}

.game-guide-content p {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
}

.game-guide-content p + p {
  margin-top: 8px;
}

.crew-roster {
  display: grid;
  max-width: 950px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  margin-top: 35px;
}

.crew-chip {
  --accent: var(--cyan);
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 13px;
  border: 2px solid var(--ink);
  border-radius: 18px;
  padding: 10px 13px;
  background: var(--white);
  box-shadow: 4px 4px 0 var(--ink);
  transition: opacity 180ms ease;
}

.crew-chip.offline {
  opacity: 0.48;
}

.crew-avatar {
  display: grid;
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--accent);
  font-size: 13px;
  font-weight: 1000;
}

.crew-chip > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.crew-chip strong {
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crew-chip small {
  margin-top: 2px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.tv-host-note {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--white);
  font-size: clamp(14px, 1.25vw, 20px);
  font-weight: 750;
}

.join-card img {
  width: min(23vw, 280px);
}

.short-link {
  display: block;
  max-width: 280px;
  margin: 7px auto 0;
  overflow: hidden;
  font-size: clamp(13px, 1.2vw, 18px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-code-large {
  margin-top: 17px;
  border: 2px solid var(--ink);
  border-radius: 15px;
  padding: 9px 12px;
  background: var(--yellow);
  font-size: clamp(25px, 2.4vw, 38px);
  font-weight: 1000;
  letter-spacing: 0.16em;
}

.planning-stage {
  align-content: center;
}

.heist-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
}

.heist-heading h1 {
  margin-bottom: 0;
  font-size: clamp(48px, 5.5vw, 90px);
}

.target-badge {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  transform: rotate(2deg);
  border: 3px solid var(--ink);
  border-radius: 21px;
  padding: 15px 22px;
  background: var(--yellow);
  box-shadow: 6px 6px 0 var(--ink);
}

.target-badge span {
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.14em;
}

.target-badge strong {
  margin-top: 4px;
  font-size: clamp(18px, 1.7vw, 27px);
}

.planning-instruction {
  margin-top: 20px;
  font-size: clamp(18px, 1.55vw, 25px);
}

.plan-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(13px, 1.5vw, 24px);
  margin-top: clamp(28px, 4vh, 55px);
}

.plan-stage-card {
  --accent: var(--cyan);
  --accent-soft: var(--cyan-soft);
  position: relative;
  display: flex;
  min-height: clamp(230px, 30vh, 345px);
  flex-direction: column;
  align-items: flex-start;
  border: 3px solid var(--ink);
  border-radius: var(--radius-lg);
  padding: clamp(18px, 2vw, 29px);
  background: var(--white);
  box-shadow: 7px 7px 0 var(--ink);
}

.plan-stage-card::before {
  position: absolute;
  z-index: -1;
  top: -9px;
  right: -9px;
  bottom: 9px;
  left: 9px;
  border-radius: inherit;
  background: var(--accent);
  content: "";
}

.stage-number,
.stage-label {
  font-weight: 950;
  letter-spacing: 0.08em;
}

.stage-number {
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--accent);
  font-size: 11px;
}

.stage-label {
  margin-top: 12px;
  font-size: clamp(13px, 1.2vw, 18px);
  text-transform: uppercase;
}

.stage-icon {
  display: grid;
  width: clamp(70px, 7vw, 105px);
  height: clamp(70px, 7vw, 105px);
  place-items: center;
  margin: auto 0 16px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--accent-soft);
  font-size: clamp(33px, 3.5vw, 54px);
}

.stage-icon.muted {
  opacity: 0.26;
  filter: grayscale(1);
}

.plan-stage-card > strong {
  font-size: clamp(18px, 1.75vw, 29px);
  letter-spacing: -0.04em;
  line-height: 1;
}

.plan-stage-card > small {
  margin-top: 9px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.intel-reminder {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  margin-top: clamp(25px, 4vh, 45px);
  font-size: clamp(15px, 1.4vw, 21px);
  font-weight: 750;
}

.intel-reminder strong {
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--pink);
  color: var(--white);
}

.execution-stage {
  align-content: center;
}

.execution-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 35px;
  font-size: 20px;
  font-weight: 900;
}

.resolution-card {
  display: grid;
  width: min(1200px, 94%);
  min-height: 420px;
  grid-template-columns: minmax(160px, 0.32fr) 1fr;
  align-items: center;
  gap: clamp(30px, 5vw, 80px);
  justify-self: center;
  border: 4px solid var(--ink);
  border-radius: 40px;
  padding: clamp(35px, 5vw, 80px);
  background: var(--white);
  box-shadow: 14px 14px 0 var(--ink);
  animation: reveal-card 480ms cubic-bezier(0.16, 1, 0.3, 1);
}

.resolution-card.tone-success {
  background: var(--green-soft);
}

.resolution-card.tone-warning {
  background: var(--yellow-soft);
}

.resolution-card.tone-danger {
  background: #ffdada;
}

@keyframes reveal-card {
  from {
    transform: translateY(35px) rotate(-1deg) scale(0.96);
    opacity: 0;
  }
}

.resolution-icon {
  display: grid;
  width: clamp(150px, 16vw, 250px);
  aspect-ratio: 1;
  place-items: center;
  transform: rotate(-4deg);
  border: 4px solid var(--ink);
  border-radius: 35%;
  background: var(--white);
  box-shadow: 9px 9px 0 var(--ink);
  font-size: clamp(72px, 9vw, 145px);
}

.resolution-stage {
  font-size: clamp(12px, 1.1vw, 17px);
  font-weight: 950;
  letter-spacing: 0.16em;
}

.resolution-card h1 {
  margin: 13px 0 20px;
  font-size: clamp(42px, 5.3vw, 88px);
}

.resolution-card p {
  font-size: clamp(18px, 1.8vw, 29px);
}

.execution-countdown {
  justify-self: center;
  text-align: center;
}

.execution-countdown > span {
  display: block;
  font-size: clamp(100px, 15vw, 240px);
  animation: countdown-bob 1.2s ease-in-out infinite alternate;
}

@keyframes countdown-bob {
  to {
    transform: translateY(-12px) rotate(4deg);
  }
}

.execution-countdown h1 {
  max-width: 1000px;
  font-size: clamp(45px, 5.5vw, 90px);
}

.execution-track {
  display: flex;
  width: min(720px, 80%);
  gap: 10px;
  justify-self: center;
  margin-top: 42px;
}

.execution-track span {
  height: 10px;
  flex: 1;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
  transition: background 300ms ease;
}

.execution-track span.active {
  background: var(--pink);
}

.results-stage {
  grid-template-columns: minmax(300px, 0.65fr) minmax(0, 1.2fr);
  align-items: center;
  gap: clamp(50px, 8vw, 140px);
}

.score-orbit {
  display: grid;
  width: min(30vw, 430px);
  aspect-ratio: 1;
  place-items: center;
  justify-self: center;
  border: 4px dashed var(--ink);
  border-radius: 50%;
  animation: slow-spin 24s linear infinite;
}

@keyframes slow-spin {
  to {
    transform: rotate(360deg);
  }
}

.score-disc {
  display: flex;
  width: 76%;
  aspect-ratio: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 12px 12px 0 var(--ink);
  animation: counter-spin 24s linear infinite;
}

@keyframes counter-spin {
  to {
    transform: rotate(-360deg);
  }
}

.score-disc span,
.score-disc small {
  font-size: clamp(10px, 1vw, 14px);
  font-weight: 950;
  letter-spacing: 0.13em;
}

.score-disc strong {
  margin: -3px 0 -10px;
  font-size: clamp(78px, 9vw, 140px);
  font-weight: 1000;
  letter-spacing: -0.08em;
}

.result-copy h1 {
  font-size: clamp(52px, 6vw, 102px);
}

.result-stamps {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  margin-top: 31px;
}

.result-stamps span,
.phone-result-stamps span {
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 10px 14px;
  background: #ffdada;
  box-shadow: 4px 4px 0 var(--ink);
  font-size: clamp(14px, 1.3vw, 20px);
  font-weight: 950;
  letter-spacing: 0.05em;
}

.result-stamps span.yes,
.phone-result-stamps span.yes {
  background: var(--green);
}

/* Phone */
.phone-body {
  overflow-x: hidden;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 0 0, var(--purple-soft), transparent 32%),
    radial-gradient(circle at 100% 30%, var(--pink-soft), transparent 34%),
    var(--paper);
  overscroll-behavior: none;
}

.phone-body::before {
  position: fixed;
  z-index: 0;
  inset: 0;
  background-image: radial-gradient(rgb(23 20 47 / 11%) 1px, transparent 1px);
  background-size: 18px 18px;
  content: "";
  pointer-events: none;
}

.phone-app {
  position: relative;
  z-index: 1;
  width: min(100%, 640px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding-bottom: calc(35px + env(safe-area-inset-bottom));
}

.phone-app-pairing {
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}

.phone-app-pairing .phone-header {
  flex-shrink: 0;
}

.phone-noise {
  position: fixed;
  z-index: -1;
  inset: 0;
  opacity: 0.025;
  pointer-events: none;
}

.phone-header {
  position: relative;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: calc(13px + env(safe-area-inset-top)) 18px 12px;
}

.phone-room-status {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.phone-room-status .room-population {
  font-size: 11px;
}

.phone-room-code {
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 8px 11px;
  background: var(--white);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 13px;
  font-weight: 1000;
  letter-spacing: 0.14em;
}

.missing-room {
  display: flex;
  min-height: calc(100vh - 70px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 23px 55px;
  text-align: center;
}

.join-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2.5svh, 22px);
  padding: 18px 22px max(22px, env(safe-area-inset-bottom));
  text-align: center;
}

.join-intro {
  display: grid;
  width: 100%;
  max-width: 400px;
  justify-items: center;
  gap: 18px;
}

.join-intro .sticker {
  max-width: 100%;
  padding: 8px 12px;
  font-size: 10px;
  line-height: 1.3;
  letter-spacing: 0.1em;
}

.join-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 17px;
  width: 100%;
}

.join-icon {
  display: grid;
  flex: 0 0 64px;
  width: 64px;
  aspect-ratio: 1;
  place-items: center;
  transform: rotate(-5deg);
  margin: 0;
  border: var(--border);
  border-radius: 21px;
  background: var(--pink-soft);
  box-shadow: 5px 5px 0 var(--ink);
  font-size: 34px;
}

.join-panel h1 {
  min-width: 0;
  margin: 0;
  font-size: clamp(30px, 9vw, 40px);
  font-weight: 1000;
  letter-spacing: -0.055em;
  line-height: 1.02;
  text-align: left;
}

.missing-room h1 {
  margin: 12px 0;
  font-size: clamp(45px, 14vw, 70px);
  font-weight: 1000;
  letter-spacing: -0.07em;
  line-height: 0.92;
}

.join-intro > p {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.4;
}

.missing-room > p {
  max-width: 480px;
  margin: 5px 0 0;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.45;
}

.join-form {
  width: 100%;
  max-width: 400px;
  margin: 0;
  text-align: left;
}

.join-form label {
  display: block;
  margin: 0 0 7px 3px;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.join-form input {
  width: 100%;
  height: 52px;
  border: var(--border);
  border-radius: 17px;
  outline: 0;
  padding: 0 17px;
  background: var(--white);
  box-shadow: 5px 5px 0 var(--ink);
  font-size: 17px;
  font-weight: 750;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.join-form input:focus {
  transform: translate(2px, 2px);
  box-shadow: 3px 3px 0 var(--ink);
}

.join-form .primary-button {
  min-height: 54px;
  margin-top: 14px;
  padding: 10px 13px 10px 16px;
}

.join-form .primary-button b {
  min-width: 30px;
  height: 30px;
  border-radius: 10px;
}

.join-panel .form-error {
  max-width: 400px;
  margin: 0 !important;
}

.primary-button,
.secondary-button {
  display: flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  border: var(--border);
  border-radius: 17px;
  padding: 12px 15px 12px 19px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 950;
  text-align: left;
  text-decoration: none;
  transition: transform 100ms ease, box-shadow 100ms ease, opacity 100ms ease;
}

.primary-button {
  margin-top: 18px;
  background: var(--cyan);
  box-shadow: 6px 6px 0 var(--ink);
}

.primary-button-yellow {
  background: var(--yellow);
}

.primary-button-pink {
  background: var(--pink);
  color: var(--white);
}

.primary-button b,
.secondary-button b {
  display: grid;
  min-width: 35px;
  height: 35px;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 12px;
  font-size: 20px;
}

.primary-button:active,
.secondary-button:active,
.option-button:active,
.role-tabs button:active {
  transform: translate(4px, 4px);
  box-shadow: 1px 1px 0 var(--ink);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
  filter: grayscale(0.4);
}

.secondary-button {
  margin-top: 13px;
  background: var(--white);
  box-shadow: 5px 5px 0 var(--ink);
}

.form-error {
  width: 100%;
  max-width: 480px;
  margin-top: 20px !important;
  border: 2px solid var(--ink);
  border-radius: 13px;
  padding: 11px 13px;
  background: #ffdada;
  color: #931c1c;
  font-size: 14px !important;
  font-weight: 800 !important;
}

.tiny-promise {
  margin: 0;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.08em;
  line-height: 1.4;
  opacity: 0.6;
}

@media (max-height: 600px) {
  .phone-app-pairing .join-panel {
    gap: 12px;
    padding-top: 10px;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }

  .phone-app-pairing .join-intro {
    gap: 12px;
  }

  .phone-app-pairing .join-panel h1 {
    font-size: 30px;
  }

  .phone-app-pairing .join-icon {
    flex-basis: 52px;
    width: 52px;
    border-radius: 17px;
    font-size: 28px;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .phone-app-pairing {
    width: min(100%, 900px);
  }

  .phone-app-pairing .join-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-content: center;
    column-gap: 28px;
    padding-inline: max(22px, env(safe-area-inset-left)) max(22px, env(safe-area-inset-right));
  }

  .phone-app-pairing .join-intro {
    grid-row: 1 / 4;
  }

  .phone-app-pairing .join-form,
  .phone-app-pairing .form-error,
  .phone-app-pairing .tiny-promise {
    grid-column: 2;
  }
}

.phone-connection-banner {
  position: sticky;
  z-index: 20;
  top: calc(8px + env(safe-area-inset-top));
  display: flex;
  width: calc(100% - 34px);
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 auto -42px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--white);
  box-shadow: var(--shadow-small);
  font-size: 13px;
  font-weight: 850;
}

.phone-screen {
  padding: 17px 17px 35px;
}

.phone-hero-card,
.intel-panel,
.phone-stage,
.waiting-card {
  border: var(--border);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: 6px 6px 0 var(--ink);
}

.phone-hero-card {
  position: relative;
  overflow: hidden;
  padding: 25px;
  background:
    radial-gradient(circle at 100% 0, var(--yellow) 0 14%, transparent 14.5%),
    var(--white);
}

.phone-hero-card::after {
  position: absolute;
  right: -40px;
  bottom: -55px;
  width: 150px;
  height: 150px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--pink-soft);
  content: "";
}

.phone-hero-icon {
  position: relative;
  z-index: 2;
  margin-top: 24px;
  font-size: 67px;
}

.phone-hero-card h1,
.phone-mission-header h1,
.watch-tv-screen h1,
.phone-results-screen h1 {
  position: relative;
  z-index: 2;
  margin: 7px 0 9px;
  font-size: clamp(37px, 11vw, 58px);
  font-weight: 1000;
  letter-spacing: -0.065em;
  line-height: 0.96;
}

.phone-hero-card p,
.phone-mission-header p,
.watch-tv-screen p,
.phone-results-screen > p {
  position: relative;
  z-index: 2;
  max-width: 410px;
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.4;
}

.host-actions {
  margin-top: 22px;
}

.share-feedback {
  margin: 13px 0 0;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.waiting-card {
  margin-top: 22px;
  padding: 22px;
  background: var(--cyan-soft);
  text-align: center;
}

.waiting-card.compact {
  margin-top: 0;
  padding: 15px;
}

.waiting-card strong {
  display: block;
  font-size: 18px;
}

.waiting-card p {
  margin: 5px 0 0;
  font-size: 14px;
  font-weight: 650;
}

.waiting-icon {
  display: block;
  margin-bottom: 7px;
  font-size: 34px;
}

.phone-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 32px 3px 12px;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.12em;
}

.phone-section-heading strong {
  border-radius: 999px;
  padding: 5px 8px;
  background: var(--ink);
  color: var(--white);
}

.phone-crew-list {
  display: grid;
  gap: 9px;
}

.phone-crew-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 2px solid var(--ink);
  border-radius: 16px;
  padding: 9px 11px;
  background: var(--white);
}

.phone-crew-row .crew-avatar {
  width: 39px;
  height: 39px;
  border-radius: 12px;
}

.phone-crew-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phone-crew-row small {
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.phone-mission-header {
  padding: 17px 5px 12px;
}

.phone-mission-header .eyebrow {
  font-size: 10px;
  opacity: 0.6;
}

.phone-mission-header h1 {
  font-size: clamp(33px, 9vw, 47px);
}

.intel-panel {
  margin-top: 16px;
  padding: 17px;
  background: var(--ink);
  color: var(--white);
}

.intel-panel .phone-section-heading {
  margin: 0 0 14px;
}

.intel-panel .phone-section-heading strong {
  background: var(--yellow);
  color: var(--ink);
}

.role-tabs {
  display: flex;
  gap: 8px;
  margin: 0 -3px 15px;
  flex-wrap: wrap;
  padding: 3px 3px 7px;
  scrollbar-width: none;
}

.role-tabs::-webkit-scrollbar {
  display: none;
}

.role-tabs button {
  --accent: var(--cyan);
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  border: 2px solid var(--white);
  border-radius: 999px;
  padding: 8px 11px;
  background: transparent;
  color: var(--white);
  font-size: 12px;
  font-weight: 850;
}

.role-tabs button.active {
  border-color: var(--ink);
  background: var(--accent);
  box-shadow: 3px 3px 0 var(--white);
  color: var(--ink);
}

.intel-stack {
  display: grid;
  gap: 11px;
}

.intel-card {
  --accent: var(--cyan);
  --accent-soft: var(--cyan-soft);
  border: 2px solid var(--white);
  border-radius: 17px;
  padding: 14px;
  background: var(--accent-soft);
  box-shadow: 4px 4px 0 var(--white);
  color: var(--ink);
}

.intel-role {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
}

.intel-role > span {
  font-size: 24px;
}

.intel-role strong {
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
}

.intel-role small {
  border-radius: 999px;
  padding: 4px 7px;
  background: var(--accent);
  font-size: 8px;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.intel-card p {
  margin: 11px 0 1px;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.38;
}

.plan-controls {
  margin-top: 31px;
}

.phone-stage {
  margin-bottom: 16px;
  padding: 16px;
}

.phone-stage-title {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 13px;
}

.phone-stage-title > span {
  --accent: var(--cyan);
  display: grid;
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--accent);
  font-size: 12px;
  font-weight: 950;
}

.phone-stage-title > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.phone-stage-title strong {
  font-size: 17px;
  font-weight: 950;
}

.phone-stage-title small {
  margin-top: 1px;
  font-size: 11px;
  font-weight: 650;
  opacity: 0.65;
}

.option-grid {
  display: grid;
  gap: 9px;
}

.option-button {
  --accent: var(--cyan);
  --accent-soft: var(--cyan-soft);
  display: grid;
  min-height: 70px;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  border: 2px solid var(--ink);
  border-radius: 15px;
  padding: 10px 12px;
  background: var(--white);
  box-shadow: 3px 3px 0 var(--ink);
  text-align: left;
}

.option-button > span {
  display: grid;
  width: 42px;
  height: 42px;
  grid-row: 1 / 3;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--accent-soft);
  font-size: 22px;
}

.option-button strong {
  align-self: end;
  font-size: 15px;
  font-weight: 950;
}

.option-button small {
  align-self: start;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.25;
  opacity: 0.67;
}

.option-button.selected {
  transform: translate(2px, 2px);
  background: var(--accent);
  box-shadow: 1px 1px 0 var(--ink), inset 0 0 0 2px var(--white);
}

.option-button.selected::after {
  align-self: center;
  justify-self: end;
  border: 2px solid var(--ink);
  border-radius: 50%;
  padding: 1px 4px;
  background: var(--white);
  content: "✓";
  font-size: 11px;
  font-weight: 1000;
  grid-column: 2;
  grid-row: 1 / 3;
}

.option-button.selected strong,
.option-button.selected small {
  padding-right: 30px;
}

.phone-bottom-action {
  position: sticky;
  z-index: 12;
  bottom: 0;
  margin: 19px -5px 0;
  padding: 8px 5px calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--paper) 22%);
}

.watch-tv-screen,
.phone-results-screen {
  display: flex;
  min-height: calc(100vh - 80px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.watch-orbit {
  display: grid;
  width: 180px;
  aspect-ratio: 1;
  place-items: center;
  margin-bottom: 32px;
  border: 3px dashed var(--ink);
  border-radius: 50%;
  animation: slow-spin 12s linear infinite;
}

.watch-orbit span {
  display: grid;
  width: 125px;
  aspect-ratio: 1;
  place-items: center;
  border: var(--border);
  border-radius: 35px;
  background: var(--cyan);
  box-shadow: 7px 7px 0 var(--ink);
  font-size: 62px;
  animation: counter-spin 12s linear infinite;
}

.watch-tv-screen h1,
.phone-results-screen h1 {
  margin-top: 22px;
}

.watch-tv-screen p,
.phone-results-screen > p {
  max-width: 430px;
}

.mini-score {
  display: flex;
  width: 150px;
  aspect-ratio: 1;
  align-items: baseline;
  justify-content: center;
  transform: rotate(-5deg);
  margin-bottom: 27px;
  border: var(--border);
  border-radius: 40px;
  background: var(--yellow);
  box-shadow: 8px 8px 0 var(--ink);
}

.mini-score strong {
  align-self: center;
  font-size: 63px;
  font-weight: 1000;
  letter-spacing: -0.08em;
}

.mini-score span {
  align-self: center;
  margin: 27px 0 0 3px;
  font-size: 12px;
  font-weight: 950;
}

.phone-result-stamps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 25px;
}

.phone-result-stamps span {
  border-width: 2px;
  border-radius: 12px;
  padding: 8px 10px;
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 12px;
}

.result-actions {
  width: 100%;
  margin-top: 30px;
}

.toast {
  position: fixed;
  z-index: 40;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  left: 20px;
  width: fit-content;
  max-width: min(500px, calc(100% - 40px));
  margin: 0 auto;
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 13px 16px;
  background: var(--danger);
  box-shadow: 5px 5px 0 var(--ink);
  color: var(--white);
  font-size: 14px;
  font-weight: 850;
  text-align: center;
}

.missing-room {
  min-height: 100vh;
}

.missing-room .brand-mark {
  margin-bottom: 25px;
}

.missing-room .join-icon {
  margin-top: 0;
}

.missing-room .primary-button {
  max-width: 420px;
  margin-top: 30px;
}

@media (max-width: 900px) and (orientation: landscape) {
  .tv-header {
    height: 70px;
    padding-top: 12px;
  }

  .tv-stage {
    min-height: calc(100vh - 70px);
    padding-top: 20px;
    padding-bottom: 25px;
  }

  .pairing-stage,
  .lobby-stage {
    grid-template-columns: 1fr 260px;
    gap: 35px;
  }

  .hero-copy h1,
  .lobby-main h1 {
    font-size: 55px;
  }

  .qr-card img,
  .join-card img {
    width: 190px;
  }

  .crew-roster {
    margin-top: 20px;
  }
}

@media (max-width: 700px) {
  .phone-app {
    width: 100%;
  }

  .sticker {
    padding: 8px 11px;
  }
}

@media (max-width: 380px) {
  .phone-header .brand-name {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Space Race: small SVG sprites and bounded effects keep the battlefield light. */
.race-display { width: min(96vw, 1500px); margin: 1rem auto; color: #f0f5ff; }
.race-topbar { display: flex; align-items: center; justify-content: space-between; gap: 2rem; margin-bottom: 16px; }
.race-title { display: flex; align-items: center; gap: 12px; color: #84eddb; }
.race-title > .race-sprite { width: 54px; height: 54px; }
.race-title div { display: grid; gap: 2px; }
.race-title small { color: #9cabc7; letter-spacing: .2em; font-size: 10px; font-weight: 800; }
.race-title strong { color: #f0f5ff; font-size: clamp(20px, 2.4vw, 34px); letter-spacing: -.04em; line-height: 1; }
.race-course-progress { width: min(32vw, 410px); }
.race-course-progress > div:first-child { display: flex; justify-content: space-between; margin-bottom: 7px; font-size: 11px; letter-spacing: .12em; font-weight: 800; color: #9cabc7; }
.race-course-progress b { color: #84eddb; font-variant-numeric: tabular-nums; }
.race-course-track { height: 8px; background: #24304a; border-radius: 8px; overflow: hidden; }
.race-course-track i { display: block; height: 100%; background: #84eddb; border-radius: inherit; }
.race-clock { display: flex; align-items: center; gap: 10px; padding: 7px 16px; border: 1px solid #394760; border-radius: 14px; background: #14213a; }
.race-clock strong { font-size: 36px; line-height: 1; font-variant-numeric: tabular-nums; color: #ffe1a4; }
.race-clock span { width: 52px; font-size: 10px; font-weight: 800; letter-spacing: .1em; color: #9cabc7; }
.race-clock.urgent { border-color: #ff748d; }.race-clock.urgent strong { color: #ff748d; }
.race-world { position: relative; overflow: hidden; isolation: isolate; height: min(55vh, 580px); min-height: 320px; border: 2px solid #44546e; border-radius: 22px; background: #081329; box-shadow: 0 12px 35px #0004; }
.race-nebula { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 65% 110%, #17505466, transparent 65%), radial-gradient(ellipse at 25% -15%, #41387788, transparent 60%); }
.race-sector-2 .race-nebula { background: radial-gradient(ellipse at 75% 110%, #66395366, transparent 65%), radial-gradient(ellipse at 10% -15%, #2d497d77, transparent 60%); }
.race-sector-3 .race-nebula { background: radial-gradient(ellipse at 70% 110%, #75402e77, transparent 65%), radial-gradient(ellipse at 15% -15%, #523a7266, transparent 60%); }
.race-stars { position: absolute; inset: 0; opacity: .42; background-image: radial-gradient(#d2e9ff 1px, transparent 1px), radial-gradient(#d2e9ff 1px, transparent 1px); background-size: 78px 81px, 117px 103px; background-position: 0 0, 40px 30px; animation: race-star-drift 4s linear infinite; }
@keyframes race-star-drift { to { background-position: -78px 0, -77px 30px; } }
.race-distant-planet { position: absolute; width: 150px; height: 150px; top: -85px; right: 22%; border-radius: 50%; background: #8095c414; border: 1px solid #b1d4ef22; box-shadow: inset -30px -8px #050f251f; }
.race-world::before, .race-world::after { content: ''; position: absolute; left: 0; right: 0; height: 3px; z-index: 2; background: repeating-linear-gradient(90deg, #85b6c1 0 24px, transparent 24px 45px); opacity: .4; }
.race-world::before { top: 0; }.race-world::after { bottom: 0; }
.race-sector-label { position: absolute; top: 14px; left: 18px; z-index: 2; display: flex; align-items: center; gap: 7px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #b8c8e3; pointer-events: none; }
.race-sector-label i { width: 5px; height: 5px; border-radius: 50%; background: #84eddb; }
.race-object, .race-shot, .race-ship, .race-finish, .race-effect { position: absolute; transform: translate(-50%, -50%); }
.race-sprite { display: block; width: 100%; height: 100%; overflow: visible; }
.race-object { width: clamp(32px, 3.2vw, 47px); height: clamp(32px, 3.2vw, 47px); z-index: 3; }
.race-large { width: clamp(48px, 4.8vw, 70px); height: clamp(48px, 4.8vw, 70px); }
.race-enemy { width: clamp(36px, 3.6vw, 52px); height: clamp(36px, 3.6vw, 52px); }
.race-boost, .race-life { width: 39px; height: 39px; }
.mine-core { animation: mine-pulse .85s ease-in-out infinite alternate; }@keyframes mine-pulse { to { opacity: .35; } }
.race-shot { width: 18px; height: 5px; border-radius: 6px; background: var(--shot-color); box-shadow: 0 0 7px var(--shot-color); transform: translate(-50%, -50%) rotate(var(--shot-angle)); z-index: 4; }
.race-ship { width: clamp(48px, 4.6vw, 67px); height: clamp(48px, 4.6vw, 67px); z-index: 5; color: var(--ship-color); }
.race-ship small { position: absolute; top: calc(100% - 6px); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 5px; max-width: 175px; white-space: nowrap; padding: 3px 7px 3px 3px; border: 1px solid var(--ship-color); border-radius: 7px; background: #0a142b; font-size: 11px; font-weight: 800; color: #f0f5ff; overflow: hidden; text-overflow: ellipsis; }
.race-ship small b { display: grid; place-items: center; min-width: 17px; height: 17px; border-radius: 4px; background: var(--ship-color); color: #10192d; font-size: 10px; }
.ship-flame { transform-origin: 23px 32px; animation: engine-flicker .18s alternate infinite; }.ship-flame-core { opacity: .9; }
@keyframes engine-flicker { to { transform: scaleX(.72); } }
.ship-shield { opacity: 0; }.race-ship.immune .ship-shield { opacity: .85; animation: shield-pulse .4s alternate infinite; }
@keyframes shield-pulse { to { opacity: .3; } }
.race-ship.boosting .ship-flame { fill: #84eddb; transform: scaleX(1.7); animation: none; }
.race-ship.behind { opacity: .5; }.race-ship.behind::before { content: '‹'; position: absolute; left: -8px; top: 14px; font-size: 24px; font-weight: 900; }
.race-finish { top: 0; bottom: 0; width: 12px; transform: translateX(-50%); background: repeating-conic-gradient(#f5f7ff 0 25%, #152742 0 50%) 0 0/12px 12px; border-inline: 1px solid #eaf7ff; z-index: 2; pointer-events: none; }
.race-finish > span { position: absolute; top: 46px; right: 20px; display: flex; align-items: center; gap: 7px; white-space: nowrap; padding: 7px 10px; background: #f5f7ff; border: 2px solid #152742; border-radius: 8px; color: #152742; font-size: 12px; font-weight: 900; letter-spacing: .08em; box-shadow: 0 3px 12px #0004; }
.race-effect { width: 12px; height: 12px; z-index: 6; pointer-events: none; }
.race-effect i { display: block; width: 100%; height: 100%; border: 3px solid var(--effect-color); border-radius: 50%; animation: race-burst .55s ease-out forwards; }
.race-effect.effect-pickup i { border-radius: 4px; }.race-effect.effect-hit i { border-width: 5px; }
@keyframes race-burst { from { transform: scale(.5); opacity: 1; } to { transform: scale(6); opacity: 0; } }
.race-overlay { position: absolute; inset: 0; z-index: 7; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: #edf5ff; background: #081329c7; text-align: center; }
.race-overlay small { font-size: 13px; font-weight: 800; letter-spacing: .22em; color: #84eddb; }.race-overlay > strong { font-size: clamp(80px, 13vw, 170px); line-height: 1.1; color: #ffe1a4; }.race-overlay > span { font-size: 16px; color: #b8c8e3; }
.race-result > strong { max-width: 90%; font-size: clamp(35px, 5vw, 75px); overflow-wrap: anywhere; margin: 15px 0; }
.race-legend { display: flex; justify-content: center; gap: 26px; flex-wrap: wrap; padding: 12px 0; color: #afbed6; font-size: 11px; }.race-legend span { display: flex; align-items: center; gap: 7px; }.race-legend i { width: 7px; height: 7px; border-radius: 2px; }.legend-danger { background: #ff8b9c; }.legend-large { background: #d8a47c; }.legend-pickup { background: #63ebae; }
.race-standings { display: flex; gap: 10px; flex-wrap: wrap; }
.race-standings article { flex: 1; min-width: 155px; display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid #34425d; border-top: 3px solid var(--ship-color); border-radius: 12px; background: #111d33; }
.race-rank { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 9px; background: var(--ship-color); color: #111d33; font-size: 19px; }
.race-standing-info { flex: 1; min-width: 0; }.race-standing-info > strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.race-standing-stats { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin: 2px 0 5px; }.race-lives { color: #ff8b9c; font-size: 16px; letter-spacing: 2px; }.race-lives em { color: #647591; font-style: normal; }.race-standing-stats small { color: #afbed6; font-size: 10px; font-variant-numeric: tabular-nums; }
.race-standing-track { height: 3px; border-radius: 4px; background: #29364f; overflow: hidden; }.race-standing-track i { display: block; height: 100%; background: var(--ship-color); }
.race-standings article.out { opacity: .5; }
@media (max-width: 700px) { .race-topbar { gap: 10px; }.race-title > .race-sprite { display: none; }.race-course-progress { width: 25vw; }.race-clock { padding: 7px; }.race-clock strong { font-size: 28px; }.race-clock span { display: none; }.race-legend { gap: 10px; }.race-world { min-height: 280px; }.race-ship small { font-size: 9px; } }
.race-assign-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 8px 0; padding: 10px; background: #fff; border: 2px solid #121530; border-radius: 12px; }.race-assign-row select { max-width: 60%; padding: 8px; border-radius: 8px; }
.race-phone { color: #fff; touch-action: none; }.race-phone header, .race-phone-status { display: flex; justify-content: space-between; gap: 8px; align-items: center; }.race-phone header { font-size: 1.15rem; }.race-phone-status { padding: 12px; margin: 12px 0; background: #171a3d; border-radius: 12px; font-weight: 900; }.race-phone-status span:first-child { color: #ff5c9d; }
.race-cruise-note { display: block; margin: -4px 0 8px; color: #53dce5; font-weight: 800; text-align: center; }
.race-controls { display: grid; gap: 20px; margin-top: 20px; }.race-controls.solo { grid-template-columns: 1fr 1fr; gap: 10px; }.pilot-controls, .gunner-controls { text-align: center; }.pilot-controls > strong, .gunner-controls > strong { display: block; margin-bottom: 12px; letter-spacing: .1em; }
.direction-pad { display: grid; grid-template-columns: 1fr; grid-template-rows: repeat(2, 62px); gap: 8px; }.direction-pad button, .pilot-actions button, .shoot-button { border: 2px solid #fff; border-radius: 12px; background: #253664; color: #fff; font-size: 24px; font-weight: 900; touch-action: none; user-select: none; }.direction-pad .up { grid-area: 1/1; }.direction-pad .down { grid-area: 2/1; }.direction-pad button.pressed, .pilot-actions button.pressed { background: #53dce5; color: #071029; transform: scale(.94); }.pilot-actions { display: flex; gap: 6px; margin-top: 10px; }.pilot-actions button { flex: 1; min-height: 55px; font-size: 14px; }.pilot-actions button:disabled { opacity: .4; }
.aim-pad { position: relative; width: min(48vw, 230px); aspect-ratio: 1; margin: auto; border-radius: 18px; border: 2px solid #7183af; background: #192747; touch-action: none; user-select: none; cursor: grab; }
.aim-pad.aiming { cursor: grabbing; border-color: #ffd45b; background: #223454; }
.aim-pad:focus-visible { outline: 3px solid #53dce5; outline-offset: 3px; }
.aim-pad[aria-disabled="true"] { opacity: .45; cursor: default; }
.aim-control { position: absolute; inset: 8%; width: 84%; height: 84%; overflow: visible; pointer-events: none; }
.aim-ship { fill: #617699; stroke: #bdcde8; stroke-width: 1.5; }
.aim-line, .aim-tip { fill: none; stroke: #ffd45b; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.aim-handle { fill: #ffd45b; fill-opacity: .12; stroke: #ffd45b; stroke-width: 1; }
.aiming .aim-handle { fill-opacity: .3; stroke-width: 2; }
.aim-pivot { fill: #fff4c7; stroke: #192747; stroke-width: 2; }
.aim-pad-label, .aim-pad-caption { position: absolute; left: 0; right: 0; pointer-events: none; font-size: 9px; font-weight: 800; letter-spacing: .06em; line-height: 1; }
.aim-pad-label { top: 7px; color: #fff4c7; }
.aim-pad-caption { bottom: 7px; color: #bacbeb; font-size: 8px; }
.shoot-button { width: 100%; margin-top: 12px; min-height: 66px; background: #ef4d83; }
.shoot-button:active { transform: scale(.95); background: #ffd45b; }
.shoot-button:disabled { opacity: .4; }
.gunner-controls small, .race-latency { display: block; margin-top: 8px; opacity: .7; }
.gunner-controls .gunner-fire-status { margin-top: 3px; color: #ffd45b; }
.race-phone-message { text-align: center; color: #ff5c9d; font-weight: 900; padding: 10px; }
@media (max-width: 600px) { .race-controls.solo .direction-pad { grid-template-rows: repeat(2, 54px); }.race-controls.solo .direction-pad button { font-size: 20px; }.race-controls.solo .pilot-actions { flex-direction: column; }.race-controls.solo .aim-pad { width: min(38vw, 170px); } }
