/* =============================================================
   NOCTWARD styles
   Sections (search the marker to jump): HUD, overlays, bestiary,
   level up choices, menu, chest reveal, audio/language controls,
   joystick, evolution reference, mobile.
   Colors come from the :root tokens below - prefer a token over a
   raw hex so the palette stays consistent.
   ============================================================= */
:root {
  --accent: #6c7bff;
  --accent-2: #5effa6;
  --ink: #ecebe4; /* primary text */
  --ink-2: #b6a8d6; /* secondary lavender text */
  --ink-3: #9c8fbe; /* dimmer labels */
  --ink-4: #6c5f8a; /* faint text / borders */
  --lav: #c2b5dd; /* light lavender accents */
  --magenta: #c04dff; /* vivid purple accent (level-up, links) */
  --accent-active: #ffb38a; /* weapons (mirrors ACTIVE_COL in 09-combat.js) */
  --accent-passive: #8ec5ff; /* passives (mirrors PASSIVE_COL in 09-combat.js) */
  --danger: #ff4d6d;
  --gold: #ffe27a;
  --panel: rgba(12, 14, 30, 0.96);
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --display: "Trebuchet MS", system-ui, sans-serif;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  overflow: hidden;
  background: #05060f;
  font-family: var(--display);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
#game {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

/* ---------- HUD ---------- */
#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  display: flex;
  flex-direction: column;
}
#topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  flex-wrap: wrap;
}
.clock {
  font-family: var(--mono);
  font-size: clamp(26px, 5vw, 38px);
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--ink);
  text-shadow: 0 0 18px rgba(108, 123, 255, 0.5);
  min-width: 92px;
  transition:
    opacity 0.2s ease,
    color 0.2s ease;
}
/* survival clock is frozen inside a dungeon/cave - dim it so the pause reads */
.clock.paused {
  color: var(--ink-2);
  opacity: 0.55;
  text-shadow: none;
}
.stat {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--ink-2);
  display: flex;
  gap: 6px;
  align-items: baseline;
}
.stat b {
  color: var(--ink);
  font-size: 16px;
}
.stat-ico {
  font-size: 15px;
  line-height: 1;
}
.kills b {
  color: var(--danger);
}
.keys b {
  color: var(--gold);
}
/* `.stat { display:flex }` otherwise overrides the [hidden] attribute */
.stat[hidden] {
  display: none;
}
/* The XP bar sits under the topbar (HP now lives only under the player).
   With HP gone it gets the full width and a bit more presence. */
#bars {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  /* stay left of the top-right minimap on narrow screens; on wide screens the
     820px cap wins so the bar keeps its normal length */
  max-width: min(820px, calc(100vw - var(--mmw, 210px) - 8px));
}
/* transient objective banner (dungeon treasure hint). Centred near the top,
   non-interactive, fades in then out. Pointer-events off so it never blocks
   touch input on the play field. */
#toast {
  position: fixed;
  top: 86px;
  left: 50%;
  transform: translate(-50%, -8px);
  max-width: min(440px, 88vw);
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(16, 10, 28, 0.88);
  border: 1px solid rgba(255, 215, 107, 0.5);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  z-index: 6; /* under the HUD control buttons so it never covers them on phones */
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
#toast .toast-title {
  display: block;
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--gold);
  margin-bottom: 3px;
}
/* big centred reward banner (e.g. "Relic claimed"). Sits a little above the
   middle so it reads as a headline without covering the player. Pointer-events
   off so it never blocks the play field; pops in then fades out. */
#rewardBanner {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  max-width: min(560px, 90vw);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  z-index: 6;
  transition:
    opacity 0.35s ease,
    transform 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
}
#rewardBanner.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
#rewardBanner .rb-title {
  display: block;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(22px, 4.4vw, 38px);
  letter-spacing: 2px;
  color: var(--gold);
  text-shadow:
    0 0 18px rgba(255, 215, 107, 0.55),
    0 3px 10px rgba(0, 0, 0, 0.7);
}
#rewardBanner .rb-sub {
  display: block;
  margin-top: 6px;
  font-size: clamp(15px, 2.6vw, 22px);
  font-weight: 600;
  color: #e7d6ff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}
.bar {
  position: relative;
  height: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.bar > i {
  position: absolute;
  inset: 0;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.12s linear;
}
.xpbar {
  height: 18px;
  border-radius: 10px;
}
#xpfill {
  background: linear-gradient(90deg, #36409c, var(--accent));
  box-shadow: 0 0 14px rgba(108, 123, 255, 0.6);
}
.bar .lvl {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 1px 2px #000;
  z-index: 2;
}
/* weapon / passive inventory row */
#inv {
  margin-top: auto;
  padding: 12px 16px 16px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: flex-end;
}
/* active (weapons) and passive (upgrades) groups are visually split:
   each gets its own tinted tray + a labelled header row */
.invgroup {
  position: relative;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  width: fit-content;
  padding: 16px 8px 8px;
  /* a faint tray so new players notice the hotbar instead of overlooking it */
  background: rgba(20, 12, 34, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}
/* label floats above the slots (absolute) so it never widens the tray */
.invgroup::before {
  position: absolute;
  top: 3px;
  left: 2px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
  line-height: 1;
  white-space: nowrap; /* keep the label (incl. the drop hint) on one line */
}
#invweapons::before {
  content: "⚔ " attr(data-label);
  color: var(--accent-active);
}
#invpassives::before {
  content: "✦ " attr(data-label);
  color: var(--accent-passive);
}
.slot {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: rgba(20, 12, 34, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  position: relative;
}
/* empty placeholder slots - show full capacity from the start */
.slot.empty {
  background: rgba(20, 12, 34, 0.35);
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: none;
}
/* filled weapon slots can be clicked/tapped to drop the weapon.
   #hud is pointer-events:none, so re-enable hits on these slots. */
#invweapons .slot.filled {
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}
/* filled slots need a clearly visible edge - the base 12% border all but
   vanished on mobile for T1 weapons (e.g. Spores), which read borderless.
   T2+ still override this with their brighter tier colours below. */
.slot.filled {
  border-color: rgba(255, 255, 255, 0.32);
}
.slot .dropx {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #ff5a5a;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
  opacity: 0;
  transform: scale(0.6);
  transition:
    opacity 0.12s,
    transform 0.12s;
  pointer-events: none;
}
#invweapons .slot.filled:hover {
  border-color: #ff7a7a;
}
#invweapons .slot.filled:hover .dropx {
  opacity: 1;
  transform: scale(1);
}
/* touch devices have no hover, so keep a faint ✕ badge permanently visible on
   filled weapon slots - otherwise new players never discover they can drop
   items. Tapping the slot drops it (with a confirm dialog on touch). */
@media (hover: none) {
  #invweapons .slot.filled .dropx {
    display: block;
    opacity: 0.85;
    transform: scale(0.9);
  }
}
.slot .pips {
  position: absolute;
  bottom: 2px;
  right: 3px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--gold);
  font-weight: 700;
}
/* weapon tier coloring (T1 grey -> T4 gold) */
.slot.t2 {
  border-color: rgba(120, 230, 150, 0.7);
}
.slot.t2 .pips {
  color: #6fe89a;
}
.slot.t3 {
  border-color: rgba(120, 180, 255, 0.75);
}
.slot.t3 .pips {
  color: #7db4ff;
}
.slot.max {
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(255, 226, 122, 0.4);
}
/* RELICS: dungeon-only rewards, set apart from ordinary passives with a warm
   gold frame + faint glow and a tinted tray, so they read as something special
   you earned rather than a normal stat pick. */
.slot.filled.relic {
  border-color: var(--gold);
  background: radial-gradient(
    120% 120% at 50% 0%,
    rgba(255, 215, 107, 0.22),
    rgba(40, 28, 10, 0.85)
  );
  box-shadow:
    0 0 10px rgba(255, 215, 107, 0.45),
    inset 0 0 6px rgba(255, 215, 107, 0.25);
}
.slot.filled.relic .pips {
  color: var(--gold);
}
/* one copy away from a merge - flag it on the HUD WITHOUT recoloring the slot
   (the tier colour must stay readable; a copy count is not a rarity). A soft
   neutral pulse signals "ready to merge" instead of a purple rarity border. */
.slot.merging {
  animation: mergeReady 1.1s ease-in-out infinite;
}
@keyframes mergeReady {
  0%,
  100% {
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.25);
  }
  50% {
    box-shadow: 0 0 9px rgba(255, 255, 255, 0.6);
  }
}
.slot .mprog {
  position: absolute;
  top: -6px;
  left: -4px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: var(--magenta);
  border-radius: 6px;
  padding: 0 3px;
  line-height: 13px;
}
/* mid level-up HOTBAR SWAP: the weapon bar glows and each filled slot pulses,
   prompting the player to tap the weapon to replace (number badge shows the key) */
#invweapons.swapping {
  outline: 2px solid rgba(255, 210, 122, 0.85);
  outline-offset: 3px;
  border-radius: 10px;
}
#invweapons.swapping .slot.filled {
  cursor: pointer;
  animation: swapPulse 0.9s ease-in-out infinite;
}
#invweapons.swapping .slot.empty {
  opacity: 0.3;
}
@keyframes swapPulse {
  0%,
  100% {
    box-shadow: 0 0 5px rgba(255, 210, 122, 0.4);
    transform: translateY(0);
  }
  50% {
    box-shadow: 0 0 12px rgba(255, 210, 122, 0.9);
    transform: translateY(-2px);
  }
}
.slot .slotkey {
  position: absolute;
  top: -7px;
  left: -5px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: #2a1430;
  background: rgba(255, 210, 122, 0.95);
  border-radius: 6px;
  padding: 0 4px;
  line-height: 14px;
}

/* ---------- overlays ---------- */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(7, 4, 15, 0.78);
  backdrop-filter: blur(3px);
  padding: 20px;
}
.overlay.show {
  display: flex;
}
/* secondary panels opened on top of pause must sit above it */
#evo,
#opts,
#news,
#confirm,
#stats,
#bestiary,
#achievements,
#guide {
  z-index: 30;
}
/* ---------- bestiary ---------- */
.bestiary-panel {
  max-width: 720px;
}
.bestiary-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  max-height: 60vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  margin: 14px 0 18px;
  text-align: left;
}
.best-card {
  background: rgba(26, 16, 44, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px;
}
/* inline coin glyph (the 🪙 emoji is missing on some systems) */
.coin-ico {
  width: 1.05em;
  height: 1.05em;
  vertical-align: -0.18em;
}
/* achievements overlay */
.ach-list {
  max-height: 60vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  text-align: left;
}
.ach-cat {
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--gold, #ffd76b);
  font-size: 13px;
  margin: 14px 2px 6px;
}
.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
}
.ach-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(26, 16, 44, 0.9);
  border: 1px solid rgba(255, 215, 107, 0.35);
  border-radius: 10px;
  padding: 8px 10px;
}
.ach-card.locked {
  border-color: rgba(255, 255, 255, 0.1);
  opacity: 0.55;
}
.ach-ico {
  font-size: 24px;
  flex: 0 0 auto;
  width: 30px;
  text-align: center;
}
.ach-name {
  font-weight: 700;
  font-size: 13px;
}
.ach-desc {
  font-size: 11px;
  color: var(--ink-3, #8a86a8);
}
.best-card.locked {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  opacity: 0.5;
  min-height: 90px;
}
.best-card.locked .best-spr {
  font-size: 30px;
  font-family: var(--mono);
  color: var(--ink-3);
}
.best-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.best-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
}
.best-tag {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1px;
  padding: 1px 5px;
  border-radius: 5px;
  background: #ff4d6d;
  color: #1a0b2b;
}
.best-tag.elite {
  background: var(--gold);
}
.best-stats {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
  margin-top: 2px;
}
.best-lore {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--lav);
  margin: 8px 0 6px;
}
.best-weak {
  font-size: 12px;
  line-height: 1.45;
  color: #9effc4;
}
.best-weak b {
  color: var(--ink);
}
.confirm-panel {
  max-width: 420px;
}
.confirm-panel h1 {
  color: #ff6b81;
  text-shadow: 0 0 24px rgba(255, 90, 110, 0.5);
}
/* destructive confirm button (red instead of the usual purple) */
.btn-danger {
  background: linear-gradient(#ff7a8c, #e23b54);
  color: #fff;
  box-shadow: 0 6px 20px rgba(226, 59, 84, 0.45);
}
.panel {
  background: var(--panel);
  border: 1px solid rgba(108, 123, 255, 0.35);
  border-radius: 18px;
  padding: clamp(24px, 5vw, 40px);
  text-align: center;
  max-width: 540px;
  width: 100%;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.7);
}
.panel h1 {
  font-size: clamp(30px, 7vw, 46px);
  letter-spacing: 3px;
  color: var(--accent);
  text-shadow: 0 0 28px rgba(108, 123, 255, 0.6);
  margin-bottom: 10px;
}
.panel h1.win {
  color: var(--accent-2);
  text-shadow: 0 0 28px rgba(94, 255, 166, 0.6);
}
.panel p {
  font-size: 15px;
  line-height: 1.7;
  color: #c9bce4;
  margin-bottom: 18px;
}
.panel .keys {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-2);
  margin: 14px 0 22px;
  line-height: 2;
}
.panel .keys kbd {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 12px;
  color: #fff;
}
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
  margin-bottom: 22px;
  font-family: var(--mono);
  font-size: 14px;
}
.stats-grid div {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 4px;
}
.stats-grid span {
  color: var(--ink-3);
}
.stats-grid b {
  color: var(--ink);
}
/* attribute deltas: gain / loss / no change */
.stat-up {
  color: var(--accent-2);
}
.stat-down {
  color: var(--danger);
}
.stat-zero {
  color: var(--ink-4);
}
button {
  pointer-events: auto;
  font-family: var(--display);
  background: linear-gradient(#d98bff, var(--accent));
  color: #1a0b2b;
  border: none;
  border-radius: 11px;
  padding: 14px 36px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(108, 123, 255, 0.4);
  /* iOS Safari: kill the 300ms tap delay + grey tap flash so buttons feel
     responsive and reliably register a tap */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
}
button:hover {
  filter: brightness(1.08);
}
button:focus-visible {
  outline: 3px solid var(--gold);
}

/* ---------- level up choices ---------- */
#levelup .panel {
  max-width: 760px;
  /* small phones (e.g. iPhone mini) can overflow with 3 tall choices + the
     arsenal strip - let the panel scroll instead of clipping the buttons */
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
/* during a level-up we show the real HUD hotbar (not an in-panel copy), so lift
   the whole HUD above the modal backdrop. #hud establishes its own stacking
   context, so the bump has to be on #hud itself rather than on #inv. */
body.lu-open #hud {
  z-index: 25;
}
/* keep only the hotbar interactive during a level-up - the topbar buttons would
   otherwise become clickable over the modal and let a stray tap pause/close it */
body.lu-open #topbar {
  pointer-events: none;
}
/* heads-up banner on the level-up screen (e.g. weapon slots full) */
.lu-note {
  margin: 0 auto 14px;
  max-width: 520px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 90, 90, 0.12);
  border: 1px solid rgba(255, 120, 120, 0.45);
  color: #ffd2c4;
  font-size: 13px;
  line-height: 1.4;
}
.lu-note[hidden] {
  display: none;
}
.choices {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 8px;
}
.choice {
  position: relative;
  pointer-events: auto;
  background: rgba(26, 16, 44, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 18px 16px;
  cursor: pointer;
  text-align: left;
  /* these are cards, not raised action buttons - drop the inherited button shadow */
  box-shadow: none;
  transition:
    transform 0.12s ease,
    border-color 0.12s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.choice:hover,
.choice:focus-visible {
  transform: translateY(-4px);
  border-color: var(--c, var(--accent));
  outline: none;
}
.choice .keynum {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 20px;
  height: 22px;
  padding: 0 5px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-bottom-width: 3px;
  border-radius: 6px;
}
.choice .head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 26px;
}
.choice .ic {
  font-size: 26px;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}
.choice .nm {
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
}
.choice .tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--c, var(--accent));
}
.choice .lv {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gold);
}
.choice .ds {
  font-size: 13px;
  color: var(--lav);
  line-height: 1.5;
}
/* physical / spell damage-type badge on weapon cards + arsenal rows */
.dtype {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  padding: 1px 6px;
  border-radius: 5px;
  white-space: nowrap;
}
.choice .dtype {
  margin-top: 5px;
}
/* damage-type badges use their own crimson/violet palette so they
   don't read as the orange "Active" / blue "Passive" kind tags */
.dtype.phys {
  background: rgba(255, 107, 107, 0.16);
  color: #ff6b6b;
}
.dtype.spell {
  background: rgba(91, 200, 255, 0.16);
  color: #5bc8ff;
}
/* a copy that completes a 3-of-a-kind merge - make it pop in the RESULTING
   tier's colour (--c is set to tierColor(mergeTo) in JS): T2 green, T3 blue,
   T4 gold, so the card always reads as the tier it's upgrading to. */
.choice.merge {
  border-color: color-mix(in srgb, var(--c, #7fe07f) 85%, transparent);
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--c, #7fe07f) 30%, #11140f),
    color-mix(in srgb, var(--c, #7fe07f) 14%, #0d100c)
  );
  box-shadow: 0 0 18px color-mix(in srgb, var(--c, #7fe07f) 45%, transparent);
  animation: mergePulse 1.1s ease-in-out infinite;
}
.choice.merge .tag {
  color: var(--c, #b3ffcf);
}
.choice.merge .lv {
  color: var(--c, #b3ffcf);
}
@keyframes mergePulse {
  0%,
  100% {
    box-shadow: 0 0 14px color-mix(in srgb, var(--c, #7fe07f) 35%, transparent);
  }
  50% {
    box-shadow: 0 0 24px color-mix(in srgb, var(--c, #7fe07f) 65%, transparent);
  }
}
/* secondary "skip" action - spans the row, quieter than the picks */
.choice.skip {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  background: rgba(20, 12, 34, 0.7);
  opacity: 0.8;
}
.choice.skip:hover,
.choice.skip:focus-visible {
  opacity: 1;
  transform: none;
}
.choice.skip .keynum {
  position: static;
  margin-right: 8px;
}
.choice.skip b {
  color: var(--gold);
}

.hint {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
  pointer-events: none;
  z-index: 4;
}
/* on touch devices the hotbar sits along the bottom and covers this
   desktop keyboard hint, so hide it there - it's not relevant anyway */
@media (pointer: coarse) {
  .hint {
    display: none;
  }
}
/* ---------- menu: bank, characters, shop ---------- */
.menu-panel {
  max-width: 620px;
  text-align: center;
}
.menu-logo {
  width: clamp(72px, 18vw, 104px);
  height: auto;
  display: block;
  margin: 0 auto 10px;
  filter: drop-shadow(0 6px 26px rgba(108, 123, 255, 0.45));
}
.menu-panel .tagline {
  margin-bottom: 16px;
}
.bank {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 18px;
}
.bank b {
  color: var(--gold);
  font-size: 15px;
}
.section-t {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--faint, var(--ink-4));
  text-align: left;
  margin: 16px 0 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 5px;
}
.charsel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.char {
  pointer-events: auto;
  background: rgba(26, 16, 44, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 12px 8px;
  cursor: pointer;
  text-align: center;
  /* let the grid track shrink to the panel width: without this a wide child (the
     nowrap unlock button on a narrow phone) forces the column wider and the whole
     row overflows the menu panel */
  min-width: 0;
  overflow: hidden;
  transition:
    border-color 0.12s ease,
    transform 0.12s ease;
}
.char:hover {
  transform: translateY(-3px);
}
.char.sel {
  border-color: var(--accent);
  box-shadow:
    0 0 0 1px var(--accent),
    0 0 18px rgba(108, 123, 255, 0.35);
}
.char .ci {
  font-size: 26px;
}
.char .cn {
  font-weight: 700;
  font-size: 14px;
  margin-top: 4px;
}
.char .cd {
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.4;
  margin-top: 4px;
}
.shop {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 8px;
  margin: 14px 0 18px;
  /* scroll the grid instead of letting a tall list overflow the centred panel
     (which left the top + bottom rows clipped with no way to reach them) */
  max-height: 62vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-right: 4px; /* a little room so cards don't sit under the scrollbar */
}
.buy {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(26, 16, 44, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
  color: var(--ink);
  font-family: var(--display);
  /* card, not a raised action button - drop the inherited button shadow */
  box-shadow: none;
  transition: border-color 0.12s ease;
}
.buy:hover:not(:disabled) {
  border-color: var(--gold);
}
.buy:disabled {
  cursor: default;
  opacity: 0.55;
}
.buy .bi {
  font-size: 20px;
  flex-shrink: 0;
}
/* the middle text column must be allowed to shrink (min-width:0) so a long row
   of level dots or a big cost can't force the card wider and shove the gold
   past the right edge */
.buy .bt {
  flex: 1;
  min-width: 0;
}
.buy .bn {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
}
.buy .bx {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
}
.buy .bc {
  margin-left: auto;
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--gold);
  white-space: nowrap;
}
.buy.maxed .bc {
  color: var(--accent-2);
}
.buy .dots {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--accent);
  letter-spacing: 2px;
  line-height: 1.2;
  display: block;
  /* high-max upgrades (15 dots) must wrap inside the card, not force its width */
  white-space: normal;
  word-break: break-all;
  margin-top: 2px;
}
.keys2 {
  font-family: var(--mono);
  font-size: 12px;
  color: #8b7fb0;
  margin-top: 14px;
}
/* social / contact links under the main menu actions */
.menu-social {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 12px;
}
.menu-social a {
  color: var(--lav);
  text-decoration: none;
  opacity: 0.85;
}
.menu-social a:hover {
  color: var(--accent);
  opacity: 1;
  text-decoration: underline;
}
.keys2 kbd {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 11px;
  color: #fff;
}
.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 16px;
  box-shadow: none;
  cursor: pointer;
}
/* a step up from .ghost: a solid, clearly-visible secondary action (Upgrades)
   that sits between the plain ghost buttons and the primary gradient Start */
.secondary {
  background: rgba(168, 132, 255, 0.18);
  color: var(--ink);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 11px 24px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 3px 12px rgba(108, 123, 255, 0.22);
  cursor: pointer;
}
/* menu nav buttons (Arsenal/Bestiary/Guide/...) are ghost-styled for low
   emphasis, but should match the primary/secondary footprint so the menu reads
   as one consistent row instead of big buttons + tiny links. The compact .ghost
   sizing stays for icon-only buttons (audio/lang) outside .menu-actions. */
.menu-actions .ghost {
  padding: 11px 20px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 10px;
  border-color: rgba(255, 255, 255, 0.28);
}
.menu-actions .ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}
.secondary:hover {
  background: rgba(168, 132, 255, 0.3);
  filter: none;
}
#muteBtn {
  pointer-events: auto;
  margin-left: auto;
  background: rgba(20, 12, 34, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--ink);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 15px;
  box-shadow: none;
  cursor: pointer;
}

/* ---------- chest reveal ---------- */
.chest-panel {
  position: relative;
  overflow: hidden;
  max-width: 460px;
}
.rays {
  position: absolute;
  left: 50%;
  top: 38%;
  width: 900px;
  height: 900px;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 226, 122, 0.16) 0deg 9deg,
    transparent 9deg 18deg
  );
  animation: spin 14s linear infinite;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.chest.show .rays {
  opacity: 1;
}
@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}
.chest-ico {
  position: relative;
  font-size: 84px;
  line-height: 1;
  margin-bottom: 6px;
  filter: drop-shadow(0 0 22px rgba(255, 226, 122, 0.6));
  animation: chestShake 0.5s ease-in-out;
  transform-origin: 50% 80%;
}
@keyframes chestShake {
  0%,
  100% {
    transform: rotate(0);
  }
  20% {
    transform: rotate(-7deg) scale(1.04);
  }
  40% {
    transform: rotate(7deg) scale(1.04);
  }
  60% {
    transform: rotate(-5deg);
  }
  80% {
    transform: rotate(5deg);
  }
}
.chest-panel h1 {
  position: relative;
}
.reveal {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 14px 0 22px;
  min-height: 90px;
  justify-content: center;
}
.reveal .evo-card {
  animation: pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.reveal .evo-ico {
  font-size: 56px;
  filter: drop-shadow(0 0 18px var(--c, var(--accent)));
}
.reveal .evo-tag {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--accent);
  text-transform: uppercase;
}
.reveal .evo-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 4px;
}
.reveal .loot-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.reveal .loot {
  background: rgba(26, 16, 44, 0.9);
  border: 1px solid rgba(255, 226, 122, 0.35);
  border-radius: 12px;
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  animation: pop 0.4s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.reveal .loot .li {
  font-size: 28px;
}
.reveal .loot.reward {
  border-color: rgba(255, 179, 138, 0.6);
}
.reveal .loot small {
  opacity: 0.6;
  font-size: 11px;
}
.reveal .chest-note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--lav);
  opacity: 0.85;
}
@keyframes pop {
  from {
    transform: scale(0.3);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ---------- audio / language controls ---------- */
.hudbtns {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
/* music track + its music/SFX toggles, kept tight and set apart from pause/fullscreen */
.hud-audio {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 16px;
}
/* the now-playing music icon reads larger than the other HUD toggles so it's
   clearly tied to the track name beside it */
#musicBtn {
  font-size: 22px;
  padding: 3px 9px;
}
#musicBtn,
#sfxBtn,
#pauseBtn,
#fsBtn {
  pointer-events: auto;
  background: rgba(20, 12, 34, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--ink);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 15px;
  box-shadow: none;
  cursor: pointer;
}
.audiobtns {
  display: inline-flex;
  gap: 6px;
}
/* the pause menu's music / SFX / fullscreen toggle row (the phone home for these
   controls). Centred, with roomy tap targets. */
.pause-audio {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 4px auto 16px;
}
.pause-audio button {
  width: 44px;
  height: 40px;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
button.off {
  opacity: 0.38;
}
.langsel {
  display: inline-flex;
}
.langsel-dd {
  pointer-events: auto;
  background: rgba(20, 12, 34, 0.85);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  padding: 4px 10px;
  font-size: 12px;
  font-family: var(--mono);
  cursor: pointer;
}
.langsel-dd:focus-visible {
  outline: none;
  border-color: var(--accent);
}
/* native option list renders in the OS theme; keep text readable on platforms
   that honour these */
.langsel-dd option {
  background: #140c22;
  color: var(--ink);
}
.menu-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 18px;
}
#buffs {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.buff {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(20, 12, 34, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 3px 8px 4px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
}
.buff .bmini {
  position: relative;
  width: 36px;
  height: 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}
.buff .bmini > i {
  position: absolute;
  inset: 0;
  transform-origin: left;
}
#trackBtn {
  pointer-events: none;
  background: rgba(20, 12, 34, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--ink);
  border-radius: 8px;
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.5px;
  white-space: nowrap;
  box-shadow: none;
}
#trackBtn #trackName {
  color: var(--accent);
}
#trackBtn:disabled {
  opacity: 0.5;
  cursor: default;
}
/* debug / FPS readout: pinned to the bottom-right, out of the topbar flow (so it
   never squeezes the control-button row). Off by default, so overlapping the
   hotbar corner is fine; a faint plate keeps it legible when it's on. */
.fps {
  position: fixed;
  right: 8px;
  bottom: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-2);
  text-align: right;
  background: rgba(10, 6, 20, 0.55);
  padding: 3px 6px;
  border-radius: 6px;
  z-index: 7;
  pointer-events: none;
}
.opt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 0;
  font-size: 14px;
  color: var(--ink);
}
.opt-row input[type="range"] {
  flex: 1;
  max-width: 220px;
  accent-color: var(--accent);
}
.opt-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}
.opt-row input[type="password"] {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: var(--ink);
  padding: 6px 10px;
  font-family: var(--mono);
}
/* developer tools block - quietly set off from the player-facing options */
#optDevPanel {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}
.opt-devhint {
  font-size: 12px;
  color: var(--lav);
  margin: 0 0 6px;
  text-align: left;
}
/* dev-tools overlay: a label + a wrapping grid of compact action buttons */
.dev-section {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--lav);
  text-align: left;
  margin: 14px 0 6px;
  opacity: 0.8;
}
.dev-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dev-grid .ghost {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
}
/* the Dev tools entry in the pause menu - a faint dashed accent so it reads as
   a hidden/developer affordance, not a normal menu action */
.dev-btn {
  border: 1px dashed rgba(155, 255, 122, 0.5) !important;
  color: #9bff7a !important;
}
.news-body {
  text-align: left;
  font-size: 13.5px;
  line-height: 1.6;
  color: #c9bce4;
  margin: 8px 0 20px;
  max-height: 55vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.news-body h4 {
  color: var(--accent);
  margin: 12px 0 4px;
  font-size: 14px;
}
.news-body ul {
  margin: 0 0 6px 18px;
}
.char.locked {
  opacity: 0.5;
  cursor: default;
}
/* coin-locked card: subdue the icon + name but keep the unlock button bright
   (parent opacity would dim a child button too, so we never use .locked here) */
.char.coinlock {
  cursor: default;
}
.char.coinlock .ci,
.char.coinlock .cn,
.char.coinlock .mapdot {
  opacity: 0.5;
}
.unlockbtn {
  margin-top: 2px;
  padding: 3px 8px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  color: var(--bg-0, #0c0a18);
  background: var(--gold, #ffd76b);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  /* wrap rather than force the card wider on a narrow phone (was nowrap, which
     overflowed the char-select grid). Stay within the card and wrap if needed. */
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
.unlockbtn:hover {
  filter: brightness(1.1);
}
.unlockbtn[disabled] {
  background: rgba(255, 215, 107, 0.22);
  color: var(--ink-3, #8a86a8);
  cursor: default;
}
/* "Not available in DEMO" note on a teaser card (locked survivor/world) */
.char .demo-lock {
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
/* "Not available in DEMO" banner over the (disabled) upgrades shop */
.shop-demo-note {
  grid-column: 1 / -1;
  margin: 0 0 4px;
  text-align: center;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.char.map .ci {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px;
}
.mapdot {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

/* ---------- on-screen joystick ---------- */
#stick {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  display: none;
}
#stick.on {
  display: block;
}
#stickBase {
  position: absolute;
  width: 120px;
  height: 120px;
  margin: -60px 0 0 -60px;
  border-radius: 50%;
  background: rgba(108, 123, 255, 0.12);
  border: 2px solid rgba(108, 123, 255, 0.45);
}
#stickKnob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  background: rgba(205, 214, 255, 0.5);
  border: 2px solid rgba(205, 214, 255, 0.85);
  box-shadow: 0 0 16px rgba(108, 123, 255, 0.6);
}

/* ---------- evolution reference ---------- */
.menu-panel,
.evo-panel {
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.evo-panel {
  max-width: 640px;
}
.evo-intro {
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 16px;
}
.evo-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.evo-subhead {
  margin: 14px 0 2px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-passive);
  opacity: 0.9;
}
.evo-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(26, 16, 44, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 8px 10px;
}
.evo-part {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  text-align: left;
}
.evo-part .ei {
  font-size: 22px;
  flex-shrink: 0;
}
.evo-part .et {
  font-size: 12px;
  line-height: 1.2;
}
.evo-part .et small {
  color: var(--ink-3);
}
.evo-part.res {
  color: var(--c, var(--accent));
  font-weight: 700;
}
.evo-op {
  color: #8b7fb0;
  font-family: var(--mono);
  flex-shrink: 0;
}
.evo-badge.ready {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: #1a0b2b;
  background: var(--accent-2);
  border-radius: 5px;
  padding: 2px 6px;
  flex-shrink: 0;
}

/* ---------- mobile ---------- */
@media (max-width: 560px) {
  .clock {
    font-size: 24px;
    min-width: 70px;
  }
  /* PHONE HUD LAYOUT: the topbar holds the timer + stat chips (left). The music,
     SFX and fullscreen toggles move into the PAUSE menu, so the only always-on
     control on the play field is the pause button - pinned just below the minimap
     on the right edge. Less chrome over the game. */
  #topbar {
    gap: 8px;
    /* keep the timer + stat chips clear of the top-right minimap */
    padding: 8px var(--mmw, 140px) 8px 10px;
  }
  .hudbtns {
    position: fixed;
    right: 14px; /* right edge lines up with the minimap (which sits at margin 14) */
    top: var(--mmh, 190px);
    margin: 0;
    z-index: 8;
  }
  #fsBtn,
  .hud-audio {
    display: none;
  }
  .hudbtns button {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .fps {
    font-size: 10px;
  }
  .stat {
    font-size: 11px;
  }
  /* LEVEL-UP on phones: anchor the panel to the TOP and let it run ALMOST full
     height. We only reserve a slim bottom band, so the hotbar (lifted above this
     modal during a level-up) overlaps the very bottom of the panel a little -
     that's fine; the choices live up top and the panel scrolls if needed. */
  #levelup {
    align-items: flex-start;
  }
  #levelup .panel {
    /* clear of the top edge / notch; max-height drops by the same amount so the
       panel's bottom edge (and the hotbar band below it) stays put */
    margin-top: 28px;
    max-height: calc(100vh - 110px);
    max-height: calc(100dvh - 110px);
    /* a little breathing room at the bottom so the last card isn't flush against
       the slice of hotbar that overlaps it */
    padding-bottom: 26px;
  }
  /* COMPACT level-up cards on phones so all three fit with little/no scrolling:
     tighter header, smaller icon, snugger padding + line-height. (!important to
     beat the inline font-size/margin on the heading + subtitle.) */
  #levelup h1 {
    font-size: 23px !important;
    margin-bottom: 2px;
  }
  #levelup #luSub {
    font-size: 13px;
    margin-bottom: 8px !important;
  }
  .choices {
    gap: 8px;
    margin-top: 4px;
  }
  .choice {
    padding: 10px 12px;
    gap: 4px;
    border-radius: 12px;
  }
  .choice .ic {
    width: 34px;
    height: 34px;
    font-size: 21px;
    border-radius: 9px;
  }
  .choice .head {
    gap: 8px;
  }
  .choice .nm {
    font-size: 15px;
  }
  .choice .ds {
    font-size: 12px;
    line-height: 1.35;
  }
  .panel {
    padding: 20px 16px;
  }
  .evo-row {
    flex-wrap: wrap;
  }
  .evo-part {
    flex-basis: 40%;
  }
  /* compact hotbar so 8+8 slots don't eat the screen on phones */
  #inv {
    padding: 6px 8px 8px;
    gap: 8px;
  }
  .invgroup {
    padding: 15px 5px 5px;
    gap: 4px;
    border-radius: 9px;
  }
  .invgroup::before {
    font-size: 7px;
    top: 4px;
    left: 6px;
  }
  .slot {
    width: 27px;
    height: 27px;
    border-radius: 7px;
    font-size: 14px;
  }
  .slot .pips {
    font-size: 7px;
    bottom: 1px;
    right: 2px;
  }
  .slot .dropx {
    width: 13px;
    height: 13px;
    line-height: 13px;
    font-size: 8px;
    top: -4px;
    right: -4px;
  }
  .slot .mprog {
    font-size: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* feedback / bug-report form */
.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  text-align: left;
}
.feedback-form select,
.feedback-form textarea,
.feedback-form input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.35);
  color: var(--ink);
  border: 1px solid var(--ink-4);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
}
.feedback-form textarea {
  resize: vertical;
  min-height: 90px;
}
.feedback-form select:focus,
.feedback-form textarea:focus,
.feedback-form input:focus {
  outline: none;
  border-color: var(--accent);
}
.feedback-form .menu-actions {
  margin-top: 4px;
}
#fbStatus {
  min-height: 1em;
  margin: 4px 0 0;
}
    