:root {
  --aq-bg: #04090b;
  --aq-panel: rgba(7, 16, 19, 0.94);
  --aq-panel-soft: rgba(12, 24, 28, 0.78);
  --aq-text: #edfdf9;
  --aq-muted: #8aa8ab;
  --aq-gold: #fbbf24;
  --aq-gold-light: #fde68a;
  --aq-cyan: #67e8f9;
  --aq-emerald: #4ade80;
  --aq-red: #fb7185;
  --aq-line: rgba(196, 240, 228, 0.14);
  --aq-line-strong: rgba(196, 240, 228, 0.28);
  --aq-accent: #67e8f9;
  --aq-accent-rgb: 103, 232, 249;
  --aq-secondary: #fbbf24;
  --aq-secondary-rgb: 251, 191, 36;
  --aq-font-display: "Cinzel", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --aq-font-ui: "Outfit", "Segoe UI", system-ui, sans-serif;
}

.aq-shell[data-theme="halls"] {
  --aq-accent: #67e8f9;
  --aq-accent-rgb: 103, 232, 249;
  --aq-secondary: #fbbf24;
  --aq-secondary-rgb: 251, 191, 36;
}

.aq-shell[data-theme="gardens"] {
  --aq-accent: #86efac;
  --aq-accent-rgb: 134, 239, 172;
  --aq-secondary: #fde68a;
  --aq-secondary-rgb: 253, 230, 138;
}

.aq-shell[data-theme="ember"] {
  --aq-accent: #fb923c;
  --aq-accent-rgb: 251, 146, 60;
  --aq-secondary: #fde047;
  --aq-secondary-rgb: 253, 224, 71;
}

.aq-shell[data-theme="frost"] {
  --aq-accent: #a5f3fc;
  --aq-accent-rgb: 165, 243, 252;
  --aq-secondary: #bae6fd;
  --aq-secondary-rgb: 186, 230, 253;
}

.aq-shell[data-theme="sanctum"] {
  --aq-accent: #c084fc;
  --aq-accent-rgb: 192, 132, 252;
  --aq-secondary: #67e8f9;
  --aq-secondary-rgb: 103, 232, 249;
}

* {
  box-sizing: border-box;
}

body.aq-page {
  margin: 0;
  min-height: 100vh;
  color: var(--aq-text);
  background:
    radial-gradient(900px 500px at 50% -12%, rgba(34, 197, 180, 0.14), transparent 62%),
    radial-gradient(700px 500px at 108% 105%, rgba(251, 191, 36, 0.08), transparent 60%),
    linear-gradient(180deg, #071315 0%, #04090b 60%, #020506 100%);
  font-family: var(--aq-font-ui);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.aq-page.aq-playing {
  overflow: hidden;
}

html.aq-playing {
  overflow: hidden;
}

.aq-shell {
  position: relative;
  width: min(1180px, 100%);
  height: calc(100vh - var(--app-header-h, 72px) - 10px);
  height: calc(100dvh - var(--app-header-h, 72px) - 10px);
  min-height: 420px;
  margin: 0 auto;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ══════════════════════════════════════
   TOP BAR
   ══════════════════════════════════════ */

.aq-topbar {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
  min-height: 54px;
  padding: 7px 10px;
  background: linear-gradient(180deg, rgba(15, 29, 33, 0.88), rgba(6, 13, 16, 0.92));
  border: 1px solid var(--aq-line);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(10px);
}

.aq-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 164px;
}

.aq-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  box-shadow: 0 0 18px rgba(var(--aq-accent-rgb), 0.22);
}

.aq-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.05;
}

.aq-brand-kicker {
  font-size: 0.48rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  color: var(--aq-gold);
}

.aq-brand-copy strong {
  font-family: var(--aq-font-display);
  font-size: 0.92rem;
  letter-spacing: 0.05em;
  color: var(--aq-text);
  white-space: nowrap;
}

.aq-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.aq-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 68px;
  padding: 4px 9px;
  border-left: 1px solid rgba(255, 255, 255, 0.07);
}

.aq-stat:first-child {
  border-left: 0;
}

.aq-stat-label {
  font-size: 0.5rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--aq-muted);
  white-space: nowrap;
}

.aq-stat-value {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.aq-stat-value b {
  font-size: 1rem;
  color: var(--aq-accent);
  text-shadow: 0 0 12px rgba(var(--aq-accent-rgb), 0.28);
}

.aq-stat-value small {
  font-size: 0.58rem;
  color: var(--aq-muted);
}

.aq-stat-score .aq-stat-value b {
  color: var(--aq-gold-light);
  text-shadow: 0 0 12px rgba(var(--aq-secondary-rgb), 0.3);
}

.aq-stat-life .aq-stat-value {
  gap: 2px;
}

.aq-hearts {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 16px;
  font-size: 1rem;
  line-height: 1;
  letter-spacing: 0.02em;
}

.aq-heart {
  display: inline-block;
  color: var(--aq-red);
  text-shadow: 0 0 10px rgba(251, 113, 133, 0.45);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.aq-heart.empty {
  color: rgba(251, 113, 133, 0.2);
  text-shadow: none;
}

.aq-heart.new {
  animation: aqHeartPop 0.4s ease;
}

.aq-gem {
  display: inline-block;
  width: 9px;
  height: 9px;
  background: linear-gradient(135deg, var(--aq-emerald), var(--aq-cyan));
  transform: rotate(45deg);
  border-radius: 2px;
  box-shadow: 0 0 9px rgba(74, 222, 128, 0.6);
}

.aq-tools {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.aq-tool {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--aq-line-strong);
  border-radius: 9px;
  background: rgba(5, 12, 16, 0.9);
  color: var(--aq-text);
  font: 800 0.92rem var(--aq-font-ui);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.aq-tool:hover,
.aq-tool:focus-visible {
  border-color: var(--aq-accent);
  background: rgba(var(--aq-accent-rgb), 0.12);
  outline: none;
}

.aq-tool:active {
  transform: scale(0.92);
}

.aq-tool.muted {
  color: var(--aq-muted);
  opacity: 0.7;
}

/* ══════════════════════════════════════
   STAGE
   ══════════════════════════════════════ */

.aq-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: #010506;
  border: 1px solid rgba(var(--aq-accent-rgb), 0.42);
  border-radius: 17px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.65),
    0 0 46px rgba(var(--aq-accent-rgb), 0.10),
    0 22px 50px rgba(0, 0, 0, 0.45),
    inset 0 0 50px rgba(0, 0, 0, 0.85);
}

.aq-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
}

.aq-stage-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 48%, transparent 62%, rgba(0, 3, 6, 0.32) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.16), transparent 15%, transparent 84%, rgba(0, 0, 0, 0.22));
}

.aq-hidden {
  display: none !important;
}

/* floor transition banner */
.aq-floor-banner {
  position: absolute;
  top: 17%;
  left: 50%;
  z-index: 3;
  transform: translateX(-50%);
  width: min(420px, 86%);
  padding: 12px 22px;
  text-align: center;
  pointer-events: none;
  border-top: 1px solid rgba(var(--aq-secondary-rgb), 0.55);
  border-bottom: 1px solid rgba(var(--aq-secondary-rgb), 0.35);
  background: linear-gradient(90deg, transparent, rgba(2, 8, 10, 0.72), transparent);
  animation: aqBannerIn 2.5s ease both;
}

.aq-floor-banner span {
  display: block;
  font-family: var(--aq-font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.42em;
  color: var(--aq-gold);
}

.aq-floor-banner strong {
  display: block;
  margin-top: 3px;
  font-family: var(--aq-font-display);
  font-size: clamp(1.1rem, 3.5vw, 1.7rem);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--aq-text);
  text-shadow: 0 0 24px rgba(var(--aq-secondary-rgb), 0.4);
}

@keyframes aqBannerIn {
  0% { opacity: 0; transform: translateX(-50%) translateY(10px); }
  14%, 70% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-8px); }
}

/* toast */
.aq-toast {
  position: absolute;
  left: 50%;
  bottom: 15%;
  z-index: 4;
  transform: translateX(-50%);
  max-width: 82%;
  padding: 8px 16px;
  border: 1px solid rgba(var(--aq-accent-rgb), 0.3);
  border-radius: 999px;
  background: rgba(3, 10, 12, 0.88);
  color: var(--aq-text);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: aqToastIn 2.8s ease both;
}

@keyframes aqToastIn {
  0% { opacity: 0; transform: translateX(-50%) translateY(6px); }
  12%, 76% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-4px); }
}

/* combo */
.aq-combo {
  position: absolute;
  top: 24%;
  right: 5%;
  z-index: 4;
  padding: 5px 11px;
  border: 1px solid rgba(var(--aq-secondary-rgb), 0.42);
  border-radius: 999px;
  background: rgba(5, 12, 13, 0.82);
  color: var(--aq-gold-light);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  pointer-events: none;
  animation: aqComboIn 1.1s ease both;
}

@keyframes aqComboIn {
  0% { opacity: 0; transform: translateY(8px) scale(0.9); }
  18%, 70% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-8px) scale(0.96); }
}

/* boss bar */
.aq-bossbar {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 4;
  width: min(470px, 78%);
  transform: translateX(-50%);
  padding: 7px 12px 8px;
  border: 1px solid rgba(251, 113, 133, 0.28);
  border-radius: 9px;
  background: rgba(8, 7, 11, 0.78);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(5px);
}

.aq-bossbar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.56rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--aq-red);
  text-shadow: 0 0 10px rgba(251, 113, 133, 0.26);
}

.aq-boss-phase {
  color: var(--aq-gold);
  font-size: 0.5rem;
}

.aq-bossbar-track {
  height: 6px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.aq-bossbar-track > div {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #7f1d1d, var(--aq-red), #fda4af);
  box-shadow: 0 0 12px rgba(251, 113, 133, 0.5);
  transition: width 0.18s linear;
}

/* ══════════════════════════════════════
   TOUCH CONTROLS
   ══════════════════════════════════════ */

.aq-touch {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  pointer-events: none;
}

.aq-stick {
  position: absolute;
  left: 18px;
  bottom: max(18px, calc(18px + var(--safe-area-inset-bottom, 0px)));
  width: 118px;
  height: 118px;
  border: 1px solid rgba(var(--aq-accent-rgb), 0.35);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 46%, rgba(var(--aq-accent-rgb), 0.1), rgba(2, 8, 10, 0.5));
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.5), 0 0 22px rgba(var(--aq-accent-rgb), 0.1);
  pointer-events: auto;
  touch-action: none;
}

.aq-stick::before,
.aq-stick::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.aq-stick::before {
  top: 50%;
  left: 14px;
  right: 14px;
  height: 1px;
}

.aq-stick::after {
  top: 14px;
  bottom: 14px;
  left: 50%;
  width: 1px;
}

.aq-stick-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, rgba(var(--aq-accent-rgb), 0.8), rgba(8, 35, 38, 0.9));
  box-shadow: 0 0 18px rgba(var(--aq-accent-rgb), 0.4);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.aq-actions {
  position: absolute;
  right: 16px;
  bottom: max(16px, calc(16px + var(--safe-area-inset-bottom, 0px)));
  display: grid;
  grid-template-columns: 66px 72px;
  grid-template-rows: 58px 74px;
  gap: 7px;
  pointer-events: none;
}

.aq-action {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  padding: 0;
  border: 1px solid rgba(var(--aq-accent-rgb), 0.42);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, rgba(var(--aq-accent-rgb), 0.16), rgba(3, 11, 14, 0.88));
  color: var(--aq-text);
  font-family: var(--aq-font-ui);
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.36), 0 0 18px rgba(var(--aq-accent-rgb), 0.1);
  transition: transform 0.08s ease, background 0.1s ease, box-shadow 0.1s ease;
}

.aq-action:active,
.aq-action.pressed {
  transform: scale(0.92) translateY(2px);
  background: rgba(var(--aq-accent-rgb), 0.2);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

.aq-action-small {
  width: 58px;
  height: 58px;
}

.aq-action-sword {
  grid-column: 2;
  grid-row: 2;
  width: 72px;
  height: 72px;
  border-color: rgba(var(--aq-secondary-rgb), 0.62);
  background: radial-gradient(circle at 35% 28%, rgba(var(--aq-secondary-rgb), 0.24), rgba(18, 17, 8, 0.9));
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.36), 0 0 24px rgba(var(--aq-secondary-rgb), 0.18);
}

.aq-action-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.aq-action-label {
  max-width: 100%;
  overflow: hidden;
  font-size: 0.42rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--aq-muted);
}

.aq-action-sword .aq-action-label {
  color: var(--aq-gold-light);
}

@media (pointer: coarse) {
  .aq-touch {
    display: block;
  }
}

/* ══════════════════════════════════════
   FOOTER
   ══════════════════════════════════════ */

.aq-footer {
  flex: 0 0 auto;
  min-height: 16px;
  text-align: center;
}

.aq-hint {
  margin: 0;
  color: var(--aq-muted);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
}

.aq-hint-mobile {
  display: none;
}

@media (pointer: coarse) {
  .aq-hint-desktop {
    display: none;
  }
  .aq-hint-mobile {
    display: block;
  }
}

/* ══════════════════════════════════════
   OVERLAYS / PANELS
   ══════════════════════════════════════ */

.aq-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 22px;
  overflow-y: auto;
  background:
    radial-gradient(ellipse at 50% 36%, rgba(var(--aq-accent-rgb), 0.1), transparent 56%),
    linear-gradient(180deg, rgba(2, 7, 9, 0.80), rgba(1, 4, 6, 0.93));
  backdrop-filter: blur(5px);
}

#titleOverlay {
  background:
    radial-gradient(ellipse at 50% 36%, rgba(var(--aq-accent-rgb), 0.12), transparent 56%),
    linear-gradient(180deg, rgba(2, 7, 9, 0.55), rgba(1, 4, 6, 0.78));
  backdrop-filter: blur(2px);
}

.aq-title-panel,
.aq-result-panel {
  position: relative;
  width: min(100%, 460px);
  margin: auto 0;
  padding: 26px 28px;
  border: 1px solid var(--aq-line-strong);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(14, 29, 32, 0.96), rgba(4, 11, 14, 0.97));
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.025) inset,
    0 0 50px rgba(var(--aq-accent-rgb), 0.07);
}

.aq-title-panel {
  width: min(100%, 940px);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(260px, 0.92fr);
  gap: 30px;
  padding: 30px;
}

.aq-title-panel::before,
.aq-result-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(120deg, rgba(var(--aq-accent-rgb), 0.5), transparent 32%, transparent 68%, rgba(var(--aq-secondary-rgb), 0.3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.aq-title-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
}

.aq-kicker {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 0.56rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--aq-gold);
}

.aq-logo {
  display: block;
  width: min(430px, 100%);
  height: auto;
  margin-bottom: 7px;
  filter: drop-shadow(0 0 22px rgba(var(--aq-secondary-rgb), 0.18));
}

.aq-tagline {
  margin: 0 0 10px;
  font-family: var(--aq-font-display);
  font-size: clamp(1.05rem, 2.4vw, 1.38rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--aq-accent);
  text-shadow: 0 0 18px rgba(var(--aq-accent-rgb), 0.22);
}

.aq-story {
  max-width: 540px;
  margin: 0 0 16px;
  color: var(--aq-muted);
  font-size: 0.83rem;
  line-height: 1.65;
}

.aq-feats {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 16px;
}

.aq-feats > span {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid var(--aq-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.aq-feats b {
  font-family: var(--aq-font-display);
  font-size: 0.92rem;
  color: var(--aq-gold-light);
}

.aq-feats small {
  font-size: 0.48rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--aq-muted);
}

.aq-best-line {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--aq-muted);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.aq-best-line b {
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: 0;
  color: var(--aq-gold-light);
  font-variant-numeric: tabular-nums;
}

.aq-best-line small {
  color: var(--aq-muted);
  font-size: 0.54rem;
}

.aq-controls-card {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 9px;
  padding: 18px;
  border: 1px solid var(--aq-line);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.18);
}

.aq-controls-card h2 {
  margin: 0 0 5px;
  font-family: var(--aq-font-display);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--aq-text);
}

.aq-control-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.022);
  color: var(--aq-muted);
  font-size: 0.7rem;
}

.aq-key {
  min-width: 67px;
  padding: 4px 5px;
  border: 1px solid rgba(var(--aq-accent-rgb), 0.28);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--aq-accent);
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.57rem;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

.aq-control-note {
  margin: 5px 0 0;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--aq-muted);
  font-size: 0.65rem;
  line-height: 1.5;
}

.aq-control-note-touch {
  display: none;
}

@media (pointer: coarse) {
  .aq-controls-card .aq-control-row,
  .aq-controls-card .aq-control-note:not(.aq-control-note-touch) {
    display: none;
  }

  .aq-control-note-touch {
    display: block;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .aq-controls-card {
    align-self: center;
  }
}

.aq-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 12px 22px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(100deg, var(--aq-gold), var(--aq-emerald));
  color: #061012;
  font: 900 0.86rem var(--aq-font-ui);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(var(--aq-secondary-rgb), 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.aq-btn:hover,
.aq-btn:focus-visible {
  filter: brightness(1.08);
  transform: translateY(-1px);
  outline: none;
  box-shadow: 0 14px 34px rgba(var(--aq-secondary-rgb), 0.26), 0 0 0 2px rgba(var(--aq-accent-rgb), 0.35);
}

.aq-btn:active {
  transform: scale(0.98);
}

.aq-btn-ghost {
  margin-top: 8px;
  background: transparent;
  color: var(--aq-muted);
  border: 1px solid var(--aq-line-strong);
  box-shadow: none;
}

.aq-btn-ghost:hover,
.aq-btn-ghost:focus-visible {
  color: var(--aq-text);
  background: rgba(var(--aq-accent-rgb), 0.08);
  box-shadow: none;
}

.aq-result-panel {
  text-align: center;
}

.aq-result-panel h2 {
  margin: 0 0 8px;
  font-family: var(--aq-font-display);
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--aq-text);
  text-shadow: 0 0 22px rgba(var(--aq-accent-rgb), 0.22);
}

.aq-result-copy {
  max-width: 410px;
  margin: 0 auto 18px;
  color: var(--aq-muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.aq-run-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 16px 0;
}

.aq-run-stats > div {
  padding: 9px 7px;
  border: 1px solid var(--aq-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.aq-run-stats span {
  display: block;
  margin-bottom: 3px;
  color: var(--aq-muted);
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.aq-run-stats b {
  color: var(--aq-accent);
  font-size: 1rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.aq-record {
  display: inline-block;
  margin: 0 0 12px;
  padding: 5px 12px;
  border: 1px solid rgba(var(--aq-secondary-rgb), 0.44);
  border-radius: 999px;
  background: rgba(var(--aq-secondary-rgb), 0.08);
  color: var(--aq-gold-light);
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  animation: aqRecordGlow 1.2s ease-in-out infinite alternate;
}

@keyframes aqRecordGlow {
  from { box-shadow: 0 0 8px rgba(var(--aq-secondary-rgb), 0.08); }
  to { box-shadow: 0 0 22px rgba(var(--aq-secondary-rgb), 0.28); }
}

.aq-victory-panel {
  border-color: rgba(var(--aq-secondary-rgb), 0.4);
}

.aq-victory-panel h2 {
  color: var(--aq-gold-light);
  text-shadow: 0 0 26px rgba(var(--aq-secondary-rgb), 0.3);
}

.aq-hidden {
  display: none !important;
}

/* ══════════════════════════════════════
   SEO / GAME EXTRAS
   ══════════════════════════════════════ */

.aq-tips {
  width: min(1180px, 100%);
  margin: 18px auto 0;
  padding: 0 14px 24px;
}

.aq-tips h2 {
  margin: 0 0 12px;
  font-family: var(--aq-font-display);
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  color: var(--aq-text);
}

.aq-tips-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.aq-tips-grid article {
  padding: 15px 16px;
  border: 1px solid var(--aq-line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.02);
}

.aq-tips-grid h3 {
  margin: 0 0 6px;
  color: var(--aq-gold-light);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
}

.aq-tips-grid p {
  margin: 0;
  color: var(--aq-muted);
  font-size: 0.72rem;
  line-height: 1.6;
}

/* ══════════════════════════════════════
   ANIMATIONS / RESPONSIVE
   ══════════════════════════════════════ */

@keyframes aqHeartPop {
  0% { transform: scale(0.7); }
  55% { transform: scale(1.24); }
  100% { transform: scale(1); }
}

@media (max-width: 860px) {
  .aq-title-panel {
    grid-template-columns: 1fr;
    gap: 18px;
    width: min(100%, 560px);
    padding: 24px;
  }

  .aq-controls-card {
    justify-content: flex-start;
  }

  .aq-controls-card h2 {
    font-size: 0.88rem;
  }

  .aq-control-row {
    font-size: 0.66rem;
  }

  .aq-tips-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .aq-shell {
    height: calc(100vh - var(--app-header-h, 56px) - 8px);
    height: calc(100dvh - var(--app-header-h, 56px) - 8px);
    min-height: 400px;
    padding: 6px 8px;
    gap: 5px;
  }

  .aq-topbar {
    min-height: 48px;
    padding: 5px 7px;
    gap: 7px;
    border-radius: 11px;
  }

  .aq-brand {
    min-width: 0;
    gap: 6px;
  }

  .aq-brand-mark {
    width: 32px;
    height: 32px;
  }

  .aq-brand-copy {
    display: none;
  }

  .aq-stats {
    gap: 0;
    justify-content: space-evenly;
  }

  .aq-stat {
    min-width: 0;
    padding: 3px 5px;
  }

  .aq-stat-label {
    display: none;
  }

  .aq-stat-value b {
    font-size: 0.88rem;
  }

  .aq-stat-value small {
    font-size: 0.5rem;
  }

  .aq-hearts {
    font-size: 0.86rem;
    gap: 2px;
  }

  .aq-stat .aq-gem {
    width: 7px;
    height: 7px;
  }

  .aq-tools {
    gap: 4px;
  }

  .aq-tool {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
  }

  .aq-stage {
    border-radius: 12px;
  }

  .aq-overlay {
    padding: 10px;
    align-items: flex-start;
  }

  .aq-title-panel,
  .aq-result-panel {
    margin: auto 0;
    padding: 20px 18px;
    border-radius: 18px;
  }

  .aq-logo {
    width: min(330px, 100%);
  }

  .aq-tagline {
    font-size: 0.98rem;
  }

  .aq-story {
    font-size: 0.76rem;
    line-height: 1.55;
  }

  .aq-feats {
    gap: 5px;
    margin-bottom: 12px;
  }

  .aq-feats > span {
    padding: 4px 7px;
  }

  .aq-controls-card {
    padding: 12px;
    gap: 6px;
  }

  .aq-control-row {
    padding: 5px 7px;
  }

  .aq-key {
    min-width: 57px;
    font-size: 0.52rem;
  }

  .aq-control-note {
    font-size: 0.6rem;
  }

  .aq-run-stats {
    gap: 5px;
    margin: 12px 0;
  }

  .aq-run-stats > div {
    padding: 7px 4px;
  }

  .aq-run-stats b {
    font-size: 0.86rem;
  }

  .aq-tips {
    padding: 0 10px 18px;
  }

  .aq-hint {
    font-size: 0.53rem;
  }

  .aq-stick {
    width: 98px;
    height: 98px;
    left: 12px;
    bottom: max(12px, calc(12px + var(--safe-area-inset-bottom, 0px)));
  }

  .aq-stick-knob {
    width: 42px;
    height: 42px;
  }

  .aq-actions {
    right: 10px;
    bottom: max(10px, calc(10px + var(--safe-area-inset-bottom, 0px)));
    grid-template-columns: 56px 64px;
    grid-template-rows: 52px 66px;
    gap: 5px;
  }

  .aq-action-small {
    width: 50px;
    height: 50px;
  }

  .aq-action-sword {
    width: 64px;
    height: 64px;
  }

  .aq-action-icon {
    font-size: 0.98rem;
  }

  .aq-action-label {
    font-size: 0.36rem;
  }

  .aq-floor-banner {
    top: 13%;
    padding: 9px 16px;
  }

  .aq-toast {
    bottom: 16%;
    max-width: 84%;
    font-size: 0.62rem;
  }

  .aq-bossbar {
    top: 7px;
    width: 84%;
    padding: 5px 8px 6px;
  }

  .aq-bossbar-head {
    font-size: 0.5rem;
  }
}

@media (max-height: 560px) and (pointer: coarse) {
  .aq-shell {
    height: calc(100vh - var(--app-header-h, 56px) - 4px);
    height: calc(100dvh - var(--app-header-h, 56px) - 4px);
    min-height: 280px;
    padding: 4px 7px;
    gap: 3px;
  }

  .aq-topbar {
    min-height: 40px;
    padding: 3px 6px;
  }

  .aq-brand-mark {
    width: 28px;
    height: 28px;
  }

  .aq-stat {
    padding: 1px 4px;
  }

  .aq-stat-value b {
    font-size: 0.8rem;
  }

  .aq-hearts {
    font-size: 0.76rem;
  }

  .aq-tool {
    width: 28px;
    height: 28px;
    font-size: 0.72rem;
  }

  .aq-footer {
    display: none;
  }

  .aq-stick {
    width: 84px;
    height: 84px;
    left: 10px;
    bottom: max(8px, calc(8px + var(--safe-area-inset-bottom, 0px)));
  }

  .aq-stick-knob {
    width: 36px;
    height: 36px;
  }

  .aq-actions {
    right: 9px;
    bottom: max(8px, calc(8px + var(--safe-area-inset-bottom, 0px)));
    grid-template-columns: 48px 56px;
    grid-template-rows: 44px 56px;
    gap: 4px;
  }

  .aq-action-small {
    width: 44px;
    height: 44px;
  }

  .aq-action-sword {
    width: 56px;
    height: 56px;
  }

  .aq-action-label {
    display: none;
  }

  .aq-action-icon {
    font-size: 1rem;
  }

  .aq-overlay {
    padding: 7px;
  }

  .aq-title-panel {
    grid-template-columns: 1fr 0.9fr;
    gap: 14px;
    padding: 12px 16px;
    width: min(100%, 860px);
  }

  .aq-logo {
    width: min(330px, 100%);
  }

  .aq-story {
    display: none;
  }

  .aq-controls-card {
    padding: 10px;
    gap: 4px;
  }

  .aq-control-row {
    padding: 3px 6px;
  }

  .aq-control-note:not(.aq-control-note-touch) {
    display: none;
  }

  .aq-result-panel {
    padding: 18px;
    max-height: 100%;
  }

  .aq-result-panel h2 {
    font-size: 1.35rem;
  }

  .aq-result-copy {
    display: none;
  }

  .aq-run-stats {
    margin: 8px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
