:root {
  --bg-deep: #050818;
  --bg-mid: #0c1430;
  --panel: rgba(8, 14, 31, 0.78);
  --panel-border: rgba(173, 223, 255, 0.22);
  --text: #edf7ff;
  --muted: #9ab6d8;
  --accent: #7af7d6;
  --accent-strong: #ffcf70;
  --danger: #f472b6;
  --shadow: rgba(0, 0, 0, 0.45);
  --safe-top-ui: calc(env(safe-area-inset-top) + 16px);
  --safe-bottom-ui: calc(env(safe-area-inset-bottom) + 16px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-deep);
  background:
    radial-gradient(circle at top left, rgba(18, 65, 120, 0.4), transparent 34%),
    radial-gradient(circle at 75% 18%, rgba(14, 173, 173, 0.22), transparent 24%),
    linear-gradient(160deg, var(--bg-deep), var(--bg-mid) 52%, #050610);
  color: var(--text);
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
}

body {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at top left, rgba(18, 65, 120, 0.4), transparent 34%),
    radial-gradient(circle at 75% 18%, rgba(14, 173, 173, 0.22), transparent 24%),
    linear-gradient(160deg, var(--bg-deep), var(--bg-mid) 52%, #050610);
}

#game {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  touch-action: none;
}

.hidden {
  display: none !important;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  padding:
    calc(22px + env(safe-area-inset-top))
    calc(18px + env(safe-area-inset-right))
    calc(22px + env(safe-area-inset-bottom))
    calc(18px + env(safe-area-inset-left));
  background: linear-gradient(
    180deg,
    rgba(2, 5, 13, 0.4),
    rgba(2, 5, 13, 0.78)
  );
  backdrop-filter: blur(4px);
  overflow-y: auto;
}

.overlay-menu {
  background:
    radial-gradient(circle at 50% 18%, rgba(65, 156, 255, 0.2), transparent 24%),
    radial-gradient(circle at center, rgba(17, 40, 88, 0.34), transparent 42%),
    linear-gradient(180deg, rgba(2, 5, 13, 0.35), rgba(2, 5, 13, 0.7));
}

.overlay-menu.menu-replay .hero-stage,
.overlay-menu.menu-replay .hero-stage-stars,
.overlay-menu.menu-replay .hero-stage-ring,
.overlay-menu.menu-replay .hero-stage-core,
.overlay-menu.menu-replay .hero-stage-comet,
.overlay-menu.menu-replay .hero-content,
.overlay-menu.menu-replay .start-button,
.overlay-menu.menu-replay .start-button::after {
  animation: none !important;
}

.panel {
  width: min(920px, 100%);
  padding: 30px;
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(11, 19, 39, 0.9), rgba(8, 13, 27, 0.8)),
    var(--panel);
  box-shadow:
    0 24px 90px var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.overlay:not(.hidden) .panel {
  animation: overlayPanelIn 560ms cubic-bezier(0.18, 0.9, 0.32, 1) both;
}

.overlay:not(.hidden) .eyebrow {
  animation: overlayItemIn 520ms 80ms cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.overlay:not(.hidden) h1,
.overlay:not(.hidden) h2 {
  animation: overlayItemIn 560ms 130ms cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.overlay:not(.hidden) .hero-copy {
  animation: overlayItemIn 560ms 190ms cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.overlay:not(.hidden) .hero-pill-row,
.overlay:not(.hidden) .result-hero {
  animation: overlayItemIn 560ms 240ms cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.overlay:not(.hidden) .instruction-grid,
.overlay:not(.hidden) .results-board {
  animation: overlayItemIn 580ms 300ms cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.overlay:not(.hidden) .button-row {
  animation: overlayItemIn 580ms 360ms cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.hero-panel {
  position: relative;
  width: min(920px, 100%);
  min-height: 100vh;
  min-height: 100svh;
  min-height: min(900px, calc(100dvh - 44px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(28px, 4vw, 40px);
  border-color: rgba(173, 223, 255, 0.16);
  background:
    radial-gradient(circle at 50% 14%, rgba(88, 168, 255, 0.16), transparent 26%),
    linear-gradient(180deg, rgba(6, 12, 28, 0.58), rgba(5, 9, 20, 0.3));
}

.end-panel {
  max-width: 760px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

h1,
h2 {
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.02em;
}

h1 {
  font-size: clamp(3rem, 9vw, 5.8rem);
  line-height: 0.95;
  text-shadow: 0 18px 42px rgba(3, 8, 20, 0.42);
}

h2 {
  font-size: clamp(2.2rem, 6vw, 3.4rem);
}

.hero-copy {
  margin: 16px 0 24px;
  max-width: 58ch;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.12rem);
  line-height: 1.55;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(100%, 560px);
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.overlay:not(.hidden) .hero-content {
  animation: overlayItemIn 620ms 190ms cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.hero-subtext {
  margin: 14px 0 26px;
  max-width: 22ch;
  color: rgba(237, 247, 255, 0.86);
  font-size: clamp(1.02rem, 2.2vw, 1.22rem);
  line-height: 1.4;
}

.hero-stage {
  position: absolute;
  inset: 0;
  margin: 0;
  border-radius: inherit;
  overflow: hidden;
  background:
    radial-gradient(circle at 52% 62%, rgba(122, 247, 214, 0.22), transparent 16%),
    radial-gradient(circle at 50% 50%, rgba(36, 83, 176, 0.24), transparent 42%),
    radial-gradient(circle at 18% 12%, rgba(255, 207, 112, 0.1), transparent 20%),
    linear-gradient(180deg, rgba(11, 22, 45, 0.96), rgba(5, 11, 25, 0.92));
  animation: heroStageGlow 7s ease-in-out infinite;
  pointer-events: none;
}

.overlay:not(.hidden) .hero-stage {
  animation:
    overlayItemIn 620ms 140ms cubic-bezier(0.2, 0.9, 0.3, 1) both,
    heroStageGlow 7s 620ms ease-in-out infinite;
}

.hero-stage::before,
.hero-stage::after {
  content: "";
  position: absolute;
  inset: auto;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.hero-stage::before {
  width: 420px;
  height: 420px;
  top: -170px;
  right: -120px;
  background: rgba(255, 255, 255, 0.05);
}

.hero-stage::after {
  width: 320px;
  height: 320px;
  bottom: -120px;
  left: -80px;
  background: rgba(122, 247, 214, 0.08);
}

.hero-stage-stars,
.hero-stage-ring,
.hero-stage-core,
.hero-stage-comet {
  position: absolute;
}

.hero-stage-stars {
  inset: 0;
  background-repeat: repeat;
}

.hero-stage-stars-far {
  background-image:
    radial-gradient(circle at 12% 22%, rgba(255, 255, 255, 0.52) 0 1px, transparent 1.5px),
    radial-gradient(circle at 72% 16%, rgba(173, 223, 255, 0.44) 0 1px, transparent 1.6px),
    radial-gradient(circle at 36% 78%, rgba(255, 239, 193, 0.34) 0 1.1px, transparent 1.7px),
    radial-gradient(circle at 88% 62%, rgba(122, 247, 214, 0.28) 0 1px, transparent 1.6px);
  background-size: 260px 260px, 320px 320px, 290px 290px, 360px 360px;
  opacity: 0.62;
  animation: heroStarDriftFar 28s linear infinite;
}

.hero-stage-stars-near {
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.84) 0 1.4px, transparent 2px),
    radial-gradient(circle at 64% 44%, rgba(255, 207, 112, 0.5) 0 1.5px, transparent 2.1px),
    radial-gradient(circle at 82% 78%, rgba(122, 247, 214, 0.44) 0 1.4px, transparent 2px),
    radial-gradient(circle at 42% 12%, rgba(255, 155, 209, 0.42) 0 1.4px, transparent 2px);
  background-size: 180px 180px, 240px 240px, 220px 220px, 260px 260px;
  opacity: 0.44;
  animation: heroStarDriftNear 18s linear infinite;
}

.hero-stage-ring {
  border: 2px solid rgba(180, 230, 255, 0.3);
  border-radius: 50%;
}

.hero-stage-ring::before,
.hero-stage-ring::after {
  content: "";
  position: absolute;
  display: block;
  border-radius: 50%;
}

.hero-stage-ring-outer {
  width: 640px;
  height: 640px;
  top: 50%;
  left: 50%;
  border-color: rgba(138, 248, 255, 0.1);
  transform: translate(-50%, -50%) rotate(-10deg);
  animation: heroOrbitOuter 30s linear infinite;
}

.hero-stage-ring-large {
  width: 390px;
  height: 390px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(12deg);
  animation: heroOrbitLarge 24s linear infinite;
}

.hero-stage-ring-small {
  width: 228px;
  height: 228px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-18deg);
  border-color: rgba(255, 207, 112, 0.42);
  animation: heroOrbitSmall 16s linear infinite;
}

.hero-stage-ring-inner {
  width: 124px;
  height: 124px;
  top: 50%;
  left: 50%;
  border-color: rgba(122, 247, 214, 0.44);
  transform: translate(-50%, -50%) rotate(22deg);
  animation: heroOrbitInner 11s linear infinite;
}

.hero-stage-ring-large::before {
  top: -7px;
  left: 50%;
  width: 14px;
  height: 14px;
  background: linear-gradient(135deg, #f6fbff, #8af8ff);
  box-shadow: 0 0 22px rgba(138, 248, 255, 0.6);
  transform: translateX(-50%);
}

.hero-stage-ring-large::after {
  right: 46px;
  bottom: 26px;
  width: 10px;
  height: 10px;
  background: linear-gradient(135deg, #ffefc1, #ffcf70);
  box-shadow: 0 0 18px rgba(255, 207, 112, 0.55);
}

.hero-stage-ring-small::before {
  left: 14px;
  top: 14px;
  width: 10px;
  height: 10px;
  background: linear-gradient(135deg, #9ff2c3, #7af7d6);
  box-shadow: 0 0 18px rgba(122, 247, 214, 0.5);
}

.hero-stage-ring-small::after {
  right: 12px;
  bottom: 18px;
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, #ffc8ea, #ff9bd1);
  box-shadow: 0 0 14px rgba(255, 155, 209, 0.45);
}

.hero-stage-ring-inner::before {
  top: 10px;
  right: 18px;
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, #f6fbff, #9ff2c3);
  box-shadow: 0 0 18px rgba(159, 242, 195, 0.5);
}

.hero-stage-ring-inner::after {
  left: 18px;
  bottom: 10px;
  width: 6px;
  height: 6px;
  background: linear-gradient(135deg, #ffefc1, #ff9bd1);
  box-shadow: 0 0 14px rgba(255, 155, 209, 0.45);
}

.hero-stage-core {
  width: 72px;
  height: 72px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: linear-gradient(135deg, #f6fbff, #8af8ff 52%, #7af7d6);
  box-shadow:
    0 0 0 22px rgba(122, 247, 214, 0.08),
    0 0 90px rgba(122, 247, 214, 0.38);
  animation: heroCorePulse 2.8s ease-in-out infinite;
}

.hero-stage-comet {
  top: 50%;
  left: 50%;
  width: 148px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 207, 112, 0.96));
  transform-origin: left center;
  box-shadow: 0 0 34px rgba(255, 207, 112, 0.34);
  animation: heroCometSweep 4.8s ease-in-out infinite;
}

.hero-stage-comet-secondary {
  width: 124px;
  height: 18px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(122, 247, 214, 0.94));
  box-shadow: 0 0 28px rgba(122, 247, 214, 0.3);
  animation-duration: 5.6s;
  animation-delay: -2.1s;
}

.button-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.action-row {
  display: grid;
  width: 100%;
  gap: 12px;
}

.action-row-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.action-row-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.action-button {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-height: 94px;
  padding: 14px 12px;
  border-radius: 20px;
  text-align: center;
}

.button-glyph {
  display: block;
  font-size: 1.45rem;
  line-height: 1;
}

.button-text {
  display: block;
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.start-button {
  position: relative;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 82px;
  max-width: min(100%, 420px);
  padding: 18px 28px;
  border-radius: 999px;
  font-size: 1.08rem;
  background: linear-gradient(135deg, #ffefc1 0%, #ffcf70 32%, #86ffe0 100%);
  color: #05111c;
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    0 24px 48px rgba(12, 25, 48, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.24) inset,
    0 0 36px rgba(255, 207, 112, 0.28);
  animation: startButtonFloat 2.4s ease-in-out infinite;
}

.start-button::before,
.start-button::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.start-button::before {
  inset: 2px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.04));
  opacity: 0.8;
  z-index: -2;
}

.start-button::after {
  inset: -16% -28%;
  background: linear-gradient(110deg, transparent 24%, rgba(255, 255, 255, 0.68) 48%, transparent 72%);
  transform: translateX(-120%) skewX(-16deg);
  z-index: -1;
  animation: startButtonSheen 2.9s ease-in-out infinite;
}

.overlay:not(.hidden) .start-button {
  animation:
    overlayItemIn 620ms 420ms cubic-bezier(0.2, 0.9, 0.3, 1) both,
    startButtonFloat 2.4s 620ms ease-in-out infinite;
}

.start-button .button-glyph {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(5, 17, 28, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    0 10px 18px rgba(5, 17, 28, 0.18);
  font-size: 1.12rem;
}

.start-button .button-text {
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.start-button:hover {
  transform: translateY(-2px) scale(1.01);
}

.start-button:active {
  transform: scale(0.985);
}

.overlay-menu.launching::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 70%, rgba(255, 245, 214, 0.34), transparent 38%);
  animation: menuLaunchFlash 620ms ease-out both;
  pointer-events: none;
  z-index: 3;
}

.overlay-menu.launching .hero-stage {
  animation: heroStageLaunch 620ms cubic-bezier(0.2, 0.9, 0.28, 1) both;
}

.overlay-menu.launching .hero-stage-ring {
  animation: heroLaunchRing 620ms cubic-bezier(0.18, 0.9, 0.28, 1) both;
}

.overlay-menu.launching .hero-stage-stars-far,
.overlay-menu.launching .hero-stage-stars-near {
  animation: heroLaunchStars 620ms ease-in both;
}

.overlay-menu.launching .hero-stage-core {
  animation: heroLaunchCore 620ms cubic-bezier(0.2, 0.9, 0.28, 1) both;
}

.overlay-menu.launching .hero-stage-comet {
  animation: heroLaunchComet 620ms cubic-bezier(0.2, 0.9, 0.28, 1) both;
}

.overlay-menu.launching .hero-content {
  animation: heroContentLaunch 520ms cubic-bezier(0.2, 0.9, 0.28, 1) both;
}

.overlay-menu.launching .start-button {
  animation: startButtonIgnite 540ms cubic-bezier(0.22, 0.9, 0.26, 1) both;
}

.overlay-menu.launching .start-button::after {
  animation: none;
}

.end-copy {
  margin-bottom: 14px;
}

.result-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 0 0 22px;
}

.result-hero strong {
  font-size: clamp(4.2rem, 14vw, 7rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
}

.result-hero-time-label {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.result-hero-time {
  color: rgba(237, 247, 255, 0.92);
  font-size: clamp(1.05rem, 2.8vw, 1.45rem);
  font-variant-numeric: tabular-nums;
}

.results-board {
  margin: 0 0 24px;
  padding: 14px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.results-header,
.result-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 110px 78px 86px;
  gap: 12px;
  align-items: center;
}

.results-header {
  padding: 0 10px 10px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.results-list {
  display: grid;
  gap: 8px;
}

.result-row {
  padding: 12px 10px;
  border-radius: 16px;
  background: rgba(7, 12, 28, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
}

.result-row.is-human {
  border-color: rgba(122, 247, 214, 0.26);
  background: rgba(10, 30, 38, 0.45);
}

.result-place {
  font-weight: 800;
  color: var(--accent);
}

.result-name {
  font-weight: 700;
}

.result-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.result-time,
.result-rings,
.result-deaths {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 180ms ease,
    filter 180ms ease,
    background 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.button:active {
  transform: translateY(1px);
}

.button.primary {
  background: linear-gradient(135deg, #8af8ff, #7af7d6 58%, #d5ff8b);
  color: #06121e;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.hud {
  position: absolute;
  top: var(--safe-top-ui);
  left: calc(12px + env(safe-area-inset-left));
  right: calc(12px + env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.hud-top-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.hud-card {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 56px;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(7, 12, 28, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.hud-stat-card {
  width: fit-content;
  max-width: min(46vw, 240px);
}

.hud-time-card {
  grid-column: 2;
  justify-self: center;
  justify-content: center;
  text-align: center;
}

.hud-position-card {
  grid-column: 3;
  justify-self: end;
  justify-content: flex-end;
  text-align: right;
}

.hud-card strong {
  display: block;
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-pause-button {
  appearance: none;
  position: fixed;
  top: var(--safe-top-ui);
  left: calc(12px + env(safe-area-inset-left));
  display: grid;
  place-items: center;
  width: 56px;
  min-width: 56px;
  min-height: 56px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  background: rgba(7, 12, 28, 0.76);
  color: var(--text);
  font: inherit;
  font-size: 1.18rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  pointer-events: auto;
  transition:
    transform 160ms ease,
    filter 160ms ease,
    background 160ms ease;
}

.hud-pause-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.hud-pause-button:active {
  transform: translateY(1px);
}

.hud-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  color: var(--accent);
  font-size: 1rem;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.hud-label {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#timer,
#position {
  font-variant-numeric: tabular-nums;
}

#timer {
  min-width: 6.3ch;
  overflow: visible;
  text-align: center;
  text-overflow: clip;
}

#position {
  min-width: 3.4ch;
  text-align: right;
}

.status-feed {
  position: fixed;
  top: calc(var(--safe-top-ui) + 72px);
  left: calc(12px + env(safe-area-inset-left));
  right: calc(12px + env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 0;
}

.status-feed:empty {
  display: none;
}

.status-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: min(88vw, 680px);
  color: rgba(237, 247, 255, 0.96);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-shadow:
    0 3px 20px rgba(0, 0, 0, 0.48),
    0 0 22px rgba(7, 12, 28, 0.3);
  animation: statusLineLife 5000ms linear both;
  animation-delay: calc(var(--status-age, 0ms) * -1);
}

.status-line-icon {
  color: var(--accent-strong);
}

.status-line.is-warning .status-line-icon {
  color: #ffb0c9;
}

.powerup-dock {
  position: fixed;
  right: calc(92px + env(safe-area-inset-right));
  bottom: calc(var(--safe-bottom-ui) + 30px);
  z-index: 7;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  pointer-events: none;
}

.powerup-slot {
  --powerup-rgb: 122, 247, 214;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(260px, calc(100vw - 120px));
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(7, 12, 28, 0.72);
  border: 1px solid rgba(var(--powerup-rgb), 0.16);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.2),
    0 0 24px rgba(var(--powerup-rgb), 0.1);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.powerup-slot:not(.is-empty) {
  animation: powerupDockGlow 2200ms ease-in-out infinite;
}

.powerup-slot-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.24), transparent 42%),
    rgba(var(--powerup-rgb), 0.18);
  color: rgba(237, 247, 255, 0.98);
  font-size: 1rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 20px rgba(var(--powerup-rgb), 0.18);
}

.powerup-slot-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.powerup-slot-copy strong {
  display: block;
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.powerup-slot-copy span {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.15;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.powerup-slot.is-empty {
  opacity: 0.82;
}

.powerup-slot.is-active {
  box-shadow:
    0 16px 38px rgba(0, 0, 0, 0.22),
    0 0 38px rgba(var(--powerup-rgb), 0.18);
}

.powerup-activate-desktop,
.powerup-activate-mobile {
  --powerup-rgb: 122, 247, 214;
  appearance: none;
  border: 1px solid rgba(var(--powerup-rgb), 0.26);
  background: rgba(7, 12, 28, 0.82);
  color: var(--text);
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.22),
    0 0 24px rgba(var(--powerup-rgb), 0.14);
  pointer-events: auto;
  transition:
    transform 160ms ease,
    filter 160ms ease,
    opacity 160ms ease,
    border-color 160ms ease;
}

.powerup-activate-desktop {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 16px 0 12px;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.powerup-activate-desktop:hover,
.powerup-activate-mobile:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.powerup-activate-desktop:active,
.powerup-activate-mobile:active {
  transform: translateY(1px);
}

.powerup-activate-desktop.is-disabled,
.powerup-activate-mobile.is-disabled {
  opacity: 0.42;
  filter: saturate(0.7);
}

.powerup-activate-desktop:not(.is-disabled),
.powerup-activate-mobile.is-ready {
  animation: powerupButtonPulse 1800ms ease-in-out infinite;
}

.powerup-activate-key {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(var(--powerup-rgb), 0.2);
  color: rgba(237, 247, 255, 0.96);
  font-size: 0.9rem;
  font-weight: 800;
}

.powerup-activate-text {
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.powerup-activate-mobile {
  position: fixed;
  right: calc(14px + env(safe-area-inset-right));
  bottom: calc(var(--safe-bottom-ui) + 18px);
  z-index: 8;
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  padding: 0;
  border-radius: 50%;
  font: inherit;
  font-size: 1.8rem;
  font-weight: 800;
  cursor: pointer;
  overflow: visible;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.28), transparent 34%),
    radial-gradient(circle at center, rgba(var(--powerup-rgb), 0.28), rgba(7, 12, 28, 0.9) 72%);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.3),
    0 0 34px rgba(var(--powerup-rgb), 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.powerup-activate-mobile::before,
.powerup-activate-mobile::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  pointer-events: none;
}

.powerup-activate-mobile::before {
  background: radial-gradient(circle, rgba(var(--powerup-rgb), 0.22), rgba(var(--powerup-rgb), 0));
  filter: blur(8px);
  opacity: 0.9;
}

.powerup-activate-mobile::after {
  border: 1px solid rgba(var(--powerup-rgb), 0.28);
  animation: powerupOrbHalo 2200ms ease-out infinite;
}

.powerup-activate-mobile.is-active {
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.3),
    0 0 42px rgba(var(--powerup-rgb), 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.powerup-activate-mobile.is-passive {
  opacity: 0.9;
  pointer-events: none;
  animation: none;
}

.powerup-activate-mobile.is-passive::after {
  animation-duration: 3200ms;
  opacity: 0.52;
}

.pause-panel {
  max-width: 460px;
  text-align: center;
}

.pause-panel .hero-copy {
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 860px) {
  .panel {
    padding: 24px;
    border-radius: 22px;
  }

  .hud {
    gap: 6px;
  }

  .hud-card strong {
    font-size: 1.16rem;
  }

  .hud-pause-button {
    width: 52px;
    min-width: 52px;
    min-height: 52px;
  }

  .results-header,
  .result-row {
    grid-template-columns: 60px minmax(0, 1fr) 94px 64px 72px;
    gap: 10px;
  }
}

@media (max-width: 720px) {
  .end-panel {
    width: min(100%, 560px);
  }

  .result-hero {
    margin-bottom: 18px;
  }

  .result-hero strong {
    font-size: clamp(3.4rem, 18vw, 5.4rem);
  }

  .results-board {
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: 0;
  }

  .results-header {
    display: none;
  }

  .results-list {
    gap: 10px;
  }

  .result-row {
    grid-template-columns: 56px minmax(0, 1fr) auto auto;
    grid-template-areas:
      "place name time time"
      "place name rings deaths";
    gap: 8px 12px;
    min-width: 0;
    padding: 12px;
    border-radius: 18px;
  }

  .result-row > :nth-child(1) {
    grid-area: place;
    align-self: center;
  }

  .result-row > :nth-child(2) {
    grid-area: name;
    min-width: 0;
  }

  .result-row > :nth-child(3) {
    grid-area: time;
  }

  .result-row > :nth-child(4) {
    grid-area: rings;
  }

  .result-row > :nth-child(5) {
    grid-area: deaths;
  }

  .result-place {
    font-size: 1.08rem;
  }

  .result-meta {
    margin-top: 2px;
    font-size: 0.76rem;
  }

  .result-time,
  .result-rings,
  .result-deaths {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 4px;
    font-size: 0.88rem;
  }

  .result-rings::before,
  .result-deaths::before {
    color: var(--muted);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .result-rings::before {
    content: "Rings";
  }

  .result-deaths::before {
    content: "Deaths";
  }
}

@media (max-width: 620px), (max-height: 760px) {
  .overlay {
    place-items: center;
  }

  .overlay-menu {
    padding: 0;
    align-items: stretch;
  }

  .panel {
    padding: 18px;
    border-radius: 20px;
  }

  .hero-panel {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    padding:
      calc(28px + env(safe-area-inset-top))
      calc(18px + env(safe-area-inset-right))
      calc(18px + env(safe-area-inset-bottom) + max(10px, env(safe-area-inset-bottom)))
      calc(18px + env(safe-area-inset-left));
    border-radius: 0;
    background:
      radial-gradient(circle at 50% 14%, rgba(122, 247, 214, 0.12), transparent 28%),
      linear-gradient(180deg, rgba(8, 14, 30, 0.82), rgba(5, 10, 22, 0.4));
  }

  .hero-panel h1 {
    font-size: clamp(2.9rem, 14vw, 4.2rem);
  }

  .hero-content {
    width: 100%;
  }

  .hero-stage {
    border-radius: 0;
  }

  .hero-subtext {
    margin: 14px 0 20px;
    max-width: 18ch;
    font-size: 0.98rem;
    line-height: 1.34;
  }

  .start-button {
    width: 100%;
    max-width: none;
    min-height: 78px;
    padding: 18px 22px;
    font-size: 1.05rem;
    box-shadow:
      0 22px 40px rgba(12, 25, 48, 0.38),
      0 0 0 1px rgba(255, 255, 255, 0.2) inset,
      0 0 30px rgba(255, 207, 112, 0.3);
  }

  .start-button .button-glyph {
    width: 42px;
    height: 42px;
  }

  .hud {
    top: calc(env(safe-area-inset-top) + 14px);
    left: calc(8px + env(safe-area-inset-left));
    right: calc(8px + env(safe-area-inset-right));
    gap: 6px;
  }

  .hud-top-row {
    gap: 8px;
  }

  .hud-card {
    gap: 6px;
    min-height: 58px;
    padding: 11px 14px;
    border-radius: 999px;
  }

  .hud-stat-card {
    max-width: min(48vw, 228px);
  }

  .hud-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 1rem;
  }

  .hud-pause-button {
    top: calc(env(safe-area-inset-top) + 14px);
    left: calc(8px + env(safe-area-inset-left));
    width: 54px;
    min-width: 54px;
    min-height: 54px;
    border-radius: 50%;
    font-size: 1.08rem;
  }

  .status-feed {
    top: calc(env(safe-area-inset-top) + 82px);
    left: calc(8px + env(safe-area-inset-left));
    right: calc(8px + env(safe-area-inset-right));
  }

  .hud-label {
    display: none;
  }

  .hud-card strong {
    font-size: 1.24rem;
  }

  .status-line {
    max-width: min(92vw, 620px);
    font-size: 1rem;
  }

  .powerup-dock {
    left: calc(10px + env(safe-area-inset-left));
    right: calc(90px + env(safe-area-inset-right));
    bottom: calc(env(safe-area-inset-bottom) + 18px);
    transform: none;
  }

  .powerup-slot {
    width: min(200px, calc(100vw - 116px));
    padding: 9px 11px;
  }

  .powerup-slot-icon {
    width: 30px;
    height: 30px;
    font-size: 0.92rem;
  }

  .powerup-slot-copy strong {
    font-size: 0.7rem;
  }

  .powerup-slot-copy span {
    font-size: 0.62rem;
  }

  .powerup-dock {
    right: calc(90px + env(safe-area-inset-right));
    bottom: calc(env(safe-area-inset-bottom) + 24px);
  }

  .powerup-activate-mobile {
    right: calc(10px + env(safe-area-inset-right));
    bottom: calc(env(safe-area-inset-bottom) + 14px);
    width: 78px;
    height: 78px;
    font-size: 1.7rem;
  }

  .action-row {
    gap: 10px;
  }

  .action-button {
    min-height: 88px;
    padding: 12px 10px;
    border-radius: 18px;
  }

  .button-text {
    font-size: 0.78rem;
  }

  .results-board {
    overflow-x: visible;
  }
}

@media (max-height: 700px) {
  .hero-panel {
    padding:
      calc(18px + env(safe-area-inset-top))
      calc(16px + env(safe-area-inset-right))
      calc(14px + env(safe-area-inset-bottom) + max(8px, env(safe-area-inset-bottom)))
      calc(16px + env(safe-area-inset-left));
  }

  .hero-panel h1 {
    font-size: clamp(2.45rem, 11vh, 3.6rem);
  }

  .hero-subtext {
    margin: 12px 0 16px;
    font-size: 0.9rem;
    line-height: 1.28;
  }

  .start-button {
    min-height: 64px;
    margin-top: 4px;
    padding: 14px 18px;
    font-size: 1rem;
  }
}

@media (max-height: 620px) {
  .hero-subtext {
    margin-bottom: 14px;
    font-size: 0.84rem;
  }

  .start-button {
    min-height: 60px;
  }
}

@keyframes heroOrbitOuter {
  from {
    transform: translate(-50%, -50%) rotate(-10deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(350deg);
  }
}

@keyframes heroOrbitLarge {
  from {
    transform: translate(-50%, -50%) rotate(12deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(372deg);
  }
}

@keyframes heroOrbitSmall {
  from {
    transform: translate(-50%, -50%) rotate(-18deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(-378deg);
  }
}

@keyframes heroOrbitInner {
  from {
    transform: translate(-50%, -50%) rotate(22deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(382deg);
  }
}

@keyframes heroStarDriftFar {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(-18px, 24px, 0) scale(1.04);
  }
}

@keyframes heroStarDriftNear {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(28px, -24px, 0) scale(1.08);
  }
}

@keyframes heroCorePulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow:
      0 0 0 22px rgba(122, 247, 214, 0.08),
      0 0 90px rgba(122, 247, 214, 0.38);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow:
      0 0 0 34px rgba(122, 247, 214, 0.06),
      0 0 120px rgba(122, 247, 214, 0.5);
  }
}

@keyframes heroCometSweep {
  0%,
  100% {
    transform: translate(-50%, -50%) rotate(-28deg) translateX(24px) scale(0.96);
    opacity: 0.62;
  }
  50% {
    transform: translate(-50%, -50%) rotate(8deg) translateX(210px) scale(1.08);
    opacity: 1;
  }
}

@keyframes heroStageGlow {
  0%,
  100% {
    filter: saturate(1) brightness(1);
  }
  50% {
    filter: saturate(1.08) brightness(1.05);
  }
}

@keyframes startButtonFloat {
  0%,
  100% {
    transform: translateY(0) scale(1);
    box-shadow:
      0 24px 48px rgba(12, 25, 48, 0.38),
      0 0 0 1px rgba(255, 255, 255, 0.24) inset,
      0 0 36px rgba(255, 207, 112, 0.28);
  }
  50% {
    transform: translateY(-3px) scale(1.012);
    box-shadow:
      0 30px 56px rgba(12, 25, 48, 0.42),
      0 0 0 1px rgba(255, 255, 255, 0.28) inset,
      0 0 54px rgba(255, 207, 112, 0.34);
  }
}

@keyframes startButtonSheen {
  0%,
  22% {
    transform: translateX(-120%) skewX(-16deg);
  }
  40%,
  100% {
    transform: translateX(140%) skewX(-16deg);
  }
}

@keyframes menuLaunchFlash {
  0% {
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes heroStageLaunch {
  0% {
    transform: scale(1);
    filter: saturate(1) brightness(1);
  }
  100% {
    transform: scale(1.12);
    filter: saturate(1.2) brightness(1.18);
  }
}

@keyframes heroLaunchRing {
  0% {
    opacity: 1;
    filter: brightness(1);
  }
  100% {
    opacity: 0;
    filter: brightness(1.6);
  }
}

@keyframes heroLaunchStars {
  0% {
    opacity: 0.6;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.16);
  }
}

@keyframes heroLaunchCore {
  0% {
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.2);
    opacity: 0;
  }
}

@keyframes heroLaunchComet {
  0% {
    opacity: 0.94;
  }
  100% {
    opacity: 0;
    filter: brightness(1.4);
  }
}

@keyframes heroContentLaunch {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-18px) scale(0.96);
  }
}

@keyframes startButtonIgnite {
  0% {
    transform: scale(1);
    box-shadow:
      0 24px 48px rgba(12, 25, 48, 0.38),
      0 0 0 1px rgba(255, 255, 255, 0.24) inset,
      0 0 36px rgba(255, 207, 112, 0.28);
  }
  50% {
    transform: scale(1.08);
    box-shadow:
      0 32px 64px rgba(12, 25, 48, 0.44),
      0 0 0 1px rgba(255, 255, 255, 0.34) inset,
      0 0 110px rgba(255, 207, 112, 0.58);
  }
  100% {
    transform: scale(0.86);
    box-shadow:
      0 10px 24px rgba(12, 25, 48, 0.2),
      0 0 0 1px rgba(255, 255, 255, 0.12) inset,
      0 0 0 rgba(255, 207, 112, 0);
    opacity: 0;
  }
}

@keyframes powerupDockGlow {
  0%,
  100% {
    transform: translateY(0);
    box-shadow:
      0 14px 32px rgba(0, 0, 0, 0.2),
      0 0 26px rgba(var(--powerup-rgb), 0.12);
  }
  50% {
    transform: translateY(-2px);
    box-shadow:
      0 18px 40px rgba(0, 0, 0, 0.24),
      0 0 40px rgba(var(--powerup-rgb), 0.22);
  }
}

@keyframes powerupButtonPulse {
  0%,
  100% {
    box-shadow:
      0 14px 32px rgba(0, 0, 0, 0.22),
      0 0 24px rgba(var(--powerup-rgb), 0.14);
  }
  50% {
    box-shadow:
      0 18px 40px rgba(0, 0, 0, 0.26),
      0 0 42px rgba(var(--powerup-rgb), 0.24);
  }
}

@keyframes powerupOrbHalo {
  0% {
    transform: scale(0.9);
    opacity: 0.72;
  }
  70% {
    transform: scale(1.18);
    opacity: 0;
  }
  100% {
    transform: scale(1.18);
    opacity: 0;
  }
}

@keyframes statusLineLife {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  10%,
  72% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

@keyframes overlayPanelIn {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes overlayItemIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
