/* AURA v2: TikTok phonk edit skin for every screen and the battle HUD. Bold condensed type,
   FLAT white and black with ONE accent (--accent, the aura yellow), heavy outlines, no neon glow,
   punchy keyframes. The like / dislike green and red are the one exception (the bar's meaning). The canvas is full window behind #ui;
   #ui itself lets pointer events fall through to it except on the pieces that are interactive. */

:root {
  /* The one accent. The legacy names below stay so old selectors keep working, but they all
     resolve to white, black or this accent: no neon anywhere. */
  --accent: #ffd400;
  --cyan: #ffffff;
  --magenta: var(--accent);
  --yellow: var(--accent);
  --violet: #ffffff;
  --red: #ffffff;
  --ink: #000000;
  --like: #3fb950;
  --dislike: #e5484d;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; background: var(--ink); overflow: hidden; }

body {
  font-family: "Anton", "Arial Narrow", Impact, sans-serif;
  color: #fff;
  -webkit-user-select: none;
  user-select: none;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
  touch-action: none;
}

#ui {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  pointer-events: none;
  padding: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l);
  overflow: hidden;
  /* Above the stage's letterbox bars (z-index 2). */
  z-index: 3;
}

#ui.debug .screen.active { outline: 1px dashed rgba(255, 255, 255, 0.4); }

.hidden { display: none !important; }

/* Text style shared by headings and popups: a thick black outline behind the neon fill. */
.outline-text,
h1, h2, h3, .logo, .screen-title, .vs-level-name, .grade-popup, .burst-num, .burst-label,
.count-num, .level-title-punch, .combo-popup, .results-heading, .menu-item .label {
  -webkit-text-stroke: 3px #000;
  paint-order: stroke fill;
  text-shadow: 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000;
  letter-spacing: 0.02em;
}

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

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(24px + var(--safe-t)) calc(24px + var(--safe-r)) calc(24px + var(--safe-b)) calc(24px + var(--safe-l));
}
.screen.active { display: flex; pointer-events: auto; }
/* Every screen fits the viewport: nothing scrolls on a phone. */
.screen { overflow: hidden; overscroll-behavior: none; }
.screen.title, .screen.settings, .screen.loadout { background: rgba(0, 0, 0, 0.72); }

.logo {
  font-size: clamp(48px, 12vw, 120px);
  color: #fff;
  margin: 0 0 8px;
}

.subtitle { color: var(--cyan); font-size: clamp(14px, 2.4vw, 20px); margin: 0 0 24px; }

.screen-title { font-size: clamp(28px, 6vw, 56px); color: #fff; margin: 0 0 12px; }

/* ---------------------------------------------------------------- menus (title, settings) */

.menu { display: flex; flex-direction: column; gap: 10px; width: min(92vw, 460px); }

.menu-item {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 64px;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid #444;
  border-radius: 10px;
  color: #fff;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}
.menu-item .label { font-size: clamp(18px, 3vw, 26px); }
.menu-item .hint { font-size: 14px; color: #aaa; -webkit-text-stroke: 0; text-shadow: none; }
.menu-item.selected { border-color: var(--magenta); background: rgba(255, 212, 0, 0.22); }
.menu-item.disabled { color: #777; cursor: default; }
.menu-item.disabled .label { color: #777; -webkit-text-stroke-color: #000; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(4px); }
}
.shake { animation: shake 0.35s ease; }

/* ---------------------------------------------------------------- settings */

.controls-list { margin-top: 20px; color: #ccc; font-size: 14px; }
.controls-row { margin: 4px 0; }

.volume-bar { position: relative; display: inline-block; width: 120px; height: 10px; background: #222; border-radius: 6px; overflow: hidden; vertical-align: middle; }
.volume-fill { display: block; height: 100%; background: var(--cyan); }

.calibrate-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  pointer-events: auto;
}
.calibrate-pulse {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--yellow);
  margin: 30px 0;
}
.calibrate-count { font-size: 22px; color: #fff; }

/* ---------------------------------------------------------------- map */

.map-bg { position: absolute; inset: 0; background-size: cover; background-position: center; filter: blur(2px); z-index: -1; }
.map-heading { color: var(--yellow); margin-top: 0; }
.map-path { position: relative; width: min(92vw, 520px); height: min(70vh, 640px); }
.map-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.map-line-path { fill: none; stroke: rgba(255, 255, 255, 0.35); stroke-width: 1.4; stroke-dasharray: 3 3; }

.map-node {
  pointer-events: auto;
  position: absolute;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 3px solid var(--cyan);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
}
.map-node.selected { border-color: var(--yellow); }
.map-node.locked { border-color: #555; color: #777; }
.map-node-lock { font-size: 20px; }
.map-node-stars { font-size: 14px; color: var(--yellow); -webkit-text-stroke: 0; text-shadow: none; }

.map-pin {
  position: absolute;
  transform: translate(-50%, -140%);
  font-size: 30px;
  transition: left 0.4s ease, top 0.4s ease;
  filter: drop-shadow(0 2px 3px #000);
}

/* ---------------------------------------------------------------- VS card */

.vs-stage { display: flex; align-items: flex-end; gap: 24px; width: min(94vw, 640px); }
.vs-side { flex: 1; height: min(38vh, 280px); display: flex; align-items: flex-end; justify-content: center; }
.vs-side.us { color: var(--cyan); }
.vs-side.us svg { width: 70%; height: 100%; }
.vs-side.them { position: relative; }
.vs-portrait {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center top;
  border-radius: 12px;
  border: 3px solid var(--opp-color, var(--magenta));
}
.vs-versus { font-size: clamp(28px, 6vw, 48px); color: var(--yellow); padding-bottom: 20%; }
.vs-info { margin-top: 20px; }
.vs-level-name { font-size: clamp(22px, 5vw, 38px); color: var(--magenta); margin: 0; }
.vs-place { color: #ccc; margin: 4px 0; font-size: 16px; -webkit-text-stroke: 0; text-shadow: none; }
.vs-bpm { color: var(--cyan); margin: 0 0 16px; font-size: 16px; -webkit-text-stroke: 0; text-shadow: none; }
.vs-prompt { color: var(--yellow); font-size: 20px; animation: blink 1.1s steps(2, jump-none) infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

/* ---------------------------------------------------------------- loadout */

.loadout-grid { display: grid; grid-template-columns: repeat(2, minmax(140px, 1fr)); gap: 14px; width: min(92vw, 480px); margin-top: 12px; }
.loadout-card { background: rgba(0, 0, 0, 0.55); border: 2px solid var(--violet); border-radius: 10px; padding: 14px; }
.loadout-card-name { color: var(--violet); margin: 0 0 6px; font-size: 20px; }
.loadout-card-desc { color: #ddd; font-size: 14px; margin: 0; -webkit-text-stroke: 0; text-shadow: none; }

/* ---------------------------------------------------------------- results (addendum 16:15 point 4: a clean card) */

.results { background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.85)); justify-content: center; }
.rc {
  width: min(92vw, 440px);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 16px 14px;
  background: rgba(10, 10, 12, 0.88);
  border: 3px solid #000;
  outline: 2px solid #2a2a2a;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}
.results-heading { font-size: clamp(44px, 13vw, 76px); line-height: 0.95; margin: 0; color: #fff; letter-spacing: 0.01em; }
.results-heading.win { color: var(--accent); }
.results-heading.lose { color: #fff; }
.rc-vs { margin: 0; font-size: 14px; letter-spacing: 0.14em; color: #aaa; -webkit-text-stroke: 0; text-shadow: none; }
.results-stars { font-size: clamp(28px, 8vw, 40px); color: var(--accent); margin: 0; line-height: 1; -webkit-text-stroke: 0; text-shadow: none; }
.rc-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; }
.rc-num { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; background: #000; border-radius: 12px; }
.rc-val { font-size: clamp(28px, 8.5vw, 42px); line-height: 1; color: #fff; }
.rc-lab { margin-top: 4px; font-size: 11px; letter-spacing: 0.12em; color: #999; }
.results-roast { max-width: 100%; color: #fff; font-size: 16px; margin: 2px 0 0; -webkit-text-stroke: 0; text-shadow: none; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; font-family: system-ui, sans-serif; font-weight: 600; }
.results-roast-tag { color: #777; font-size: 11px; margin: 0; -webkit-text-stroke: 0; text-shadow: none; font-family: system-ui, sans-serif; }

.rc-xp { width: 100%; }
.rc-xp-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; letter-spacing: 0.06em; margin-bottom: 4px; }
.rc-rank { color: #fff; }
.rc-gain { color: var(--accent); }
.rc-bar { height: 14px; background: #1c1c1c; border: 2px solid #000; border-radius: 8px; overflow: hidden; }
.rc-fill { height: 100%; width: 0%; background: var(--accent); transition: width 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); }
.rc-xp.flash .rc-bar { animation: rc-flash 0.5s ease-out; }
@keyframes rc-flash { 0% { box-shadow: 0 0 0 0 #fff; background: #fff; } 100% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); } }
.rc-rankup { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; background: rgba(255, 255, 255, 0.0); z-index: 3; }
.rc-rankup.go { animation: rc-rankup-bg 1.8s ease-out forwards; }
.rc-rankup-word { margin: 0; font-size: clamp(64px, 20vw, 120px); color: var(--accent); -webkit-text-stroke: 4px #000; paint-order: stroke fill; }
.rc-rankup-rank { margin: 0; font-size: clamp(28px, 8vw, 44px); color: #fff; -webkit-text-stroke: 3px #000; paint-order: stroke fill; }
.rc-rankup.go .rc-rankup-word { animation: rc-pop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes rc-rankup-bg { 0% { background: rgba(255, 255, 255, 0.85); } 20% { background: rgba(0, 0, 0, 0.5); } 80% { opacity: 1; } 100% { background: rgba(0, 0, 0, 0); opacity: 0; } }
@keyframes rc-pop { from { transform: scale(2.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.results-buttons { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; width: 100%; margin-top: 4px; }
.results-btn {
  min-height: 72px;
  font-family: inherit;
  font-size: clamp(24px, 7vw, 34px);
  letter-spacing: 0.04em;
  color: #fff;
  background: #000;
  border: 3px solid #fff;
  border-radius: 16px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.results-btn:active, .results-btn.pressed { transform: scale(0.96); }
.results-btn.retry { color: var(--ink); background: var(--accent); border-color: #000; }
.rc-small { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 10px; width: 100%; }
.rc-link {
  min-height: 40px;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 15px;
  letter-spacing: 0.08em;
  color: #ddd;
  background: transparent;
  border: 2px solid #444;
  border-radius: 10px;
  cursor: pointer;
  touch-action: manipulation;
}
.rc-link.disabled { opacity: 0.45; }
.rc-link.shake { animation: rc-shake 0.3s; }
@keyframes rc-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.rc-next { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 10px; background: #000; border-radius: 12px; text-align: left; }
.rc-sil { position: relative; flex: none; width: 44px; height: 52px; overflow: hidden; }
.rc-sil-head { position: absolute; left: 13px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: #3a3a3a; }
.rc-sil-body { position: absolute; left: 4px; top: 22px; width: 36px; height: 40px; border-radius: 18px 18px 4px 4px; background: #3a3a3a; }
.rc-next:not(.locked) .rc-sil-head, .rc-next:not(.locked) .rc-sil-body { background: #fff; }
.rc-next-text { display: flex; flex-direction: column; min-width: 0; }
.rc-next-lab { font-size: 11px; letter-spacing: 0.14em; color: #888; }
.rc-next-name { font-size: 20px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-next.locked .rc-next-name { color: #666; }
.rc-next-lock { font-size: 11px; letter-spacing: 0.08em; color: var(--accent); }
.results-toast { min-height: 18px; margin: 0; color: #fff; font-size: 14px; -webkit-text-stroke: 0; text-shadow: none; }
.results-toast.show { animation: toast-in 0.25s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-height: 680px) {
  .rc { gap: 5px; padding: 12px 12px 10px; }
  .results-heading { font-size: clamp(36px, 10vw, 56px); }
  .rc-val { font-size: 28px; }
  .results-roast { -webkit-line-clamp: 2; font-size: 14px; }
  .results-btn { min-height: 56px; }
  .rc-sil { width: 34px; height: 40px; transform: scale(0.8); }
}

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

.hud {
  align-items: stretch;
  /* Touches fall through to the canvas, where the battle input listens. */
  pointer-events: none !important;
  justify-content: flex-start;
  padding: 0;
}

.hud-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(10px + var(--safe-t)) calc(14px + var(--safe-r)) 0 calc(14px + var(--safe-l));
  transform: translateY(-140%);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2), opacity 0.3s ease;
}
.hud.shown .hud-top { transform: translateY(0); opacity: 1; }

/* The like / dislike bar: thumbs at the ends, green versus red ratio between, counts under the thumbs. */
.likebar {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 8px;
  row-gap: 2px;
  align-items: center;
}
.lk-icon { display: inline-flex; width: 26px; height: 26px; color: #fff; filter: drop-shadow(0 1px 0 #000); }
.lk-icon svg { width: 100%; height: 100%; display: block; }
.lk-icon-up { grid-column: 1; grid-row: 1; }
.lk-icon-down { grid-column: 3; grid-row: 1; }
.lk-track { grid-column: 2; grid-row: 1; display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: #000; border: 2px solid #000; }
.lk-fill { height: 100%; transition: width 0.12s linear; }
.lk-like { background: var(--like); }
.lk-dislike { background: var(--dislike); }
.lk-count { grid-row: 2; font-size: 13px; line-height: 1; color: #fff; -webkit-text-stroke: 0; text-shadow: 0 1px 0 #000; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lk-count-up { grid-column: 1 / 3; justify-self: start; }
.lk-count-down { grid-column: 2 / 4; justify-self: end; }
@keyframes lk-bump { 0% { transform: scaleY(1); } 35% { transform: scaleY(1.6); } 100% { transform: scaleY(1); } }
@keyframes lk-pop { 0% { transform: scale(1); } 35% { transform: scale(1.3); } 100% { transform: scale(1); } }
.lk-track.lk-bump-like, .lk-track.lk-bump-dislike { animation: lk-bump 0.22s ease-out; }
.lk-icon-up.lk-pop { animation: lk-pop 0.22s ease-out; color: var(--like); }
.lk-icon-down.lk-pop { animation: lk-pop 0.22s ease-out; color: var(--dislike); }

.hud-right-box { display: flex; flex-direction: column; align-items: flex-end; min-width: 90px; }
.hud-score { font-size: 22px; color: #fff; -webkit-text-stroke: 2px #000; }
.hud-combo { display: flex; gap: 4px; align-items: baseline; font-size: 16px; }
.hud-combo-num { font-size: 22px; color: var(--yellow); }
.hud-combo[data-tier="2"] .hud-combo-num { color: var(--violet); }
.hud-combo[data-tier="3"] .hud-combo-num { color: var(--accent); }
.hud-combo-mult { color: #fff; }


/* prompts: a transparent canvas over the stage, drawn by src/v2/ui/hud/arrows.ts */

.hud-arrows { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hud-safe-probe {
  position: fixed;
  inset: 0;
  visibility: hidden;
  pointer-events: none;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}

/* popups */

.hud-popups { position: absolute; inset: 0; pointer-events: none; }
/* Judgments sit just above the ring (position set by arrows.ts), small and short: never over the next prompt. */
.grade-lane { position: absolute; left: var(--ring-x, 50%); top: calc(var(--ring-y, 60%) - var(--ring-r, 40px) - 18px); width: 0; height: 0; }
.grade-popup {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  font-size: 20px;
  opacity: 0;
}
.grade-popup.big { font-size: 26px; }
@keyframes grade-pop {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1.25); }
  70% { opacity: 1; transform: translate(-50%, -80%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -100%) scale(1); }
}
@keyframes pop {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1.3); }
  100% { opacity: 0; transform: translate(-50%, -160%) scale(1); }
}
.grade-popup.pop { animation: grade-pop 0.4s ease-out; }
.combo-popup.pop { animation: pop 0.8s ease-out; }

.burst-popup { position: absolute; left: 50%; top: 20%; transform: translate(-50%, -50%); text-align: center; opacity: 0; }
.burst-num { font-size: 64px; color: var(--yellow); }
.burst-label { font-size: 18px; color: var(--yellow); }
@keyframes pop-big {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1.6); }
  60% { transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}
.burst-popup.pop-big { animation: pop-big 1.1s ease-out; }

.combo-popup { position: absolute; left: 50%; top: 12%; transform: translate(-50%, -50%); font-size: 26px; color: var(--yellow); opacity: 0; }

.taunt-bar {
  position: absolute;
  left: 50%;
  bottom: calc(6% + var(--safe-b));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(90vw, 560px);
  background: rgba(255, 255, 255, 0.95);
  border-radius: 14px;
  padding: 8px 16px 8px 8px;
}
.taunt-portrait {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background-size: cover;
  background-position: center top;
  border: 3px solid var(--opp-color, var(--magenta));
  flex-shrink: 0;
}
.taunt-name { color: var(--opp-color, var(--magenta)); font-size: 14px; -webkit-text-stroke: 0; text-shadow: none; }
.taunt-text { color: #111; font-size: 15px; -webkit-text-stroke: 0; text-shadow: none; }
@keyframes slide-up {
  0% { transform: translate(-50%, 40px); opacity: 0; }
  15% { transform: translate(-50%, 0); opacity: 1; }
  100% { transform: translate(-50%, 0); opacity: 1; }
}
.taunt-bar.slide-up { animation: slide-up 0.35s ease-out; }

.count-in { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.count-num { font-size: clamp(80px, 22vw, 160px); color: #fff; }
@keyframes count-pop {
  0% { transform: scale(1.6); opacity: 0; }
  40% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.count-num.pop { animation: count-pop 0.35s ease-out; }

.level-title-punch {
  position: absolute;
  left: 50%;
  top: 18%;
  transform: translate(-50%, -50%);
  font-size: clamp(16px, 3.4vw, 26px);
  color: var(--cyan);
  width: max-content;
  max-width: 92vw;
}
@keyframes punch {
  0% { transform: translate(-50%, -50%) scale(2.4); opacity: 0; }
  50% { transform: translate(-50%, -50%) scale(0.95); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
.level-title-punch.punch { animation: punch 0.4s ease-out; }

/* loading: opaque, the scene is never shown half loaded */

.loading { background: var(--ink); z-index: 5; }
.loading-bar { width: min(70vw, 360px); height: 12px; margin-top: 18px; border: 2px solid #000; border-radius: 8px; background: #222; overflow: hidden; }
.loading-fill { width: 100%; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left center; transition: transform 0.25s ease-out; }
.loading-label { margin: 12px 0 0; color: #aaa; font-size: 14px; letter-spacing: 0.12em; -webkit-text-stroke: 0; text-shadow: none; }

/* title scene: see through over the idling stage, the whole screen is the tap to play */

.gate {
  background: radial-gradient(ellipse at 50% 42%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.25) 55%, rgba(0, 0, 0, 0.7) 100%);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  /* top to bottom (addendum 17:35): logo, the fighters' band, TAP TO PLAY, the LOADOUT / SETTINGS row */
  justify-content: flex-start;
  padding-top: calc(4vh + var(--safe-t));
  padding-bottom: calc(5vh + var(--safe-b));
}
.gate-space { flex: 1 1 auto; min-height: 20vh; pointer-events: none; }
.gate-logo {
  font-size: clamp(84px, min(34vw, 22vh), 240px);
  line-height: 0.86;
  letter-spacing: -0.01em;
  color: #fff;
  /* chrome: a white to steel fill, a heavy dark outline, a hard drop shadow; no glow, no neon */
  background: linear-gradient(180deg, #ffffff 0%, #ffffff 42%, #b9bec6 58%, #f4f6f8 78%, #8e949c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 5px #0b0b0d;
  paint-order: stroke fill;
  text-shadow: none;
  filter: drop-shadow(0 6px 0 #000) drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55));
  margin: 0;
}
.gate-prompt { margin: 10px 0 0; color: var(--accent); font-size: clamp(30px, 9vw, 54px); animation: tap-pulse 1.1s ease-in-out infinite; }
.gate-prompt.waiting { font-size: clamp(22px, 6.5vw, 40px); animation: tap-wait 0.5s ease-in-out infinite; }
.gate-hint { margin: 8px 0 0; color: #ccc; font-size: 15px; -webkit-text-stroke: 0; text-shadow: 0 1px 3px #000; }
.gate-row { display: flex; flex-direction: row; justify-content: center; gap: 12px; margin-top: 18px; }
.gate-btn {
  min-width: 112px;
  min-height: 48px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 17px;
  letter-spacing: 0.08em;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid #666;
  border-radius: 12px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.gate-btn:active { transform: scale(0.96); border-color: var(--accent); }
@keyframes tap-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.1); opacity: 0.6; } }
@keyframes tap-wait { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.corner-btn {
  position: absolute;
  top: calc(12px + var(--safe-t));
  right: calc(12px + var(--safe-r));
  min-width: 88px;
  min-height: 48px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 18px;
  letter-spacing: 0.08em;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid #666;
  border-radius: 12px;
  cursor: pointer;
  touch-action: manipulation;
  z-index: 1;
}

/* loading between the FIGHT tap and the first count in click */

.hud-loading {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 22px;
  color: var(--yellow);
  -webkit-text-stroke: 2px #000;
  paint-order: stroke fill;
  animation: blink 0.8s steps(2, jump-none) infinite;
}

/* no WebGL: a message and the way to the 2D game */

.no-webgl {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: calc(24px + var(--safe-t)) 24px calc(24px + var(--safe-b));
  background: var(--ink);
  text-align: center;
  font-size: 18px;
}
.no-webgl.soft { inset: auto 0 0 0; background: rgba(0, 0, 0, 0.9); flex-direction: row; flex-wrap: wrap; }
.no-webgl a {
  display: inline-flex;
  align-items: center;
  min-height: 64px;
  padding: 0 24px;
  border: 2px solid var(--magenta);
  border-radius: 10px;
  color: var(--yellow);
  text-decoration: none;
  font-size: 22px;
}

/* portrait phones: the top bar keeps the meter readable */

@media (max-width: 480px) {
  .hud-top { gap: 8px; }
  .hud-right-box { min-width: 70px; }
  .lk-icon { width: 22px; height: 22px; }
}

/* ---------------------------------------------------------------- play zone (touch) */

/* The bottom of the screen, TAP ONLY: a hint of what the tap does now. Visual only: the canvas
   under it takes every tap anywhere on the screen (src/v2/ui/battleInput.ts). */
.playzone {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: 72%;
  pointer-events: none !important;
  display: none;
  padding: 10px 14px calc(14px + var(--safe-b, 0px));
  transition: opacity 0.2s;
}
.hud.shown .playzone { display: flex; }
.playzone > * { display: none; }
.pz-pad, .pz-his {
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 26px;
  color: rgba(255, 255, 255, 0.85);
  -webkit-text-stroke: 0;
}
.pz-big { font-size: clamp(34px, 11vw, 56px); line-height: 1; -webkit-text-stroke: 2px #000; paint-order: stroke fill; }
.pz-small { font-size: clamp(13px, 3.8vw, 18px); letter-spacing: 0.1em; margin-top: 4px; }
.pz-his { font-size: clamp(22px, 7vw, 34px); letter-spacing: 0.08em; }
.pz-pad { border: 3px solid rgba(255, 255, 255, 0.55); background: rgba(255, 255, 255, 0.08); transition: border-color 0.6s ease, background-color 0.6s ease; }
.pz-mash { color: #fff; animation: pz-pulse 0.12s ease-in-out infinite alternate; }
.pz-mash .pz-big { color: var(--yellow); }
.pz-release { border-color: var(--yellow); background: rgba(255, 212, 0, 0.24); color: var(--yellow); animation: pz-pulse 0.3s ease-in-out infinite alternate; }
.pz-hold { border-color: #fff; background: rgba(255, 255, 255, 0.1); color: #fff; }
.pz-his { background: rgba(0, 0, 0, 0.45); color: rgba(255, 255, 255, 0.7); }
.zone-mash .pz-mash,
.zone-release .pz-release,
.zone-hold .pz-hold,
.zone-opponent .pz-his { display: flex; }
.playzone.zone-opponent { opacity: 0.7; }
@keyframes pz-pulse { from { transform: scale(1); } to { transform: scale(1.03); } }

/* Hints retire after the first success of their kind (src/v2/ui/playzone.ts, session only);
   the pad outline fades after the first hit. */
.playzone.learned-tap .pz-pad { border-color: transparent; background-color: transparent; }
.playzone.learned-mash .pz-mash,
.playzone.learned-mash .pz-release,
.playzone.learned-hold .pz-hold { display: none !important; }

/* The prompt ring sits in the pad band in portrait (src/v2/ui/hud/arrows.ts PORTRAIT_RING_Y): the canvas
   draws the 67, HOLD and SWIPE UP words around the ring, the pad keeps only its pulsing box. */
.pz-pad .pz-big, .pz-pad .pz-small { display: none; }
