/* Void: portrait mobile first, desktop in a centered phone column.
   Colours: Standard Game UI tokens only (tokens.css, then the Hexapuss Drip theme). Record red comes from the shared recorder.
   Type: Drip titles (--sgu-font-title, tracking --sgu-title-tracking, -0.05em); Oswald for everything else (--sgu-font). */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --orange: var(--sgu-orange);
  --green: var(--sgu-green);
  --purple: var(--sgu-purple);
  --white: var(--sgu-white);
  --ink: var(--sgu-gray-100);
  --dim: color-mix(in srgb, var(--sgu-gray-100) 60%, transparent);
  --strip-h: 58px;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--sgu-surface, var(--sgu-black));
  background-color: var(--sgu-black);
  color: var(--ink);
  font-family: var(--sgu-font);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--sgu-black);
  overflow: hidden;
}

@media (min-width: 481px) {
  #app { box-shadow: 0 0 0 1px color-mix(in srgb, var(--sgu-white) 6%, transparent); }
}

/* The play area sits above the Record strip, so the strip never covers the circles, the door or the dials. */
#stage { position: absolute; left: 0; right: 0; top: 0; bottom: calc(var(--strip-h) + env(safe-area-inset-bottom, 0px)); overflow: hidden; }
#rec-strip {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 50;
  height: calc(var(--strip-h) + env(safe-area-inset-bottom, 0px));
  padding: 0 0.6rem env(safe-area-inset-bottom, 0px);
  display: flex; align-items: center; justify-content: center;
  background: var(--sgu-black);
  border-top: 1px solid var(--sgu-gray-700);
}
#rec-strip .shp-rec { margin: 0; }

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px);
}
.screen.is-on { display: flex; }
.screen[hidden] { display: none !important; }

/* ---------- Title ---------- */
/* No full-screen wash: black, with glow only on the art. */
#screen-title { background: transparent; }
.title-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  padding: 1.2rem 0;
  text-align: center;
  width: 100%;
}
/* About 92% of the play width: game.js fits the size to the font; the clamp is the no-JS fallback. */
.title { width: 100%; line-height: 1; white-space: nowrap; }
/* Drip title: the site font, tracking -0.05em. The right margin cancels the trailing letter space so VOID stays centered. */
.title span {
  display: inline-block;
  font-family: var(--sgu-font-title, var(--sgu-font));
  font-size: clamp(3.4rem, 16vw, 4.9rem);
  font-weight: var(--sgu-title-weight, 800);
  letter-spacing: var(--sgu-title-tracking, 0.12em);
  margin-right: calc(-1 * var(--sgu-title-tracking, 0.12em));
  line-height: var(--sgu-title-line, 1);
  padding: 0.1em 0;
  text-transform: uppercase;
  color: var(--sgu-gray-100);
  text-shadow: 0 0 calc(var(--sgu-glow, 1) * 18px) color-mix(in srgb, var(--sgu-purple) 60%, transparent);
}
.logo-play-wrap { position: relative; }
.logo-play {
  position: relative;
  appearance: none;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: block;
  padding: 0.5rem;
  border-radius: 50%;
  touch-action: manipulation;
}
.logo-play:focus-visible { outline: 2px solid var(--sgu-focus); outline-offset: 2px; }
/* Title sigil: the sigil art as a mask over a solid purple token fill, so the art and its glow are all purple.
   The glow sits on the wrapper because a mask would clip a filter on the same element. */
.title-sigil-glow {
  display: block;
  filter: drop-shadow(0 0 2px var(--purple)) drop-shadow(0 0 12px var(--purple)) drop-shadow(0 0 26px color-mix(in srgb, var(--sgu-purple) 90%, transparent));
}
.title-sigil {
  width: min(70vw, 300px, 38dvh);
  height: min(70vw, 300px, 38dvh);
  display: block;
  background-color: var(--purple);
  -webkit-mask: url("art/portal-sigil.png?v=dc23fe27") center / contain no-repeat;
  mask: url("art/portal-sigil.png?v=dc23fe27") center / contain no-repeat;
  animation: sigil-spin 24s linear infinite;
}
.logo-play:active .title-sigil { transform: scale(0.96); }
@keyframes sigil-spin { to { transform: rotate(360deg); } }
/* PLAY is big text right over the portal art; the art itself is the button. */
.play-word {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin-left: calc((var(--sgu-title-tracking, 0.08em) + 0.1em) / 2);
  font-family: var(--sgu-font-title, var(--sgu-font));
  font-size: calc(min(70vw, 300px, 38dvh) * 0.22);
  font-weight: var(--sgu-title-weight, 800);
  letter-spacing: calc(var(--sgu-title-tracking, 0.08em) + 0.1em);
  line-height: 1;
  color: var(--sgu-white);
  text-shadow: 0 0 6px var(--sgu-black), 0 0 18px var(--sgu-purple), 0 0 36px color-mix(in srgb, var(--sgu-purple) 70%, transparent);
  pointer-events: none;
  z-index: 3;
}
.site-url { font-size: 0.75rem; color: var(--sgu-gray-500); letter-spacing: 0.04em; }

/* The shared recorder still draws a Length dropdown; Void hides it because a
   recording covers the whole run (up to 3:00 plus a 3s tail), not a 15 or 30s clip. */
#recordRow .shp-rec-len { display: none; }

/* ---------- Game ---------- */
#screen-game { justify-content: flex-start; }

#hud {
  position: absolute;
  top: calc(0.55rem + env(safe-area-inset-top, 0px));
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 1rem;
  pointer-events: none;
  font-family: var(--sgu-font);
}
#hud-time {
  font-size: 1.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  line-height: 1;
  color: var(--sgu-white);
  text-shadow: 0 1px 4px var(--sgu-black), 0 0 12px color-mix(in srgb, var(--sgu-black) 80%, transparent);
  transition: color 0.2s ease;
}
/* Countdown: the last 10 seconds turn orange (never red; red is for recording only). */
#hud-time.is-low {
  color: var(--sgu-orange);
  text-shadow: 0 1px 4px var(--sgu-black), 0 0 calc(var(--sgu-glow, 1) * 14px) color-mix(in srgb, var(--sgu-orange) 70%, transparent);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#circles { position: absolute; inset: 0; z-index: 15; pointer-events: none; }

.circle {
  position: absolute;
  width: 110px;
  height: 110px;
  margin-left: -55px;
  margin-top: -55px;
  border: none;
  outline: none;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  pointer-events: auto;
  cursor: pointer;
  touch-action: manipulation;
  transform: scale(0.7);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.circle img { width: 100%; height: 100%; display: block; object-fit: contain; pointer-events: none; -webkit-user-drag: none; }
.circle.is-live { opacity: 1; transform: scale(1); animation: circle-pulse 1.4s ease-in-out infinite; }
.circle.is-hit { opacity: 0; transform: scale(1.4); pointer-events: none; transition: opacity 0.18s ease, transform 0.18s ease; animation: none; }
.circle.is-fizz { pointer-events: none; animation: circle-fizz 0.26s ease-out forwards; }
@keyframes circle-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes circle-fizz {
  0% { opacity: 1; transform: scale(1); filter: brightness(1.1); }
  40% { opacity: 0.5; transform: scale(1.25) rotate(8deg); filter: brightness(1.4); }
  100% { opacity: 0; transform: scale(1.5) rotate(-6deg); filter: brightness(1.6); }
}
.circle.phase-orange img { filter: drop-shadow(0 0 2px var(--orange)) drop-shadow(0 0 10px var(--orange)) drop-shadow(0 0 22px color-mix(in srgb, var(--sgu-orange) 95%, transparent)); }
.circle.phase-green img { filter: drop-shadow(0 0 2px var(--green)) drop-shadow(0 0 10px var(--green)) drop-shadow(0 0 22px color-mix(in srgb, var(--sgu-green) 95%, transparent)); }
.circle.phase-purple img { filter: drop-shadow(0 0 2px var(--purple)) drop-shadow(0 0 12px var(--purple)) drop-shadow(0 0 24px color-mix(in srgb, var(--sgu-purple) 98%, transparent)); }
.circle.phase-white img { filter: drop-shadow(0 0 2px var(--white)) drop-shadow(0 0 12px var(--white)) drop-shadow(0 0 28px color-mix(in srgb, var(--sgu-white) 98%, transparent)); }

/* ---------- Door puzzle (the Rift doors) ---------- */
#vault-ui {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: calc(3rem + env(safe-area-inset-top, 0px)) 0.85rem 0.6rem;
  gap: 0.4rem;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.35s ease;
}
#vault-ui.is-on { visibility: visible; opacity: 1; }
#vault-ui.is-locked #dials, #vault-ui.is-locked #game-info { opacity: 0.35; pointer-events: none; }

#objective { text-align: center; transition: opacity 0.3s ease; }
#objective-heading { font-size: 1.05rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--white); }
#objective-instructions { font-size: 0.82rem; color: var(--dim); margin-top: 0.15rem; }
#objective-values {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.22rem;
  margin-top: 0.28rem;
  pointer-events: none;
  user-select: none;
  filter: grayscale(1);
  opacity: 0.55;
  width: 100%;
}
#objective-values .target-tempo-row {
  display: flex;
  justify-content: center;
  width: 100%;
}
#objective-values .target-rhythms-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-items: center;
  align-items: start;
  gap: 0.1rem 0.15rem;
  width: 100%;
}
#objective-values .rhythm-dial.tempo {
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 0.2rem 0.35rem;
  width: auto;
  max-width: 100%;
}
#objective-values .rhythm-dial.tempo .shp-dial {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  width: auto;
  gap: 0.25rem 0.35rem;
}
#objective-values .rhythm-dial.tempo .shp-dial-label { min-height: 0; align-items: center; }
#objective-values .target-portal-dial,
#objective-values .shp-dial { width: 54px; gap: 0; }
#objective-values .shp-dial-label { min-height: 1.05em; font-size: 0.48rem; }
#objective-values .shp-dial-knob { width: 30px; height: 30px; }
#objective-values .shp-dial-knob::before { inset: 4px; }
#objective-values .shp-dial-knob i::after { width: 2px; height: 9px; top: 2px; left: calc(50% - 1px); }
#objective-values .shp-dial-value {
  min-width: 28px;
  min-height: 18px;
  font-size: 0.62rem;
  padding: 0 3px;
  cursor: default;
}
#objective-values .shp-dial-sub { min-height: 0; font-size: 0.45rem; max-width: none; }
#objective-values .rhythm-dial.tempo .shp-dial { width: auto; }

/* The door art sits directly on the dial panel. Leftover height stays above the lock, so the dials stay next to the effect. */
#portal-slot {
  position: relative;
  flex: 1 1 auto;
  min-height: 120px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
#portal-btn {
  position: relative;
  flex: 0 0 auto;
  width: var(--portal-d, 260px);
  height: var(--portal-d, 260px);
  margin: 0 auto 0.2rem;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}
#portal-btn:focus-visible { outline: 2px dashed color-mix(in srgb, var(--sgu-white) 50%, transparent); outline-offset: 4px; }

#hint {
  min-height: 1.2em;
  margin: 0 0 0.28rem;
  text-align: center;
  font-size: 0.86rem;
  color: color-mix(in srgb, var(--sgu-orange) 40%, var(--sgu-white));
  text-shadow: 0 0 10px color-mix(in srgb, var(--sgu-orange) 35%, transparent);
}
#hint:empty { display: none; min-height: 0; margin: 0; }
#hint.is-good { color: color-mix(in srgb, var(--sgu-green) 40%, var(--sgu-white)); text-shadow: 0 0 10px color-mix(in srgb, var(--sgu-green) 50%, transparent); }

#dials {
  background: color-mix(in srgb, var(--sgu-gray-900) 85%, transparent);
  border: 1px solid var(--sgu-gray-700);
  border-radius: var(--sgu-radius-l);
  padding: 0.45rem 0.35rem 0.5rem;
  transition: opacity 0.3s ease;
  flex: 0 0 auto;
}
/* Tempo on its own centered row above the three Rhythm A/B/C dials. Shared Standard Game UI dial, with - and + under each. */
#rhythm-dials {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.2rem 0.2rem;
  justify-items: center;
  align-items: start;
}
.rhythm-dial { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; }
.rhythm-dial.tempo {
  grid-column: 1 / -1;
  justify-self: center;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.4rem 0.55rem;
  width: auto;
  max-width: 100%;
}
/* Tempo reads as its own short row: label, knob, value, BPM and steps in a line, so the door keeps the height. */
.rhythm-dial.tempo .shp-dial {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  width: auto;
  gap: 0.4rem 0.5rem;
}
.rhythm-dial.tempo .shp-dial-label { min-height: 0; align-items: center; }
.rhythm-dial.tempo .shp-dial-sub { max-width: none; min-height: 0; }
.rhythm-dial .shp-dial-sub { max-width: 74px; overflow: hidden; text-overflow: ellipsis; }
.rhythm-dial.tempo .shp-dial-sub { max-width: none; }

#game-info {
  flex: 0 0 auto;
  background: color-mix(in srgb, var(--sgu-gray-900) 85%, transparent);
  border: 1px solid var(--sgu-gray-700);
  border-radius: var(--sgu-radius-l);
  padding: 0.35rem 0.5rem 0.45rem;
  text-align: center;
  transition: opacity 0.3s ease;
}
#game-info #objective { margin: 0; }
#game-info #objective-values { margin-top: 0.3rem; }
.stepper { display: flex; align-items: center; gap: 0.25rem; }
.step {
  appearance: none;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: var(--sgu-btn-radius, var(--sgu-radius-m));
  border: var(--sgu-border-w, 1px) solid var(--sgu-gray-700);
  background: var(--sgu-gray-900);
  color: var(--sgu-gray-100);
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}
.step:active { transform: scale(0.94); background: var(--sgu-gray-700); }
.step:focus-visible { outline: 2px solid var(--sgu-focus); outline-offset: 2px; }

/* ---------- Flash ---------- */
#flash { position: absolute; inset: 0; z-index: 30; pointer-events: none; opacity: 0; background: var(--white); }
#flash.flash-orange { background: var(--orange); }
#flash.flash-green { background: var(--green); }
#flash.flash-purple { background: var(--purple); }
#flash.flash-white { background: var(--white); }
#flash.is-on { animation: hit-flash 0.28s ease-out forwards; }
#flash.is-strong { animation: hit-flash-strong 0.5s ease-out forwards; }
@keyframes hit-flash { 0% { opacity: 0.4; } 100% { opacity: 0; } }
@keyframes hit-flash-strong { 0% { opacity: 0.9; } 100% { opacity: 0; } }

/* ---------- Win ---------- */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  background: var(--sgu-surface, var(--sgu-black));
  background-color: var(--sgu-black);
  text-align: center;
  overflow-y: auto;
  padding: calc(1.4rem + env(safe-area-inset-top, 0px)) 1.25rem 1.2rem;
}
.overlay[hidden] { display: none !important; }
.overlay > * { position: relative; z-index: 1; }
/* The end: the white portal (the Rift) */
.win-sigil { width: min(40vw, 160px); filter: drop-shadow(0 0 2px var(--white)) drop-shadow(0 0 14px var(--white)) drop-shadow(0 0 30px color-mix(in srgb, var(--sgu-white) 70%, transparent)); margin: 0.3rem 0; }
.overlay h2 { font-size: 1.6rem; letter-spacing: 0.08em; font-weight: 800; color: var(--orange); text-shadow: 0 0 18px color-mix(in srgb, var(--sgu-orange) 40%, transparent); }
.win-sub { font-size: 0.92rem; color: color-mix(in srgb, var(--sgu-orange) 60%, var(--sgu-white)); }
.win-clear-time { font-size: 1.1rem; font-weight: 700; letter-spacing: 0.05em; color: var(--orange); }
.lb-heading { margin-top: 0.35rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.22em; color: var(--orange); }
.win-leaderboard {
  list-style: none;
  width: min(100%, 330px);
  max-height: min(36vh, 240px);
  overflow-y: auto;
  padding: 0.25rem 0;
  border: 1px solid color-mix(in srgb, var(--sgu-orange) 35%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--sgu-gray-900) 72%, transparent);
  text-align: left;
}
.win-leaderboard li {
  display: grid;
  grid-template-columns: 1.5rem 1fr auto auto;
  gap: 0.45rem;
  align-items: center;
  padding: 0.38rem 0.65rem;
  font-size: 0.82rem;
  color: color-mix(in srgb, var(--sgu-orange) 60%, var(--sgu-white));
  border-bottom: 1px solid color-mix(in srgb, var(--sgu-white) 5%, transparent);
}
.win-leaderboard li:last-child { border-bottom: 0; }
.lb-rank { color: color-mix(in srgb, var(--sgu-orange) 55%, transparent); font-weight: 600; font-variant-numeric: tabular-nums; }
.lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: color-mix(in srgb, var(--sgu-orange) 60%, var(--sgu-white)); }
.lb-vaults, .lb-time { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--orange); }
.lb-empty { display: block !important; padding: 0.75rem; text-align: center; color: color-mix(in srgb, var(--sgu-orange) 50%, transparent); }
.win-leaderboard li.is-you { background: linear-gradient(90deg, color-mix(in srgb, var(--sgu-green) 22%, transparent), color-mix(in srgb, var(--sgu-green) 8%, transparent)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sgu-green) 65%, transparent); }
.win-leaderboard li.is-you span { color: var(--green); }
.lb-name-edit { display: flex; align-items: center; gap: 0.3rem; min-width: 0; }
.lb-inline-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--sgu-green) 65%, transparent);
  border-radius: var(--sgu-radius-s);
  background: color-mix(in srgb, var(--sgu-black) 45%, transparent);
  color: var(--green);
  font: bold 13px var(--sgu-font);
  padding: 0.25rem 0.4rem;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}
.lb-inline-ok { border: 0; border-radius: var(--sgu-radius-s); background: var(--green); color: var(--sgu-black); font: bold 12px var(--sgu-font); padding: 0.28rem 0.5rem; cursor: pointer; }
.btn-again {
  appearance: none;
  margin-top: 0.4rem;
  border: 1px solid color-mix(in srgb, var(--sgu-orange) 65%, transparent);
  background: color-mix(in srgb, var(--sgu-orange) 12%, transparent);
  color: var(--orange);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  padding: 0.75rem 1.6rem;
  border-radius: var(--sgu-btn-radius, 999px);
  font-family: inherit;
  box-shadow: 0 0 calc(var(--sgu-glow, 1) * 14px) color-mix(in srgb, var(--sgu-orange) var(--sgu-glow-b, 22%), transparent);
  cursor: pointer;
}
.btn-again:active { transform: scale(0.97); }
.btn-again:focus-visible { outline: 2px solid var(--sgu-focus); outline-offset: 3px; }

/* ---------- Time's up ---------- */
.timeup-screen { justify-content: center; gap: 0.6rem; }
.overlay h2.timeup-title {
  font-family: var(--sgu-font-title, var(--sgu-font));
  font-weight: var(--sgu-title-weight, 800);
  letter-spacing: var(--sgu-title-tracking, 0.08em);
  margin-right: calc(-1 * var(--sgu-title-tracking, 0.08em));
  line-height: var(--sgu-title-line, 1.05);
  padding: 0.1em 0;
  font-size: clamp(2.8rem, 15vw, 4rem);
  white-space: nowrap;
  color: var(--sgu-orange);
  text-shadow: 0 0 calc(var(--sgu-glow, 1) * 18px) color-mix(in srgb, var(--sgu-orange) 50%, transparent);
}
.timeup-clock { font-size: 1.85rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.06em; color: var(--sgu-orange); }
.timeup-sub { font-size: 1rem; font-weight: 700; letter-spacing: 0.04em; color: var(--sgu-gray-100); }
.timeup-note { font-size: 0.86rem; color: var(--dim); max-width: 18rem; line-height: 1.4; }

@media (max-width: 380px) {
  .step { width: 1.95rem; height: 2rem; }
  #dials { padding-left: 0.2rem; padding-right: 0.2rem; }
  #hud-time { font-size: 1.6rem; }
}

@media (max-height: 740px) {
  #objective-instructions { font-size: 0.76rem; }
  .step { height: 1.9rem; }
  #vault-ui { gap: 0.25rem; padding: calc(2.7rem + env(safe-area-inset-top, 0px)) 0.6rem 0.3rem; }
  .title-content { gap: 0.6rem; }
  #dials { padding: 0.3rem 0.25rem 0.35rem; }
  #game-info { padding: 0.28rem 0.4rem 0.32rem; }
  #hint { margin-bottom: 0.18rem; font-size: 0.8rem; }
  .portal-dial .shp-dial-sub { display: none; }
}

/* Tight vault stack on short phones (320x568) so the door stays the largest element and nothing clips. */
@media (max-height: 620px) {
  #vault-ui { gap: 0.18rem; padding: calc(2.45rem + env(safe-area-inset-top, 0px)) 0.45rem 0.2rem; }
  .portal-dial { width: 64px; gap: 0; }
  .portal-dial .shp-dial-label { min-height: 1.15em; font-size: 0.5rem; }
  .portal-dial .shp-dial-knob { width: 36px; height: 36px; }
  .portal-dial .shp-dial-value { min-height: 22px; font-size: 0.68rem; }
  .step { width: 1.75rem; height: 1.65rem; font-size: 1rem; }
  #objective-heading { font-size: 0.9rem; letter-spacing: 0.12em; }
  #objective-instructions { font-size: 0.72rem; }
  #objective-values { margin-top: 0.1rem; gap: 0.16rem; }
  #objective-values .target-portal-dial,
  #objective-values .shp-dial { width: 46px; }
  #objective-values .shp-dial-knob { width: 24px; height: 24px; }
  #objective-values .shp-dial-value { min-width: 24px; min-height: 16px; font-size: 0.56rem; }
  #hud-time { font-size: 1.45rem; }
  #hint { font-size: 0.76rem; min-height: 1.1em; }
}

/* Clip preview and encoding modals (same as Synth) */
.clip-modal { position: absolute; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; background: color-mix(in srgb, var(--sgu-black) 72%, transparent); }
.clip-modal[hidden], .game-modal[hidden] { display: none; }
.clip-card { width: min(420px, 100%); max-height: 92%; overflow: auto; background: color-mix(in srgb, var(--sgu-gray-900) 96%, transparent); border: 1px solid color-mix(in srgb, var(--sgu-white) 12%, transparent); border-radius: var(--sgu-radius-l); padding: 14px; }
.clip-card video { width: 100%; max-height: 60dvh; aspect-ratio: 4 / 5; border-radius: 12px; background: var(--sgu-black); display: block; margin-bottom: 10px; }
.clip-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.clip-btn { appearance: none; font: inherit; font-size: .78rem; font-weight: 700; padding: 8px 14px; min-height: 44px; border-radius: var(--sgu-btn-radius, var(--sgu-radius-pill)); border: 1px solid var(--sgu-gray-700); background: var(--sgu-gray-900); color: var(--sgu-gray-100); cursor: pointer; }
.clip-btn-muted { color: var(--sgu-gray-300); }
.game-modal { position: absolute; inset: 0; z-index: 90; display: flex; justify-content: center; align-items: center; background: color-mix(in srgb, var(--sgu-black) 55%, transparent); padding: 18px; }
.game-card { background: var(--sgu-gray-900); border: 1px solid var(--sgu-gray-700); border-radius: var(--sgu-radius-l); padding: 18px 20px; text-align: center; }
.game-card h2 { font-size: 1rem; color: var(--sgu-gray-100); }

@media (prefers-reduced-motion: reduce) {
  .title-sigil { animation: none; }
  #hud-time { transition: none; }
  .circle.is-live { animation: none; }
}

/* While recording or encoding, the (disabled) length picker steps aside so the progress stays on one line in the strip. */
#rec-strip .shp-rec.is-recording .shp-rec-len, #rec-strip .shp-rec.is-encoding .shp-rec-len { display: none; }
