:root {
  color-scheme: dark;
  --ink: #f4fbff;
  --muted: #8aa1ad;
  --quiet: #7b929b;
  --cyan: #71ffe2;
  --cyan-bright: #c9fff4;
  --mint: #8fffc6;
  --gold: #ffd98a;
  --coral: #ff6b8d;
  --violet: #a783ff;
  --void: #030711;
  --panel: rgba(7, 14, 25, 0.74);
  --line: rgba(158, 223, 226, 0.16);
  --safe-top: max(16px, env(safe-area-inset-top));
  --safe-right: max(16px, env(safe-area-inset-right));
  --safe-bottom: max(16px, env(safe-area-inset-bottom));
  --safe-left: max(16px, env(safe-area-inset-left));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #02050b;
}

body {
  display: grid;
  place-items: center;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

button {
  color: inherit;
  font: inherit;
}

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

button:focus-visible {
  outline: 2px solid var(--cyan-bright);
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

.game-shell {
  position: relative;
  width: min(100vw, 980px);
  height: min(100vh, 920px);
  height: min(100dvh, 920px);
  min-height: 600px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 55%, rgba(14, 74, 80, 0.18), transparent 38%),
    linear-gradient(180deg, #06101b 0%, #030711 62%, #02040a 100%);
  border: 1px solid rgba(160, 223, 222, 0.12);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.72);
}

#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

.grain,
.edge-glow {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.grain {
  opacity: 0.16;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.34'/%3E%3C/svg%3E");
}

.edge-glow {
  box-shadow:
    inset 0 0 100px rgba(0, 0, 0, 0.65),
    inset 0 -120px 150px rgba(0, 0, 0, 0.34);
}

.hud {
  position: absolute;
  z-index: auto;
  top: var(--safe-top);
  left: var(--safe-left);
  right: var(--safe-right);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 18px;
  pointer-events: none;
}

.hud-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  letter-spacing: 0.18em;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  font-size: 10px;
  line-height: 1.05;
}

.brand-copy strong {
  font-weight: 800;
}

.brand-copy em {
  color: var(--cyan);
  font-style: normal;
  font-weight: 500;
}

.brand-orbit {
  position: relative;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(113, 255, 226, 0.5);
  border-radius: 50%;
  transform: rotate(-24deg) scaleY(0.48);
  box-shadow: 0 0 18px rgba(113, 255, 226, 0.12);
}

.brand-orbit::before,
.brand-orbit::after,
.brand-orbit i {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.brand-orbit::before {
  inset: 8px;
  background: var(--cyan-bright);
  box-shadow: 0 0 14px var(--cyan);
}

.brand-orbit::after {
  width: 5px;
  height: 5px;
  right: -2px;
  top: 13px;
  background: var(--coral);
  box-shadow: 0 0 10px var(--coral);
}

.hud-stats {
  display: flex;
  min-width: 296px;
  min-height: 48px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(12, 24, 37, 0.72), rgba(5, 12, 23, 0.45));
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(12px);
}

.stat-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 84px;
  padding: 8px 15px;
  text-align: center;
}

.stat-block + .stat-block {
  border-left: 1px solid var(--line);
}

.stat-block span,
.core-status > span,
.meter-heading span {
  color: var(--quiet);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.2em;
}

.stat-block strong {
  margin-top: 2px;
  color: #eafffb;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.13em;
}

.best-stat strong,
.phase-stat strong {
  color: var(--muted);
}

.hud-actions {
  position: relative;
  z-index: 40;
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  pointer-events: auto;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  cursor: pointer;
  background: rgba(6, 14, 24, 0.56);
  border: 1px solid var(--line);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.icon-button:hover:not(:disabled) {
  background: rgba(17, 36, 47, 0.72);
  border-color: rgba(113, 255, 226, 0.36);
}

.icon-button:active:not(:disabled) {
  transform: scale(0.96);
}

.icon-button:disabled {
  cursor: default;
  opacity: 0.32;
}

.icon-button[aria-pressed="true"]#effects-button {
  color: var(--gold);
  border-color: rgba(255, 217, 138, 0.3);
}

.icon-button[aria-pressed="true"]#sound-button .sound-on-icon,
.icon-button[aria-pressed="false"]#sound-button .sound-off-icon {
  display: block;
}

.icon-button[aria-pressed="true"]#sound-button .sound-off-icon,
.icon-button[aria-pressed="false"]#sound-button .sound-on-icon {
  display: none;
}

.game-shell.is-paused .hud-actions,
.game-shell.is-ending .hud-actions,
.game-shell.is-gameover .hud-actions {
  z-index: 10;
}

.icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button-label {
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.13em;
}

.run-status {
  position: absolute;
  z-index: 9;
  top: calc(var(--safe-top) + 66px);
  left: 50%;
  display: flex;
  align-items: center;
  gap: 26px;
  width: min(420px, calc(100% - 32px));
  padding: 10px 16px;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.game-shell.is-running .run-status,
.game-shell.is-paused .run-status,
.game-shell.is-ending .run-status {
  opacity: 1;
}

.core-status {
  display: flex;
  align-items: center;
  gap: 9px;
}

.core-pips {
  display: flex;
  gap: 5px;
}

.core-pips i {
  width: 14px;
  height: 7px;
  background: var(--cyan);
  border-radius: 6px 1px 6px 1px;
  box-shadow: 0 0 11px rgba(113, 255, 226, 0.55);
  transform: rotate(-12deg);
  transition: opacity 200ms ease, transform 300ms ease, background 200ms ease;
}

.core-pips i.is-empty {
  opacity: 0.18;
  background: var(--coral);
  box-shadow: none;
  transform: rotate(-12deg) scale(0.75);
}

.bloom-status {
  flex: 1;
}

.meter-heading {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.meter-heading strong {
  color: var(--gold);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.bloom-meter {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 3px;
  height: 5px;
  overflow: hidden;
  background: rgba(123, 159, 165, 0.1);
  border-radius: 99px;
}

.bloom-meter > span {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 0;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--gold));
  border-radius: inherit;
  box-shadow: 0 0 16px rgba(113, 255, 226, 0.7);
  transition: width 160ms ease-out;
}

.bloom-meter > i {
  position: relative;
  z-index: 1;
  border-right: 1px solid rgba(3, 7, 17, 0.7);
}

.phase-banner {
  position: absolute;
  z-index: 12;
  top: 23%;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 230px;
  padding: 10px 28px;
  transform: translate(-50%, -10px);
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(7, 21, 30, 0.76), transparent);
}

.phase-banner.is-visible {
  animation: phase-in 2.4s ease both;
}

.phase-banner small {
  color: var(--cyan);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.24em;
}

.phase-banner strong {
  margin-top: 4px;
  font-size: 15px;
  letter-spacing: 0.19em;
}

@keyframes phase-in {
  0% { opacity: 0; transform: translate(-50%, 12px); }
  18%, 72% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -8px); }
}

.tutorial-prompt {
  position: absolute;
  z-index: 11;
  bottom: max(92px, calc(var(--safe-bottom) + 70px));
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
  animation: prompt-breathe 1.6s ease-in-out infinite;
}

.tutorial-prompt strong {
  color: var(--cyan-bright);
  font-size: 11px;
  letter-spacing: 0.18em;
}

.tutorial-prompt span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.tutorial-prompt i {
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
}

@keyframes prompt-breathe {
  0%, 100% { opacity: 0.64; transform: translateX(-50%) translateY(0); }
  50% { opacity: 1; transform: translateX(-50%) translateY(-3px); }
}

kbd {
  min-width: 20px;
  padding: 3px 5px;
  color: var(--cyan-bright);
  font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: center;
  background: rgba(97, 153, 157, 0.12);
  border: 1px solid rgba(144, 211, 211, 0.24);
  border-radius: 5px;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.22);
}

.touch-controls {
  position: absolute;
  z-index: 15;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  left: max(18px, env(safe-area-inset-left));
  display: none;
  justify-content: space-between;
  pointer-events: none;
}

.lane-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 96px;
  min-height: 50px;
  color: rgba(218, 255, 249, 0.76);
  background: rgba(5, 16, 26, 0.58);
  border: 1px solid rgba(113, 255, 226, 0.22);
  border-radius: 15px;
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

.lane-button:active:not(:disabled) {
  color: white;
  background: rgba(22, 72, 75, 0.72);
  transform: scale(0.96);
}

.lane-button span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.17em;
}

.lane-button:disabled {
  cursor: default;
  opacity: 0.32;
}

.lane-button svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.screen {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--safe-top) + 60px) var(--safe-right) var(--safe-bottom) var(--safe-left);
  background:
    radial-gradient(circle at 50% 48%, rgba(8, 52, 58, 0.3), transparent 36%),
    linear-gradient(180deg, rgba(2, 7, 14, 0.24), rgba(2, 6, 12, 0.78));
  backdrop-filter: blur(4px);
}

.screen-panel {
  position: relative;
  width: min(620px, 92%);
  text-align: center;
}

.intro-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.24em;
}

.eyebrow span {
  width: 18px;
  height: 1px;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(50px, 8.3vw, 86px);
  line-height: 0.82;
  letter-spacing: -0.07em;
}

h1 span {
  display: block;
  font-weight: 880;
  text-shadow: 0 6px 30px rgba(0, 0, 0, 0.42);
}

h1 em {
  display: block;
  margin-top: 10px;
  color: transparent;
  font-size: 0.69em;
  font-style: normal;
  font-weight: 420;
  letter-spacing: 0.2em;
  background: linear-gradient(90deg, var(--cyan), #d9fff4 48%, var(--gold));
  background-clip: text;
  -webkit-background-clip: text;
  filter: drop-shadow(0 0 18px rgba(113, 255, 226, 0.2));
}

.tagline {
  margin-bottom: 18px;
  color: #abc0c7;
  font-size: clamp(13px, 2vw, 16px);
  line-height: 1.55;
  letter-spacing: 0.08em;
}

.mini-arena {
  position: relative;
  width: 118px;
  height: 118px;
  margin: 2px auto 20px;
}

.mini-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid rgba(124, 255, 231, 0.22);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.ring-one { width: 44px; height: 44px; }
.ring-two { width: 76px; height: 76px; }
.ring-three { width: 108px; height: 108px; }

.mini-flower {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 17px;
  height: 17px;
  background: var(--cyan-bright);
  border-radius: 50% 10% 50% 10%;
  box-shadow: 0 0 24px var(--cyan);
  transform: translate(-50%, -50%) rotate(45deg);
}

.mini-flower::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gold);
  border-radius: inherit;
  transform: rotate(90deg);
}

.mini-spark {
  position: absolute;
  top: 50%;
  right: 1px;
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 60% 10% 60% 60%;
  box-shadow: 0 0 13px 3px var(--cyan);
  transform: translateY(-50%) rotate(45deg);
  animation: spark-orbit 5s linear infinite;
  transform-origin: -50px 4px;
}

@keyframes spark-orbit {
  to { transform: translateY(-50%) rotate(405deg); }
}

.primary-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-width: 214px;
  min-height: 56px;
  padding: 0 25px;
  overflow: hidden;
  cursor: pointer;
  color: #031513;
  background: linear-gradient(105deg, #8effe5, #d9fff4 54%, #ffe4a8);
  border: 0;
  border-radius: 16px;
  box-shadow:
    0 13px 36px rgba(54, 239, 204, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.primary-button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.72), transparent 65%);
  transform: translateX(-120%);
  transition: transform 500ms ease;
}

.primary-button:hover {
  transform: translateY(-2px);
  box-shadow:
    0 18px 42px rgba(54, 239, 204, 0.27),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.primary-button:hover::before {
  transform: translateX(120%);
}

.primary-button:active {
  transform: translateY(1px) scale(0.98);
}

.primary-button span {
  position: relative;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.18em;
}

.primary-button svg {
  position: relative;
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.how-to {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(550px, 100%);
  margin-top: 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.how-to > div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 12px;
}

.how-to > div + div {
  border-left: 1px solid var(--line);
}

.how-to p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-align: left;
}

.how-to strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 9px;
  letter-spacing: 0.18em;
}

.how-icon {
  position: relative;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
}

.petal-icon::before,
.bloom-icon::before,
.bloom-icon::after {
  content: "";
  position: absolute;
  inset: 5px;
  background: var(--cyan);
  border-radius: 50% 5px 50% 5px;
  box-shadow: 0 0 10px rgba(113, 255, 226, 0.5);
  transform: rotate(45deg);
}

.petal-icon::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 1px;
  width: 20px;
  height: 1px;
  background: rgba(113, 255, 226, 0.38);
}

.eclipse-icon {
  border: 1px solid var(--coral);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 107, 141, 0.24);
}

.eclipse-icon::after {
  content: "";
  position: absolute;
  inset: -2px 5px 4px -2px;
  background: #07101a;
  border-radius: 50%;
}

.bloom-icon::after {
  transform: rotate(135deg);
  background: var(--gold);
}

.control-copy,
.shortcut-copy {
  margin: 15px 0 0;
  color: var(--quiet);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.intro-footer {
  position: absolute;
  right: var(--safe-right);
  bottom: var(--safe-bottom);
  left: var(--safe-left);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: rgba(113, 135, 143, 0.66);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.intro-footer i {
  width: 3px;
  height: 3px;
  background: var(--cyan);
  border-radius: 50%;
}

.compact-panel,
.result-panel {
  max-width: 480px;
  padding: clamp(28px, 5vw, 48px);
  background: linear-gradient(155deg, rgba(11, 28, 39, 0.88), rgba(4, 10, 20, 0.84));
  border: 1px solid rgba(137, 220, 219, 0.18);
  border-radius: 28px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.54);
  backdrop-filter: blur(18px);
}

.compact-panel h2,
.result-panel h2 {
  margin-bottom: 10px;
  font-size: clamp(36px, 7vw, 58px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.compact-panel > p:not(.eyebrow):not(.shortcut-copy),
.result-panel > p:not(.eyebrow):not(.shortcut-copy):not(.new-best) {
  color: var(--muted);
}

.compact-panel .primary-button,
.result-panel .primary-button {
  width: 100%;
  margin-top: 20px;
}

.text-button {
  min-height: 44px;
  margin-top: 8px;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.17em;
}

.text-button:hover {
  color: var(--ink);
}

.result-eyebrow {
  margin-bottom: 12px;
  color: #bd8c9b;
}

.result-eyebrow span {
  background: var(--coral);
  box-shadow: 0 0 8px var(--coral);
}

.new-best {
  display: inline-block;
  margin: 0 0 16px;
  padding: 6px 12px;
  color: #17200d;
  background: var(--gold);
  border-radius: 99px;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.16em;
}

.final-score {
  margin-top: 20px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.final-score span,
.result-grid span {
  display: block;
  color: var(--quiet);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.18em;
}

.final-score strong {
  display: block;
  margin-top: 4px;
  color: var(--cyan-bright);
  font-size: clamp(36px, 8vw, 54px);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  text-shadow: 0 0 24px rgba(113, 255, 226, 0.25);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 16px;
}

.result-grid > div {
  padding: 7px 8px;
}

.result-grid > div + div {
  border-left: 1px solid var(--line);
}

.result-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.noscript-message {
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 100;
  padding: 20px;
  color: white;
  background: #101723;
  transform: translate(-50%, -50%);
}

body.reduced-fx *,
body.reduced-fx *::before,
body.reduced-fx *::after {
  scroll-behavior: auto !important;
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

@media (max-width: 760px) {
  .game-shell {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    border: 0;
  }

  .hud {
    grid-template-columns: auto 1fr auto;
    gap: 9px;
  }

  .brand-copy,
  .button-label,
  .best-stat,
  .phase-stat {
    display: none;
  }

  .brand-orbit {
    width: 29px;
    height: 29px;
  }

  .hud-stats {
    justify-self: center;
    min-width: 108px;
    min-height: 44px;
  }

  .stat-block {
    min-width: 108px;
    padding: 7px 12px;
  }

  .hud-actions {
    gap: 4px;
  }

  .icon-button {
    padding: 0;
  }

  .run-status {
    top: calc(var(--safe-top) + 52px);
    gap: 18px;
    padding: 8px 10px;
  }

  .touch-controls {
    display: flex;
  }

  .tutorial-prompt {
    bottom: max(88px, calc(var(--safe-bottom) + 70px));
  }

  .screen {
    padding-top: calc(var(--safe-top) + 60px);
  }

  h1 {
    font-size: clamp(48px, 17vw, 72px);
  }

  .mini-arena {
    width: 100px;
    height: 100px;
    margin-bottom: 16px;
    transform: scale(0.88);
  }

  .how-to {
    width: min(470px, 100%);
  }

  .how-to > div {
    gap: 7px;
    padding: 7px 5px;
  }

  .how-to p {
    font-size: 10px;
  }

  .how-icon {
    width: 18px;
    height: 18px;
  }

  .intro-footer {
    gap: 7px;
    font-size: 6px;
    letter-spacing: 0.12em;
  }
}

@media (max-width: 420px) {
  .how-to {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .how-to p {
    text-align: center;
  }

  .how-icon {
    display: none;
  }

  .control-copy {
    margin-top: 12px;
  }

  .result-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .result-grid > div:nth-child(3) {
    border-left: 0;
  }

  .result-grid > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}

@media (max-height: 700px) and (min-width: 600px) {
  .screen {
    padding-top: calc(var(--safe-top) + 45px);
  }

  h1 {
    font-size: 55px;
  }

  .tagline {
    margin-bottom: 8px;
    line-height: 1.3;
  }

  .mini-arena {
    display: none;
  }

  .how-to {
    margin-top: 14px;
  }

  .intro-footer {
    display: none;
  }

  .compact-panel,
  .result-panel {
    padding: 24px 36px;
  }
}

@media (max-height: 599px) {
  .game-shell {
    width: min(100vw, 980px);
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    border-top: 0;
    border-bottom: 0;
  }
}

@media (max-height: 480px) and (min-width: 600px) {
  .hud {
    grid-template-columns: auto 1fr auto;
    gap: 9px;
  }

  .brand-copy,
  .best-stat,
  .phase-stat,
  .button-label {
    display: none;
  }

  .brand-orbit {
    width: 29px;
    height: 29px;
  }

  .hud-stats {
    justify-self: center;
    min-width: 108px;
    min-height: 44px;
  }

  .stat-block {
    min-width: 108px;
    padding: 7px 12px;
  }

  .hud-actions {
    gap: 4px;
  }

  .icon-button {
    padding: 0;
  }

  .run-status {
    top: 76px;
    left: max(18px, env(safe-area-inset-left));
    width: 224px;
    gap: 12px;
    padding: 7px 8px;
    transform: none;
  }

  .phase-banner {
    top: 88px;
    right: max(18px, env(safe-area-inset-right));
    left: auto;
    min-width: 224px;
    transform: none;
  }

  .phase-banner.is-visible {
    animation-name: phase-in-landscape;
  }

  .screen {
    padding-top: calc(var(--safe-top) + 40px);
    padding-bottom: 10px;
  }

  .eyebrow {
    margin-bottom: 7px;
  }

  h1 {
    margin-bottom: 5px;
    font-size: 43px;
  }

  h1 em {
    margin-top: 6px;
  }

  .tagline {
    margin-bottom: 7px;
    font-size: 11px;
    line-height: 1.25;
  }

  .primary-button {
    min-height: 46px;
  }

  .how-to {
    margin-top: 8px;
  }

  .how-to > div {
    min-height: 42px;
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .control-copy {
    margin-top: 7px;
  }

  .result-panel {
    padding: 14px 30px;
  }

  .result-panel .eyebrow {
    margin-bottom: 4px;
  }

  .result-panel h2 {
    margin-bottom: 4px;
    font-size: 30px;
  }

  .new-best {
    margin-bottom: 5px;
    padding: 4px 10px;
  }

  .final-score {
    margin-top: 5px;
    padding: 6px 0;
  }

  .final-score strong {
    margin-top: 1px;
    font-size: 28px;
  }

  .result-grid {
    margin-top: 5px;
  }

  .result-grid > div {
    padding: 3px 7px;
  }

  .result-grid strong {
    margin-top: 2px;
    font-size: 11px;
  }

  .result-panel .primary-button {
    min-height: 40px;
    margin-top: 7px;
  }

  .result-panel .text-button {
    min-height: 28px;
    margin-top: 1px;
  }

  .result-panel .shortcut-copy {
    display: none;
  }
}

@keyframes phase-in-landscape {
  0% { opacity: 0; transform: translateY(12px); }
  18%, 72% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-8px); }
}

@media (pointer: coarse) {
  .touch-controls {
    display: flex;
  }
}

@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;
  }
}
