/* PERVIDGENZ — game shell styles.
   Retro-neon arcade identity matching the canvas renderer. System fonts only (no network
   requests), CJK-ready font stacks, 100dvh + safe-area layout, reduced-motion aware.
   NOTE: the pulsing X2 button, the blinking REVIVIR button and the pulsing POWER-UP button keep
   their animation under prefers-reduced-motion on purpose: they are the experimental
   manipulation and must be identical for every group-B participant. */

:root {
  --bg: #07061a;
  --bg-2: #0e0b2c;
  --panel: rgba(20, 15, 54, 0.9);
  --panel-solid: #140f35;
  --line: rgba(150, 128, 255, 0.28);
  --line-strong: rgba(150, 128, 255, 0.55);
  --text: #eef0ff;
  --muted: #b1b4d8;
  --dim: #7c7fa8;
  --cyan: #2bc4ff;
  --aqua: #1ff2e0;
  --magenta: #ff2bd6;
  --pink: #ff4f9a;
  --amber: #ffd23f;
  --orange: #ff9f1c;
  --lime: #b8ff3c;
  --red: #ff3b5c;
  --violet: #8b5cff;

  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans",
    "PingFang SC", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Microsoft YaHei", "Yu Gothic UI", Meiryo,
    "Noto Sans CJK SC", "Noto Sans CJK JP", sans-serif;
  --font-display: "Avenir Next Condensed", "Bahnschrift", "Roboto Condensed", sans-serif-condensed,
    "Arial Narrow", "Helvetica Neue", var(--font-ui);
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Roboto Mono", "DejaVu Sans Mono",
    "Liberation Mono", monospace;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);

  --hud-h: 52px;
  --side-w: 184px;   /* keep in sync with SIDE_PANEL_W in js/hud.js */
  --stage-gap: 14px; /* keep in sync with GAP in js/hud.js */

  color-scheme: dark;
}

:root:lang(ja) {
  --font-ui: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo,
    "Noto Sans CJK JP", "Segoe UI", Roboto, sans-serif;
}
:root:lang(zh) {
  --font-ui: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Hiragino Sans GB",
    "Segoe UI", Roboto, sans-serif;
}

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

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}

/* ------------------------------------------------------------------------------------------ */
/* Background: synthwave glow + perspective grid                                               */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(255, 43, 214, 0.22), transparent 60%),
    radial-gradient(90% 50% at 50% 110%, rgba(43, 196, 255, 0.2), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

.backdrop-grid {
  position: absolute;
  left: -50%;
  right: -50%;
  bottom: -10%;
  height: 55%;
  background-image:
    linear-gradient(rgba(255, 43, 214, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43, 196, 255, 0.28) 1px, transparent 1px);
  background-size: 48px 48px;
  transform: perspective(360px) rotateX(62deg);
  transform-origin: 50% 100%;
  mask-image: linear-gradient(180deg, transparent 0%, #000 45%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 45%);
  opacity: 0.55;
  animation: grid-run 6s linear infinite;
}

@keyframes grid-run {
  to {
    background-position: 0 48px, 0 0;
  }
}

body[data-active-screen="game"] .backdrop-grid {
  opacity: 0.18;
}

/* ------------------------------------------------------------------------------------------ */
/* Screens                                                                                     */

#app {
  position: relative;
  z-index: 1;
}

.screen {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: max(16px, var(--safe-t)) max(16px, var(--safe-r)) max(16px, var(--safe-b)) max(16px, var(--safe-l));
  animation: screen-in 0.4s ease both;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.screen.is-leaving {
  opacity: 0;
  transform: scale(0.985);
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.screen--center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.screen--center > * {
  margin: auto;
}

/* ------------------------------------------------------------------------------------------ */
/* Brand                                                                                       */

.logo {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-style: italic;
  font-stretch: condensed;
  font-size: clamp(46px, 14vw, 88px);
  line-height: 0.95;
  letter-spacing: 0.04em;
  text-align: center;
  color: #fff;
  background: linear-gradient(180deg, #ffffff 0%, #ffe0fb 32%, var(--magenta) 58%, #7b3bff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(255, 43, 214, 0.55)) drop-shadow(0 0 26px rgba(43, 196, 255, 0.3));
  padding: 0 0.08em; /* italic overhang */
  overflow-wrap: normal;
}

.logo--sm {
  font-size: clamp(30px, 9vw, 44px);
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.brand::after {
  content: "";
  width: min(70%, 320px);
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--magenta), transparent);
  box-shadow: 0 0 12px rgba(43, 196, 255, 0.8);
}

.brand-kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--aqua);
  text-shadow: 0 0 10px rgba(31, 242, 224, 0.6);
}

/* ------------------------------------------------------------------------------------------ */
/* Global language switch and test badge                                                       */

.lang-switch {
  position: fixed;
  z-index: 40;
  top: max(12px, var(--safe-t));
  right: max(12px, var(--safe-r));
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(14, 11, 44, 0.85);
  border: 1px solid var(--line);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

body[data-active-screen="game"] .lang-switch,
body[data-active-screen="loading"] .lang-switch {
  display: none;
}

.lang-switch,
.test-badge {
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Scrolled content screens: get the floating controls out of the way (see screens.js). */
body.is-scrolled:not([data-active-screen="game"]) .lang-switch,
body.is-scrolled:not([data-active-screen="game"]) .test-badge {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.lang-btn {
  appearance: none;
  border: 0;
  min-width: 44px;
  min-height: 34px;
  padding: 4px 10px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
  touch-action: manipulation;
}

.lang-btn[aria-pressed="true"] {
  background: linear-gradient(90deg, var(--cyan), var(--aqua));
  color: #03141f;
}

.test-badge {
  position: fixed;
  z-index: 70; /* above dialogs, below the ad overlay */
  top: max(10px, var(--safe-t));
  left: max(10px, var(--safe-l));
  padding: 3px 8px;
  border: 1px dashed var(--amber);
  border-radius: 6px;
  background: rgba(40, 30, 0, 0.8);
  color: var(--amber);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  pointer-events: none;
}

/* In game the badge moves to the bottom edge so it never covers the HUD. */
body[data-active-screen="game"] .test-badge {
  top: auto;
  bottom: max(2px, var(--safe-b));
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.75;
}

/* ------------------------------------------------------------------------------------------ */
/* Buttons                                                                                     */

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  touch-action: manipulation;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn--start {
  display: block;
  width: 100%;
  min-height: 58px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(90deg, var(--magenta) 0%, var(--violet) 50%, var(--cyan) 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25) inset, 0 0 22px rgba(255, 43, 214, 0.45), 0 0 44px rgba(43, 196, 255, 0.25);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.btn--start:hover:not(:disabled) {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35) inset, 0 0 30px rgba(255, 43, 214, 0.6), 0 0 60px rgba(43, 196, 255, 0.35);
}

.btn--start:disabled {
  cursor: not-allowed;
  filter: grayscale(0.85);
  opacity: 0.45;
  box-shadow: none;
}

.btn--start.is-busy {
  opacity: 0.8;
  filter: none;
  cursor: progress;
}

.btn--primary {
  color: #03141f;
  background: linear-gradient(90deg, var(--cyan), var(--aqua));
  box-shadow: 0 0 18px rgba(43, 196, 255, 0.45);
}

/* Group A: two equal, neutral, fully accessible choices (contract §2.4). */
.btn--neutral {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border: 1.5px solid rgba(238, 240, 255, 0.5);
}

.btn--neutral:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn--quiet {
  color: var(--muted);
  background: transparent;
  border: 1.5px solid var(--line-strong);
}

.btn--quiet:hover {
  color: var(--text);
}

/* ------------------------------------------------------------------------------------------ */
/* Consent                                                                                     */

.intro-wrap {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 44px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.challenge {
  margin: 4px 0 0;
  text-align: center;
  font-size: clamp(21px, 5.6vw, 28px);
  font-weight: 800;
  line-height: 1.25;
  color: var(--amber);
  text-shadow: 0 0 14px rgba(255, 210, 63, 0.45);
  text-wrap: balance;
}

.chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(20, 15, 54, 0.7);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.chip svg {
  width: 17px;
  height: 17px;
  color: var(--aqua);
  flex: none;
}

.intro-controls {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 14.5px;
}

.legal {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legal-caption {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.legal-box {
  max-height: clamp(150px, 30vh, 300px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(3, 2, 14, 0.55);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  scrollbar-width: thin;
  scrollbar-color: var(--violet) transparent;
}

.rich p {
  margin: 0 0 0.8em;
  overflow-wrap: anywhere;
}

.rich p:last-child {
  margin-bottom: 0;
}

.rich p.is-heading {
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1.5px solid var(--line-strong);
  background: rgba(20, 15, 54, 0.85);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.check:has(input:checked) {
  border-color: var(--aqua);
  box-shadow: 0 0 0 1px rgba(31, 242, 224, 0.4), 0 0 18px rgba(31, 242, 224, 0.2);
}

.check input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 28px;
  height: 28px;
  margin: 0;
  border-radius: 8px;
  border: 2px solid var(--aqua);
  background: rgba(0, 0, 0, 0.35) center / 18px 18px no-repeat;
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.check input:checked {
  background-color: var(--aqua);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4.5 12.5l5 5 10-11' fill='none' stroke='%2303141f' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  box-shadow: 0 0 14px rgba(31, 242, 224, 0.7);
}

.check-text {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.4;
  padding-top: 3px;
}

.consent-hint,
.sound-tip {
  margin: -6px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--dim);
}

.sound-tip {
  margin-top: 0;
}

.form-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 59, 92, 0.6);
  background: rgba(255, 59, 92, 0.12);
  color: #ffc2cd;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

/* ------------------------------------------------------------------------------------------ */
/* Notice cards (loading, resume, invalid, closed, error, thanks)                              */

.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.loader-bar {
  width: 160px;
  height: 4px;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
}

.loader-bar span {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--magenta), var(--cyan));
  animation: loader 1.1s ease-in-out infinite;
}

@keyframes loader {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(250%);
  }
}

.notice-card {
  width: 100%;
  max-width: 480px;
  padding: 30px 24px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(139, 92, 255, 0.18);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.notice-card--wide {
  max-width: 640px;
}

.notice-card .btn {
  width: 100%;
  margin-top: 6px;
}

.notice-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  color: var(--cyan);
  font-size: 30px;
  font-weight: 900;
  box-shadow: 0 0 20px rgba(43, 196, 255, 0.45);
}

.notice-icon--warn {
  border-color: var(--amber);
  color: var(--amber);
  box-shadow: 0 0 20px rgba(255, 210, 63, 0.4);
}

.notice-icon--ok {
  border-color: var(--lime);
  color: var(--lime);
  box-shadow: 0 0 24px rgba(184, 255, 60, 0.45);
}

.notice-title {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: clamp(26px, 7vw, 36px);
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-wrap: balance;
}

.notice-text {
  margin: 0;
  color: var(--muted);
  text-wrap: pretty;
}

.screen--thanks {
  align-items: flex-start;
}

.debrief {
  width: 100%;
  margin-top: 6px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(3, 2, 14, 0.5);
  color: var(--muted);
  font-size: 14.5px;
  text-align: left;
}

/* ------------------------------------------------------------------------------------------ */
/* Game screen: layout                                                                          */

.screen--game {
  padding: 0;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
}

.game-layout {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--stage-gap);
  padding: max(8px, var(--safe-t)) max(8px, var(--safe-r)) max(8px, var(--safe-b)) max(8px, var(--safe-l));
}

.game-layout.is-top {
  flex-direction: column;
}

.game-layout.is-side {
  flex-direction: row;
}

.stage {
  flex: none;
  position: relative;
}

.stage-frame {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #05040f;
  box-shadow:
    0 0 0 1px rgba(150, 128, 255, 0.4),
    0 0 36px rgba(139, 92, 255, 0.28),
    0 0 90px rgba(255, 43, 214, 0.12);
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* Portrait: HUD + playfield pinned to the top; spare height below becomes the thumb zone. */
.game-layout.is-top.has-thumb-zone {
  justify-content: flex-start;
}

.thumb-zone {
  display: none;
}

.has-thumb-zone .thumb-zone {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: var(--cw, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 18px;
  border: 1px dashed rgba(150, 128, 255, 0.22);
  background: linear-gradient(180deg, rgba(43, 196, 255, 0.05), rgba(139, 92, 255, 0.04));
  touch-action: none;
  cursor: ew-resize;
}

.thumb-track {
  width: 58%;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, transparent, rgba(43, 196, 255, 0.55), transparent);
  box-shadow: 0 0 12px rgba(43, 196, 255, 0.35);
}

.thumb-hint {
  padding: 0 12px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(177, 180, 216, 0.55);
}

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

.hud {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--hud-h);
  width: max(var(--cw, 360px), min(100%, 360px));
  max-width: 100%;
  padding: 0 8px 0 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(24, 18, 64, 0.94), rgba(12, 9, 36, 0.94));
  box-shadow: inset 0 0 22px rgba(139, 92, 255, 0.14), 0 6px 24px rgba(0, 0, 0, 0.35);
}

.hud-brand {
  display: none;
}

.hud-stat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1;
}

.hud-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
}

.hud-value {
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow: 0 0 8px rgba(43, 196, 255, 0.7);
  white-space: nowrap;
}

.hud-stat--score .hud-value {
  color: var(--amber);
  text-shadow: 0 0 8px rgba(255, 210, 63, 0.6);
}

.hud-hearts {
  display: flex;
  gap: 3px;
  margin-top: 4px;
}

.heart {
  width: 16px;
  height: 16px;
  fill: var(--pink);
  filter: drop-shadow(0 0 4px rgba(255, 79, 154, 0.85));
  transition: fill 0.3s ease, filter 0.3s ease;
}

.heart.is-lost {
  fill: rgba(255, 255, 255, 0.12);
  filter: none;
}

.hud-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hud-icon {
  appearance: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
}

.hud-icon svg {
  width: 20px;
  height: 20px;
}

.hud-icon:hover {
  background: rgba(255, 255, 255, 0.12);
}

.hud-icon .icon-cross,
.hud-icon.is-muted .icon-wave {
  display: none;
}

.hud-icon.is-muted .icon-cross {
  display: inline;
}

.hud-icon.is-muted {
  color: var(--dim);
}

/* Animated parts live on inner "face" elements so every button keeps a still bounding box
   (a stable hit target for players and for automated tests). */
.hud-powerup {
  appearance: none;
  border: 0;
  padding: 0;
  height: 34px;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
}

.hud-powerup-face {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 12px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #2a1400;
  background: linear-gradient(90deg, var(--amber), var(--orange));
  box-shadow: 0 0 12px rgba(255, 210, 63, 0.85), 0 0 26px rgba(255, 159, 28, 0.45);
  animation: powerup-pulse 1s ease-in-out infinite;
}

@keyframes powerup-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 10px rgba(255, 210, 63, 0.75), 0 0 22px rgba(255, 159, 28, 0.35);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 18px rgba(255, 210, 63, 1), 0 0 40px rgba(255, 159, 28, 0.7);
  }
}

/* Phones: tighten the top bar so the group-B POWER-UP button always fits next to the stats
   (the bar keeps the same height in A and B, so the playfield size is identical). */
@media (max-width: 440px) {
  .hud {
    gap: 8px;
    padding: 0 6px 0 9px;
  }
  .hud-label {
    font-size: 10px;
    letter-spacing: 0.1em;
  }
  .hud-value {
    font-size: 16px;
  }
  .hud-actions {
    gap: 5px;
  }
  .hud-icon {
    width: 34px;
    height: 34px;
  }
  .hud-powerup-face {
    padding: 0 9px;
    font-size: 11px;
  }
}

@media (max-width: 380px) {
  .hud {
    gap: 6px;
    padding: 0 5px 0 8px;
  }
  .hud-label {
    font-size: 9px;
    letter-spacing: 0.06em;
  }
  .hud-value {
    font-size: 14.5px;
  }
  .heart {
    width: 13px;
    height: 13px;
  }
  .hud-hearts {
    gap: 2px;
  }
  .hud-icon {
    width: 32px;
    height: 32px;
  }
  .hud-icon svg {
    width: 18px;
    height: 18px;
  }
  .hud-powerup-face {
    padding: 0 7px;
    font-size: 10.5px;
    letter-spacing: 0.02em;
  }
}

@media (max-width: 340px) {
  .hud {
    gap: 5px;
  }
  .hud-label {
    display: none;
  }
  .hud-value,
  .hud-hearts {
    margin-top: 0;
  }
  .hud-value {
    font-size: 13px;
  }
  .heart {
    width: 12px;
    height: 12px;
  }
  .hud-icon {
    width: 30px;
    height: 30px;
  }
  .hud-powerup-face {
    padding: 0 6px;
    font-size: 10px;
    letter-spacing: 0;
  }
}

/* Side panel (desktop / landscape): arcade-cabinet column next to the playfield. */
.is-side .hud {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  width: var(--side-w);
  height: var(--ch, auto);
  max-height: 100%;
  padding: 18px 14px;
  gap: 16px;
}

.is-side .hud-brand {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-style: italic;
  font-size: 25px;
  letter-spacing: 0.03em;
  text-align: center;
  background: linear-gradient(180deg, #fff 0%, var(--magenta) 70%, #7b3bff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 8px rgba(255, 43, 214, 0.5));
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.is-side .hud-stat {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(150, 128, 255, 0.15);
}

.is-side .hud-label {
  font-size: 11px;
}

.is-side .hud-value {
  margin-top: 7px;
  font-size: 26px;
}

.is-side .heart {
  width: 24px;
  height: 24px;
}

.is-side .hud-hearts {
  gap: 5px;
  margin-top: 7px;
}

.is-side .hud-actions {
  margin: auto 0 0;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

.is-side .hud-powerup {
  order: -1;
  width: 100%;
  height: 46px;
}

.is-side .hud-powerup-face {
  font-size: 15px;
}

.is-side .hud-icon {
  flex: 1 1 0;
  height: 44px;
}

@media (max-height: 520px) {
  .is-side .hud {
    padding: 10px;
    gap: 8px;
  }
  .is-side .hud-brand {
    display: none;
  }
  .is-side .hud-stat {
    padding: 6px 10px;
  }
  .is-side .hud-value {
    font-size: 19px;
    margin-top: 4px;
  }
  .is-side .heart {
    width: 18px;
    height: 18px;
  }
  .is-side .hud-powerup {
    height: 36px;
  }
  .is-side .hud-powerup-face {
    font-size: 13px;
  }
  .is-side .hud-icon {
    height: 36px;
  }
}

/* ------------------------------------------------------------------------------------------ */
/* Overlays on the playfield                                                                   */

.level-banner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
  text-align: center;
}

.level-banner-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-style: italic;
  font-size: clamp(34px, calc(var(--cw, 400px) * 0.15), 88px);
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 10px var(--magenta), 0 0 28px rgba(255, 43, 214, 0.7), 0 0 60px rgba(43, 196, 255, 0.5);
}

.level-banner-sub {
  font-size: clamp(13px, calc(var(--cw, 400px) * 0.04), 20px);
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--aqua);
  text-shadow: 0 0 10px rgba(31, 242, 224, 0.8);
}

.level-banner.is-playing {
  animation: banner 1.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes banner {
  0% {
    opacity: 0;
    transform: scale(1.35);
  }
  18% {
    opacity: 1;
    transform: scale(1);
  }
  75% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.96);
  }
}

.launch-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 20%;
  padding: 0 12px;
  text-align: center;
  pointer-events: none;
  font-size: clamp(12px, calc(var(--cw, 400px) * 0.034), 17px);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--aqua);
  text-shadow: 0 0 10px rgba(31, 242, 224, 0.85);
  animation: soft-blink 1.6s ease-in-out infinite;
}

@keyframes soft-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.resume-count {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: clamp(64px, calc(var(--cw, 400px) * 0.3), 160px);
  color: #fff;
  text-shadow: 0 0 16px var(--cyan), 0 0 40px rgba(43, 196, 255, 0.7);
  background: rgba(5, 4, 15, 0.25);
}

.resume-count.is-tick {
  animation: count-tick 0.4s ease-out both;
}

@keyframes count-tick {
  from {
    transform: scale(1.4);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ------------------------------------------------------------------------------------------ */
/* Dialogs                                                                                      */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

.modal-root.has-dialog {
  pointer-events: auto;
}

.modal {
  position: absolute;
  inset: 0;
  display: flex;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: max(16px, var(--safe-t)) max(16px, var(--safe-r)) max(16px, var(--safe-b)) max(16px, var(--safe-l));
  background: rgba(4, 3, 14, 0.74);
  opacity: 0;
  transition: opacity 0.2s ease;
  outline: none;
  touch-action: manipulation;
}

.modal.is-open {
  opacity: 1;
}

.modal-card {
  position: relative;
  margin: auto;
  width: min(100%, 420px);
  padding: 26px 22px 22px;
  border-radius: 22px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(28, 21, 72, 0.98), rgba(15, 11, 40, 0.98));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6), 0 0 50px rgba(139, 92, 255, 0.28);
  text-align: center;
  transform: translateY(14px) scale(0.97);
  transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.modal.is-open .modal-card {
  transform: none;
}

.modal-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--aqua);
}

.modal-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: clamp(28px, 8vw, 40px);
  line-height: 1.05;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-wrap: balance;
}

.modal-title--glow {
  color: #fff;
  text-shadow: 0 0 12px var(--cyan), 0 0 30px rgba(43, 196, 255, 0.55);
}

.modal-title--danger {
  color: #fff;
  text-shadow: 0 0 12px var(--red), 0 0 30px rgba(255, 59, 92, 0.6);
}

.modal-title--offer {
  color: var(--amber);
  text-shadow: 0 0 14px rgba(255, 210, 63, 0.6);
}

.modal-text {
  margin: 0 0 14px;
  color: var(--muted);
  text-wrap: pretty;
}

.modal-text--mono {
  font-family: var(--font-mono);
  color: var(--amber);
  font-weight: 700;
}

.modal-stats {
  display: flex;
  justify-content: center;
  gap: 26px;
  margin: 4px 0 18px;
}

.modal-stats div {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal-stats dt {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}

.modal-stats dd {
  margin: 4px 0 0;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.modal-actions > .btn {
  min-width: 150px;
}

.modal-actions--equal > .btn {
  flex: 1 1 0;
  min-width: 0;
}

.dots-loader {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.dots-loader span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  animation: soft-blink 1s ease-in-out infinite;
}

.dots-loader span:nth-child(2) {
  animation-delay: 0.2s;
}

.dots-loader span:nth-child(3) {
  animation-delay: 0.4s;
}

.modal--flash .modal-card {
  border-color: rgba(31, 242, 224, 0.6);
}

.victory-stars {
  font-size: 28px;
  letter-spacing: 0.2em;
  color: var(--amber);
  text-shadow: 0 0 14px rgba(255, 210, 63, 0.9);
  margin-bottom: 4px;
}

/* Power-up offer (group B) */
.offer-bolt {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 6px;
  filter: drop-shadow(0 0 12px rgba(255, 210, 63, 0.9));
}

.offer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 4px 0 14px;
}

.offer-card {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 10px 12px;
  border-radius: 16px;
  border: 1.5px solid var(--offer, var(--cyan));
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  box-shadow: 0 0 18px color-mix(in srgb, var(--offer, var(--cyan)) 35%, transparent);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.offer-card:hover {
  transform: translateY(-2px);
}

.offer-card--laser {
  --offer: var(--magenta);
}

.offer-card--fireball {
  --offer: var(--orange);
}

.offer-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
}

.offer-card--laser .offer-icon {
  background:
    linear-gradient(90deg, transparent 26%, #ff9cf0 26%, #fff 30%, #ff9cf0 34%, transparent 34%, transparent 66%, #ff9cf0 66%, #fff 70%, #ff9cf0 74%, transparent 74%);
  filter: drop-shadow(0 0 8px var(--magenta));
}

.offer-card--fireball .offer-icon {
  border-radius: 50%;
  background: radial-gradient(circle at 40% 38%, #fff 0 12%, #ffe27a 22%, var(--orange) 48%, #ff3b1f 70%, transparent 72%);
  filter: drop-shadow(0 0 10px var(--orange));
}

.offer-name {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
}

.offer-desc {
  font-size: 12px;
  line-height: 1.3;
  color: var(--muted);
}

.offer-cta {
  margin-top: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--amber);
  color: #2a1400;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

/* --- Deceptive end-of-game variant (group B, contract §2.7) -------------------------------- */

.modal--promo .modal-card {
  padding-bottom: 16px;
}

.x2-btn {
  appearance: none;
  display: block;
  width: 100%;
  margin: 6px 0 14px;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
}

.x2-face {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(112px, 22vh, 168px);
  padding: 16px 14px;
  border-radius: 24px;
  overflow: hidden;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 900;
  font-size: clamp(32px, 9.5vw, 48px);
  line-height: 1.02;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #3a0d00;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
  background: linear-gradient(180deg, #fff8c4 0%, var(--amber) 30%, var(--orange) 72%, #ff5a1f 100%);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.85) inset,
    0 0 22px rgba(255, 210, 63, 0.95),
    0 0 55px rgba(255, 159, 28, 0.75),
    0 0 100px rgba(255, 43, 214, 0.45);
  animation: x2-pulse 1.1s ease-in-out infinite;
}

.x2-face::after {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  width: 36%;
  left: -50%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  transform: skewX(-18deg);
  animation: x2-shine 2.2s ease-in-out infinite;
}

.x2-btn-label {
  position: relative;
  z-index: 1;
}

@keyframes x2-pulse {
  0%,
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.06);
    filter: brightness(1.15);
  }
}

@keyframes x2-shine {
  0% {
    left: -50%;
  }
  60%,
  100% {
    left: 130%;
  }
}

/* The real options: genuinely tiny, grey, low contrast; space is reserved so nothing jumps. */
.tiny-links {
  display: flex;
  justify-content: center;
  gap: 22px;
  min-height: 14px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.tiny-links.is-visible {
  visibility: visible;
  opacity: 1;
}

.tiny-link {
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: #57597a;
  text-decoration: none;
  cursor: pointer;
}

.tiny-link:focus-visible {
  outline-width: 1px;
  outline-offset: 1px;
}

/* --- Sunk-cost revive overlay (group B, contract §2.6) ------------------------------------- */

.modal--bare.revive-overlay {
  background: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
}

.revive-wrap {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
  padding: 12px;
}

.revive-kicker {
  margin: 0;
  font-size: clamp(18px, 5vw, 26px);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--amber);
  text-shadow: 0 0 14px rgba(255, 210, 63, 0.7);
}

.revive-ring {
  display: grid;
  place-items: center;
  width: clamp(96px, 26vw, 130px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 5px solid var(--red);
  box-shadow: 0 0 24px rgba(255, 59, 92, 0.8), inset 0 0 20px rgba(255, 59, 92, 0.5);
}

.revive-count {
  font-family: var(--font-mono);
  font-size: clamp(48px, 14vw, 72px);
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 14px var(--red);
}

.revive-btn {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  border-radius: 28px;
  cursor: pointer;
  touch-action: manipulation;
}

.revive-face {
  display: block;
  padding: 0.35em 0.9em;
  border-radius: 28px;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 900;
  font-size: clamp(48px, 15vw, 104px);
  line-height: 1;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 2px 10px rgba(80, 0, 20, 0.6);
  background: linear-gradient(180deg, #ff8aa2 0%, var(--red) 55%, #b0002a 100%);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.7) inset, 0 0 34px rgba(255, 59, 92, 0.95), 0 0 90px rgba(255, 59, 92, 0.6);
  animation: revive-blink 0.8s steps(1, end) infinite;
}

@keyframes revive-blink {
  0% {
    opacity: 1;
    transform: scale(1.04);
    filter: brightness(1.2);
  }
  50% {
    opacity: 0.4;
    transform: scale(1);
    filter: brightness(0.85);
  }
}

.revive-sub {
  margin: 0;
  max-width: 340px;
  font-size: 15px;
  color: var(--muted);
}

/* ------------------------------------------------------------------------------------------ */
/* Simulated ad                                                                                 */

.ad-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  padding: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l);
  background: #000;
  color: #fff;
  outline: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.ad-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
}

.ad-label {
  flex: none;
  padding: 4px 9px;
  border-radius: 5px;
  background: var(--amber);
  color: #111;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ad-reward {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  color: #d4d4de;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ad-countdown {
  flex: none;
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ad-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.ad-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1b1446, #3a1463 40%, #0f3b5e);
  background-size: 200% 200%;
  animation: ad-fallback 6s ease-in-out infinite alternate;
}

.ad-fallback span {
  font-family: var(--font-display);
  font-weight: 900;
  font-style: italic;
  font-size: clamp(60px, 20vw, 160px);
  color: rgba(255, 255, 255, 0.15);
}

@keyframes ad-fallback {
  to {
    background-position: 100% 100%;
  }
}

.ad-sound-hint {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 10px 18px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
}

.ad-progress {
  height: 4px;
  background: rgba(255, 255, 255, 0.16);
}

.ad-progress-bar {
  display: block;
  height: 100%;
  background: var(--amber);
  transform-origin: left center;
  transform: scaleX(0);
}

.ad-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 12px 14px 14px;
}

.ad-note {
  margin: 0;
  font-size: 13px;
  color: #b9b9c6;
}

.ad-pay {
  appearance: none;
  margin-left: auto;
  min-height: 44px;
  padding: 10px 20px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}

/* ------------------------------------------------------------------------------------------ */
/* Survey                                                                                       */

.screen--survey {
  padding: 0;
}

.survey-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: max(58px, calc(var(--safe-t) + 50px)) max(16px, var(--safe-r)) 0 max(16px, var(--safe-l));
}

.survey-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.survey-title {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: clamp(30px, 8vw, 44px);
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-shadow: 0 0 16px rgba(43, 196, 255, 0.45);
}

.survey-intro {
  margin: 0;
  color: var(--muted);
}

.scale-legend {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 12.5px;
  color: var(--dim);
}

.scale-legend b {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 5px;
  border-radius: 6px;
  background: rgba(43, 196, 255, 0.18);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 11px;
}

.likert-item {
  margin: 0 0 12px;
  padding: 16px 14px 14px;
  border-radius: 16px;
  border: 1.5px solid var(--line);
  background: var(--panel);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  scroll-margin: 90px 0 140px;
}

.likert-item.is-answered {
  border-color: rgba(43, 196, 255, 0.4);
}

.likert-item.is-missing {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(255, 59, 92, 0.25), 0 0 22px rgba(255, 59, 92, 0.25);
  animation: shake 0.4s ease;
}

@keyframes shake {
  25% {
    transform: translateX(-5px);
  }
  50% {
    transform: translateX(4px);
  }
  75% {
    transform: translateX(-2px);
  }
}

.likert-q {
  float: left;
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 0;
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

.likert-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--violet), var(--magenta));
  color: #fff;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
}

.likert-text {
  padding-top: 2px;
  overflow-wrap: anywhere;
}

.likert-scale {
  clear: both;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.likert-opt {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  touch-action: manipulation;
}

.likert-opt input {
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.likert-dot {
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 76px;
  height: 50px;
  border-radius: 12px;
  border: 1.5px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 800;
  color: var(--muted);
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.likert-opt:hover .likert-dot {
  border-color: var(--cyan);
  color: #fff;
}

.likert-opt input:checked + .likert-dot {
  border-color: transparent;
  background: linear-gradient(180deg, var(--cyan), #1a86d0);
  color: #03141f;
  box-shadow: 0 0 16px rgba(43, 196, 255, 0.6);
}

.likert-opt input:focus-visible + .likert-dot {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}

.likert-cap {
  font-size: 11.5px;
  line-height: 1.25;
  color: var(--dim);
  text-align: center;
  overflow-wrap: anywhere;
}

.likert-ends {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--dim);
}

@media (max-width: 559px) {
  .likert-cap {
    display: none;
  }
}

@media (min-width: 560px) {
  .likert-ends {
    display: none;
  }
  .likert-item {
    padding: 18px 18px 16px;
  }
}

.survey-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: grid;
  gap: 10px;
  margin: 6px calc(-1 * max(16px, var(--safe-r))) 0 calc(-1 * max(16px, var(--safe-l)));
  padding: 12px max(16px, var(--safe-r)) max(14px, var(--safe-b)) max(16px, var(--safe-l));
  border-top: 1px solid var(--line);
  background: rgba(9, 7, 30, 0.98);
  box-shadow: 0 -14px 28px rgba(7, 6, 26, 0.85);
}

.survey-footer .form-error {
  background: #2b0f24;
}

.survey-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.survey-progress-track {
  flex: 1;
  height: 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.survey-progress-bar {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--magenta), var(--cyan));
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

#survey-submit:not(.is-ready) {
  filter: saturate(0.6);
}

/* ------------------------------------------------------------------------------------------ */

.noscript {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
  color: var(--text);
  text-align: center;
}

/* Reduced motion: drop decorative motion. The X2 pulse, REVIVIR blink and POWER-UP pulse stay
   (experimental manipulation, see header note). */
@media (prefers-reduced-motion: reduce) {
  .backdrop-grid,
  .screen,
  .loader-bar span,
  .level-banner.is-playing,
  .launch-hint,
  .resume-count.is-tick,
  .dots-loader span,
  .likert-item.is-missing,
  .ad-fallback {
    animation: none !important;
  }
  .screen,
  .modal,
  .modal-card,
  .btn,
  .offer-card,
  .tiny-links,
  .survey-progress-bar,
  .check,
  .check input {
    transition: none !important;
  }
  .modal-card {
    transform: none;
  }
  .x2-face::after {
    animation: none;
    display: none;
  }
}
