/* Stack Tower — a calm isometric tower under a sky that changes with height.
   The canvas fills the window; the interface floats over it as frosted glass.
   [data-theme] sets dialog colours, [data-sky] (light/dark, from the sky's
   brightness at the current height) sets the ink of everything over the sky. */

:root {
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.3, 0.7, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.5, 1);
  --radius: 18px;

  --paper: #fcf7f3;
  --paper-2: #f3e9e3;
  --ink: #3a3040;
  --ink-soft: #7d7080;
  --line: rgba(70, 50, 70, 0.12);
  --accent: #e5927f;
  --accent-2: #cf7489;
  --accent-ink: #fff;
  --accent-glow: rgba(229, 146, 127, 0.45);
  --backdrop: rgba(58, 40, 62, 0.34);
  --bg: #f3e6dc;
}
[data-theme="marble"] {
  --paper: #fbf8f2;
  --paper-2: #f0eadf;
  --ink: #2e2a25;
  --ink-soft: #7a7064;
  --line: rgba(60, 50, 30, 0.13);
  --accent: #d6b25f;
  --accent-2: #a9802f;
  --accent-ink: #fffaf0;
  --accent-glow: rgba(214, 178, 95, 0.5);
  --backdrop: rgba(46, 38, 26, 0.34);
  --bg: #efe8dc;
}
[data-theme="night"] {
  --paper: #171b31;
  --paper-2: #222846;
  --ink: #eceeff;
  --ink-soft: #a0a7cc;
  --line: rgba(200, 210, 255, 0.12);
  --accent: #5fd6ff;
  --accent-2: #8c6bff;
  --accent-ink: #fff;
  --accent-glow: rgba(110, 160, 255, 0.5);
  --backdrop: rgba(4, 6, 16, 0.5);
  --bg: #0e1226;
}

[data-sky="light"] {
  --ui-ink: #2f2834;
  --ui-soft: rgba(47, 40, 52, 0.6);
  --glass: rgba(255, 255, 255, 0.4);
  --glass-strong: rgba(255, 255, 255, 0.62);
  --glass-border: rgba(255, 255, 255, 0.62);
  --glass-shadow: 0 6px 20px -10px rgba(60, 40, 70, 0.35);
  --num-shadow: 0 1px 0 rgba(255, 255, 255, 0.5), 0 4px 24px rgba(255, 255, 255, 0.55);
}
[data-sky="dark"] {
  --ui-ink: #f5f3ff;
  --ui-soft: rgba(240, 238, 255, 0.66);
  --glass: rgba(22, 24, 48, 0.36);
  --glass-strong: rgba(30, 34, 66, 0.6);
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-shadow: 0 6px 22px -10px rgba(0, 0, 0, 0.6);
  --num-shadow: 0 2px 26px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  -webkit-touch-callout: none;
}

.scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
}

/* -------------------------------------------------------------- layout */
.app {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  color: var(--ui-ink);
  transition: color 0.8s;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 10px 12px 4px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { width: 40px; height: 40px; flex: 0 0 auto; filter: drop-shadow(0 3px 6px rgba(40, 30, 60, 0.25)); }
.brand span { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand b { font-family: var(--serif); font-weight: 600; font-size: 22px; letter-spacing: 0.01em; white-space: nowrap; }
.brand small { font-size: 11px; color: var(--ui-soft); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu { display: flex; gap: 2px; flex: 0 0 auto; }

.icon-btn, .btn, .modes button, .opt { touch-action: manipulation; }
.icon-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.icon-btn:hover { background: var(--glass); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg, .btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:focus-visible, .btn:focus-visible, .modes button:focus-visible, .opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* mode switch: a frosted segmented control with a sliding thumb */
.modes {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(calc(100% - 32px), 360px);
  margin: 4px auto 0;
  padding: 3px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  transition: background 0.8s, border-color 0.8s;
}
.modes button {
  position: relative;
  z-index: 1;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ui-soft);
  font: 600 13.5px var(--sans);
  letter-spacing: 0.02em;
  height: 34px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.3s;
  white-space: nowrap;
}
.modes button[aria-checked="true"] { color: var(--ink); }
.modes-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc((100% - 6px) / 3);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 2px 8px -2px rgba(30, 20, 40, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transform: translateX(calc(var(--i, 0) * 100%));
  transition: transform 0.38s var(--ease);
}

.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  touch-action: none;
  cursor: pointer;
  outline: none;
}

.hud {
  position: absolute;
  left: 0;
  right: 0;
  top: 2%;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  text-shadow: var(--num-shadow);
}
.tower-h {
  font: 250 clamp(56px, 17vw, 88px) / 1 var(--display);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  transform-origin: 50% 60%;
}
.tower-h.pop { animation: pop 0.42s var(--spring); }
@keyframes pop {
  0% { transform: scale(1); }
  30% { transform: scale(1.1); }
  100% { transform: scale(1); }
}
.best {
  margin-top: 4px;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ui-soft);
}
.best b { font-weight: 600; color: var(--ui-ink); letter-spacing: 0.04em; margin-left: 3px; }
.combo {
  margin-top: 10px;
  padding: 5px 13px 5px;
  border-radius: 999px;
  font: 600 13px var(--sans);
  letter-spacing: 0.06em;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--accent) 45%, transparent), 0 6px 18px -6px var(--accent-glow);
  text-shadow: none;
  opacity: 0;
  transform: translateY(-6px) scale(0.92);
  transition: opacity 0.25s, transform 0.3s var(--ease);
}
.combo.show { opacity: 1; transform: none; }
.combo.pulse { animation: pulse 0.45s var(--spring); }
.combo i { font-style: normal; color: var(--accent-2); margin-left: 6px; }
@keyframes pulse {
  0% { transform: scale(1); }
  35% { transform: scale(1.14); }
  100% { transform: scale(1); }
}

.tap-hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  margin: 0;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  text-align: center;
  color: var(--ui-ink);
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  pointer-events: none;
  transition: opacity 0.5s, transform 0.5s var(--ease);
  white-space: nowrap;
}
.tap-hint.gone { opacity: 0; transform: translateX(-50%) translateY(8px); }

.paused {
  position: absolute;
  left: 50%;
  top: 37%;
  transform: translate(-50%, -50%);
  display: grid;
  gap: 4px;
  text-align: center;
  padding: 22px 34px 20px;
  border-radius: 24px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  animation: fadein 0.3s var(--ease);
  white-space: nowrap;
}
.paused b { font-family: var(--serif); font-size: 28px; font-weight: 600; }
.paused span { font-size: 13.5px; color: var(--ui-soft); }
@keyframes fadein { from { opacity: 0; transform: translate(-50%, -46%); } }

.count {
  position: absolute;
  left: 50%;
  top: 31%;
  width: 96px;
  height: 96px;
  margin: -48px 0 0 -48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font: 250 50px / 1 var(--display);
  font-variant-numeric: tabular-nums;
  color: var(--ui-ink);
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  pointer-events: none;
}
.count.tick { animation: tick 0.5s var(--ease); }
@keyframes tick {
  0% { transform: scale(1.18); }
  45% { transform: scale(1); }
  100% { transform: scale(0.96); }
}

.actions {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 6px 16px 14px;
}
.btn {
  appearance: none;
  flex: 1;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: inherit;
  font: 500 15px var(--sans);
  padding: 11px 12px;
  min-height: 46px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  transition: transform 0.15s, background 0.3s, opacity 0.2s, box-shadow 0.2s, color 0.8s, border-color 0.8s;
  white-space: nowrap;
}
.btn svg { width: 19px; height: 19px; flex: 0 0 auto; }
.btn:hover { background: var(--glass-strong); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: default; transform: none; }
.btn.primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  border-color: color-mix(in oklab, var(--accent-2) 70%, black);
  box-shadow: 0 8px 20px -8px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
}
.btn.primary:hover { filter: brightness(1.05); }
.btn.subtle { flex: 0 0 auto; background: transparent; box-shadow: none; border-color: transparent; color: var(--ink-soft); font-size: 13.5px; margin: 18px auto 0; display: flex; backdrop-filter: none; -webkit-backdrop-filter: none; }

/* -------------------------------------------------------- sheets, dialogs */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: var(--backdrop);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fade 0.25s;
}
@keyframes fade { from { opacity: 0; } }

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0 auto;
  z-index: 21;
  max-width: 560px;
  max-height: 86dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -10px 40px rgba(30, 20, 40, 0.28);
  padding-bottom: env(safe-area-inset-bottom);
  animation: rise 0.32s var(--ease);
}
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
.sheet header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px 6px 22px;
  flex: 0 0 auto;
}
.sheet h2, .dialog h2 { font-family: var(--serif); font-weight: 600; font-size: 24px; margin: 0; letter-spacing: 0.01em; }
.sheet-body {
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 2px 22px 26px;
  font-size: 15px;
  line-height: 1.55;
  -webkit-user-select: text;
  user-select: text;
}
.sheet-body h3 { font-family: var(--serif); font-weight: 600; font-size: 17px; margin: 20px 0 8px; color: var(--ink); }
.prose p { margin: 0 0 12px; }
.prose ul { margin: 0; padding-left: 20px; }
.prose li { margin: 5px 0; }
.prose li b { font-weight: 600; }
.muted { color: var(--ink-soft); }
.about { font-size: 13px; margin-top: 22px; text-align: center; }
.note { font-size: 13px; color: var(--ink-soft); margin: 10px 2px 0; line-height: 1.45; }

@media (min-width: 700px) and (min-height: 560px) {
  .sheet {
    bottom: auto;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 24px;
    max-height: 80dvh;
    animation: popsheet 0.28s var(--ease);
  }
}
@keyframes popsheet { from { opacity: 0; transform: translateY(-50%) scale(0.96); } }

.dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 22;
  width: min(calc(100vw - 32px), 400px);
  background: var(--paper);
  color: var(--ink);
  border-radius: 24px;
  padding: 26px 24px 22px;
  box-shadow: 0 20px 60px rgba(30, 20, 40, 0.35);
  text-align: center;
  animation: popc 0.3s var(--ease);
  overflow: hidden;
}
@keyframes popc { from { opacity: 0; transform: translate(-50%, -50%) scale(0.94); } }
.dialog p { margin: 8px 0 18px; color: var(--ink-soft); font-size: 15.5px; line-height: 1.5; }
.dialog .row { display: flex; gap: 10px; }
.dialog .btn { background: var(--paper-2); border-color: var(--line); box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; color: var(--ink); white-space: normal; line-height: 1.25; }
.dialog .btn.primary { background: linear-gradient(180deg, var(--accent), var(--accent-2)); color: var(--accent-ink); border-color: transparent; box-shadow: 0 8px 20px -8px var(--accent-glow); }

/* the result card sits low so the pulled-back tower stays visible above it */
.result {
  top: auto;
  bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 20px 20px 18px;
  animation: riseres 0.45s var(--ease);
  z-index: 19;
}
@keyframes riseres { from { opacity: 0; transform: translate(-50%, 24px); } }
.result .glow {
  position: absolute;
  inset: -60% -20% auto;
  height: 90%;
  background: radial-gradient(ellipse at 50% 60%, var(--accent-glow), transparent 65%);
  pointer-events: none;
  opacity: 0.7;
}
.result[data-record="true"] .glow { opacity: 1; animation: glowpulse 2.6s ease-in-out infinite; }
@keyframes glowpulse { 50% { opacity: 0.6; } }
.result-mode { position: relative; margin: 0 0 2px !important; font-size: 11px !important; letter-spacing: 0.14em; text-transform: uppercase; }
.result h2 { position: relative; font-size: 26px; }
.result-height { position: relative; margin: 2px 0 0; }
.result-height b { font: 250 64px / 1 var(--display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.result-text { position: relative; margin: 4px 0 14px !important; font-size: 14.5px !important; }
.result-stats { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 16px; }
.result-stats div, .summary div { display: flex; flex-direction: column; align-items: center; background: var(--paper-2); border-radius: 12px; padding: 8px 4px; line-height: 1.2; min-width: 0; }
.result-stats span, .summary span { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.result-stats b, .summary b { font-family: var(--serif); font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- results */
.summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
th { text-align: left; vertical-align: bottom; font-weight: 500; color: var(--ink-soft); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 4px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 7px 4px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
th.height, th.perfect, th.streak, td.height, td.perfect, td.streak { text-align: right; }
td.height { font-family: var(--serif); font-weight: 600; font-size: 16px; }
td.mode i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; transform: rotate(45deg) translateY(-1px); }
td.mode[data-mode="classic"] i { background: var(--accent); }
td.mode[data-mode="zen"] i { background: #8fcfb6; }
td.mode[data-mode="daily"] i { background: #9fb3ec; }
@media (max-width: 400px) { th.streak, td.streak { display: none; } td { padding: 7px 3px; } }

/* ------------------------------------------------------------- settings */
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt {
  appearance: none;
  border: 1.5px solid var(--line);
  background: var(--paper-2);
  color: var(--ink);
  font: 500 14px var(--sans);
  padding: 8px 14px 8px 10px;
  min-height: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.opt:active { transform: scale(0.97); }
.opt[aria-checked="true"] { border-color: var(--accent-2); background: var(--paper); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 25%, transparent); }
.opts.lang .opt, .opts.pace .opt { padding-left: 14px; min-width: 92px; justify-content: center; }
.swatch { display: inline-block; width: 30px; height: 30px; border-radius: 9px; flex: 0 0 auto; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.swatch svg { display: block; width: 100%; height: 100%; }
.toggle { display: flex; align-items: center; gap: 12px; margin-top: 8px; cursor: pointer; font-size: 15px; line-height: 1.35; min-height: 44px; }
.toggle.spaced { margin-top: 18px; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .track { flex: 0 0 auto; width: 46px; height: 28px; border-radius: 999px; background: color-mix(in oklab, var(--ink-soft) 45%, var(--paper-2)); position: relative; transition: background 0.25s; }
.toggle .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.25s var(--ease); }
.toggle input:checked + .track { background: var(--accent-2); }
.toggle input:checked + .track::after { transform: translateX(18px); }
.toggle input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------------------------------------------------------- toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(10px);
  z-index: 15;
  background: rgba(34, 28, 42, 0.9);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  max-width: min(calc(100vw - 32px), 440px);
  width: max-content;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ------------------------------------------------------- small screens */
@media (max-width: 380px) {
  .top { padding-left: 12px; padding-right: 8px; }
  .brand { gap: 8px; }
  .brand img { width: 34px; height: 34px; }
  .brand b { font-size: 20px; }
  .icon-btn { width: 42px; height: 42px; }
}
@media (max-height: 640px) {
  .top { padding-top: 6px; }
  .brand small { display: none; }
  .brand b { font-size: 20px; }
  .actions { padding-bottom: 10px; }
  .btn { padding: 9px 10px; min-height: 44px; }
  .tower-h { font-size: clamp(48px, 12vh, 72px); }
}
@media (max-height: 460px) {
  .modes { margin-top: 0; }
  .modes button { height: 30px; }
  .hud { top: 0; }
  .combo { margin-top: 4px; }
  .result { padding: 14px 18px 14px; }
  .result-height b { font-size: 44px; }
  .result-stats { margin-bottom: 10px; }
}
@media (min-width: 900px) and (min-height: 700px) {
  .brand b { font-size: 26px; }
}
/* short landscape: the mode switch moves into the header row, the height
   number to the left, so the middle of the sky stays free for the tower */
@media (max-height: 460px) and (min-width: 700px) {
  .modes { position: absolute; top: calc(env(safe-area-inset-top) + 9px); left: 50%; transform: translateX(-50%); width: 300px; margin: 0; z-index: 2; }
  .hud { left: max(20px, env(safe-area-inset-left)); right: auto; top: 6px; align-items: flex-start; }
  .tower-h { font-size: 56px; }
  .combo { margin-top: 8px; }
  .result { left: auto; right: max(16px, env(safe-area-inset-right)); bottom: 10px; transform: none; width: min(380px, 46vw); animation: riseside 0.45s var(--ease); }
}
@keyframes riseside { from { opacity: 0; transform: translateX(24px); } }

/* while the result card shows, the action bar steps aside */
.actions { transition: opacity 0.3s; }
.result-open .actions { opacity: 0; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .sheet, .dialog, .backdrop, .paused, .count.tick, .tower-h.pop, .combo.pulse, .result[data-record="true"] .glow { animation: none; }
  .modes-thumb, .combo, .tap-hint { transition-duration: 0.01s; }
}
