:root {
  --bg: #17142e;
  --bg-hi: #2e2860;
  --ink: #f4f1ea;
  --ink-soft: #aebbd6;
  --card: #fffaf2;
  --card-ink: #1d2a44;
  --jay: #4a8be8;
  --jay-dark: #2b5fb5;
  --gold: #f5b82e;
  --red: #e8574a;
  --green: #5fd68a;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; touch-action: manipulation; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
body {
  position: fixed;
  inset: 0;
  font-family: "Baloo 2", ui-rounded, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
button, a { font: inherit; color: inherit; }
[hidden] { display: none !important; }
#world { position: fixed; inset: 0; display: block; touch-action: none; background: #333; }

svg.i, .round-btn svg, .hp svg { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- buttons ---------- */
.primary, .secondary {
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 16px;
  font-weight: 800;
  font-size: 19px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.1s;
}
.primary { background: linear-gradient(#ffd25a, var(--gold)); color: #3a2605; box-shadow: 0 5px 0 #b57f0f, 0 10px 20px -8px rgba(0, 0, 0, 0.6); }
.primary:active { transform: translateY(3px); box-shadow: 0 2px 0 #b57f0f; }
.primary.big { min-height: 66px; font-size: 28px; width: 100%; max-width: 330px; border-radius: 20px; }
.secondary { background: rgba(255, 255, 255, 0.12); color: var(--ink); }
.secondary:active { background: rgba(255, 255, 255, 0.2); }
.secondary[disabled], .primary[disabled] { opacity: 0.45; }
.round-btn {
  width: 46px; height: 46px; border: 0; border-radius: 50%;
  background: rgba(10, 16, 32, 0.55); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(4px);
}
.round-btn svg { width: 24px; height: 24px; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.coin-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px 0 10px; border-radius: 20px;
  background: rgba(10, 16, 32, 0.6); font-weight: 800; font-size: 20px; color: #ffe28a;
}
.coin-chip::before, .coinline::before {
  content: ""; width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff1b0, #f2b632 55%, #c98a10); box-shadow: 0 0 0 2px #7a520a inset;
}

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; padding: var(--sg-corner-top) 12px 0; }
/* the top row: the corner's menu button (shared/menu.css), then the XP bar on its middle */
.hud-top { display: flex; align-items: center; gap: 10px; }
.hud-top > .sg-corner-slot { margin-left: calc(var(--sg-corner-left) - 12px); pointer-events: auto; }
.hud-top > .xp { flex: 1; min-width: 0; }
.xp { position: relative; height: 16px; border-radius: 8px; background: rgba(8, 14, 30, 0.65); overflow: hidden; }
.xp i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #5aa8f0, #7fe0ff); }
.xp b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; line-height: 1; text-shadow: 0 1px 2px #000; }
.hud-row { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; gap: 8px; }
.hud-row::after { content: ''; flex: 1; max-width: 170px; } /* keeps the clock in the middle */
.hp { display: flex; align-items: center; gap: 6px; flex: 1; max-width: 170px; }
.hp svg { width: 24px; height: 24px; flex: none; fill: var(--red); stroke: #fff; stroke-width: 1.6; filter: drop-shadow(0 1px 2px #000); }
.hp-bar { flex: 1; height: 14px; border-radius: 7px; background: rgba(8, 14, 30, 0.65); overflow: hidden; }
.hp-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(#ff7b6e, var(--red)); transition: width 0.12s; }
.hp b { font-size: 14px; text-shadow: 0 1px 2px #000; min-width: 28px; }
.clock { font-size: 28px; font-weight: 800; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7); }
/* banked points, Nova Drift's Upgrade bar. Jay (2026-11-16): white and partly see-through, then "it needs to look cooler, more
   like the nova drift one ... below the actives ... way too in the middle": a framed bar along the very bottom, under the
   buttons (which sit a little higher to make room): two white rims with chevron ends around a see-through inside, a light
   sweeping across. The frame is an SVG drawn to the bar's real size when it shows (game.js, frameUpgradeBar). Touches go
   through it to the field (pointer-events: none): a quick tap on it opens the cards, a drag from it steers (onUpgradeBar). */
.points {
  position: absolute; left: calc(10px + env(safe-area-inset-left, 0px)); right: calc(10px + env(safe-area-inset-right, 0px));
  bottom: calc(var(--safe-bottom) + 8px); height: 34px; z-index: 2; pointer-events: none; isolation: isolate;
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0 30px; border: 0; background: none;
  color: #fff; font: inherit; font-weight: 800; font-size: 16px; line-height: 1; text-transform: uppercase; letter-spacing: 0.24em;
  text-shadow: 0 0 8px rgba(190, 220, 255, 0.95), 0 1px 2px #000;
}
.points[hidden] { display: none; }
.points .pts-frame { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; overflow: visible; }
.points .pts-frame .fill { fill: rgba(14, 14, 40, 0.42); }
.points .pts-frame .rim-o { fill: none; stroke: rgba(255, 255, 255, 0.95); stroke-width: 2; filter: drop-shadow(0 0 3px rgba(170, 205, 255, 0.9)); }
.points .pts-frame .rim-i { fill: none; stroke: rgba(255, 255, 255, 0.55); stroke-width: 1.2; }
.points .pts-frame .sweep { animation: ptsSweep 2.8s ease-in-out infinite; }
@keyframes ptsSweep { 0%, 30% { transform: translateX(-80px); } 100% { transform: translateX(var(--sweep-to, 460px)); } }
.points svg:not(.pts-frame) { width: 15px; height: 15px; fill: currentColor; filter: drop-shadow(0 0 4px rgba(190, 220, 255, 0.9)); }
.points b { font-size: 14px; letter-spacing: 0.06em; color: #ffe9a8; }
.points b:empty { display: none; }
.points.tapped .pts-frame .fill { fill: rgba(110, 130, 255, 0.5); }
.points.bump .pts-frame .rim-i { animation: ptsBump 0.7s ease-out; } /* a point arrives: the inner rim flashes */
@keyframes ptsBump { 0%, 25% { stroke: #fff; stroke-width: 2.4; } 100% { stroke: rgba(255, 255, 255, 0.55); stroke-width: 1.2; } }
@media (prefers-reduced-motion: reduce) { .points .pts-frame .sweep { animation: none; display: none; } }
.lu-head { position: relative; width: 100%; max-width: 400px; }
.lu-later { position: absolute; right: 0; top: 0; min-height: 44px; padding: 0 16px; border-radius: 22px; font-size: 16px; }
.lu-later[hidden] { display: none; }
#levelup .lu-head h2 { padding: 0 72px; }
#levelup .lu-sub { text-align: center; text-shadow: 0 1px 3px #000, 0 0 10px rgba(0, 0, 0, 0.8); }
.hud-sub { display: flex; gap: 14px; font-size: 15px; font-weight: 700; margin-top: 2px; text-shadow: 0 1px 3px #000; }
.coinline { display: inline-flex; align-items: center; gap: 5px; color: #ffe28a; }
/* a fixed footprint: the weapons row, then one small row (paths and the "+N more" chip), however much you hold */
.tray { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; max-width: min(300px, calc(100vw - 40px)); }
.tray .t {
  position: relative; width: 30px; height: 30px; border-radius: 8px; background: rgba(8, 14, 30, 0.55); padding: 2px;
}
.tray .t img { width: 100%; height: 100%; display: block; }
/* the weapon slots (the arsenal rework): filled ones, then dashed outlines up to what you may carry right now */
.tray .slots { display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; width: 100%; }
/* one row however many slots: the tiles give up a little size (never under 22 px) before they would wrap */
.tray .slots .t { flex: 0 1 30px; min-width: 22px; height: auto; aspect-ratio: 1; }
.tray .slots .sl { flex: none; }
.tray .sl { font-size: 11px; font-weight: 800; letter-spacing: 0.04em; color: #ffd9a6; text-shadow: 0 1px 2px #000; margin-right: 2px; }
.tray .t.empty { background: transparent; border: 2px dashed rgba(255, 217, 166, 0.55); }
.tray .t.evo { box-shadow: 0 0 0 2px var(--gold), 0 0 10px var(--gold); }
.tray .t em { position: absolute; right: -2px; bottom: -3px; font-style: normal; font-size: 10px; font-weight: 800; min-width: 14px; height: 14px; border-radius: 7px; background: #fff; color: #1d2a44; text-align: center; line-height: 14px; }
.tray .t.max em { background: var(--gold); }
.tray .t.ready em { background: #ff7de0; animation: pulse 0.9s infinite alternate; }
.banner {
  position: absolute; left: 0; right: 0; top: 20%; text-align: center; font-size: 26px; font-weight: 800; padding: 0 20px; line-height: 1.1;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.55), 0 0 18px rgba(0, 0, 0, 0.7); opacity: 0; transform: scale(0.8); transition: opacity 0.25s, transform 0.25s;
}
.banner.on { opacity: 1; transform: scale(1); }
.banner.boss { color: #ff8f84; font-size: 32px; }

/* ---------- screens ---------- */
.screen {
  position: fixed; inset: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: calc(var(--safe-top) + 10px) 18px calc(var(--safe-bottom) + 16px);
  background: radial-gradient(ellipse 120% 60% at 50% 0%, var(--bg-hi), transparent 70%), var(--bg);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  max-width: 520px; margin: 0 auto;
}
@media (min-width: 521px) { .screen { left: 50%; right: auto; width: 520px; transform: translateX(-50%); } }
 /* Jay's hair, his shirt's glow */

/* sticky, so Menu is always one tap away however far down the Workshop or Codex is scrolled */
.panel-top { position: sticky; top: calc(-1 * (var(--safe-top) + 10px)); z-index: 5; background: var(--bg); width: calc(100% + 36px); margin: calc(-1 * (var(--safe-top) + 10px)) -18px 8px; padding: var(--sg-corner-top) 18px 8px; /* the corner's Menu heads it (shared/menu.css) */ box-sizing: border-box; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; margin-bottom: 8px; }
.panel-top h2 { margin: 0; font-size: 30px; text-align: center; }
.lede { color: var(--ink-soft); margin: 4px 0 12px; font-size: 15px; }
.ups { list-style: none; padding: 0; margin: 0; width: 100%; display: flex; flex-direction: column; gap: 10px; }
.ups li { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; background: rgba(255, 255, 255, 0.09); text-align: left; }
.ups .info { flex: 1; min-width: 0; }
.ups b { font-size: 20px; display: block; line-height: 1.1; }
.ups small { color: var(--ink-soft); font-size: 13px; }
.pips { display: flex; gap: 4px; margin-top: 5px; }
.pips i { width: 16px; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.2); }
.pips i.on { background: var(--gold); }
.ups .up-hd { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ups .up-hd b { display: inline; }
.ups .up-lv { font-size: 13px; font-weight: 800; color: var(--ink-soft); }
.ups .up-now { display: block; margin-top: 2px; font-weight: 700; }
.ups .up-bar { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.16); margin-top: 6px; overflow: hidden; }
.ups .up-bar i { display: block; height: 100%; border-radius: 4px; background: var(--gold); }
.ups button { min-width: 92px; min-height: 48px; border: 0; border-radius: 14px; font-weight: 800; font-size: 17px; background: linear-gradient(#ffd25a, var(--gold)); color: #3a2605; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; justify-content: center; }
.ups button[disabled] { background: rgba(255, 255, 255, 0.14); color: var(--ink-soft); }
.ups button.maxed { background: transparent; color: var(--gold); }

/* ---------- level-up ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: calc(var(--safe-top) + 10px) 16px calc(var(--safe-bottom) + 14px); background: rgba(8, 12, 26, 0.74); backdrop-filter: blur(3px);
  animation: fade 0.2s;
}
.overlay h2 { margin: 0; font-size: 44px; line-height: 1; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.5); color: #ffe28a; animation: pop 0.45s cubic-bezier(.2, 1.6, .4, 1); }
.lu-sub { margin: 0 0 4px; color: var(--ink-soft); font-size: 15px; }
/* the paths: the build view's chips and the HUD's counts */
.bpaths .pchip { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 900; background: var(--pc); color: var(--pi); letter-spacing: 0.02em; }
.tray .paths { display: flex; flex-wrap: nowrap; align-items: center; gap: 3px; width: 100%; height: 22px; overflow: visible; }
.tray .more {
  position: relative; flex: none; height: 20px; padding: 0 8px; margin-left: 3px; border: 0; border-radius: 10px; pointer-events: auto; cursor: pointer;
  font-family: inherit; font-size: 11px; font-weight: 800; line-height: 20px; color: #1d2a44; background: rgba(255, 244, 222, 0.92); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.build .more-at { scroll-margin-top: 14px; }
.tray .more::after { content: ''; position: absolute; inset: -12px -6px; } /* a 44 px touch target, no bigger to look at */
.tray .more:active { transform: scale(0.94); }
@media (prefers-reduced-motion: reduce) { .tray .more:active { transform: none; } }
.tray .pp { min-width: 24px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 11px; font-weight: 900; line-height: 18px; text-align: center; background: var(--pc); color: var(--pi); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.tray .pp.open { box-shadow: 0 0 0 2px #fff, 0 0 8px var(--pc); }
.banner.path { font-size: 20px; color: #ffe9b0; top: 34%; }
.bpaths { display: grid; gap: 6px; margin: 8px 0; }
.bpaths > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bpaths small { font-size: 13px; color: inherit; opacity: 0.85; }

/* ---------- results ---------- */
.results { justify-content: flex-start; gap: 0; padding-top: calc(var(--sg-corner-top) + 40px); } /* under the corner's Menu */
.results h2 { margin: 16px 0 0; font-size: 48px; line-height: 1; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.45); }
.results.won h2 { color: #ffe28a; }
.res-sub { margin: 6px 0 14px; color: var(--ink-soft); font-size: 16px; }
.res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; max-width: 360px; }
.res-grid div { background: rgba(255, 255, 255, 0.09); border-radius: 16px; padding: 8px 6px; }
.res-grid b { display: block; font-size: 28px; line-height: 1.05; }
.res-grid span { font-size: 13px; color: var(--ink-soft); }
.res-coins { display: flex; align-items: center; gap: 12px; margin: 14px 0 6px; font-size: 18px; font-weight: 700; }
.res-coins b { font-size: 34px; color: #ffe28a; }
.res-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; min-height: 8px; margin-bottom: 8px; }
.res-badges span { padding: 3px 10px; border-radius: 12px; background: var(--gold); color: #3a2605; font-weight: 800; font-size: 13px; animation: pop 0.5s backwards; }
.res-badges span.green { background: var(--green); }
.res-build { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; max-width: 360px; margin-bottom: 14px; }
.res-build .t { position: relative; width: 44px; height: 44px; border-radius: 12px; background: rgba(255, 255, 255, 0.1); padding: 3px; }
.res-build .t img { width: 100%; height: 100%; }
.res-build .t em { position: absolute; right: -3px; bottom: -4px; font-style: normal; font-size: 11px; font-weight: 800; min-width: 17px; height: 17px; line-height: 17px; border-radius: 9px; background: #fff; color: #1d2a44; }

/* ---------- menu sheet ---------- */
.sheet {
  width: min(440px, 100vw); max-width: 100vw; max-height: 92dvh; margin: auto auto 0; padding: 20px 18px calc(var(--safe-bottom) + 16px); border: 0;
  border-radius: 28px 28px 0 0; background: #fffaf2; color: var(--card-ink); box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.5); overflow-y: auto;
}
.sheet::backdrop { background: rgba(5, 8, 20, 0.6); }
.sheet h2 { margin: 0; font-size: 30px; }
.sheet h3 { margin: 14px 0 6px; font-size: 18px; }
.sheet .lede { color: #5a6784; }
.menu-build { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.menu-build .t { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 12px; background: #efe7d6; font-size: 14px; font-weight: 700; }
.menu-build .t img { width: 32px; height: 32px; }
.menu-build .t small { color: #6b7691; font-weight: 600; }
.codex { list-style: none; padding: 0; margin: 0; font-size: 14px; display: grid; gap: 4px; }
.codex li { display: flex; gap: 8px; align-items: center; }
.codex img { width: 26px; height: 26px; }
.codex .u { opacity: 0.5; }
.how { padding-left: 20px; margin: 4px 0; font-size: 14px; line-height: 1.35; color: #3a4662; }
.sheet-actions { display: flex; gap: 8px; margin-top: 14px; }
.sheet-actions > * { flex: 1; min-width: 0; padding: 0 8px; font-size: 17px; }
.sheet .secondary { background: #efe7d6; color: var(--card-ink); }
.sheet .primary { box-shadow: 0 4px 0 #b57f0f; }
.sheet .lb-open, .sheet .acct-saveline { color: var(--card-ink); }
.sheet .sg-actions .secondary { background: #efe7d6; }
.noscript { position: fixed; top: 40%; width: 100%; text-align: center; }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } }
@keyframes slide { from { transform: translateY(40px) scale(0.92); opacity: 0; } }
@keyframes pulse { to { transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) {
  .overlay, .overlay h2, .res-badges span, .tray .t.ready em { animation: none; }
  .banner { transition: none; }
}
@media (max-height: 700px) {
  .primary.big { min-height: 58px; }
}

.menu-section summary { font-size: 18px; font-weight: 800; min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.menu-section summary::-webkit-details-marker { display: none; }
.menu-section summary::after { content: ''; margin-left: auto; width: 9px; height: 9px; border: solid currentColor; border-width: 0 3px 3px 0; transform: rotate(45deg) translate(-2px, -2px); opacity: 0.6; transition: transform 0.15s; }
.menu-section[open] summary::after { transform: rotate(225deg); }
.menu-section { border-top: 1px solid #e6dcc8; }

/* ---------- rebuild additions ---------- */
.sub-h { width: 100%; text-align: left; margin: 10px 0 0; font-size: 20px; }
.panel .lede { text-align: left; width: 100%; }

/* crew: one full-width card per person, rules stated plainly */
.crew-list { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.ccard {
  --rar: #7fae6a; display: grid; grid-template-columns: 76px 1fr; gap: 4px 12px; padding: 12px; text-align: left;
  border-radius: 20px; border: 3px solid var(--rar); background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 -3px 0 rgba(0, 0, 0, 0.2);
}
.ccard.sel { background: color-mix(in srgb, var(--rar) 22%, rgba(255, 255, 255, 0.05)); }
.ccard img.p { width: 76px; height: 76px; border-radius: 50%; background: #f4ecdf; border: 3px solid var(--rar); }
.ccard.locked img.p { filter: brightness(0.45) saturate(0.5); }
.ccard.mystery img.p { filter: brightness(0); background: #3a3560; }
.ccard .nm { display: flex; flex-direction: column; justify-content: center; }
.ccard .nm b { font-size: 22px; line-height: 1.05; }
.ccard .nm small { color: var(--rar); font-weight: 800; font-size: 14px; letter-spacing: 0.03em; }
.ccard .facts { grid-column: 1 / -1; display: grid; gap: 6px; margin-top: 4px; }
.fact { display: grid; grid-template-columns: 84px 1fr; gap: 8px; font-size: 15px; line-height: 1.3; }
.fact > span:first-child { font-weight: 800; color: var(--ink-soft); font-size: 14px; padding-top: 1px; }
.fact.weak > span:last-child { color: #ffb4ab; }
.fact img { width: 24px; height: 24px; vertical-align: -6px; margin-right: 4px; }
.ccard .row { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.ccard .why { flex: 1; font-size: 14px; color: #ffb4ab; }
.ccard .st { min-height: 46px; min-width: 120px; border: 0; border-radius: 14px; font-weight: 800; font-size: 17px; background: rgba(255, 255, 255, 0.14); cursor: pointer; padding: 0 12px; margin-left: auto; }
.ccard .st.go { background: linear-gradient(#ffd25a, var(--gold)); color: #3a2605; }
.ccard .st.on { background: var(--rar); color: #fff; }

/* workshop */
.ups .ico { width: 44px; height: 44px; flex: none; border-radius: 12px; background: rgba(255, 255, 255, 0.08); padding: 3px; }
.ups small { font-size: 14px; line-height: 1.3; display: block; }
.ups li.owned { opacity: 0.7; }

/* codex */
.tabs { display: flex; flex: none; gap: 6px; overflow-x: auto; width: 100%; padding: 2px 0 8px; scrollbar-width: none; }
.tabs button { flex: none; min-height: 44px; padding: 0 14px; border: 0; border-radius: 14px; background: rgba(255, 255, 255, 0.1); font-weight: 800; font-size: 15px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--gold); color: #3a2605; }
/* the Workshop's tabs and the Armory's rungs (v2 Stage 7) */
.ups-pane { width: 100%; }
.rung { width: 100%; margin: 0 0 16px; text-align: left; }
.rung-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 6px 0 4px; }
.rung-hd b { font-size: 20px; }
.rung-hd span { font-size: 14px; font-weight: 800; color: var(--gold); }
.rung-bar { font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.rung .up-bar { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.16); margin: 4px 0 10px; overflow: hidden; }
.rung .up-bar i { display: block; height: 100%; border-radius: 4px; background: var(--gold); }
.rung.shut .ups li { opacity: 0.55; }
.ups small.kind { font-weight: 800; color: var(--gold); font-size: 13px; }
.dex { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.dex > li { display: grid; grid-template-columns: 56px 1fr; gap: 4px 12px; padding: 10px 12px; border-radius: 16px; background: rgba(255, 255, 255, 0.07); }
.dex > li > img { width: 56px; height: 56px; border-radius: 12px; grid-row: span 2; background: rgba(255, 255, 255, 0.06); }
.dex > li > b { font-size: 18px; line-height: 1.1; align-self: end; }
.dex > li > small { font-size: 14px; color: var(--ink-soft); }
.dex > li > .ls { grid-column: 1 / -1; margin: 4px 0 0; padding-left: 18px; font-size: 15px; line-height: 1.35; }
.dex > li > .un { grid-column: 1 / -1; font-size: 14px; color: #ffe28a; }
.dex > li.unseen > b { color: var(--ink-soft); }
.coin-chip.ghost::before { display: none; }
.coin-chip.ghost { color: var(--ink-soft); font-size: 16px; }

/* the ability button */
.ability {
  position: absolute; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(var(--safe-bottom) + 50px); width: 84px; height: 84px; border-radius: 50%; /* +24 px: room for the Upgrade bar */
  border: 0; pointer-events: auto; cursor: pointer; background: radial-gradient(circle at 35% 30%, #6a5ce0, #3a2f8a); color: #fff;
  box-shadow: 0 6px 0 #231c5a, 0 10px 24px -6px rgba(0, 0, 0, 0.7); display: grid; place-items: center; touch-action: none;
}
.ability img { width: 44px; height: 44px; margin-top: -10px; }
.ability span { position: absolute; bottom: 9px; left: 0; right: 0; font-size: 12px; font-weight: 800; text-align: center; }
.ability .ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); fill: none; stroke: #ffe28a; stroke-width: 6; stroke-linecap: round; }
.ability.cool { background: radial-gradient(circle at 35% 30%, #4a4870, #2a2848); }
.ability[hidden] { display: none; }
.ability.cool img { opacity: 0.5; }
.ability:active { transform: translateY(3px); box-shadow: 0 3px 0 #231c5a; }
.rulechip { color: #bfe8ff; }
.banner.elite { color: #ffe28a; font-size: 24px; }
.banner.move { font-size: 22px; }

.overlay { justify-content: flex-start; overflow-y: auto; }
.overlay > :first-child { margin-top: auto; }
.overlay > :last-child { margin-bottom: auto; }
.lu-actions { display: flex; gap: 10px; width: 100%; max-width: 400px; }
@media (max-height: 700px) {
  #levelup h2 { font-size: 34px; }
  #levelup .lu-sub { margin: 0; font-size: 14px; }
}
.lu-actions > * { flex: 1; }
#banish-btn.on { background: #b23a2e; }
/* the Pacts (pacts.js): black cards with gold edges, their own class (not a rarity) */
.overlay.pact { background: rgba(4, 3, 8, 0.86); }
.overlay.pact h2 { color: #f6d27a; text-shadow: 0 3px 0 #000, 0 0 18px rgba(232, 184, 74, 0.45); }
.overlay.pact .lu-sub { color: #e9dcc0; text-align: center; max-width: 400px; }
.pact-away { width: 100%; max-width: 400px; min-height: 50px; font-size: 18px; }
.card.pact { background: linear-gradient(160deg, #2a2632, #0e0c12 55%, #030304); color: #f4e8cc;
  box-shadow: 0 5px 0 #5c410a, 0 0 0 2px #e8b84a, 0 0 24px 1px rgba(232, 184, 74, 0.32), 0 14px 26px -10px rgba(0, 0, 0, 0.8); }
.card.pact::after { box-shadow: inset 0 0 0 1.5px rgba(246, 210, 122, 0.75), inset 0 2px 0 rgba(255, 236, 190, 0.22), inset 0 -3px 0 rgba(0, 0, 0, 0.5); }
.card.pact .name { color: #f6d27a; text-shadow: 0 1px 0 #000; }
.card.pact .line { color: #ece0c6; }
.card.pact .well { box-shadow: 0 3px 6px -1px rgba(0, 0, 0, 0.7); }
.card.pact .pg { display: grid; width: 40px; height: 40px; color: #f2c654; filter: drop-shadow(0 1px 0 #000); }
.card.pact .pg svg { width: 100%; height: 100%; }
.card.pact .plaque { background: linear-gradient(#2c2832, #0c0b10); color: #f6d27a; box-shadow: 0 0 0 1px #e8b84a, 0 2px 3px rgba(0, 0, 0, 0.6); }
.card.pact .plaque::before, .card.pact .plaque::after { background: linear-gradient(#1c1a22, #050507); }
.card.pact .sheen::before { animation: sweepLoop 4.2s calc(0.32s + var(--i, 0) * 90ms) ease-in-out infinite both; }
@media (prefers-reduced-motion: reduce) { .card.pact .sheen::before { animation: none; } .points.bump { animation: none; } }
.banner.pact { color: #f6d27a; font-size: 24px; }
.banner.map { color: #eaf2ff; font-size: 18px; white-space: pre-line; top: 60%; } /* Endless's map at the start: its name, then its twist (below you, clear of the HUD and a new Jay's card) */
.banner.map::first-line { font-size: 30px; }
.tray .t.locked { background: rgba(10, 8, 14, 0.55); border: 2px solid rgba(232, 184, 74, 0.6); position: relative; }
.tray .t.locked::after { content: ''; position: absolute; inset: 22%; background: #e8b84a; clip-path: polygon(20% 45%, 20% 30%, 30% 12%, 50% 4%, 70% 12%, 80% 30%, 80% 45%, 92% 45%, 92% 100%, 8% 100%, 8% 45%, 32% 45%, 32% 32%, 40% 20%, 50% 16%, 60% 20%, 68% 32%, 68% 45%); }
.bw.pact { box-shadow: inset 0 0 0 1.5px #e8b84a; background: linear-gradient(160deg, #2a2632, #0e0c12 60%, #030304); border-radius: 12px; }
.bw.pact b { color: #f6d27a; }
.bw.pact small { color: #ece0c6; opacity: 1; }

/* the build view in the pause menu */
.build { display: grid; gap: 8px; margin-bottom: 8px; }
.build h3 { margin: 8px 0 0; font-size: 18px; }
.bw { display: grid; grid-template-columns: 44px 1fr; gap: 2px 10px; padding: 8px 10px; border-radius: 14px; background: #f3ecdd; }
.bw img { width: 44px; height: 44px; grid-row: span 2; }
.bw b { font-size: 17px; }
.bw small { font-size: 14px; color: #5a6784; }
.bw .st { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; color: #36405c; }
.grow { display: grid; gap: 6px; }
.grow div { font-size: 14px; }
.grow i { display: block; height: 7px; border-radius: 4px; background: #e3dcf5; margin-top: 2px; overflow: hidden; }
.grow i u { display: block; height: 100%; background: linear-gradient(90deg, #8a5ce0, #c58cff); }
.totals { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; color: #36405c; }
.opts { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.opts label { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: #f3ecdd; min-height: 48px; font-size: 15px; }
.opts input { width: 24px; height: 24px; flex: none; margin-top: 2px; }
.opts b { display: block; font-size: 17px; }
.opts img { width: 40px; height: 40px; border-radius: 50%; background: #f4ecdf; flex: none; }
.sg-actions.one { grid-template-columns: 1fr; }

/* ---------- the shared menus (shared/mainmenu.js): colors only, through the --sg-* variables ---------- */
#mm {
  --sg-bg: radial-gradient(ellipse 120% 60% at 50% 0%, var(--bg-hi), transparent 70%), var(--bg);
  --sg-ink: var(--ink); --sg-ink-soft: var(--ink-soft);
  --sg-title: var(--ink); --sg-title-shadow: 0 4px 0 #0c0a1e, 0 0 30px rgba(140, 110, 240, 0.55);
  --sg-accent: var(--gold); --sg-accent-ink: #3a2a05;
  --sg-card: var(--card); --sg-card-ink: var(--card-ink); --sg-line: rgba(255, 255, 255, 0.3);
}
.sg-sheet { --sg-sheet-bg: #fffaf2; --sg-sheet-ink: var(--card-ink); --sg-accent: var(--gold); --sg-accent-ink: #3a2a05; --sg-ink-soft: #5a6784; }
.jay-hero { width: 120px; height: 120px; border-radius: 50%; background: #f4ecdf; border: 4px solid var(--rar, #7fae6a); box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.6); }
.sg-sheet .menu-section { border-top: 1px solid #e6dcc8; }
.sg-sheet .build { margin: 4px 0 0; }

/* ---------- the crew carousel in the title screen's art slot ---------- */
#mm .sg-art { height: auto; min-height: 175px; overflow: visible; display: block; } /* every slide the same height, so Play never jumps (Bri's mystery slide is shorter) */
#mm .sg-art > * { max-height: none; }
.cc { --rar: #7fae6a; width: 100%; display: flex; flex-direction: column; gap: 3px; touch-action: pan-y; }
.cc-main { display: flex; align-items: center; gap: 2px; }
.cc-arrow {
  flex: none; width: 44px; height: 64px; padding: 0; border: 0; border-radius: 14px; background: rgba(255, 255, 255, 0.1); color: var(--ink);
  display: grid; place-items: center; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.cc-arrow svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.cc-arrow:active { background: rgba(255, 255, 255, 0.22); transform: scale(0.96); }
.cc-slide { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; text-align: left; }
.cc-p { flex: none; width: 84px; height: 84px; border-radius: 50%; background: #f4ecdf; border: 4px solid var(--rar); box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.6); pointer-events: none; -webkit-user-drag: none; }
.cc.locked .cc-p { filter: brightness(0.12) saturate(0); opacity: 0.8; }
.cc-id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cc-name { font: 800 24px/26px var(--sg-font); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-meta { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cc-badge { flex: none; padding: 0 8px; border-radius: 999px; background: var(--rar); color: #1c1530; font: 800 11px/16px var(--sg-font); letter-spacing: 0.04em; text-transform: uppercase; }
.cc-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 12px/16px var(--sg-font); color: var(--ink-soft); }
.cc-stats { display: grid; gap: 1px; margin-top: 3px; }
.cc-stat { display: grid; grid-template-columns: 76px 1fr 34px; align-items: center; gap: 6px; font: 700 12px/14px var(--sg-font); }
.cc-stat .k { color: var(--ink-soft); white-space: nowrap; }
.cc-stat .v { text-align: right; color: var(--ink); }
.cc-bar { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.cc-bar::after { content: ""; display: block; height: 100%; width: calc(var(--f, 1) * 100%); border-radius: 4px; background: var(--rar); }
.cc-lock { display: flex; align-items: center; gap: 8px; margin-top: 3px; min-height: 44px; }
.cc-how { flex: 1; min-width: 0; font: 800 13px/1.15 var(--sg-font); color: var(--ink); }
.cc-need { display: block; margin-top: 2px; font: 700 12px/1.15 var(--sg-font); color: #ffb4ab; }
.cc-unlock { flex: none; min-height: 44px; min-width: 92px; padding: 0 16px; border: 0; border-radius: 14px; background: linear-gradient(#ffd25a, var(--gold)); color: #3a2605; font: 800 17px/1 var(--sg-font); cursor: pointer; }
.cc-unlock:active { transform: scale(0.97); }
.cc-info {
  display: flex; flex-direction: column; gap: 1px; width: 100%; margin: 0; padding: 2px 22px 2px 4px; border: 0; border-radius: 10px;
  background: none; color: var(--ink); text-align: left; font-family: var(--sg-font); cursor: pointer; position: relative; -webkit-tap-highlight-color: transparent;
}
.cc-info::after { content: ""; position: absolute; right: 6px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border: solid var(--ink-soft); border-width: 2.5px 2.5px 0 0; transform: rotate(45deg); opacity: 0.7; }
.cc-info:disabled { cursor: default; }
.cc-info:disabled::after { display: none; }
.cc-line { margin: 0; font: 600 12.5px/15px var(--sg-font); color: var(--ink); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; line-clamp: 1; overflow: hidden; }
.cc-line:nth-child(-n+2) { -webkit-line-clamp: 2; line-clamp: 2; }
.cc-line:first-child { -webkit-line-clamp: 3; line-clamp: 3; }
.cc-line b { color: var(--rar); margin-right: 5px; font-weight: 800; }
.cc-line.weak b { color: #ffb4ab; }
.cc-dots { display: flex; justify-content: center; gap: 7px; height: 10px; align-items: center; }
.cc-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.28); }
.cc-dots i.lk { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.4); }
.cc-dots i.on { width: 9px; height: 9px; background: var(--rar); box-shadow: none; }
.cc.mystery .cc-name { letter-spacing: 0.2em; }
/* run setup sheet and the crew details sheet */
.setup-sec + .setup-sec { margin-top: 14px; padding-top: 10px; border-top: 1px solid #e6dcc8; }
.setup-h { margin: 0 0 6px; font: 800 20px/1.1 var(--sg-font); }
.cc-sheet { display: grid; gap: 10px; text-align: left; }
.cc-sheet-sub { font: 800 14px/1 var(--sg-font); color: var(--rar); letter-spacing: 0.03em; text-transform: uppercase; }
.cc-fact { display: grid; gap: 2px; font: 600 16px/1.35 var(--sg-font); }
.cc-fact b { font: 800 13px/1 var(--sg-font); color: #5a6784; text-transform: uppercase; letter-spacing: 0.04em; }
.cc-fact.weak span { color: #b3382c; }
/* the character cards on the crew card (kits.js): two columns, an epic over the legendary it opens, "or" between them */
.cc-kit-h { font: 800 13px/1 var(--sg-font); color: #5a6784; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 4px; }
.cc-kit-line { margin: 0; font: 600 14px/1.35 var(--sg-font); color: #3a4560; }
.cc-kit-line.lock { color: #7a5a1a; }
.cc-kit { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: stretch; }
.cc-kcol { display: grid; gap: 6px; grid-template-rows: 1fr 1fr; }
.cc-kor { align-self: start; margin-top: 30px; font: 800 13px/1 var(--sg-font); color: #8a5ce0; text-transform: uppercase; }
.cc-kc { display: grid; gap: 3px; align-content: start; padding: 8px 9px; border-radius: 12px; border: 2px solid #8a5ce0; background: linear-gradient(160deg, #f6efff, #e9ddff); }
.cc-kc.r-legendary { border-color: #e0a21e; background: linear-gradient(160deg, #fff8df, #ffeab0); }
.cc-kc.shut { opacity: 0.6; filter: saturate(0.4); }
.cc-kc b { font: 800 15px/1.1 var(--sg-font); color: #2b2f45; }
.cc-kr { font: 800 11px/1 var(--sg-font); text-transform: uppercase; letter-spacing: 0.04em; color: #6a3fc0; }
.cc-kc.r-legendary .cc-kr { color: #8a5a00; }
.cc-kt { font: 600 13px/1.3 var(--sg-font); color: #3a4560; }
@media (prefers-reduced-motion: reduce) { .cc-arrow:active, .cc-unlock:active { transform: none; } }

/* ---------- the mode switch (under the crew carousel, right above Play) ---------- */
.home-art { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.modes { width: 100%; display: flex; flex-direction: column; gap: 4px; }
.mode-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 18px; background: rgba(8, 10, 30, 0.45); border: 1px solid rgba(255, 255, 255, 0.12); }
.mode-btn {
  min-height: 52px; border: 0; border-radius: 14px; background: transparent; color: var(--ink-soft); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 4px 6px;
  font-family: var(--sg-font, inherit); -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
.mode-btn b { font: 800 18px/1.05 var(--sg-font, inherit); color: inherit; }
.mode-btn small { font: 700 11.5px/1.1 var(--sg-font, inherit); opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.mode-btn.on { background: linear-gradient(#ffd25a, var(--gold)); color: #3a2605; box-shadow: 0 3px 0 #b57f0f; }
.mode-btn:active { transform: scale(0.98); }
.mode-line { margin: 0; min-height: 30px; font: 700 12.5px/15px var(--sg-font, inherit); color: var(--ink-soft); text-align: center; padding: 0 6px; }
/* a run kept on the phone: the line says where it waits, and a small New run (it asks first) */
.mode-foot { display: flex; align-items: center; gap: 8px; }
.mode-foot .mode-line { flex: 1 1 auto; min-width: 0; }
.has-run .mode-line { display: flex; align-items: center; text-align: left; }
.new-run { flex: none; min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid rgba(255, 255, 255, 0.28); background: rgba(8, 10, 30, 0.45); color: var(--ink); font: 800 14px/1 var(--sg-font, inherit); }
.new-run:active { transform: scale(0.97); }
.new-run[hidden] { display: none; }
.newrun { display: flex; flex-direction: column; gap: 14px; padding: 4px 2px 8px; }
.newrun-text { margin: 0; font: 700 16px/1.35 var(--sg-font, inherit); }
.newrun-go { min-height: 48px; border-radius: 16px; border: 0; background: #e2524f; color: #fff; font: 800 17px/1 var(--sg-font, inherit); box-shadow: 0 3px 0 #9c2f2d; }
.newrun-go:active { transform: translateY(1px); box-shadow: 0 2px 0 #9c2f2d; }
@media (prefers-reduced-motion: reduce) { .new-run:active, .newrun-go:active { transform: none; } }
/* the Workshop is the first extra: a warm edge so it stands out from the rest (colors only) */
#mm .sg-extras > .sg-btn:first-child { box-shadow: inset 0 0 0 2px var(--gold), 0 6px 18px -10px rgba(245, 184, 46, 0.9); }

/* ---------- the run: a stage's goal (or Endless's next boss), and a boss's title card ---------- */
.goal { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; max-width: 280px; font-size: 14px; text-shadow: 0 1px 3px #000; }
.goal[hidden] { display: none; }
.goal b { font-weight: 800; color: #b9f5e2; }
.goal-bar { flex: 1 0 100%; display: block; height: 6px; border-radius: 3px; background: rgba(8, 14, 30, 0.6); overflow: hidden; }
.goal-bar u { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6ee1be, #b9f5e2); }
.goal.nobar .goal-bar { display: none; }
.stagechip { padding: 1px 8px; border-radius: 10px; background: rgba(8, 10, 30, 0.6); font-size: 12px; font-weight: 800; color: #ffe28a; }
.stagechip[hidden] { display: none; }
/* a boss's name card (his entrance: cine.js draws it, game.js runs it): a dark band across the lower third with a stripe in
   his colors (--ba, --bb), his portrait on a medallion, the name slammed in; it slides off as the camera pans back */
.intro {
  --ba: #ffcc4a; --bb: #fff4c8;
  position: absolute; left: 0; right: 0; bottom: calc(var(--safe-bottom) + 10.5%); z-index: 1; display: flex; align-items: center; gap: 14px;
  padding: 16px max(18px, 6vw) 16px max(16px, 6vw); pointer-events: none; isolation: isolate;
}
.intro[hidden] { display: none; }
.intro::before, .intro::after { content: ''; position: absolute; z-index: -1; transform: skewY(-3.5deg); transform-origin: left center; }
.intro::before { inset: 0 -6%; background: linear-gradient(90deg, rgba(10, 6, 26, 0) 0%, rgba(10, 6, 26, 0.93) 9%, rgba(10, 6, 26, 0.93) 84%, rgba(10, 6, 26, 0) 100%); }
.intro::after { left: -6%; right: -6%; bottom: -4px; height: 4px; background: linear-gradient(90deg, transparent, var(--ba) 12%, var(--bb) 46%, var(--ba) 80%, transparent); }
.intro-medal { position: relative; flex: none; width: 88px; height: 88px; margin: -24px 0 -20px; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, var(--bb), var(--ba) 72%); box-shadow: 0 0 0 3px #fff8e6, 0 0 0 6px var(--ba), 0 10px 20px rgba(0, 0, 0, 0.6), 0 0 30px var(--ba); }
.intro-medal img { position: absolute; left: -8%; bottom: 0; width: 116%; height: 116%; }
.intro-txt { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; min-width: 0; }
.intro small { font-size: 13px; font-weight: 800; letter-spacing: 0.04em; color: var(--ba); text-shadow: 0 2px 3px #000; }
.intro b { font-size: 34px; line-height: 1.02; color: #fff; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.6), 0 0 22px var(--ba); }
.intro span { font-size: 15px; font-weight: 700; color: var(--ink); text-shadow: 0 2px 4px #000; max-width: 270px; line-height: 1.2; margin-top: 2px; }
.intro em { font-style: normal; font-size: 14px; font-weight: 800; color: #ffd9a6; margin-top: 3px; text-shadow: 0 2px 3px #000; }
.intro.go::before, .intro.go::after { animation: wipe 0.34s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
.intro.go .intro-medal { animation: medal 0.55s 0.05s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
.intro.go b { animation: slam 0.42s 0.1s cubic-bezier(0.2, 1.3, 0.4, 1) both; }
.intro.go small, .intro.go span, .intro.go em { animation: fadeUp 0.4s 0.22s both; }
.intro.out { animation: introOut 0.36s ease-in forwards; }
@keyframes wipe { from { transform: skewY(-3.5deg) scaleX(0); } }
@keyframes medal { from { transform: scale(0) rotate(-40deg); } }
@keyframes slam { from { transform: scale(1.9) rotate(-5deg); opacity: 0; } 55% { opacity: 1; } }
@keyframes introOut { to { transform: translateX(16%); opacity: 0; } }
.intro[data-boss="prime"] b { color: #fff4c8; }
/* while a boss makes his entrance the HUD steps aside, and a tap anywhere skips it */
body.cine #hud > :not(.intro) { opacity: 0 !important; }
.cine-skip { position: fixed; inset: 0; z-index: 4; margin: 0; padding: 0; border: 0; background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cine-skip[hidden] { display: none; }
.cine-skip span { position: absolute; right: 14px; bottom: calc(var(--safe-bottom) + 1.5%); font-size: 13px; font-weight: 800; color: rgba(255, 244, 220, 0.72); }
/* first sightings: a small card under the HUD, never pausing the game (tap to dismiss) */
.seen { position: absolute; left: 0; right: 0; margin: 0 auto; top: calc(env(safe-area-inset-top, 0px) + max(186px, 23vh)); display: flex; align-items: center; gap: 10px;
  width: min(340px, calc(100vw - 24px)); padding: 6px 12px 6px 6px; border: 0; border-radius: 16px; text-align: left; color: var(--ink); pointer-events: auto;
  background: rgba(14, 10, 34, 0.88); box-shadow: 0 0 0 2px rgba(255, 217, 166, 0.6), 0 10px 24px -8px rgba(0, 0, 0, 0.7); font: inherit; }
.seen[hidden] { display: none; }
.seen img { width: 56px; height: 56px; flex: none; border-radius: 12px; background: rgba(255, 255, 255, 0.08); }
.seen-txt { display: flex; flex-direction: column; min-width: 0; }
.seen small { font-size: 11px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: #ffd9a6; }
.seen b { font-size: 18px; line-height: 1.1; color: #fff; }
.seen-txt > span { font-size: 14px; font-weight: 700; line-height: 1.2; }
.seen.res { box-shadow: 0 0 0 2px rgba(201, 166, 255, 0.85), 0 10px 24px -8px rgba(0, 0, 0, 0.7); }
.seen.go { animation: fadeUp 0.35s both; }
@media (prefers-reduced-motion: reduce) { .seen.go { animation: none; } }
@keyframes bandIn { from { transform: scaleY(0.2); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 370px) { .intro { gap: 11px; } .intro b { font-size: 33px; } .intro-medal { width: 74px; height: 74px; } }

/* the boss bar: under the HUD's top rows, left of the minimap; a name plate with phase pips, the bar with a trailing chip */
.bossbar {
  position: relative; margin-top: 6px; max-width: 420px; padding: 4px 8px 7px; border-radius: 12px; text-align: left;
  background: linear-gradient(rgba(36, 20, 56, 0.86), rgba(14, 10, 30, 0.86)); box-shadow: inset 0 0 0 1.5px rgba(255, 214, 110, 0.5), 0 4px 12px rgba(0, 0, 0, 0.45);
}
.bossbar[hidden] { display: none; }
.in-dungeon .bossbar { max-width: calc(100% - 96px); }
.bb-plate { display: flex; align-items: center; gap: 6px; height: 24px; min-width: 0; }
.bb-plate img { width: 32px; height: 32px; flex: none; margin: -10px -2px -4px -4px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6)); }
.bb-plate b { font-size: 16px; font-weight: 800; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; text-shadow: 0 2px 2px rgba(0, 0, 0, 0.7); }
.bb-plate b { flex: 0 1 auto; }
/* on a narrow phone the tag (FLOOR 6 BOSS) gives way first, so the boss's name keeps its room */
.bb-plate small { flex: 0 1000 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: #ffd36a; white-space: nowrap; }
.bb-pips { margin-left: auto; display: flex; gap: 5px; flex: none; padding-right: 2px; }
.bb-pips i { width: 9px; height: 9px; transform: rotate(45deg); border: 1.5px solid #ffd36a; background: rgba(255, 214, 110, 0.12); }
.bb-pips i.on { background: #ffd36a; box-shadow: 0 0 6px #ffd36a; }
.bb-pips i.done { border-color: rgba(255, 255, 255, 0.25); background: none; }
.bb-bar { position: relative; height: 12px; margin-top: 3px; border-radius: 6px; background: rgba(0, 0, 0, 0.6); overflow: hidden; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.22); }
.bb-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; border-radius: 6px; }
.bb-chip { background: #fff2c4; }
.bb-fill { background: linear-gradient(#ff9a5c, #d83f2c 60%, #a8261c); }
.bb-ticks { position: absolute; inset: 0; }
.bb-ticks s { position: absolute; top: 1px; bottom: 1px; width: 2px; margin-left: -1px; background: rgba(255, 255, 255, 0.8); text-decoration: none; }
.boss-up .goal { display: none; }
.bossbar.hurt { box-shadow: inset 0 0 0 1.5px rgba(255, 240, 200, 0.9), 0 4px 12px rgba(0, 0, 0, 0.45); }

/* hearts (the Dungeon) and a shield over them; outside the Dungeon a shield is a band over the HP bar */
.hp-bar { position: relative; }
.hp-bar .sh { position: absolute; left: 0; bottom: 0; height: 45%; width: 0; border-radius: 0 3px 3px 0; background: linear-gradient(#d8f6ff, #7fd8f0); box-shadow: 0 0 6px rgba(127, 216, 240, 0.8); transition: width 0.12s; }
.hearts { height: 20px; width: 126px; flex: none; }
.hearts[hidden] { display: none; }
.in-dungeon .hp svg, .in-dungeon .hp-bar { display: none; }
.in-dungeon .hp { max-width: none; flex: 0 1 auto; gap: 4px; }
.hp .sh-text { font-style: normal; font-weight: 800; font-size: 13px; color: #b9efff; text-shadow: 0 1px 2px #000; }
.hp .sh-text[hidden] { display: none; }
@keyframes introIn { from { transform: translateX(-60px) scale(1.25); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeUp { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- the Stages screen ---------- */
#stages { padding-bottom: calc(var(--safe-bottom) + 20px); }
.coin-chip.ghost.star-chip { color: #ffe28a; }
.coin-chip.ghost.star-chip::before { display: inline; content: "★"; color: #ffd34e; font-size: 18px; background: none; box-shadow: none; border-radius: 0; width: auto; height: auto; }
.stage-card { width: 100%; text-align: left; background: rgba(255, 255, 255, 0.08); border-radius: 22px; padding: 12px; border: 1px solid rgba(255, 255, 255, 0.12); }
.sc-head { display: flex; gap: 12px; align-items: center; }
.sc-sw { width: 72px; height: 72px; border-radius: 18px; flex: none; box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.7); border: 2px solid rgba(255, 255, 255, 0.25); }
.sc-meta { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sc-meta small { font-size: 12.5px; color: var(--ink-soft); font-weight: 700; }
.sc-meta b { font-size: 24px; line-height: 1.05; }
.sc-place { font-size: 13px; color: var(--ink-soft); }
.sc-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.sc-chips .chip { padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 800; background: rgba(255, 255, 255, 0.14); }
.sc-chips .chip.win { background: var(--gold); color: #3a2605; }
.sc-chips .diff-easy { background: #2f7d55; }
.sc-chips .diff-medium { background: #3a6fb8; }
.sc-chips .diff-hard { background: #8a4fc0; }
.sc-chips .diff-veryhard { background: #a8402f; }
.sc-blurb { margin: 8px 0 6px; font-size: 14px; color: var(--ink-soft); font-style: italic; }
.sc-rows { display: grid; gap: 6px; }
.sc-row { display: grid; grid-template-columns: 56px 1fr; gap: 8px; font-size: 14.5px; line-height: 1.25; }
.sc-row b { color: #ffe28a; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; padding-top: 1px; }
.sc-row small { display: block; color: var(--ink-soft); font-size: 12.5px; margin-top: 1px; }
.sc-stars { list-style: none; padding: 0; margin: 10px 0 4px; display: grid; gap: 3px; font-size: 14px; }
.sc-stars li { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); }
.sc-stars li i { font-style: normal; font-size: 18px; width: 20px; text-align: center; color: rgba(255, 255, 255, 0.35); }
.sc-stars li.on { color: var(--ink); }
.sc-stars li.on i { color: #ffd34e; }
.sc-reward { margin: 6px 0 0; font-size: 13px; color: var(--ink-soft); }
.stage-play { margin: 12px 0 6px; max-width: none; font-size: 22px; position: sticky; top: 8px; z-index: 2; flex: none; }
.stage-list { width: 100%; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.chapter h3 { margin: 8px 0 0; font-size: 19px; }
.ch-sub { display: block; color: var(--ink-soft); font-size: 13px; margin-bottom: 6px; }
.stage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stile {
  position: relative; min-height: 68px; border: 0; border-radius: 16px; padding: 8px 10px 8px 46px; text-align: left; cursor: pointer; color: var(--ink);
  background: linear-gradient(90deg, rgba(23, 20, 46, 0.55), rgba(23, 20, 46, 0.92) 60%), var(--sw) center / 140px; display: flex; flex-direction: column; justify-content: center; gap: 2px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); font-family: inherit; -webkit-tap-highlight-color: transparent;
}
.stile .n { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 16px; background: rgba(255, 255, 255, 0.9); color: #1d2a44; }
.stile b { font-size: 14.5px; line-height: 1.1; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.stile small { font-size: 12px; color: var(--ink-soft); }
.stile.sel { box-shadow: inset 0 0 0 3px var(--gold), 0 0 18px -6px var(--gold); }
.stile.done .n { background: #ffd34e; }
.stile.finale .n { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--gold); }
.stile.locked { opacity: 0.55; cursor: default; filter: saturate(0.4); }
.stile:not(.locked):active { transform: scale(0.98); }
.stars { display: inline-flex; gap: 1px; font-size: 15px; line-height: 1; }
.stars i { font-style: normal; color: rgba(255, 255, 255, 0.35); }
.stars i.on { color: #ffd34e; }

/* ---------- results: stars, what's next ---------- */
.res-stars { display: grid; gap: 5px; width: 100%; max-width: 360px; margin: 0 0 12px; }
.res-stars[hidden] { display: none; }
.res-stars .rs { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.07); text-align: left; font-size: 15px; font-weight: 700; color: var(--ink-soft); animation: pop 0.5s backwards; }
.res-stars .rs i { font-style: normal; font-size: 26px; line-height: 1; color: rgba(255, 255, 255, 0.3); }
.res-stars .rs.on { color: var(--ink); background: rgba(255, 211, 78, 0.16); }
.res-stars .rs.on i { color: #ffd34e; text-shadow: 0 0 12px rgba(255, 211, 78, 0.8); }
.res-next { margin: 0 0 8px; font-size: 14px; color: var(--ink-soft); }
.home-row [hidden] { display: none; }
@media (prefers-reduced-motion: reduce) {
  .intro.go b, .intro.go small, .intro.go span, .intro.go em, .res-stars .rs, .intro.go::before, .intro.go::after, .intro.go .intro-medal, .intro.out { animation: none; }
}

/* ---------- the Dungeon ---------- */
/* three modes side by side (Dungeon, Endless, Stages) */
.mode-seg { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mode-btn small { font-size: 11px; }
.minimap {
  position: absolute; top: calc(var(--safe-top) + 92px); right: calc(10px + env(safe-area-inset-right, 0px)); width: 84px; height: 84px;
  pointer-events: none; border-radius: 10px;
}
.in-dungeon .tray, .in-dungeon .goal { max-width: calc(100% - 100px); }
.dgchips { display: inline-flex; gap: 10px; }
.dgchips[hidden] { display: none; }
.dgchip { display: inline-flex; align-items: center; gap: 4px; color: #ffe28a; }
.dgchip i { width: 16px; height: 16px; display: inline-block; }
.dgchip.key i { background: radial-gradient(circle at 28% 50%, transparent 0 18%, #f2c21a 20% 38%, transparent 40%), linear-gradient(#f2c21a, #f2c21a) 100% 50% / 58% 24% no-repeat; }
.dgchip.bomb i { border-radius: 50%; background: radial-gradient(circle at 35% 35%, #9aa0b8, #2e2f45 60%); box-shadow: 0 0 0 1.5px #000 inset; }
.bomb-btn, .active-btn {
  position: absolute; border: 0; border-radius: 50%; pointer-events: auto; cursor: pointer; display: grid; place-items: center; touch-action: none; color: #fff;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.45), 0 8px 18px -6px rgba(0, 0, 0, 0.7);
}
.bomb-btn {
  right: calc(29px + env(safe-area-inset-right, 0px)); bottom: calc(var(--safe-bottom) + 150px); width: 58px; height: 58px;
  background: radial-gradient(circle at 35% 30%, #5b6278, #2a2d40);
}
.bomb-btn .bomb-ic { width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #9aa0b8, #2e2f45 60%); box-shadow: 0 0 0 2px #000 inset; position: relative; }
.bomb-btn .bomb-ic::after { content: ""; position: absolute; right: -3px; top: -6px; width: 9px; height: 9px; border-radius: 50%; background: #ffd34e; box-shadow: 0 0 8px #ffd34e; }
.bomb-btn b { position: absolute; right: -2px; bottom: -2px; min-width: 22px; height: 22px; line-height: 22px; border-radius: 11px; background: #fff; color: #1d2a44; font-size: 13px; font-weight: 800; text-align: center; }
.bomb-btn.cool { opacity: 0.55; }
.bomb-btn:active, .active-btn:active { transform: translateY(2px); }
.active-btn {
  right: calc(112px + env(safe-area-inset-right, 0px)); bottom: calc(var(--safe-bottom) + 58px); width: 64px; height: 64px;
  background: radial-gradient(circle at 35% 30%, #3fae9a, #1f5a50);
}
.active-btn img { width: 44px; height: 44px; }
.active-btn .ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); fill: none; stroke: #ffe28a; stroke-width: 7; stroke-linecap: round; }
.active-btn.cool { background: radial-gradient(circle at 35% 30%, #4a4870, #2a2848); }
.active-btn.cool img { opacity: 0.5; }
.active-btn b { position: absolute; right: -4px; bottom: -4px; min-width: 24px; height: 24px; line-height: 24px; padding: 0 3px; border-radius: 12px; background: #fff; color: #1d2a44; font-size: 13px; font-weight: 800; text-align: center; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); }
.active-btn b:empty { display: none; }
.active-btn.rest .ring { stroke: #8fb4ff; } /* resting after a use: the ring drains; then it fills with Jays beaten */
.active-btn.rest b { background: #cfe0ff; }

#chest[data-rarity="epic"] h2, #chest[data-rarity="legendary"] h2 { text-shadow: 0 4px 0 rgba(0, 0, 0, 0.5), 0 0 24px currentColor; }
.dex > li.rar > img { box-shadow: 0 0 0 3px var(--rar); }
.dex > li.rar.unseen > img { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15); }

/* the results: every row keeps its own space, so the badges never sit on the build (a flex column was squeezing them) */
.results > * { flex-shrink: 0; }
.res-badges { width: 100%; max-width: 360px; min-height: 0; margin: 2px 0 12px; }
.res-badges span { line-height: 1.25; }
.res-badges span.plain { background: rgba(255, 255, 255, 0.14); color: var(--ink); }
.res-build { width: 100%; }
.results .home-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }

/* the Dungeon's choice after the clear: go deeper, or head home (two big targets; the clear already counts) */
.deeper { background: radial-gradient(120% 80% at 50% 30%, rgba(60, 40, 110, 0.84), rgba(8, 10, 26, 0.92)); }
.deeper h2 { color: #ffe28a; }
.deeper .lu-sub { color: #e8e2ff; font-size: 16px; text-align: center; max-width: 360px; }
.deeper-pick { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 380px; margin-top: 6px; }
.deep-opt {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 76px; padding: 12px 16px; border: 0; border-radius: 20px;
  text-align: left; cursor: pointer; font: inherit; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  animation: slide 0.35s backwards cubic-bezier(.2, 1.3, .4, 1); transition: transform 0.1s;
}
.deep-opt b { display: block; font-size: 24px; line-height: 1.1; font-weight: 800; }
.deep-opt small { display: block; margin-top: 3px; font-size: 15px; line-height: 1.3; font-weight: 600; }
.deep-opt img { width: 64px; height: 64px; flex: none; border-radius: 16px; background: rgba(40, 20, 80, 0.35); }
.deep-opt.go { background: linear-gradient(#ffd25a, var(--gold)); color: #3a2605; box-shadow: 0 6px 0 #b57f0f, 0 0 26px rgba(255, 210, 90, 0.45), 0 14px 24px -10px rgba(0, 0, 0, 0.6); }
.deep-opt.go small { color: #5a3a08; }
.deep-opt.home { background: var(--card); color: var(--card-ink); box-shadow: 0 6px 0 #c9bba0, 0 14px 24px -10px rgba(0, 0, 0, 0.6); animation-delay: 0.08s; }
.deep-opt.home small { color: #4a5670; }
.deep-opt:active { transform: translateY(3px); }
.deeper-note { margin: 4px 0 0; max-width: 380px; color: var(--ink-soft); font-size: 14px; line-height: 1.4; text-align: center; }
@media (prefers-reduced-motion: reduce) { .deep-opt { animation: none; } .deep-opt:active { transform: none; } }

/* a card note that is longer than one line (the Workshop: "1,240 coins · 3 to buy") takes two lines (a line break in its text), right-aligned, instead of being cut off at 360 wide */
.sg-btn.sg-extra .sg-sub { white-space: pre-line; text-align: right; font-size: 13px; line-height: 1.15; }
/* A narrow phone in the Dungeon (the minimap beside the bar): the tag goes and the phase pips tighten, so a boss's
   whole name fits ("The Jay Prime" with four pips at 360 px). */
@media (max-width: 380px) {
  .in-dungeon .bb-plate small { display: none; }
  .in-dungeon .bb-pips { gap: 4px; }
  .in-dungeon .bb-pips i { width: 8px; height: 8px; }
}

/* ---------- level-up cards (Jay, 2026-11-15: "I want it to be stellar"; then "the rest of the banner, the most visible part,
   is the rarity indicator") ----------
   The body is the rarity (cardart.js bakes each once: Common sage linen, Rare sapphire satin, Epic amethyst crystal,
   Legendary hammered gold; gold is Legendary's alone), and its edge and glow grow with it. The icon sits on its path's
   tile (Arcane marbled pink ink, Steel spun steel, Wild a leaf, Tinker verdigris bronze, Brawler stitched leather, plain
   things a neutral paper; a cross power's two paths split) in the rarity's bezel; the kind is the plaque under the icon;
   the Roman numeral top right, in the path's ink, is that path's count after taking it; a lock with a question mark means
   it opens something new. Layers, bottom to top: body, sheen, trim, embers, frame and words, the edge. The textures are CSS
   variables on the page (--rar-*, --tile-*, --bz-*), baked once; every animation here is transform or opacity. */
@font-face { font-family: "Cinzel"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/cinzel-latin-700-normal.woff2") format("woff2"); }
#chest { backdrop-filter: none; -webkit-backdrop-filter: none; background: radial-gradient(120% 70% at 50% 45%, rgba(32, 22, 64, 0.9), rgba(6, 8, 20, 0.95)); }
/* Jay (2026-11-15): "the picking mods thing should be semi transparent and near the bottom of the screen, so it's easier to
   hit with your thumbs ... a bit more like nova drift": the cards sit at the bottom, a little see-through, over a scrim that
   leaves the run in view above them. */
#levelup { overflow: hidden; justify-content: flex-end; gap: 6px; backdrop-filter: none; -webkit-backdrop-filter: none;
  background: linear-gradient(to bottom, rgba(8, 8, 26, 0.1) 0%, rgba(10, 10, 32, 0.3) 30%, rgba(8, 8, 26, 0.78) 62%, rgba(6, 8, 20, 0.9) 100%); }
#levelup .card { opacity: 0.93; }
#levelup .lu-head h2 { text-shadow: 0 4px 0 rgba(0, 0, 0, 0.55), 0 0 22px rgba(0, 0, 0, 0.6); }
#levelup > .lu-head, #levelup > .lu-actions { flex: none; margin: 0; }
.lu-head { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.lu-scroll { flex: 0 1 auto; min-height: 0; width: calc(100% + 32px); margin: 0 -16px; padding: 6px 16px 14px; overflow-y: auto; overscroll-behavior: contain; }
.lu-scroll.fade-top { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22px); mask-image: linear-gradient(to bottom, transparent, #000 22px); }
.lu-scroll.fade-bot { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent); }
.lu-scroll.fade-top.fade-bot { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22px, #000 calc(100% - 26px), transparent); mask-image: linear-gradient(to bottom, transparent, #000 22px, #000 calc(100% - 26px), transparent); }
.cards { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 400px; margin: 0 auto; }
#levelup.leaving { animation: fadeOut 0.3s 0.08s forwards; pointer-events: none; }
#levelup.leaving .card:not(.chosen) { transition: transform 0.28s ease-in, opacity 0.22s; transform: translateY(18px) scale(0.95); opacity: 0; }
@keyframes fadeOut { to { opacity: 0; } }

.card {
  --c-ink: #2b2f45; --c-soft: #566079; --c-edge: #c8b48c; --c-deep: #a38c62;
  position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: 70px 1fr; column-gap: 12px; align-items: start;
  width: 100%; min-height: 98px; padding: 10px 12px 12px 10px; border: 0; border-radius: 18px; text-align: left; color: var(--c-ink);
  background: #dfe8d6; box-shadow: 0 5px 0 var(--c-deep), 0 14px 26px -10px rgba(0, 0, 0, 0.75);
  cursor: pointer; font: inherit; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  animation: deal 0.46s calc(var(--i, 0) * 80ms) backwards cubic-bezier(0.2, 1.25, 0.35, 1); transition: transform 0.08s;
}
.card::after { /* the edge: a rim in the rarity's color, a lit top, a shaded foot */
  content: ''; position: absolute; inset: 0; z-index: 5; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1.5px var(--c-edge), inset 0 2px 0 rgba(255, 255, 255, 0.6), inset 0 -3px 0 rgba(0, 0, 0, 0.16);
}
.card:active { transform: translateY(3px) scale(0.985); }
@keyframes deal { from { transform: translateY(28px) scale(0.94); opacity: 0; } }
/* the body: the rarity's baked texture; the color under it shows if a texture is missing */
.card .mat { position: absolute; inset: 0; z-index: 0; background: center / cover no-repeat; }
.card.r-common .mat { background-image: var(--rar-common); }
.card.r-rare { background-color: #cadcf6; box-shadow: 0 5px 0 var(--c-deep), 0 0 0 1px rgba(140, 190, 255, 0.55), 0 0 16px rgba(74, 144, 226, 0.42), 0 14px 26px -10px rgba(0, 0, 0, 0.75); }
.card.r-rare .mat { background-image: var(--rar-rare); }
.card.r-epic { background-color: #ddcdf2; box-shadow: 0 5px 0 var(--c-deep), 0 0 0 1.5px rgba(214, 178, 255, 0.75), 0 0 22px 1px rgba(166, 107, 224, 0.6), 0 14px 26px -10px rgba(0, 0, 0, 0.75); }
.card.r-epic .mat { background-image: var(--rar-epic); }
.card.r-legendary { background-color: #f4cf6e; }
.card.r-legendary .mat { background-image: var(--rar-legendary); }
/* Epic: a silver line inside the edge; Legendary: an engraved one with a lit lip (the bezels' inner rims, card-sized) */
.card .trim { position: absolute; inset: 5px; z-index: 2; border-radius: 13px; pointer-events: none; border: 1.2px solid rgba(250, 244, 255, 0.85); box-shadow: 0 0 0 1px rgba(80, 40, 140, 0.18); }
.card.r-legendary .trim { border-color: rgba(120, 72, 4, 0.5); box-shadow: 1px 1px 0 rgba(255, 248, 214, 0.75), inset 1px 1px 0 rgba(255, 248, 214, 0.55); }
@keyframes drift { from { transform: translate3d(-5%, -4%, 0) rotate(-1.5deg); } to { transform: translate3d(5%, 4%, 0) rotate(1.5deg); } }
/* light: one sweep as the card lands; Rare and up keep sweeping now and then, Legendary in gold and more often */
.card .sheen { position: absolute; inset: 0; z-index: 2; overflow: hidden; border-radius: inherit; pointer-events: none; }
.card .sheen::before {
  content: ''; position: absolute; top: -30%; bottom: -30%; left: 0; width: 36%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.42) 42%, rgba(255, 255, 255, 0.7) 50%, rgba(255, 255, 255, 0.42) 58%, rgba(255, 255, 255, 0) 100%);
  transform: translateX(-130%) skewX(-16deg); animation: sweep 1.1s calc(0.32s + var(--i, 0) * 90ms) ease-in-out both;
}
.card.r-rare .sheen::before { animation: sweepLoop 6s calc(0.32s + var(--i, 0) * 90ms) ease-in-out infinite both; }
.card.r-epic .sheen::before { animation: sweepLoop 4.6s calc(0.32s + var(--i, 0) * 90ms) ease-in-out infinite both; }
.card.r-legendary .sheen::before { animation: sweepLoop 3.4s calc(0.32s + var(--i, 0) * 90ms) ease-in-out infinite both;
  background: linear-gradient(100deg, rgba(255, 230, 150, 0) 0%, rgba(255, 236, 170, 0.5) 42%, rgba(255, 252, 230, 0.85) 50%, rgba(255, 236, 170, 0.5) 58%, rgba(255, 230, 150, 0) 100%); }
@keyframes sweep { from { transform: translateX(-130%) skewX(-16deg); } to { transform: translateX(320%) skewX(-16deg); } }
@keyframes sweepLoop { 0% { transform: translateX(-130%) skewX(-16deg); } 24%, 100% { transform: translateX(320%) skewX(-16deg); } }
/* Legendary: embers rise off the bottom edge over a warm glow, rays turn behind the icon */
.card.r-legendary { box-shadow: 0 5px 0 var(--c-deep), 0 0 0 2px rgba(255, 216, 120, 0.9), 0 0 26px 2px rgba(255, 176, 46, 0.55), 0 14px 26px -10px rgba(0, 0, 0, 0.75); }
.card .embers { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.card .embers::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 46%; background: linear-gradient(to top, rgba(255, 150, 40, 0.38), rgba(255, 190, 70, 0)); animation: glow 1.8s ease-in-out infinite alternate; }
.card .embers i { position: absolute; bottom: -3px; width: 5px; height: 5px; border-radius: 50%; background: radial-gradient(#fffbe0 0 30%, #ffc34a 55%, rgba(255, 140, 30, 0) 72%); opacity: 0; animation: ember 1.9s linear infinite; }
.card .embers i:nth-child(1) { left: 8%; animation-delay: 0s; --dx: 6px; }
.card .embers i:nth-child(2) { left: 19%; animation-delay: 0.7s; --dx: -5px; }
.card .embers i:nth-child(3) { left: 31%; animation-delay: 1.3s; --dx: 8px; width: 4px; height: 4px; }
.card .embers i:nth-child(4) { left: 43%; animation-delay: 0.35s; --dx: -7px; }
.card .embers i:nth-child(5) { left: 55%; animation-delay: 1.05s; --dx: 5px; width: 6px; height: 6px; }
.card .embers i:nth-child(6) { left: 66%; animation-delay: 1.6s; --dx: -4px; }
.card .embers i:nth-child(7) { left: 76%; animation-delay: 0.5s; --dx: 7px; width: 4px; height: 4px; }
.card .embers i:nth-child(8) { left: 86%; animation-delay: 1.25s; --dx: -6px; }
.card .embers i:nth-child(9) { left: 94%; animation-delay: 0.9s; --dx: 3px; }
@keyframes ember { 0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0; } 12% { opacity: 1; } 100% { transform: translate3d(var(--dx, 0), -64px, 0) scale(0.3); opacity: 0; } }
@keyframes glow { from { opacity: 0.55; } to { opacity: 1; } }
/* the icon in its rarity's frame, the kind's plaque under it */
.card .frame { position: relative; z-index: 3; width: 70px; height: 70px; grid-row: 1 / span 3; margin-bottom: 8px; }
.card .well { position: absolute; inset: 0; z-index: 0; display: grid; place-items: center; background: center / 100% 100% no-repeat; border-radius: 16px; box-shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.35); }
.card .well img { position: relative; z-index: 2; width: 50px; height: 50px; }
/* a character card (kits.js): its icon is the character's portrait (art.js drawKitIcon), and the body gets a double rim */
.card.kit .mat { box-shadow: inset 0 0 0 4px rgba(255,255,255,0.35), inset 0 0 0 5.5px var(--c-edge, #8a5ce0); } /* the character-card frame: a double inner rim */
/* the path's tile (cards and the Paths tree's nodes): the material in the bezel's open well, under its light */
.tile { position: absolute; inset: 9%; z-index: 0; overflow: hidden; border-radius: 17%; background: #cfc8ba; }
.tile.oct { inset: 10.6%; border-radius: 0; clip-path: polygon(16% 0, 84% 0, 100% 16%, 100% 84%, 84% 100%, 16% 100%, 0 84%, 0 16%); }
.tile .tm { position: absolute; inset: 0; background: #cfc8ba center / cover no-repeat; }
.tm.p-steel { background-image: var(--tile-steel); background-color: #9aa6b4; } .tm.p-arcane { background-image: var(--tile-arcane); background-color: #d77cc6; }
.tm.p-wild { background-image: var(--tile-wild); background-color: #6fa34c; } .tm.p-tinker { background-image: var(--tile-tinker); background-color: #3f9488; }
.tm.p-brawler { background-image: var(--tile-brawler); background-color: #a85a35; } .tm.p-none { background-image: var(--tile-none); }
.tm.p-arcane { inset: -24%; animation: drift 16s ease-in-out infinite alternate; } /* the ink moves, slowly */
.tile .half { position: absolute; inset: 0; overflow: hidden; clip-path: polygon(62% 0, 100% 0, 100% 100%, 38% 100%); }
.tile .tseam { position: absolute; inset: 0; background: linear-gradient(#ffffff, #cfd6e2); clip-path: polygon(60.6% 0, 63.4% 0, 39.4% 100%, 36.6% 100%); }
.bezel { position: absolute; inset: 0; z-index: 1; background: center / 100% 100% no-repeat; pointer-events: none; }
.bezel.r-common { background-image: var(--bz-common); } .bezel.r-rare { background-image: var(--bz-rare); }
.bezel.r-epic { background-image: var(--bz-epic); } .bezel.r-legendary { background-image: var(--bz-legendary); }
.card .rays { position: absolute; left: 50%; top: 50%; width: 156px; height: 156px; margin: -78px 0 0 -78px; z-index: -1; background: var(--rays) center / contain no-repeat; opacity: 0.72; animation: spin 16s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.card .plaque { /* a little ribbon banner: the body, and two folded tails behind its ends */
  position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 3px; padding: 0 7px 0 5px;
  border-radius: 3px; background: linear-gradient(#433a62, #231c3a); color: #fff4e2; font-size: 11.5px; font-weight: 800; line-height: 17px; white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(255, 240, 220, 0.6), 0 2px 3px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.card .plaque::before, .card .plaque::after { content: ''; position: absolute; top: 3px; width: 8px; height: 17px; background: linear-gradient(#2a2244, #15111f); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 45% 50%); }
.card .plaque::before { left: -8px; }
.card .plaque::after { right: -8px; transform: scaleX(-1); }
.card .plaque .kg { display: inline-flex; width: 12px; height: 12px; color: #ffe6c4; }
.card .plaque svg, .card .trait svg, .card .lock svg, .card .mline .lk svg { width: 100%; height: 100%; display: block; }
.card .new { position: absolute; top: -4px; left: -6px; padding: 0 6px; border-radius: 7px; background: linear-gradient(#45d18a, #1f9c5c); color: #fff; font-size: 11px; font-weight: 800; line-height: 17px; transform: rotate(-10deg); box-shadow: 0 2px 0 #157044, 0 0 0 1px rgba(255, 255, 255, 0.6); }
.card .sparks { position: absolute; inset: -8px; pointer-events: none; }
.card .sparks i { position: absolute; width: 13px; height: 13px; background: var(--sparkle) center / contain no-repeat; opacity: 0; animation: twinkle 2.6s ease-in-out infinite; }
.card .sparks i:nth-child(1) { top: 0; left: 6px; }
.card .sparks i:nth-child(2) { top: 10px; right: -2px; animation-delay: 0.55s; width: 10px; height: 10px; }
.card .sparks i:nth-child(3) { bottom: 18px; left: -3px; animation-delay: 1.15s; }
.card .sparks i:nth-child(4) { bottom: 8px; right: 4px; animation-delay: 1.7s; width: 9px; height: 9px; }
.card .sparks i:nth-child(5) { top: 30px; left: 32px; animation-delay: 2.15s; width: 8px; height: 8px; }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(0.2) rotate(0deg); } 14% { opacity: 1; transform: scale(1) rotate(45deg); } 32% { opacity: 0; transform: scale(0.3) rotate(90deg); } }
/* the words */
.card .words { position: relative; z-index: 3; min-width: 0; padding-top: 1px; }
.card .name { display: block; font-size: 19px; line-height: 1.08; font-weight: 800; color: var(--c-ink); text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); }
.card .sub { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 9px; margin-top: 3px; font-size: 12.5px; line-height: 1.2; font-weight: 800; color: var(--c-soft); }
.card .line { display: block; margin-top: 3px; font-size: 14.5px; line-height: 1.24; font-weight: 600; color: var(--c-ink); }
.card.opens .line { padding-right: 24px; }
.card .pips { display: inline-flex; align-items: center; gap: 4px; padding: 0 1px; }
.card .pips i { width: 8px; height: 8px; border-radius: 2px; transform: rotate(45deg); border: 1.5px solid var(--c-soft); opacity: 0.55; }
.card .pips i.on { background: var(--c-soft); opacity: 0.9; }
.card .pips i.now { background: #fffdf6; border-color: var(--c-ink); opacity: 1; box-shadow: 0 0 0 1.5px var(--c-edge), 0 0 6px 1px var(--c-edge); animation: pipnow 0.9s ease-in-out infinite alternate; }
@keyframes pipnow { to { transform: rotate(45deg) scale(1.25); } }
.card .trait { display: inline-flex; align-items: center; gap: 3px; }
.card .trait svg { width: 13px; height: 13px; flex: none; color: var(--tc, currentColor); }
.card .t-magic { --tc: #7a3fd0; } .card .t-phys { --tc: #47607a; } .card .t-fire { --tc: #e2621f; } .card .t-ice { --tc: #2f8fd6; }
.card .t-shock { --tc: #c99400; } .card .t-sick { --tc: #3f8f24; } .card .t-heavy { --tc: #6a5440; }
.card .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* the numeral: carved in Cinzel in its path's ink; the path's foil when this one opens the path's powers */
.card .num { position: absolute; z-index: 3; top: 6px; right: 11px; font-family: "Cinzel", Georgia, serif; font-weight: 700; font-size: 22px; line-height: 1; letter-spacing: 0.02em;
  color: var(--p-ink, var(--c-ink)); opacity: 0.8; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65), 0 -1px 0 rgba(0, 0, 0, 0.2); animation: stamp 0.5s calc(0.28s + var(--i, 0) * 80ms) backwards cubic-bezier(0.2, 1.6, 0.4, 1); }
.card .num.tier { opacity: 1; color: var(--p-deep); background: linear-gradient(180deg, var(--p-hi) 10%, var(--p-edge) 46%, var(--p-deep) 54%, var(--p-hi) 92%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; text-shadow: none; filter: drop-shadow(0 1px 0 var(--p-ink)) drop-shadow(0 0 1px var(--p-ink)); }
@keyframes stamp { from { transform: scale(1.8); opacity: 0; } }
/* the path's name under its numeral; the words wrap around both */
.card .numspace { float: right; width: var(--numw, 0px); height: 40px; margin-left: 6px; }
.card .plabel { position: absolute; z-index: 3; top: 31px; right: 11px; font-family: "Cinzel", Georgia, serif; font-weight: 700; font-size: 11px; line-height: 1; letter-spacing: 0.04em;
  color: var(--p-ink, var(--c-ink)); opacity: 0.8; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65); }
.card .plabel.tier { opacity: 1; }
/* the lock with a question mark: taking it opens something (More says what) */
.card .lock { position: absolute; z-index: 3; right: 9px; bottom: 9px; width: 23px; height: 23px; color: var(--c-ink); opacity: 0.8; animation: lockbeat 2.8s ease-in-out infinite; }
@keyframes lockbeat { 0%, 70%, 100% { transform: none; } 80% { transform: rotate(-12deg) scale(1.12); } 90% { transform: rotate(8deg) scale(1.06); } }
/* More: the numbers, what it opens, the notes, the tags */
.card .more { grid-column: 1 / -1; position: relative; z-index: 3; display: grid; gap: 4px; margin-top: 6px; padding: 7px 10px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.66); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.14); font-size: 13.5px; line-height: 1.28; color: var(--c-ink); }
#levelup.brief .card .more { display: none; }
.card .rows { display: grid; grid-template-columns: 1fr auto; gap: 1px 10px; }
.card .rows span:nth-child(odd) { color: var(--c-soft); font-weight: 700; }
.card .rows span:nth-child(even) { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.card .rows .up { color: #136536; }
.card .rows .dn { color: #a5302a; }
.card .rows + .mline { margin-top: 2px; padding-top: 5px; border-top: 1px solid rgba(0, 0, 0, 0.1); }
.card .mline { display: block; font-weight: 600; }
.card .mline.unlock { display: flex; align-items: flex-start; gap: 6px; font-weight: 800; }
.card .mline .lk { flex: none; width: 16px; height: 17px; margin-top: 1px; }
.card .tagline { color: var(--c-soft); font-weight: 700; font-size: 12.5px; }
/* taking one: it flares while the others fall away */
.card.chosen { animation: chosen 0.36s ease-out forwards; }
.card.chosen::after { box-shadow: inset 0 0 0 3px #fffbe8, inset 0 0 34px rgba(255, 255, 255, 0.9); }
.card.chosen .sheen::before { animation: sweep 0.32s ease-out both; }
@keyframes chosen { 0% { transform: scale(1); } 40% { transform: scale(1.045); } 100% { transform: scale(1.02); } }
.card.banishing { outline: 3px dashed #ff6a5a; outline-offset: 2px; }
.card.banishing .sheen, .card.banishing .embers, .card.banishing .sparks { display: none; }
@media (max-height: 700px) {
  .card { min-height: 90px; padding: 8px 10px 10px 8px; }
  .cards { gap: 10px; }
}
@media (max-width: 370px) {
  .card { grid-template-columns: 64px 1fr; column-gap: 10px; }
  .card .frame { width: 64px; height: 64px; }
  .card .well img { width: 46px; height: 46px; }
  .card .name { font-size: 18px; }
  .card .line { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .card, .card .num, .card .sheen::before, .tm.p-arcane, .card .rays, .card .lock, .card .pips i.now, .card.chosen, .card .embers::before { animation: none; }
  .card .sparks, .card .embers i { display: none; }
  .card .sheen::before { transform: translateX(-130%) skewX(-16deg); }
  #levelup.leaving .card:not(.chosen) { transition: none; }
}
/* a first-sighting card waits behind a level-up or a chest rather than showing through it */
body:has(.overlay:not([hidden])) .seen { visibility: hidden; }

/* ---------- the Paths tree (tree.js; Jay, 2026-11-15: "We can add like an unlock tree of mods in the main menu") ----------
   A dark sheet like the level-up's, so the materials glow the way the cards do. One scroll area: the tabs stick to its top
   and Done to its foot. Each path is a spine of studs (its Roman numerals, then what its other mods need) with small
   cards hanging off it, each like its card: the rarity's body, the icon on its path's tile in the rarity's bezel. The
   materials are CSS variables set once (tree.js, cardart.js), so a baked texture is in the page once. */
.sg-sheet.pt-sheet {
  --sg-sheet-bg: #1a1634; --sg-sheet-ink: #f4f1ea; --sg-ink-soft: #b7c1da;
  --rail: rgba(214, 204, 255, 0.26); --stud: 38px; --sgap: 10px;
  padding: 16px 14px 0; color: var(--sg-sheet-ink);
  background: radial-gradient(130% 230px at 50% 0, #352d6e, rgba(53, 45, 110, 0)) #1a1634 local;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 24px 60px -20px rgba(0, 0, 0, 0.8);
}
/* a fixed height: a short tab (Plain) or a node opening must never resize the sheet and move it from under the finger
   (the click that follows a tap would land on the backdrop and close it) */
.sg-sheet.pt-sheet[open] { display: flex; flex-direction: column; height: calc(100dvh - 32px); }
.pt-sheet > * { flex: none; }
.pt-sheet > .sg-sheet-body { flex: 1 0 auto; }
.pt-sheet .sg-sheet-title { margin: 2px 0 4px; font: 700 26px/1.1 "Cinzel", Georgia, serif; letter-spacing: 0.05em; color: #f6e7c0; text-shadow: 0 2px 0 #0c0a1e; }
.pt-sheet .sg-actions { position: sticky; bottom: 0; z-index: 6; margin: 4px -14px 0; padding: 14px 14px 16px; background: linear-gradient(rgba(26, 22, 52, 0), #1a1634 14px); }
.pt { display: flex; flex-direction: column; gap: 10px; }
.pt .mat { position: absolute; inset: 0; z-index: -2; background: #efe2c6 center / cover no-repeat; }
.pt .mat.m-steel { background-image: var(--mat-steel); } .pt .mat.m-arcane { background-image: var(--mat-arcane); }
.pt .mat.m-wild { background-image: var(--mat-wild); } .pt .mat.m-tinker { background-image: var(--mat-tinker); }
.pt .mat.m-brawler { background-image: var(--mat-brawler); } .pt .mat.m-none { background-image: var(--mat-none); }
.pt .mat.r-common { background-color: #dfe8d6; background-image: var(--rar-common); } .pt .mat.r-rare { background-color: #cadcf6; background-image: var(--rar-rare); }
.pt .mat.r-epic { background-color: #ddcdf2; background-image: var(--rar-epic); } .pt .mat.r-legendary { background-color: #f4cf6e; background-image: var(--rar-legendary); }
.pt-head > .mat.m-brawler::before { content: ''; position: absolute; inset: 4px; border-radius: 11px; border: 1.5px dashed rgba(255, 246, 236, 0.8); }
.pt-intro { margin: 0; font: 600 14px/1.3 var(--sg-font); color: var(--sg-ink-soft); }
/* the tabs: a small tile of each path's material, its badge and its name; in a run, its count and a spark if something can turn up */
.pt-tabs { position: sticky; top: -16px; z-index: 5; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px;
  margin: 0 -14px; padding: 8px 14px 12px; }
.pt-sheet.stuck .pt-tabs { background: linear-gradient(#1a1634 84%, rgba(26, 22, 52, 0)); }
.pt-tab {
  --c-ink: #2b2f45; --c-edge: #c8b48c; --c-deep: #a38c62;
  position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-width: 0; height: 60px; margin: 0; padding: 2px 0 0; border: 0; border-radius: 14px; color: var(--c-ink); font: 800 11.5px/1 var(--sg-font);
  cursor: pointer; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none;
  box-shadow: 0 3px 0 var(--c-deep); opacity: 0.6; filter: saturate(0.6); transition: opacity 0.15s, filter 0.15s, transform 0.15s;
}
.pt-tab::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 1.5px var(--c-edge), inset 0 2px 0 rgba(255, 255, 255, 0.55); }
.pt-tab.sel { opacity: 1; filter: none; transform: translateY(-2px); box-shadow: 0 4px 0 var(--c-deep), 0 0 0 2px rgba(255, 238, 190, 0.9), 0 10px 18px -8px rgba(0, 0, 0, 0.8); }
.pt-tico { width: 32px; height: 32px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35)); }
.pt-tname { max-width: 100%; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6); }
.pt-tnum { position: absolute; top: 3px; right: 3px; padding: 2px 4px 1px; border-radius: 6px; background: linear-gradient(#433a62, #231c3a); color: #fff1d2;
  font: 700 10.5px/1 "Cinzel", Georgia, serif; box-shadow: 0 0 0 1px rgba(255, 222, 150, 0.6); }
.pt-tnum.tier { color: #ffd98a; box-shadow: 0 0 0 1px #f2bf3a, 0 0 6px rgba(255, 190, 60, 0.7); }
.pt-tspark { position: absolute; top: 4px; left: 4px; width: 11px; height: 11px; color: #fffbe6; filter: drop-shadow(0 0 2px rgba(255, 180, 40, 1)); animation: ptTwinkle 2.4s ease-in-out infinite; }
.pt-tspark svg, .pt-mark svg, .pt-gk svg, .pt-ck svg, .pt-si svg, .pt-stud svg, .pt-ci svg { display: block; width: 100%; height: 100%; }
@keyframes ptTwinkle { 0%, 100% { transform: scale(0.8) rotate(0deg); opacity: 0.7; } 50% { transform: scale(1.12) rotate(45deg); opacity: 1; } }
/* the path's head: its material, its badge, its name in Cinzel and what's in it; in a run its count as the numeral */
.pt-panel { display: flex; flex-direction: column; gap: 10px; }
/* the Pacts under the Plain tab: black cards with gold edges */
.pt-pacts { display: grid; gap: 8px; }
.pt-pact { position: relative; display: grid; grid-template-columns: 50px minmax(0, 1fr); column-gap: 10px; align-items: start; padding: 9px 12px 10px 9px; border-radius: 14px;
  background: linear-gradient(160deg, #2a2632, #0e0c12 60%, #030304); color: #ece0c6; box-shadow: 0 3px 0 #5c410a, 0 0 0 1.5px #e8b84a; font: 600 13.5px/1.28 var(--sg-font); }
.pt-pact.locked { opacity: 0.72; }
.pt-pact.held { box-shadow: 0 3px 0 #5c410a, 0 0 0 2px #f6d27a, 0 0 14px rgba(232, 184, 74, 0.45); }
.pt-pwell { display: grid; place-items: center; width: 50px; height: 50px; background: center / 100% 100% no-repeat; }
.pt-pg { display: block; width: 28px; height: 28px; color: #f2c654; }
.pt-pg svg { display: block; width: 100%; height: 100%; }
.pt-pw b { display: block; font: 800 16px/1.1 var(--sg-font); color: #f6d27a; margin-bottom: 2px; }
.pt-pw span { display: block; }
.pt-pnote { margin-top: 3px; color: #cdbf9f; font-size: 12.5px; }
.pt-plock { display: flex !important; align-items: center; gap: 5px; }
.pt-plock .pt-si { width: 13px; height: 13px; flex: none; }
.pt-pact .pt-mark { position: absolute; top: 8px; right: 8px; width: 20px; height: 20px; color: #f6d27a; }
.pt-panel.swap { animation: ptIn 0.22s ease-out; }
@keyframes ptIn { from { opacity: 0; transform: translateY(8px); } }
.pt-head { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; column-gap: 12px;
  min-height: 84px; padding: 10px 14px 10px 10px; border-radius: 18px; color: var(--c-ink); box-shadow: 0 5px 0 var(--c-deep), 0 14px 26px -12px rgba(0, 0, 0, 0.8); }
.pt-head::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 1.5px var(--c-edge), inset 0 2px 0 rgba(255, 255, 255, 0.6), inset 0 -3px 0 rgba(0, 0, 0, 0.16); }
.pt-panel.m-arcane .pt-head > .mat { inset: -14%; animation: drift 16s ease-in-out infinite alternate; }
.pt-sheen { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.pt-sheen::before { content: ''; position: absolute; top: -30%; bottom: -30%; left: 0; width: 30%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.4) 45%, rgba(255, 255, 255, 0.65) 50%, rgba(255, 255, 255, 0.4) 55%, rgba(255, 255, 255, 0) 100%);
  transform: translateX(-130%) skewX(-16deg); animation: sweep 1.1s 0.1s ease-in-out both; }
.pt-hicon { width: 56px; height: 56px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35)); }
.pt-hw { min-width: 0; }
.pt-hname { display: block; font: 700 24px/1.05 "Cinzel", Georgia, serif; letter-spacing: 0.03em; color: var(--c-ink); text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6); }
.pt-from { display: block; margin-top: 4px; font: 700 12.5px/1.25 var(--sg-font); color: var(--c-soft); }
.pt-hnum { font: 700 30px/1 "Cinzel", Georgia, serif; color: var(--c-ink); opacity: 0.75; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65), 0 -1px 0 rgba(0, 0, 0, 0.2); }
.pt-hnum.zero { opacity: 0.3; }
.pt-hnum.tier { opacity: 1; color: #8a5a06; background: linear-gradient(180deg, #fff6c8 10%, #f2bf3a 48%, #a8700c 54%, #f6d36a 90%); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; text-shadow: none; filter: drop-shadow(0 1px 0 rgba(90, 50, 0, 0.6)); }
/* the section headings */
.pt-body { display: flex; flex-direction: column; gap: 8px; }
.pt-h { display: flex; flex-direction: column; gap: 3px; margin: 8px 0 2px; font: 700 13px/1.1 "Cinzel", Georgia, serif; letter-spacing: 0.1em; text-transform: uppercase; color: #f1d98e; }
.pt-h span { display: flex; align-items: center; gap: 10px; }
.pt-h span::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(241, 217, 142, 0.55), rgba(241, 217, 142, 0)); }
.pt-h small { font: 600 13px/1.3 var(--sg-font); letter-spacing: 0; text-transform: none; color: var(--sg-ink-soft); }
/* a track: studs on a spine, each with its nodes hanging off it; the spine is gold between reached studs */
.pt-track { display: flex; flex-direction: column; }
.pt-gate { position: relative; display: grid; grid-template-columns: var(--stud) minmax(0, 1fr); column-gap: var(--sgap); row-gap: 8px; padding-bottom: 14px; }
.pt-gate::before { content: ''; position: absolute; left: calc(var(--stud) / 2 - 1px); top: var(--stud); bottom: 0; width: 2px; border-radius: 1px; background: var(--rail); }
.pt-gate:last-child { padding-bottom: 4px; }
.pt-gate:last-child::before { -webkit-mask-image: linear-gradient(#000 calc(100% - 34px), transparent); mask-image: linear-gradient(#000 calc(100% - 34px), transparent); }
.pt-gate.lit::before { background: linear-gradient(#ffe7a0, #e2a92e); box-shadow: 0 0 6px rgba(255, 196, 70, 0.55); }
.pt-stud { position: relative; z-index: 1; grid-column: 1; grid-row: 1; display: grid; place-items: center; width: var(--stud); height: var(--stud); border-radius: 50%;
  font: 700 13px/1 "Cinzel", Georgia, serif; letter-spacing: 0.02em; color: #ece6fb;
  background: radial-gradient(circle at 36% 30%, #6a6394, #2e2950 72%); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.26), inset 0 -2px 0 rgba(0, 0, 0, 0.3), 0 2px 0 rgba(0, 0, 0, 0.45); }
.pt-gate.reached > .pt-stud { box-shadow: inset 0 0 0 2px #f6d36a, 0 0 0 3px rgba(255, 210, 100, 0.2), 0 0 14px rgba(255, 186, 60, 0.5), 0 2px 0 rgba(0, 0, 0, 0.45); }
.pt-gate.reached > .pt-stud.num { color: #5a3700; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); background: radial-gradient(circle at 36% 30%, #fff8d6, #f4c443 52%, #b0760d);
  box-shadow: inset 0 0 0 1.5px rgba(255, 250, 220, 0.7), 0 0 0 3px rgba(255, 210, 100, 0.22), 0 0 16px rgba(255, 186, 60, 0.55), 0 2px 0 #6e4a06; }
.pt-stud.ico { background: radial-gradient(circle at 40% 34%, #fbf6ea, #cfc4ad 74%); }
.pt-stud.ico img { width: 30px; height: 30px; }
.pt-stud.glyph svg { width: 21px; height: 21px; }
.pt-stud.pt-tag { background: radial-gradient(circle at 40% 34%, #ffffff, #ddd5ec 74%); color: var(--tc); }
.pt .ghost, .pt-node.unseen .pt-well img { filter: brightness(0) opacity(0.45); }
.pt-gh { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; justify-content: center; gap: 3px; min-width: 0; min-height: var(--stud); }
.pt-gt { display: block; font: 800 15px/1.2 var(--sg-font); color: var(--sg-sheet-ink); }
.pt-gk { display: inline-block; width: 17px; height: 17px; margin-left: 6px; vertical-align: -3px; color: #f6d36a; }
.pt-gs { font: 600 12.5px/1.25 var(--sg-font); color: var(--sg-ink-soft); }
.pt-prow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.pt-pips { display: inline-flex; gap: 6px; padding: 2px 0 2px 2px; }
.pt-pips i { width: 8px; height: 8px; border-radius: 2px; transform: rotate(45deg); border: 1.5px solid rgba(214, 204, 255, 0.5); }
.pt-pips i.on { background: #f4c443; border-color: #fff0b8; box-shadow: 0 0 5px rgba(255, 196, 60, 0.7); }
.pt-left { padding: 0 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); font: 800 12px/19px var(--sg-font); color: #ffe7a0; }
.pt-branch { grid-column: 2; grid-row: 2; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pt-branch:empty { display: none; }
/* a node: a small card in its path's material; tap it for the rest */
.pt-node { --c-ink: #2b2f45; --c-soft: #566079; --c-edge: #c8b48c; --c-deep: #a38c62;
  position: relative; display: block; width: 100%; margin: 0; padding: 0; border: 0; background: none; color: var(--c-ink); font: inherit; text-align: left;
  cursor: pointer; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; scroll-margin: 96px 0 92px; }
.pt-node::before { content: ''; position: absolute; left: calc(var(--stud) / -2 - var(--sgap)); top: 30px; width: calc(var(--stud) / 2 + var(--sgap)); height: 2px; background: var(--rail); }
.pt-node.s-taken::before { background: #f4c443; box-shadow: 0 0 5px rgba(255, 196, 60, 0.6); }
.pt-card { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: 46px minmax(0, 1fr); column-gap: 10px; align-items: start;
  min-height: 62px; padding: 8px 12px 8px 8px; border-radius: 14px; box-shadow: 0 3px 0 var(--c-deep), 0 10px 18px -10px rgba(0, 0, 0, 0.85); transition: transform 0.08s; }
.pt-card::after { content: ''; position: absolute; inset: 0; z-index: 3; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1.5px var(--c-edge), inset 0 2px 0 rgba(255, 255, 255, 0.55), inset 0 -2px 0 rgba(0, 0, 0, 0.14); }
.pt-node:active .pt-card { transform: translateY(2px) scale(0.99); }
.pt-node:focus-visible { outline: none; }
.pt-node:focus-visible .pt-card { outline: 3px solid var(--sg-accent); outline-offset: 2px; }
.pt-well { position: relative; z-index: 0; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 11px; box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.35); }
.pt-well img { position: relative; z-index: 2; width: 32px; height: 32px; }
.pt-words { min-width: 0; padding-top: 1px; }
.in-run .pt-words { padding-right: 16px; }
.pt-name { display: block; font: 800 16px/1.12 var(--sg-font); color: var(--c-ink); text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); }
.pt-node.unseen .pt-name { letter-spacing: 0.12em; }
.pt-with { display: block; margin-top: 2px; font: 700 10px/1.2 "Cinzel", Georgia, serif; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-soft); }
.pt-line { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; margin-top: 2px; font: 600 13px/1.25 var(--sg-font); color: var(--c-ink); }
.pt-line.nf { color: var(--c-soft); font-style: italic; }
.pt-line.st, .pt-line.pair { font-weight: 800; color: var(--c-soft); }
.pt-node.on .pt-line { display: block; }
.pt-mark { position: absolute; z-index: 2; top: 7px; right: 7px; width: 16px; height: 16px; }
.pt-mark.taken { width: 20px; height: 20px; top: 6px; right: 6px; padding: 3px; border-radius: 50%; color: #5a3700; background: radial-gradient(circle at 36% 30%, #fff8d6, #f4c443 55%, #b0760d); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35); }
.pt-mark.open { width: 18px; height: 18px; color: #fffbe6; filter: drop-shadow(0 0 2px rgba(255, 176, 30, 1)) drop-shadow(0 0 1px #7a4d00); animation: ptTwinkle 2.4s ease-in-out infinite; }
.pt-mark.locked { width: 14px; height: 14px; color: var(--c-ink); opacity: 0.4; }
.pt-mark.banned { color: #8f2a24; opacity: 0.75; }
.pt-mark.shop { color: #9a6a08; }
.pt-node.s-taken .pt-card { box-shadow: 0 3px 0 var(--c-deep), 0 0 0 2px #f6d36a, 0 0 16px rgba(255, 186, 60, 0.45); }
.pt-node.s-open .pt-card::after { box-shadow: inset 0 0 0 2px #fffbe8, inset 0 2px 0 rgba(255, 255, 255, 0.7), inset 0 -2px 0 rgba(0, 0, 0, 0.14); }
.pt-node.s-open .pt-card { box-shadow: 0 3px 0 var(--c-deep), 0 0 14px rgba(255, 250, 230, 0.28); }
.pt-node.s-locked .pt-card, .pt-node.s-banned .pt-card, .pt-node.s-shop .pt-card { filter: saturate(0.45) brightness(0.88); }
/* the rest of a node: its full text, what it needs (one chip each; gold where you have it), notes */
.pt-more { grid-column: 1 / -1; display: none; gap: 6px; margin-top: 8px; padding: 8px 10px; border-radius: 11px; background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.14); font: 600 13.5px/1.3 var(--sg-font); color: var(--c-ink); }
.pt-node.on .pt-more { display: grid; }
.pt-need { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 6px; }
.pt-nl { margin-right: 2px; font: 800 11px/1 var(--sg-font); letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-soft); }
.pt-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 26px; max-width: 100%; padding: 2px 9px 2px 3px; border-radius: 999px; background: rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); font: 800 12.5px/1.15 var(--sg-font); }
.pt-chip.have { background: linear-gradient(#fff6cf, #f7dc8a); box-shadow: inset 0 0 0 1px #c8901e; }
.pt-ci { flex: none; width: 22px; height: 22px; }
span.pt-ci { display: grid; place-items: center; padding: 4px; border-radius: 50%; background: #fff; color: var(--tc); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.pt-ck { flex: none; width: 13px; height: 13px; color: #8a5a06; }
.pt-plus { font-weight: 800; color: var(--c-soft); }
.pt-ml { display: block; }
.pt .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.pt-st { display: flex; align-items: center; gap: 6px; font-weight: 800; }
.pt-si { flex: none; width: 15px; height: 15px; }
.pt-st.taken .pt-si { color: #8a5a06; } .pt-st.open .pt-si { color: #c48a00; } .pt-st.locked .pt-si { color: var(--c-soft); }
.pt .t-magic { --tc: #7a3fd0; } .pt .t-phys { --tc: #47607a; } .pt .t-fire { --tc: #e2621f; } .pt .t-ice { --tc: #2f8fd6; }
.pt .t-shock { --tc: #c99400; } .pt .t-sick { --tc: #3f8f24; } .pt .t-heavy { --tc: #6a5440; }
@media (max-width: 370px) {
  .sg-sheet.pt-sheet { --stud: 34px; --sgap: 8px; padding-left: 12px; padding-right: 12px; }
  .pt-sheet .sg-actions, .pt-tabs { margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
  .pt-tabs { gap: 4px; }
  .pt-tab { height: 56px; font-size: 11px; }
  .pt-tico { width: 28px; height: 28px; }
  .pt-stud { font-size: 12px; }
  .pt-stud.ico img { width: 26px; height: 26px; }
  .pt-head { grid-template-columns: 48px minmax(0, 1fr) auto; column-gap: 10px; }
  .pt-hicon { width: 48px; height: 48px; }
  .pt-hname { font-size: 21px; }
  .pt-card { grid-template-columns: 42px minmax(0, 1fr); column-gap: 9px; padding-right: 10px; }
  .pt-well { width: 42px; height: 42px; }
  .pt-well img { width: 30px; height: 30px; }
  .pt-name { font-size: 15px; }
  .pt-line { font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .pt-panel.swap, .pt-mark.open, .pt-tspark, .pt-panel.m-arcane .pt-head > .mat, .pt-sheen::before, .pt .tm.p-arcane { animation: none; }
  .pt-tab, .pt-card { transition: none; }
  .pt-node:active .pt-card { transform: none; }
}

/* ---------- the Career (career.js): the results' block and the page ---------- */
.res-career { width: 100%; max-width: 360px; margin: 4px 0 10px; padding: 10px 12px 12px; border-radius: 18px; background: rgba(255, 255, 255, 0.08); text-align: left; display: grid; gap: 8px; }
.res-career:empty { display: none; }
.rc-head { display: flex; align-items: center; gap: 10px; }
.rc-badge { width: 40px; height: 40px; flex: none; }
.rc-hw { display: grid; min-width: 0; flex: 1; }
.rc-hw b { font-size: 17px; line-height: 1.15; }
.rc-hw small { font-size: 12px; color: var(--ink-soft); }
.rc-promo { flex: none; padding: 3px 10px; border-radius: 12px; background: var(--gold); color: #3a2605; font-weight: 800; font-size: 14px; animation: pop 0.5s 0.6s backwards; }
.rc-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 14px; }
.rc-lines li { display: flex; justify-content: space-between; gap: 8px; color: var(--ink-soft); }
.rc-lines li b { color: var(--ink); font-variant-numeric: tabular-nums; }
.rc-lines li.tot { margin-top: 2px; padding-top: 4px; border-top: 1px solid rgba(255, 255, 255, 0.14); color: var(--ink); font-weight: 700; }
.rc-lines li.tot b { color: #ffe28a; }
.rc-bar { --pb-track: rgba(255, 255, 255, 0.14); --pb-ink: var(--ink-soft); }
.rc-bar .pb-text { font-size: 13px; }
.rc-new { display: grid; gap: 6px; }
.rc-nl { margin: 0; font-size: 14px; font-weight: 800; color: #ffe28a; }
.cthing { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 14px; background: rgba(255, 211, 78, 0.14); animation: pop 0.5s 0.8s backwards; }
.cth-ic { width: 40px; height: 40px; flex: none; }
.cth-w { display: grid; min-width: 0; }
.cth-w b { font-size: 15px; line-height: 1.15; }
.cth-w small { font-size: 12px; color: var(--ink-soft); }
.rc-next { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-soft); }
.rc-sil, .cr-list li.shut .cr-ic { filter: brightness(0) opacity(0.45); } /* a silhouette (static, never per frame) */
.rc-sil { width: 34px; height: 34px; flex: none; }
.career { display: grid; gap: 10px; }
.cr-head { display: flex; align-items: center; gap: 12px; }
.cr-badge { width: 56px; height: 56px; flex: none; }
.cr-hw { display: grid; }
.cr-hw b { font-size: 26px; line-height: 1.05; }
.cr-hw span { font-size: 16px; font-weight: 700; color: var(--sg-ink-soft); }
.cr-bar { --pb-track: rgba(29, 42, 68, 0.12); --pb-ink: var(--sg-ink-soft); }
.cr-nextl, .cr-note { margin: 0; font-size: 14px; color: var(--sg-ink-soft); }
.career h3 { margin: 8px 0 0; font-size: 18px; }
.cr-hats { display: flex; flex-wrap: wrap; gap: 8px; }
.cr-hat { width: 56px; height: 56px; border: 0; border-radius: 16px; background: #efe7d6; padding: 4px; cursor: pointer; display: grid; place-items: center; font: inherit; }
.cr-hat img { width: 46px; height: 46px; }
.cr-hat.on { box-shadow: 0 0 0 3px var(--gold); background: #fff3cf; }
.cr-nohat { font-size: 13px; font-weight: 800; color: #5a6784; }
.cr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.cr-list li { display: flex; align-items: center; gap: 10px; padding: 4px 6px; border-radius: 12px; }
.cr-list li.open { background: rgba(245, 184, 46, 0.12); }
.cr-lv { width: 30px; flex: none; text-align: center; font-weight: 800; font-size: 15px; color: #5a6784; font-variant-numeric: tabular-nums; }
.cr-list li.open .cr-lv { color: #9a6a06; }
.cr-ic { width: 36px; height: 36px; flex: none; }
.cr-w { display: grid; min-width: 0; }
.cr-w b { font-size: 15px; line-height: 1.2; }
.cr-w small { font-size: 12px; color: #5a6784; }
.cr-list li.shut .cr-w b { color: #5a6784; }
.cr-how { margin: 0; }
@media (prefers-reduced-motion: reduce) { .rc-promo, .cthing { animation: none; } }
/* a capstone (capstones.js): the top of a path. A gold crown over its frame, a gold plaque, and a gold inner rim on the card
   (its rarity frame is legendary's; black stays the Pacts') */
.card .crest { position: absolute; left: 50%; top: -9px; width: 30px; height: 19px; transform: translateX(-50%); z-index: 4; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45)); }
.card .crest svg { width: 100%; height: 100%; display: block; }
.card.capstone .plaque { background: linear-gradient(#ffd25a, #c98a12); color: #3a2605; box-shadow: 0 0 0 1px #fff3c0, 0 2px 3px rgba(0, 0, 0, 0.4); font-size: 11px; padding: 0 5px 0 4px; }
.card.capstone .plaque .kg { color: #3a2605; }
.card.capstone::after { content: ''; position: absolute; inset: 3px; border-radius: inherit; box-shadow: inset 0 0 0 2px rgba(255, 214, 110, 0.85), inset 0 0 18px rgba(255, 200, 80, 0.35); pointer-events: none; z-index: 2; }

/* v2 drafts (drafts.js): the cards' sheet in the tier's colour; the pill says "New weapon" in gold while one waits */
#levelup.draft[data-tier="1"] .lu-head h2 { color: #dfe8f2; }
#levelup.draft[data-tier="2"] .lu-head h2 { color: #d9b6ff; }
#levelup.draft[data-tier="3"] .lu-head h2 { color: #ffd86b; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.55), 0 0 22px rgba(255, 196, 64, 0.55); }
#levelup.draft #banish-btn { display: none; }
#levelup.draft .lu-head h2 { font-size: clamp(26px, 8vw, 34px); white-space: nowrap; }
.points.draft { color: #ffe9a8; text-shadow: 0 0 8px rgba(255, 210, 110, 0.95), 0 1px 2px #000; }
.points.draft .pts-frame .rim-o { stroke: #ffe08a; filter: drop-shadow(0 0 3px rgba(255, 200, 90, 0.9)); }

/* Primus arrives (game.js revealPrimus): a card over the page, his portrait in a gold ring before turning rays */
.reveal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(8, 7, 18, 0.82); animation: rv-in 0.35s ease-out both; }
.reveal.out { animation: rv-out 0.26s ease-in both; }
.reveal .rv-card { position: relative; width: min(340px, 100%); padding: 22px 18px 16px; border-radius: 22px; text-align: center; color: #f3efe6;
  background: radial-gradient(120% 90% at 50% 0%, #2c2d52 0%, #14152a 70%); box-shadow: 0 0 0 2px #f2c94c, 0 18px 50px rgba(0, 0, 0, 0.55); overflow: hidden; }
.reveal .rv-rays { position: absolute; left: 50%; top: 112px; width: 420px; height: 420px; margin: -210px 0 0 -210px; background: var(--rays) center / contain no-repeat; opacity: 0.55; animation: rv-spin 18s linear infinite; pointer-events: none; }
.reveal .rv-p { position: relative; width: 168px; height: 168px; border-radius: 50%; background: #f4ecdf; box-shadow: 0 0 0 4px #fff, 0 0 0 8px #f2c94c, 0 0 40px rgba(242, 201, 76, 0.6); animation: rv-pop 0.6s 0.15s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.reveal .rv-k { position: relative; margin-top: 14px; font: 800 12px/1 var(--sg-font); letter-spacing: 0.12em; text-transform: uppercase; color: #f2c94c; }
.reveal .rv-n { position: relative; margin-top: 6px; font: 800 34px/1 var(--sg-font); }
.reveal .rv-t { position: relative; margin-top: 4px; font: 700 14px/1.2 var(--sg-font); color: #c9cfe6; }
.reveal .rv-l { position: relative; margin: 12px 4px 16px; font: 600 15px/1.4 var(--sg-font); color: #e6e2f2; }
.reveal .rv-row { position: relative; display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; }
.reveal button { min-height: 48px; border: 0; border-radius: 14px; font: 800 16px/1 var(--sg-font); touch-action: manipulation; }
.reveal .rv-go { background: linear-gradient(180deg, #ffe08a, #f2b632); color: #3a2a05; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18); }
.reveal .rv-later { background: rgba(255, 255, 255, 0.12); color: #f3efe6; }
.reveal.still, .reveal.still * { animation: none !important; }
@keyframes rv-in { from { opacity: 0; } }
@keyframes rv-out { to { opacity: 0; } }
@keyframes rv-pop { from { transform: scale(0.4); opacity: 0; } }
@keyframes rv-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .reveal, .reveal * { animation: none !important; } }

/* ---------- weapon families (forms.js FAMILIES; Jay, 2026-11-19: "how can I tell if something is thrown vs up close vs underfoot") ----------
   a small icon in the family's color: on weapon cards (a chip with the name), on the HUD's weapon slots, in the build view,
   on family mod cards ("Works on your ...") and in How to play. Nothing animates. */
.card .trait.fam { color: var(--fc); gap: 3px; font-weight: 800; }
.card .trait.fam svg { width: 14px; height: 14px; color: var(--fc); }
.card .works { display: flex; align-items: center; flex-wrap: wrap; gap: 3px; margin-top: 4px; font-size: 13px; line-height: 1.2; font-weight: 800; color: var(--c-soft); }
.card .works .fam { display: inline-flex; color: var(--fc); }
.card .works .fam svg { width: 14px; height: 14px; display: block; }
.tray .t .fm { position: absolute; left: -3px; top: -3px; width: 14px; height: 14px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #fff8e8; color: var(--fc); box-shadow: 0 0 0 1px rgba(8, 14, 30, 0.7); }
.tray .t .fm svg { width: 10px; height: 10px; display: block; }
.res-build .t { position: relative; }
.res-build .t .fm { position: absolute; left: -3px; top: -3px; width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #fff8e8; color: var(--fc); box-shadow: 0 0 0 1px rgba(8, 14, 30, 0.7); }
.res-build .t .fm svg { width: 11px; height: 11px; display: block; }
.bw .bfam { grid-column: 1 / -1; display: flex; align-items: flex-start; gap: 6px; font-size: 14px; line-height: 1.25; color: #36405c; }
.bw .bfam .fam { flex: none; display: inline-flex; color: var(--fc); margin-top: 1px; }
.bw .bfam .fam svg, .bw .bfam .fam { width: 16px; height: 16px; }
.fam-how .fam-row { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; font-weight: 600; }
.fam-how .fam-row svg { flex: none; color: var(--fc); margin-top: 1px; }
.fam-how .fam-row small { font-size: 13px; font-weight: 600; opacity: 0.8; }

/* Experimental artwork (admins only): the 16-bit look draws the field small and lets the screen show its pixels */
.art-pick { display: grid; gap: 10px; }
.art-opt { display: grid; gap: 2px; text-align: left; min-height: 56px; padding: 10px 14px; border-radius: 14px; border: 2px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.06); color: inherit; font: inherit; }
.art-opt b { font-size: 17px; }
.art-opt small { opacity: 0.75; font-size: 13px; }
.art-opt.on { border-color: #ffd34e; background: rgba(255,211,78,0.14); }
.art-note { margin: 4px 2px 0; font-size: 13px; opacity: 0.7; }

/* Feel pass (2026-11-29): field moments and the legendary hand. Display only. */
#fieldfx { position: fixed; inset: 0; z-index: 12; pointer-events: none; opacity: 0; }
#fieldfx.on.boss { animation: fxBoss 1.25s ease-out forwards;
  background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.95), rgba(255, 236, 170, 0.55) 40%, rgba(255, 196, 64, 0) 75%); }
#fieldfx.on.legend { animation: fxLegend 0.8s ease-out forwards;
  background: radial-gradient(circle at 50% 55%, rgba(255, 226, 120, 0.7), rgba(255, 186, 40, 0.25) 45%, rgba(255, 186, 40, 0) 80%); }
@keyframes fxBoss { 0% { opacity: 0; } 6% { opacity: 1; } 30% { opacity: 0.55; } 100% { opacity: 0; } }
@keyframes fxLegend { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }
/* a legendary on the table: a gold breath across the sheet, the legendary card comes in last and slower, with a flare */
#levelup.legend-in { isolation: isolate; }
#levelup.legend-in::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at 50% 70%, rgba(255, 210, 90, 0.42), rgba(255, 180, 40, 0) 65%); animation: luGold 1.4s ease-out forwards; }
@keyframes luGold { 0% { opacity: 0; } 18% { opacity: 1; } 100% { opacity: 0.25; } }
#levelup.legend-in .card.r-legendary { animation: dealLegend 0.9s calc(0.25s + var(--i, 0) * 80ms) backwards cubic-bezier(0.2, 1.4, 0.35, 1); }
@keyframes dealLegend { 0% { transform: translateY(36px) scale(0.8); opacity: 0; filter: brightness(2.2); } 60% { filter: brightness(1.4); } 100% { filter: none; } }
@media (prefers-reduced-motion: reduce) { #levelup.legend-in::before, #levelup.legend-in .card.r-legendary { animation: none; } }
