:root {
  --ink: #070B1A;
  --ink-2: #0E1730;
  --slate: #1C2A47;
  --rock: #3A4A66;
  --steel: #9FB4C4;
  --steel-soft: #6C7F97;
  --pale: #DFFFFB;
  --cyan: #3FE0D0;
  --turq: #35C9C0;
  --gold: #F2C56B;
  --warm: #FFF3D6;
  --serif: "Instrument Serif", Georgia, serif;
  --text: "Golos Text", "Helvetica Neue", sans-serif;
  --mono: "Azeret Mono", ui-monospace, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--ink);
  color: var(--steel);
  font-family: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

button:focus-visible {
  outline: 1px solid rgba(63, 224, 208, 0.7);
  outline-offset: 5px;
}

#stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  touch-action: none;
}

#backdrop {
  position: absolute;
  inset: -7%;
  background-image: url("assets/elements/world_backdrop.webp");
  background-size: cover;
  background-position: 50% 58%;
  background-repeat: no-repeat;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

#scene {
  position: absolute;
  inset: 0;
  z-index: 2;
}

#scene canvas {
  display: block;
  cursor: grab;
  touch-action: none;
}

#scene canvas.grabbing { cursor: grabbing; }

#vignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    radial-gradient(125% 95% at 50% 44%, rgba(4, 7, 16, 0) 52%, rgba(4, 7, 16, 0.52) 100%),
    linear-gradient(180deg, rgba(4, 7, 16, 0.18), rgba(4, 7, 16, 0) 18%, rgba(4, 7, 16, 0) 78%, rgba(4, 7, 16, 0.34));
}

#dim {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: #04070f;
  opacity: 0;
  transition: opacity 0.5s ease;
}

#dim.on { opacity: 0.09; }

/* ---------- HUD ---------- */

.hud {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}

.hud.show {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.45s ease, visibility 0s;
}

.hud-level {
  position: absolute;
  top: calc(20px + var(--safe-t));
  left: calc(24px + env(safe-area-inset-left, 0px));
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.18em;
  color: var(--steel);
  text-transform: uppercase;
}

.hud-level-word { opacity: 0.72; }

#level-num { color: #DFF6F6; letter-spacing: 0.12em; }

.hud-right {
  position: absolute;
  top: calc(14px + var(--safe-t));
  right: calc(16px + env(safe-area-inset-right, 0px));
  display: flex;
  align-items: center;
  gap: 14px;
}

.charges {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-right: 4px;
}

.pips {
  display: flex;
  align-items: center;
  gap: 7px;
}

.pip {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid rgba(63, 224, 208, 0.22);
  background: transparent;
  transition: background 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.pip.on {
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 9px rgba(63, 224, 208, 0.55), 0 0 22px rgba(63, 224, 208, 0.22);
}

.charge-num {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 300;
  color: #DFF6F6;
  letter-spacing: 0.08em;
  min-width: 1ch;
}

.icon-btn {
  width: 44px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  pointer-events: auto;
  opacity: 0.78;
  transition: opacity 0.25s, background 0.25s;
}

.icon-btn:hover { opacity: 1; background: rgba(159, 180, 196, 0.06); }

.pause-bars {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 18px;
}

.pause-bars i {
  display: block;
  width: 2px;
  height: 17px;
  background: var(--steel);
  border-radius: 1px;
  opacity: 0.86;
}

.hud-actions {
  position: absolute;
  left: calc(24px + env(safe-area-inset-left, 0px));
  bottom: calc(22px + var(--safe-b));
  display: flex;
  gap: 12px;
  pointer-events: auto;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 13px;
  border-radius: 999px;
  border: 1px solid rgba(159, 180, 196, 0.28);
  background: rgba(10, 17, 36, 0.5);
  color: #C9D6E0;
  font-family: var(--text);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.19em;
  transition: border-color 0.3s, color 0.3s, box-shadow 0.35s, background 0.3s, opacity 0.3s;
}

.pill:hover { border-color: rgba(159, 180, 196, 0.5); color: #EAF6F8; }

.pill img {
  display: block;
  width: 19px;
  height: 19px;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(76%) sepia(12%) saturate(512%) hue-rotate(165deg) brightness(94%) contrast(87%);
  opacity: 0.9;
}

.pill-key {
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: var(--steel-soft);
  border: 1px solid rgba(159, 180, 196, 0.22);
  border-radius: 3px;
  padding: 2px 4px;
  margin-left: 2px;
}

.undo-pill.ready {
  border-color: rgba(63, 224, 208, 0.5);
  color: #DFFFFB;
  box-shadow: 0 0 20px rgba(53, 201, 192, 0.16), inset 0 0 14px rgba(53, 201, 192, 0.05);
}

.undo-pill.ready img {
  filter: brightness(0) saturate(100%) invert(88%) sepia(28%) saturate(647%) hue-rotate(140deg) brightness(105%) contrast(92%);
}

.undo-pill:disabled {
  opacity: 0.3;
  box-shadow: none;
  border-color: rgba(159, 180, 196, 0.2);
  color: #7C8EA3;
}

.pill.charging { animation: pillPulse 1.4s ease-in-out infinite; }

@keyframes pillPulse {
  0%, 100% { box-shadow: 0 0 14px rgba(53, 201, 192, 0.12); }
  50% { box-shadow: 0 0 28px rgba(53, 201, 192, 0.3); }
}

/* ---------- hint + toast ---------- */

.hint {
  position: absolute;
  z-index: 7;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  width: min(310px, 74vw);
  text-align: center;
  font-family: var(--text);
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: 0.035em;
  color: #C3D2DD;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
  text-wrap: balance;
}

.hint.show { opacity: 0.92; }

.toast {
  position: absolute;
  z-index: 9;
  left: 50%;
  bottom: calc(96px + var(--safe-b));
  transform: translateX(-50%) translateY(6px);
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(53, 201, 192, 0.26);
  background: rgba(7, 11, 26, 0.78);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 0.16em;
  color: #BFF7F2;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- screens ---------- */

.screen {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.45s ease, visibility 0s;
}

.screen.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.45s ease, visibility 0s;
}

.menu-screen {
  flex-direction: column;
  align-items: center;
  padding: calc(9vh + var(--safe-t)) 22px calc(28px + var(--safe-b));
  background:
    radial-gradient(70% 55% at 50% 42%, rgba(7, 11, 26, 0.12), rgba(7, 11, 26, 0.5) 80%),
    linear-gradient(180deg, rgba(7, 11, 26, 0.22), rgba(7, 11, 26, 0.05) 34%, rgba(7, 11, 26, 0.52) 100%);
}

.menu-inner {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.brand {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 8.4vw, 100px);
  line-height: 0.98;
  letter-spacing: 0.11em;
  color: var(--gold);
  text-align: center;
  white-space: nowrap;
}

.title-rule {
  width: min(560px, 72vw);
  height: 1px;
  margin: clamp(14px, 2.4vh, 26px) 0 clamp(12px, 2vh, 22px);
  background: linear-gradient(90deg, rgba(242, 197, 107, 0), rgba(242, 197, 107, 0.75) 18%, rgba(242, 197, 107, 0.75) 82%, rgba(242, 197, 107, 0));
}

.tagline {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(9px, 1.12vw, 13px);
  font-weight: 200;
  letter-spacing: 0.29em;
  color: #A9BACA;
  text-align: center;
  line-height: 1.8;
}

.menu-rows {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  width: min(340px, 78vw);
  margin-top: clamp(34px, 7vh, 76px);
}

.text-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 10px 11px 4px;
  color: #A9BACA;
  font-family: var(--text);
  font-size: clamp(17px, 1.6vw, 21px);
  font-weight: 400;
  letter-spacing: 0.105em;
  text-align: left;
  transition: color 0.28s ease;
}

.text-row .tick {
  width: 0;
  height: 1px;
  background: var(--turq);
  opacity: 0;
  transition: width 0.3s cubic-bezier(.2,.7,.2,1), opacity 0.3s;
  box-shadow: 0 0 9px rgba(53, 201, 192, 0.65);
  flex: none;
}

.text-row .row-label {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(.2,.7,.2,1);
}

.text-row:hover .tick,
.text-row:focus-visible .tick { width: 24px; opacity: 1; }

.text-row:hover .row-label,
.text-row:focus-visible .row-label { transform: translateY(-1px); }

.text-row:hover,
.text-row:focus-visible { color: #EAF6F8; }

.text-row:active .row-label { transform: translateY(0); }

.sound-row { margin-top: 8px; opacity: 0.78; }

.sound-row .row-label { font-size: 0.8em; letter-spacing: 0.16em; color: var(--steel-soft); }

.sound-glyph {
  width: 21px;
  height: 21px;
  color: var(--steel);
  opacity: 0.72;
  flex: none;
  transition: opacity 0.25s, color 0.25s;
}

.sound-glyph .slash { display: none; }
.sound-glyph.off .wave1,
.sound-glyph.off .wave2 { display: none; }
.sound-glyph.off .slash { display: block; }
.sound-glyph.off { opacity: 0.45; }

.sound-row:hover .sound-glyph { opacity: 1; }

.complete-name {
  margin: -12px 0 18px;
  font-family: var(--serif);
  font-size: clamp(18px, 2.4vw, 24px);
  letter-spacing: 0.04em;
  color: #AFC0CE;
}

.menu-foot {
  margin-top: auto;
  padding-top: 28px;
  display: flex;
  align-items: center;
  gap: 13px;
  opacity: 0.55;
}

.mono-mini {
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 300;
  letter-spacing: 0.26em;
  color: #7E93AA;
}

.foot-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(159, 180, 196, 0.55);
}

/* ---------- panels ---------- */

.panel-screen {
  align-items: center;
  justify-content: center;
  padding: calc(18px + var(--safe-t)) 18px calc(18px + var(--safe-b));
  background:
    radial-gradient(92% 82% at 50% 46%, rgba(8, 13, 29, 0.9), rgba(5, 9, 20, 0.985) 80%);
}

.panel {
  width: min(760px, 94vw);
  max-height: 86vh;
  max-height: 86dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(20px, 3.4vw, 38px);
  scrollbar-width: thin;
  scrollbar-color: rgba(159, 180, 196, 0.25) transparent;
}

.panel.narrow { width: min(520px, 94vw); }

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(159, 180, 196, 0.16);
}

.panel-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 4vw, 44px);
  letter-spacing: 0.055em;
  color: #EAF6F8;
}

.back-row {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--text);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--steel-soft);
  padding: 6px 2px;
  transition: color 0.25s;
  flex: none;
}

.back-row:hover { color: #EAF6F8; }

.back-chev {
  width: 7px;
  height: 7px;
  border-left: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.8;
  margin-right: 3px;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.level-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 80px;
  padding: 10px 12px 9px;
  border: 1px solid rgba(159, 180, 196, 0.24);
  background: linear-gradient(160deg, rgba(38, 55, 88, 0.5), rgba(22, 34, 59, 0.55));
  text-align: left;
  transition: border-color 0.28s, background 0.28s, opacity 0.28s;
}

.level-cell:hover {
  border-color: rgba(63, 224, 208, 0.52);
  background: linear-gradient(160deg, rgba(48, 70, 108, 0.6), rgba(28, 42, 71, 0.62));
}

.level-cell.locked { opacity: 0.7; }

.level-cell.locked:hover { border-color: rgba(159, 180, 196, 0.42); }

.level-cell.current { border-color: rgba(63, 224, 208, 0.55); }

.level-cell .cell-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.level-cell .cell-num {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: #F2FAFC;
}

.level-cell .cell-flag {
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: var(--turq);
}

.level-cell.locked .cell-flag { color: #7E93AA; }

.level-cell .cell-name {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.02em;
  color: #D8E5EE;
  line-height: 1.25;
}

.level-cell.locked .cell-num { color: #D4E2EC; }
.level-cell.locked .cell-name { color: #AFC0CE; }

.level-cell .cell-stars {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
  padding-top: 2px;
}

.cell-star {
  width: 11px;
  height: 11px;
  display: inline-block;
}

.cell-star img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.cell-star.empty svg {
  width: 12px;
  height: 12px;
  display: block;
  opacity: 0.85;
}

.panel-message {
  min-height: 17px;
  margin: 11px 2px 0;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 300;
  letter-spacing: 0.13em;
  color: var(--gold);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.panel-message.show { opacity: 0.9; }

.panel-note {
  margin: 22px 2px 0;
  font-family: var(--text);
  font-size: 11.5px;
  line-height: 1.6;
  letter-spacing: 0.03em;
  color: #7E93AA;
}

/* ---------- settings ---------- */

.settings-rows {
  display: flex;
  flex-direction: column;
  margin-top: 10px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 4px;
  border-bottom: 1px solid rgba(159, 180, 196, 0.11);
  transition: background 0.25s;
}

.setting-row:hover { background: rgba(159, 180, 196, 0.035); }

.setting-name {
  font-family: var(--text);
  font-size: 16px;
  letter-spacing: 0.05em;
  color: #D5E2EA;
}

.setting-value {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--turq);
  border: 1px solid rgba(53, 201, 192, 0.28);
  border-radius: 999px;
  padding: 4px 10px;
  transition: color 0.3s, border-color 0.3s;
}

.setting-row[aria-pressed="false"] .setting-value {
  color: var(--steel-soft);
  border-color: rgba(159, 180, 196, 0.2);
}

.setting-row.danger .setting-value { color: var(--gold); border-color: rgba(242, 197, 107, 0.28); }

.setting-row.danger.armed .setting-value {
  color: #070B1A;
  background: var(--gold);
  border-color: var(--gold);
}

/* ---------- pauses / complete ---------- */

.veil-screen {
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(90% 80% at 50% 46%, rgba(7, 11, 26, 0.88), rgba(4, 7, 15, 0.985) 84%);
}

.centre-col {
  width: min(94vw, 560px);
  text-align: center;
  padding: 20px 8px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 0.32em;
  color: #7E93AA;
}

.over-title {
  margin: 0 0 20px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 5.3vw, 56px);
  line-height: 1.08;
  letter-spacing: 0.045em;
  color: #EAF6F8;
}

.body-line {
  margin: 0 auto 26px;
  max-width: 390px;
  font-family: var(--text);
  font-size: 13px;
  line-height: 1.7;
  letter-spacing: 0.025em;
  color: #A7B8C7;
}

.menu-rows.centre {
  margin: clamp(16px, 3vh, 30px) auto 0;
  width: min(300px, 76vw);
}

.centre .text-row { justify-content: flex-start; }

.complete-col .eyebrow { color: #8FA5BA; }

.complete-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin: 2px 0 20px;
}

.stat-label {
  display: block;
  margin-bottom: 7px;
}

.stat-value {
  display: block;
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: #DFFFFB;
}

.stars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 62px;
  margin-bottom: 22px;
}

.star {
  position: relative;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.55);
}

.star img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.star.empty { opacity: 0.55; transform: scale(0.82); }

.star.empty svg { width: 38px; height: 38px; display: block; }
.star.empty path { stroke: #7e93aa; }

.stars.play .star {
  animation: starIn 0.55s cubic-bezier(.16,.8,.3,1.15) forwards;
  animation-delay: var(--d, 0s);
}

@keyframes starIn {
  0% { opacity: 0; transform: scale(0.35) rotate(-14deg); }
  65% { opacity: 1; transform: scale(1.12) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.complete-rows { margin-top: 4px; }

/* ---------- fade ---------- */

#fade {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: #070B1A;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.55s ease;
}

#fade.on { opacity: 1; }

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  .title { font-size: clamp(25px, 9.4vw, 62px); letter-spacing: 0.06em; }
  .tagline { letter-spacing: 0.2em; font-size: 9px; }
  .title-rule { width: 78vw; }
  .menu-screen { padding-top: calc(11vh + var(--safe-t)); }
  .menu-rows { margin-top: clamp(30px, 6vh, 56px); }

  .hud-level { font-size: 11px; letter-spacing: 0.14em; top: calc(16px + var(--safe-t)); left: 16px; }
  .hud-right { top: calc(10px + var(--safe-t)); right: 8px; }
  .charge-num { display: none; }
  .hud-actions {
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(14px + var(--safe-b));
    width: calc(100% - 28px);
    max-width: 430px;
    gap: 10px;
  }
  .pill {
    flex: 1;
    justify-content: center;
    min-height: 52px;
    padding: 12px 10px;
    font-size: 11px;
    letter-spacing: 0.16em;
  }
  .pill img { width: 21px; height: 21px; }
  .pill-key { display: none; }
  .toast { bottom: calc(84px + var(--safe-b)); font-size: 8px; max-width: 88vw; overflow: hidden; text-overflow: ellipsis; }
  .hint { font-size: 12px; }

  .level-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .level-cell { min-height: 80px; padding: 10px 12px 9px; }
  .level-cell .cell-num { font-size: 20px; }
  .panel { padding: 20px 16px 26px; }
  .panel-head { padding-bottom: 12px; }
  .over-title { margin-bottom: 14px; }
  .complete-stats { margin-bottom: 12px; }
  .stars { min-height: 54px; margin-bottom: 14px; }
  .star { width: 44px; height: 44px; }
  .star.empty svg { width: 32px; height: 32px; }
  .menu-rows.centre { margin-top: 12px; }
  .text-row { padding: 10px 4px; }
  .menu-foot { display: none; }
}

@media (max-height: 560px) and (orientation: landscape) {
  .menu-screen { padding-top: calc(7vh + var(--safe-t)); padding-bottom: 14px; }
  .complete-rows { flex-direction: column; flex-wrap: nowrap; width: min(300px, 76vw); }
  .title { font-size: clamp(30px, 6.4vw, 58px); }
  .title-rule { margin: 9px 0 8px; }
  .menu-rows { margin-top: 14px; flex-direction: row; flex-wrap: wrap; justify-content: center; width: min(640px, 92vw); gap: 4px 20px; }
  .text-row { padding: 5px 4px; font-size: 15px; }
  .sound-row { margin-top: 0; }
  .menu-foot { display: none; }
  .hud-actions { bottom: calc(10px + var(--safe-b)); }
  .pill { min-height: 44px; padding: 9px 14px; font-size: 10px; }
  .over-title { font-size: 34px; margin-bottom: 10px; }
  .stars { min-height: 44px; margin-bottom: 8px; }
  .star { width: 40px; height: 40px; }
  .body-line { margin-bottom: 14px; }
  .complete-stats { margin-bottom: 6px; }
  .stat-value { font-size: 20px; }
  .panel { max-height: 92vh; max-height: 92dvh; }
}

@media (pointer: coarse) {
  .pill-key { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .screen, .hud, .hint, #fade, #dim { transition-duration: 0.01s; }
  .stars.play .star { animation-duration: 0.01s; animation-delay: 0s; }
  .pill.charging { animation: none; }
}
