:root {
  --bg: #07050b;
  --ink: #f6eef1;
  --ink-2: #cdbcc4;
  --muted: #9a8791;
  --crimson: #e34948;
  --crimson-deep: #9b1c3a;
  --gold: #f2b544;
  --teal: #3fc1a5;
  --frost: #7fe8ff;
  --panel: rgba(18, 9, 16, 0.72);
  --panel-strong: rgba(18, 9, 16, 0.9);
  --line: rgba(255, 255, 255, 0.1);
  --display: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

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

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

button { font: inherit; color: inherit; }

kbd {
  display: inline-block;
  min-width: 1.7em;
  padding: 0.1em 0.45em;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom-width: 2px;
  background: rgba(255, 255, 255, 0.06);
  font: 600 0.78em/1.4 var(--ui);
  text-align: center;
  color: var(--ink);
}

/* ---------------------------------------------------------------- stage */

.shell {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(1200px 600px at 50% 40%, rgba(120, 20, 50, 0.25), transparent 70%),
    var(--bg);
}

.stage-wrap {
  position: relative;
  width: min(100vw, calc(100vh * 16 / 9));
  width: min(100vw, calc(100dvh * 16 / 9));
  aspect-ratio: 16 / 9;
  container-type: inline-size;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #0b0710;
}

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

.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  font-size: clamp(9px, 1.45cqi, 16px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.hud-top {
  position: absolute;
  inset: 1.4em 1.6em auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 1em;
}

.vitals { display: grid; gap: 0.45em; width: min(22em, 100%); }

.meter { display: flex; align-items: center; gap: 0.6em; }
.meter-label { width: 1.7em; font: 700 0.75em var(--ui); letter-spacing: 0.08em; color: var(--muted); }
.meter-track {
  position: relative;
  flex: 1;
  height: 0.55em;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.meter-hp .meter-track { height: 0.95em; }
.meter-fill, .meter-ghost {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  border-radius: inherit;
  transition: width 0.08s linear;
}
.meter-ghost { background: rgba(255, 220, 220, 0.55); transition: none; }
.meter-hp .meter-fill { background: linear-gradient(90deg, #b3203a, #ff5a5f); box-shadow: 0 0 12px rgba(255, 70, 90, 0.5); }
.meter-st .meter-fill { background: linear-gradient(90deg, #1f8f7a, var(--teal)); }
.meter-rage .meter-fill { background: linear-gradient(90deg, #b8741a, var(--gold)); }
.meter-mark { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: rgba(0, 0, 0, 0.55); }
.meter-num { min-width: 2.2em; font: 800 0.95em var(--ui); font-variant-numeric: tabular-nums; }

.rage-ready {
  font: 800 0.7em var(--ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0;
  transform: translateX(-0.4em);
  transition: opacity 0.2s, transform 0.2s;
}
.rage-ready.on { opacity: 1; transform: none; animation: glow 1.1s ease-in-out infinite; }

.hud.danger .meter-hp .meter-track { animation: danger 0.9s ease-in-out infinite; }

.wave-info, .score-info { display: grid; gap: 0.25em; }
.wave-info { text-align: center; justify-items: center; }
.wave-info strong { font: 900 1.9em/1 var(--display); letter-spacing: 0.06em; }
.wave-info > span { display: flex; gap: 0.6em; align-items: center; color: var(--ink-2); font-size: 0.85em; }
.mood {
  padding: 0.15em 0.6em;
  border-radius: 99px;
  font-weight: 700;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}
.mood[data-mood='calm'] { color: var(--frost); border-color: rgba(127, 232, 255, 0.35); }
.mood[data-mood='balanced'] { color: var(--gold); border-color: rgba(242, 181, 68, 0.35); }
.mood[data-mood='ruthless'] { color: #ff6b6b; border-color: rgba(255, 90, 95, 0.5); background: rgba(255, 60, 70, 0.14); }

.score-info { justify-items: end; text-align: right; }
.score-info strong { font: 900 2em/1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.score-info span { color: var(--ink-2); font-size: 0.85em; }
.score-info b { color: var(--gold); }

.combo {
  position: absolute;
  right: 1.8em;
  top: 32%;
  display: grid;
  justify-items: end;
  opacity: 0;
  transform: translateX(1em);
  transition: opacity 0.2s, transform 0.2s;
}
.combo.show { opacity: 1; transform: none; }
.combo b {
  font: 900 3.6em/0.9 var(--display);
  background: linear-gradient(180deg, #fff 20%, #ffb3b8 60%, var(--crimson));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.7));
}
.combo b.bump { animation: bump 0.18s ease-out; }
.combo span { font: 800 0.85em var(--ui); letter-spacing: 0.3em; text-transform: uppercase; color: var(--ink-2); }
.combo-track { width: 6em; height: 0.3em; margin-top: 0.4em; border-radius: 99px; background: rgba(0, 0, 0, 0.5); overflow: hidden; }
.combo-track i { display: block; height: 100%; width: 100%; background: var(--crimson); border-radius: inherit; }

.boss {
  position: absolute;
  left: 50%;
  bottom: 5.6em;
  width: min(34em, 60%);
  transform: translateX(-50%);
  display: grid;
  gap: 0.35em;
  justify-items: center;
}
.boss span { font: 700 1.05em var(--display); letter-spacing: 0.18em; text-transform: uppercase; color: #ffd0d0; }
.boss-track { width: 100%; height: 0.8em; border-radius: 99px; background: rgba(0, 0, 0, 0.6); box-shadow: inset 0 0 0 1px rgba(255, 80, 90, 0.4); overflow: hidden; }
.boss-track div { height: 100%; width: 100%; background: linear-gradient(90deg, #6d0f22, #ff2a3a); transition: width 0.15s; }

.tools {
  position: absolute;
  right: 1.2em;
  bottom: 1.1em;
  display: flex;
  gap: 0.5em;
  pointer-events: auto;
}
.tool {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  height: 2.5em;
  padding: 0 0.9em;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(8px);
  color: var(--ink-2);
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tool.icon { width: 2.5em; padding: 0; justify-content: center; }
.tool svg { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tool:hover { color: var(--ink); background: var(--panel-strong); }
.tool.on { color: #fff; border-color: rgba(127, 232, 255, 0.6); background: rgba(40, 120, 150, 0.45); }
.tool .off-icon, .tool.off .on-icon { display: none; }
.tool.off .off-icon { display: block; }
.tool.off { color: var(--muted); }

.engine-chip {
  position: absolute;
  left: 1.4em;
  bottom: 1.3em;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.35em 0.8em;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72em;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.engine-chip i { width: 0.55em; height: 0.55em; border-radius: 50%; background: #58e0a0; box-shadow: 0 0 8px #58e0a0; }

/* ---------------------------------------------------------------- banner */

.banner {
  position: absolute;
  left: 50%;
  top: 24%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  font-size: clamp(10px, 1.6cqi, 18px);
  opacity: 0;
  white-space: nowrap;
}
.banner.show { animation: banner 2.4s ease forwards; }
.banner h2 {
  margin: 0;
  font: 900 3.2em/1 var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #fff 30%, #ff9aa0 70%, var(--crimson));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.8));
}
.banner p { margin: 0.5em 0 0; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); text-shadow: 0 2px 6px #000; }

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

.screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  overflow-y: auto;
  touch-action: pan-y;
  -webkit-user-select: text;
  user-select: text;
}
.screen[hidden] { display: none; }
.screen-loading, .screen-error { background: radial-gradient(900px 500px at 50% 40%, #2a0b1c, var(--bg) 70%); }
.screen-title { background: linear-gradient(90deg, rgba(7, 5, 11, 0.92) 0%, rgba(7, 5, 11, 0.72) 45%, rgba(7, 5, 11, 0.2) 100%); place-items: center start; }
.screen-pause, .screen-over { background: rgba(7, 5, 11, 0.7); backdrop-filter: blur(6px); }

.logo {
  margin: 0;
  font: 900 clamp(44px, 8vw, 96px)/0.95 var(--display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #fff 25%, #ffc2c5 55%, var(--crimson) 80%, #7a1024);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 24px rgba(227, 73, 72, 0.35));
}
.logo span { display: block; }
.logo.small { font-size: clamp(32px, 6vw, 56px); text-align: center; }

.loader { width: min(420px, 90vw); display: grid; gap: 18px; justify-items: center; }
.load-track { width: 100%; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.load-track div { height: 100%; width: 0; background: linear-gradient(90deg, var(--crimson-deep), var(--crimson), var(--gold)); border-radius: inherit; transition: width 0.25s; }
#load-label { margin: 0; color: var(--muted); font-size: 13px; }

.title-card {
  width: min(560px, 100%);
  margin-left: clamp(0px, 6vw, 96px);
  display: grid;
  gap: 18px;
}
.eyebrow { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--crimson); }
.tagline { margin: 0; color: var(--ink-2); font-size: clamp(14px, 1.6vw, 17px); line-height: 1.55; max-width: 46ch; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.actions.col { flex-direction: column; align-items: stretch; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 26px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.2s, background 0.2s;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:focus-visible, .tool:focus-visible { outline: 2px solid var(--frost); outline-offset: 2px; }
.btn-play {
  color: #fff;
  background: linear-gradient(135deg, #ff5a5f, var(--crimson-deep));
  box-shadow: 0 10px 30px rgba(227, 73, 72, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  text-transform: uppercase;
}
.btn-play:hover { box-shadow: 0 14px 40px rgba(227, 73, 72, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.btn-play kbd { background: rgba(0, 0, 0, 0.2); border-color: rgba(255, 255, 255, 0.3); font-size: 11px; }
.btn-ghost { color: var(--ink); background: rgba(255, 255, 255, 0.06); border-color: var(--line); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); }

.title-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 13px; }
.title-meta b { color: var(--ink); }

.controls { display: none; gap: 16px; padding: 18px; border-radius: 16px; background: var(--panel-strong); border: 1px solid var(--line); }
.controls.open { display: grid; animation: rise 0.25s ease; }
.keys { display: grid; gap: 8px; font-size: 13px; color: var(--ink-2); }
.keys div { display: grid; grid-template-columns: 9.5em 1fr; gap: 12px; align-items: center; }
.keys span { color: var(--ink); white-space: nowrap; }
.tips { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.tips b { color: var(--ink); }

.back {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  padding: 8px 14px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--line);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.back:hover { color: var(--ink); }

.card {
  width: min(460px, 100%);
  padding: 28px;
  border-radius: 20px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  display: grid;
  gap: 16px;
  text-align: center;
  animation: rise 0.3s ease;
}
.card h2 { margin: 0; font: 900 clamp(30px, 5vw, 44px)/1 var(--display); letter-spacing: 0.06em; text-transform: uppercase; }
.card .actions { justify-content: center; }
.card.over { width: min(560px, 100%); }
.over h2 { color: #ffb3b8; }
.final-score { font: 900 clamp(40px, 7vw, 64px)/1 var(--display); color: var(--gold); font-variant-numeric: tabular-nums; }
.new-best {
  justify-self: center;
  padding: 6px 14px;
  border-radius: 99px;
  background: linear-gradient(135deg, var(--gold), #d4861a);
  color: #1a0d05;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  animation: glow 1.2s ease-in-out infinite;
}
.stats { margin: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 520px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stats div { padding: 10px 8px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.stats dt { font-size: 10px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats dd { margin: 4px 0 0; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.note { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.55; }

/* ---------------------------------------------------------------- touch */

.touch {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 10;
  display: none;
  justify-content: space-between;
  align-items: end;
  padding: 12px max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  pointer-events: none;
}
body.touch-ui[data-mode='playing'] .touch { display: flex; }
.touch button {
  pointer-events: auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(20, 10, 18, 0.45);
  backdrop-filter: blur(6px);
  color: rgba(255, 255, 255, 0.85);
  font: 800 12px var(--ui);
  letter-spacing: 0.06em;
  border-radius: 50%;
  touch-action: none;
  transition: transform 0.06s, background 0.06s;
}
.touch button.on { transform: scale(0.94); background: rgba(227, 73, 72, 0.55); border-color: rgba(255, 150, 150, 0.7); }
.touch svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.pad { display: flex; gap: 10px; }
.pad button { width: 72px; height: 72px; border-radius: 20px; }
.buttons {
  display: grid;
  grid-template-columns: repeat(3, 62px);
  grid-template-rows: repeat(2, 62px);
  gap: 10px;
  grid-template-areas:
    'special heavy jump'
    'dash attack jump';
}
.buttons button { width: 62px; height: 62px; }
.b-special { grid-area: special; color: var(--gold) !important; }
.b-heavy { grid-area: heavy; }
.b-dash { grid-area: dash; color: var(--frost) !important; }
.b-attack { grid-area: attack; width: 70px !important; height: 70px !important; background: rgba(227, 73, 72, 0.35) !important; }
.b-jump { grid-area: jump; align-self: center; }

/* Phones held upright: stage on top, controls in the space below. */
@media (orientation: portrait) {
  .shell { place-items: start center; padding-top: max(56px, env(safe-area-inset-top)); }
  .screen-title { place-items: center; background: rgba(7, 5, 11, 0.86); }
  .title-card { margin-left: 0; }
}

@media (max-width: 640px), (max-height: 480px) {
  .engine-chip { display: none; }
  .tool span { display: none; }
  .tool { width: 2.5em; padding: 0; justify-content: center; }
  .keys div { grid-template-columns: 8em 1fr; }
}

/* Touch devices: keep the tool buttons clear of the thumb controls. */
body.touch-ui .tools { top: 4.4em; bottom: auto; right: 1.2em; }
body.touch-ui .btn kbd, body.touch-ui .controls .keys { display: none; }

.rotate-hint {
  display: none;
  position: fixed;
  left: 50%;
  top: calc(100vw * 9 / 16 + 90px);
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
@media (orientation: portrait) {
  body.touch-ui[data-mode='playing'] .rotate-hint { display: block; }
}

/* Short screens (phones held sideways) */
@media (max-height: 520px) {
  .logo { font-size: clamp(28px, 10vh, 56px); }
  .boss-offer { padding: 8px 12px 8px 8px; }
  .boss-offer-icon { width: 36px; height: 36px; }
  .boss-offer-text small { display: none; }
  .title-card { gap: 10px; padding-top: 44px; }
  .tagline { font-size: 13px; }
  .btn { min-height: 42px; padding: 0 20px; font-size: 14px; }
  .card { padding: 18px; gap: 10px; }
  .final-score { font-size: 36px; }
  .stats dd { font-size: 16px; }
  .pad button { width: 64px; height: 64px; }
  .buttons { grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(2, 56px); gap: 8px; }
  .buttons button { width: 56px; height: 56px; }
  .b-attack { width: 64px !important; height: 64px !important; }
}

/* ---------------------------------------------------------------- main boss */

.btn svg, .tool svg { flex: none; }
.boss-btn svg, .btn-boss svg, .boss-offer-icon svg { fill: currentColor; stroke: none; }
.btn-boss svg { width: 18px; height: 18px; }
.btn-boss {
  color: #ffd9a0;
  background: linear-gradient(135deg, rgba(255, 122, 26, 0.22), rgba(155, 28, 58, 0.35));
  border-color: rgba(255, 170, 90, 0.4);
}
.btn-boss:hover { background: linear-gradient(135deg, rgba(255, 122, 26, 0.32), rgba(155, 28, 58, 0.45)); }
.tool.boss-btn { color: #ffd9a0; border-color: rgba(255, 170, 90, 0.45); background: rgba(90, 30, 10, 0.55); }
.tool.boss-btn:hover { color: #fff; background: rgba(140, 50, 15, 0.7); }

.boss-offer {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(420px, 100%);
  padding: 12px 16px 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 170, 90, 0.4);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255, 122, 26, 0.28), transparent 60%),
    linear-gradient(135deg, rgba(60, 14, 20, 0.85), rgba(25, 8, 14, 0.85));
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(255, 90, 20, 0.12);
  transition: transform 0.12s, box-shadow 0.2s, border-color 0.2s;
}
.boss-offer:hover { border-color: rgba(255, 190, 120, 0.7); box-shadow: 0 14px 40px rgba(255, 90, 20, 0.25); }
.boss-offer:active { transform: translateY(1px); }
.boss-offer:focus-visible { outline: 2px solid var(--frost); outline-offset: 2px; }
.boss-offer-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 12px;
  color: #1a0805;
  background: linear-gradient(135deg, #ffcf7a, #ff7a1a);
  box-shadow: 0 0 20px rgba(255, 122, 26, 0.45);
}
.boss-offer-icon svg { width: 24px; height: 24px; }
.boss-offer-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.boss-offer-text b { font: 800 15px var(--ui); letter-spacing: 0.02em; }
.boss-offer-text small { color: var(--ink-2); font-size: 12px; }
.boss-offer-price {
  flex: none;
  padding: 6px 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  font: 800 13px var(--ui);
  color: #ffd9a0;
}
.boss-offer-price:empty { display: none; }
[data-boss-button][aria-busy='true'] { opacity: 0.7; cursor: progress; }
[data-boss-button][aria-busy='true'] .boss-offer-icon { animation: glow 0.9s ease-in-out infinite; }

.toast {
  position: absolute;
  left: 50%;
  bottom: 16%;
  transform: translate(-50%, 8px);
  z-index: 30;
  max-width: 80%;
  padding: 10px 16px;
  border-radius: 99px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  color: var(--ink);
  font: 600 clamp(11px, 1.3cqi, 14px) var(--ui);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Inside the mobile app: no dashboard to go back to, and it is already fullscreen. */
body.native .back, body.native #btn-fullscreen { display: none; }

/* ---------------------------------------------------------------- motion */

@keyframes banner {
  0% { opacity: 0; transform: translateX(-50%) scale(1.25); letter-spacing: 0.3em; }
  12% { opacity: 1; transform: translateX(-50%) scale(1); }
  80% { opacity: 1; transform: translateX(-50%) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-0.6em) scale(0.98); }
}
@keyframes bump { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes glow { 50% { filter: brightness(1.35); } }
@keyframes danger { 50% { box-shadow: inset 0 0 0 1px rgba(255, 60, 60, 0.9), 0 0 12px rgba(255, 40, 40, 0.6); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .banner.show { animation: none; opacity: 1; }
}
