/* Aurora — the night sky and the light of the aurora. Glass over a living
   sky, thin edges of light, a shimmer when the pointer passes and a flash
   where something is pressed. Aurora has no light theme: the night is the
   setting. */

:root {
  --night: #0a0e1c;
  --night-2: #121831;
  --night-3: #1a2244;
  --ink: #eef2ff;
  --ink-soft: #c9d0ea;
  --muted: #8b93b5;
  --line: #2c3560;
  --aurora: #5cf2b4;   /* the marker: aurora green */
  --aurora-ink: #06140f;
  --teal: #3fd3e6;
  --violet: #a37cff;
  --rose: #ff7ac6;
  --gold: #ffc84a;
  --red: #ff6b6b;
  --red-soft: #3a1620;
  --shadow: var(--violet);
  --radius: 18px;
  --glass: rgba(10, 14, 32, 0.58);
  --edge: rgba(190, 220, 255, 0.15);
  --aurora-edge: linear-gradient(120deg, #5cf2b488, #3fd3e655 30%, #a37cff44 60%, #ffffff10);
  --serif: "Cinzel", Georgia, serif;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; background: var(--night); }

/* no background on body: the sky (z-index -1) sits between html and body */
body {
  margin: 0;
  color: var(--ink);
  font: 18px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: #bfffe9; text-decoration-color: var(--aurora); text-shadow: 0 0 14px #5cf2b466; }

button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

/* marked words glow in the aurora's colours */
mark {
  color: transparent;
  background: linear-gradient(110deg, #5cf2b4, #3fd3e6 45%, #a37cff 90%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 14px #5cf2b455);
}

kbd {
  font: 600 .72em/1 var(--font);
  border: 1.5px solid var(--line);
  border-bottom-width: 3px;
  border-radius: 5px;
  padding: .15em .4em;
  color: var(--ink-soft);
  background: var(--night-2);
}

code { font: .88em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--night-3); padding: .1em .35em; border-radius: 4px; }

.muted { color: var(--muted); }
.small { font-size: 15px; }

/* ---------- the sky: slow aurora bands behind everything ---------- */

.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.sky::after {
  /* stars */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 33% 9%, #fff6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 58% 22%, #fff9 50%, transparent 51%),
    radial-gradient(1px 1px at 77% 12%, #fff7 50%, transparent 51%),
    radial-gradient(1px 1px at 90% 30%, #fff5 50%, transparent 51%),
    radial-gradient(1px 1px at 24% 40%, #fff4 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 66% 46%, #fff6 50%, transparent 51%),
    radial-gradient(1px 1px at 46% 60%, #fff3 50%, transparent 51%),
    radial-gradient(1px 1px at 8% 70%, #fff4 50%, transparent 51%),
    radial-gradient(1px 1px at 86% 76%, #fff3 50%, transparent 51%);
}
.band {
  position: absolute;
  left: -20%;
  width: 140%;
  height: 46vh;
  filter: blur(48px);
  opacity: .3;
  border-radius: 50%;
  animation: drift 26s ease-in-out infinite alternate;
}
.b1 { top: -14vh; background: linear-gradient(90deg, transparent, var(--aurora), var(--teal), transparent); transform: rotate(-6deg); }
.b2 { top: -4vh; background: linear-gradient(90deg, transparent, var(--violet), var(--rose) 70%, transparent); opacity: .22; animation-duration: 34s; animation-delay: -8s; }
.b3 { top: 8vh; background: linear-gradient(90deg, transparent 10%, var(--teal), transparent 80%); opacity: .14; animation-duration: 41s; animation-delay: -15s; }
@keyframes drift {
  from { transform: translateX(-4%) rotate(-6deg) scaleY(.9); }
  to   { transform: translateX(4%) rotate(-2deg) scaleY(1.1); }
}
@media (prefers-reduced-motion: reduce) { .band { animation: none; } }
/* with JavaScript the sky is painted (site.js, sky.js); the bands stay as the quiet fallback */
.sky-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sky.live .band, .sky.live::after { display: none; }

/* pages rise softly into view and fade when leaving */
main { animation: rise .7s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
body.leaving main, body.leaving header.site { opacity: 0; transition: opacity .18s; }
@media (prefers-reduced-motion: reduce) { main { animation: none; } }

/* a flash of light where something is pressed (site.js sets --fx, --fy) */
.flash-host, .btn, .seg-btn, .swatch, .to-hub, header nav a.account { position: relative; overflow: hidden; isolation: isolate; }
.btn::after, .seg-btn::after, .swatch::after, .to-hub::after, header nav a.account::after {
  content: "";
  position: absolute;
  left: var(--fx, 50%);
  top: var(--fy, 50%);
  width: 12px;
  height: 12px;
  margin: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff, #bfffe9 35%, #5cf2b400 70%);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}
.flash::after { animation: lightflash .6s ease-out; }
@keyframes lightflash { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(36); } }
@media (prefers-reduced-motion: reduce) { .flash::after { animation-duration: .01s; } }

/* ---------- header / footer ---------- */

header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px clamp(16px, 4vw, 48px);
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: .06em;
  text-decoration: none;
}
.wordmark:hover { color: inherit; text-shadow: 0 0 18px #5cf2b455; }
.dot { color: var(--aurora); text-shadow: 0 0 12px var(--aurora); }

/* back to the selection page of all games */
.to-hub {
  flex: none;
  padding: 4px 13px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color .3s, box-shadow .3s;
}
.to-hub:hover { color: var(--ink); border-color: #5cf2b488; box-shadow: 0 0 18px #5cf2b433; text-shadow: none; }
.to-hub + .wordmark { margin-right: auto; }

header nav { display: flex; align-items: center; gap: clamp(10px, 2.5vw, 28px); font-weight: 600; }
header nav a { text-decoration: none; padding: 2px 4px; border-radius: 4px; }
header nav a[aria-current="page"] { color: #bfffe9; text-shadow: 0 0 14px #5cf2b488; box-shadow: inset 0 -2px 0 var(--aurora); border-radius: 0; }
header nav a.account {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 11em;
  padding: 4px 13px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--glass);
  font-weight: 600;
  white-space: nowrap;
  transition: border-color .3s, box-shadow .3s;
}
header nav a.account:hover { border-color: #5cf2b488; box-shadow: 0 0 18px #5cf2b433; color: var(--ink); text-shadow: none; }
.account-name { overflow: hidden; text-overflow: ellipsis; }
.account-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--aurora); box-shadow: 0 0 8px var(--aurora); }

footer.site {
  margin-top: auto;
  padding: 48px 16px 32px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}
footer.site p { margin: 0; }
footer.site .legal { margin-top: 6px; }
footer.site .legal a {
  color: var(--muted);
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent);
}
footer.site .legal a:hover {
  background: none;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--aurora);
  text-decoration-thickness: 3px;
}

/* ---------- type ---------- */

.headline {
  font-family: var(--serif);
  font-size: clamp(32px, 5.4vw, 56px);
  line-height: 1.12;
  letter-spacing: .01em;
  font-weight: 700;
  margin: 12px 0 28px;
  text-wrap: balance;
}
.kicker {
  margin: 24px 0 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 800;
  color: var(--teal);
}
.lede { max-width: 38em; color: var(--ink-soft); font-size: 19px; line-height: 1.5; margin: 0 0 28px; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(190, 220, 255, 0.28);
  background: rgba(12, 16, 34, 0.62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--ink);
  border-radius: 999px;
  padding: 12px 26px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .01em;
  box-shadow: 0 8px 24px #0006, inset 0 1px 0 #ffffff14;
  transition: border-color .3s, box-shadow .3s, transform .15s;
}
/* the aurora shimmer that sweeps across when the pointer comes */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 25%, #5cf2b430 38%, #3fd3e650 47%, #a37cff40 56%, transparent 70%);
  background-size: 260% 100%;
  background-position: 130% 0;
  transition: background-position 1s ease;
}
a.btn { text-decoration: none; }
.btn.primary {
  border-color: transparent;
  color: #03110c;
  background: linear-gradient(120deg, #5cf2b4, #3fd3e6 45%, #a37cff 80%, #5cf2b4);
  background-size: 260% 100%;
  box-shadow: 0 0 26px #5cf2b455, 0 8px 24px #0007;
  animation: auroraflow 10s ease-in-out infinite alternate;
}
.btn.primary::before { background: linear-gradient(110deg, transparent 30%, #ffffff70 50%, transparent 70%); background-size: 260% 100%; background-position: 130% 0; }
@keyframes auroraflow { to { background-position: 100% 0; } }
.btn.small { padding: 7px 16px; font-size: 15px; }
@media (hover: hover) {
  .btn:hover { border-color: #5cf2b499; box-shadow: 0 0 24px #5cf2b433, 0 8px 24px #0006; color: var(--ink); text-shadow: none; }
  .btn.primary:hover { box-shadow: 0 0 42px #5cf2b499, 0 8px 24px #0007; color: #03110c; }
  .btn:hover::before { background-position: -30% 0; }
}
.btn:active { transform: scale(.97); }
@media (prefers-reduced-motion: reduce) { .btn.primary { animation: none; } .btn::before { transition: none; } }

.linklike {
  background: none; border: 0; padding: 2px 4px; border-radius: 4px;
  font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px;
}
.linklike:hover { color: #bfffe9; text-decoration-color: var(--aurora); text-shadow: 0 0 14px #5cf2b466; }

.actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin: 0 0 14px; }
.actions form { margin: 0; }

.error {
  margin: 0 0 18px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 90, 110, 0.12);
  color: #ffb4bc;
  font-weight: 600;
  border: 1px solid #ff6b6b66;
}

/* ---------- front door and Lighthold ---------- */

main.front {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 48px);
}

.features {
  list-style: none;
  padding: 0;
  margin: 48px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
/* glass with an edge of aurora light */
.features li, .note, .datum, .hero-card {
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: linear-gradient(var(--glass), var(--glass)) padding-box, var(--aurora-edge) border-box;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 34px #0006, inset 0 1px 0 #ffffff0d;
}
.features li { padding: 6px 22px 8px; }
.features li:nth-child(2) { --aurora-edge: linear-gradient(120deg, #3fd3e688, #a37cff44 40%, #ffffff10); }
.features li:nth-child(3) { --aurora-edge: linear-gradient(120deg, #a37cff88, #ff7ac644 40%, #ffffff10); }
.features h2 { font-family: var(--serif); font-weight: 700; font-size: 19px; letter-spacing: .02em; margin: 16px 0 6px; }
.features p { margin: 0 0 12px; color: var(--ink-soft); font-size: 16px; }
@media (max-width: 760px) { .features { grid-template-columns: 1fr; } }
.desktop-note { margin-top: 32px; }

/* ---------- legal pages & data ---------- */

main.narrow {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 48px);
}

.note { padding: 4px 22px; }

.prose h2 { font-size: 22px; letter-spacing: -.01em; margin: 40px 0 8px; }
.prose p, .prose li { max-width: 40em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin: 6px 0; }
.prose .stand { margin-top: 40px; font-size: 15px; }

.todo { background: var(--red-soft); color: var(--red); font-weight: 700; padding: 0 .25em; border-radius: 4px; }

.store-group { margin-top: 28px; }
.store-where {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink);
  margin: 0 0 12px;
}
.where-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--aurora); box-shadow: 0 0 10px var(--aurora); flex: none; }

.datum { padding: 16px 22px 18px; margin-bottom: 12px; }
.datum h4 { margin: 0; font-size: 20px; letter-spacing: -.01em; }
.datum-what { margin: 2px 0 14px; color: var(--muted); font-size: 16px; }
.datum dl {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 18px;
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.datum dt { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--muted); margin-bottom: 3px; }
.datum dd { margin: 0; font-size: 16px; line-height: 1.45; }
@media (max-width: 600px) { .datum dl { grid-template-columns: 1fr; } }

/* ---------- error pages: a rift with the code glowing inside ---------- */

.error-page {
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 48px) 0;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.rift {
  position: relative;
  aspect-ratio: 3 / 4;
  border: 1px solid #a37cff66;
  border-radius: 50% / 40%;
  background:
    radial-gradient(ellipse at 50% 55%, var(--violet) 0, #3a1f7a 35%, #120a2a 70%, var(--night) 100%);
  box-shadow: 0 0 60px #a37cff44, inset 0 0 40px #000c;
  display: grid;
  place-items: center;
  animation: swirl 9s linear infinite;
  overflow: hidden;
}
.rift::before {
  content: "";
  position: absolute;
  inset: -30%;
  background: conic-gradient(from 0deg, transparent, #a37cff55, transparent 30%, #3fd3e655, transparent 60%, #ff7ac655, transparent);
  animation: spin 12s linear infinite;
}
.rift-code {
  position: relative;
  font-weight: 900;
  font-size: 54px;
  letter-spacing: -.04em;
  color: var(--ink);
  text-shadow: 0 0 18px var(--violet), 0 0 4px #fff;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes swirl { 50% { border-radius: 46% / 42%; } }
@media (prefers-reduced-motion: reduce) { .rift, .rift::before { animation: none; } }
.err-code { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .14em; font-weight: 800; color: var(--muted); }
@media (max-width: 640px) {
  .error-page { grid-template-columns: 1fr; }
  .rift { width: 160px; }
}

/* on phones the header links wrap to a second row rather than run off the screen */
@media (max-width: 520px) {
  header nav { flex-wrap: wrap; justify-content: flex-start; column-gap: 14px; row-gap: 8px; }
  header nav a.account { max-width: 8em; padding: 1px 8px; }
}

/* ---------- game page: the 3D view fills the window ---------- */

body.game { height: 100vh; overflow: hidden; background: #05070f; user-select: none; -webkit-user-select: none; }
.game-bar {
  position: fixed;
  top: 14px;
  left: 16px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 18px;
}
.game-bar .to-hub { background: color-mix(in srgb, var(--night) 70%, transparent); }
.small-mark { font-size: 22px; opacity: .85; }
.stage { position: fixed; inset: 0; }
.stage canvas.view { display: block; width: 100%; height: 100%; outline: none; }
.stage-msg {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  font-weight: 700;
  color: var(--ink-soft);
}
.stage-msg.error { color: var(--red); }
.stage-msg[hidden] { display: none; }
.hud-hint {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  margin: 0;
  padding: 6px 14px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--night) 75%, transparent);
  color: var(--ink-soft);
  font-size: 14px;
  white-space: nowrap;
  pointer-events: none;
}
.touch-note {
  position: absolute;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(90vw, 520px);
  margin: 0;
  padding: 10px 16px;
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  background: var(--night-2);
  color: var(--gold);
  font-weight: 700;
  text-align: center;
}

/* ---------- Lighthold: the heroes ---------- */

.section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 800;
  margin: 0;
}
p.flash { display: inline-block; margin: -10px 0 24px; padding: 8px 16px; border-radius: 999px; border: 1px solid #5cf2b466; background: rgba(92, 242, 180, 0.12); color: #bfffe9; font-weight: 600; box-shadow: 0 0 24px #5cf2b422; }
.heroes { margin: 12px 0 40px; max-width: 760px; }
.heroes-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 10px; margin-bottom: 14px; border-bottom: 1px solid; border-image: linear-gradient(90deg, #5cf2b488, #a37cff44, transparent) 1; }
.hero-list { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 12px; }
.hero-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  transition: transform .25s, box-shadow .25s;
}
.hero-card:hover { transform: translateY(-2px); box-shadow: 0 16px 40px #0007, 0 0 30px #5cf2b41a; }
.hero-card.ironman { --aurora-edge: linear-gradient(120deg, #ffc84a99, #ff7ac644 40%, #ffffff10); }
.hero-info { display: flex; flex-direction: column; min-width: 0; }
.hero-name { font-family: var(--serif); font-weight: 700; font-size: 20px; letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; }
.hero-swatch { width: 26px; height: 26px; border-radius: 50%; animation: breathe 4s ease-in-out infinite; }
@keyframes breathe { 50% { filter: brightness(1.25); transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .hero-swatch { animation: none; } }
.light-0 { background: #5cf2b4; box-shadow: 0 0 12px #5cf2b4; }
.light-1 { background: #3fd3e6; box-shadow: 0 0 12px #3fd3e6; }
.light-2 { background: #a37cff; box-shadow: 0 0 12px #a37cff; }
.light-3 { background: #ff7ac6; box-shadow: 0 0 12px #ff7ac6; }
.light-4 { background: #ffc84a; box-shadow: 0 0 12px #ffc84a; }
.badge-ironman { color: var(--gold); font-weight: 800; }
.hero-delete summary { list-style: none; cursor: pointer; font-size: 15px; }
.hero-delete summary::-webkit-details-marker { display: none; }
.hero-delete[open] { grid-column: 1 / -1; }
.delete-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.delete-form p { flex-basis: 100%; margin: 0; }
input, select {
  font: inherit;
  color: var(--ink);
  background: rgba(4, 6, 16, 0.7);
  border: 1px solid var(--edge);
  border-radius: 12px;
  padding: 8px 12px;
  transition: border-color .2s, box-shadow .2s;
}
input:focus { border-color: #5cf2b4aa; box-shadow: 0 0 0 3px #5cf2b422, 0 0 18px #5cf2b422; outline: none; }
.btn.danger { background: rgba(255, 90, 110, 0.15); border-color: #ff6b6b88; color: #ffc0c6; }
.hq-foot { margin-top: 8px; }
@media (max-width: 600px) { .hero-card { grid-template-columns: auto minmax(0, 1fr); } }

/* ---------- character creation ---------- */

.creator { position: fixed; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr) 400px; }
.creator-view { position: relative; min-width: 0; }
.creator-view canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.creator-view canvas:active { cursor: grabbing; }
.creator-panel {
  overflow-y: auto;
  padding: 64px 26px 28px;
  background: rgba(7, 9, 22, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-left: 1px solid var(--edge);
  box-shadow: -24px 0 60px #0008;
}
.creator.is-ironman .creator-panel { border-left-color: #ffc84a66; }
.creator-title { font-family: var(--serif); font-size: 26px; line-height: 1.15; letter-spacing: .02em; font-weight: 700; margin: 0 0 18px; }
.random-btn { margin-bottom: 14px; }
.field { margin: 0 0 14px; }
.field-label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; color: var(--muted); margin-bottom: 6px; }
.field input:not([type]) , #creator-name { width: 100%; font-size: 18px; font-weight: 700; }
.seg { display: flex; gap: 6px; }
.seg-btn { flex: 1; border: 1px solid var(--edge); border-radius: 999px; background: rgba(12, 16, 34, 0.6); padding: 7px 10px; font-weight: 600; font-size: 15px; transition: border-color .25s, box-shadow .25s; }
.seg-btn[aria-checked="true"] { border-color: transparent; background: linear-gradient(120deg, #5cf2b4, #3fd3e6); color: #03110c; box-shadow: 0 0 18px #5cf2b455; }
.is-ironman .seg-btn[aria-checked="true"]:last-child { background: linear-gradient(120deg, #ffc84a, #ff7ac6); color: #1a1205; box-shadow: 0 0 18px #ffc84a55; }
@media (hover: hover) { .seg-btn:hover:not([aria-checked="true"]) { border-color: #5cf2b488; box-shadow: 0 0 14px #5cf2b422; } }
/* the figures: a grid of chips instead of one long pill */
.seg.figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; border: 0; border-radius: 0; overflow: visible; }
.seg.figures .seg-btn { padding: 6px 8px; font-size: 14px; }
.seg.figures .seg-btn:nth-child(4) { grid-column: 1 / span 1; }
.seg.figures .seg-btn:last-child { grid-column: span 2; }
.swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.swatch {
  width: 28px; height: 28px; padding: 0;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--c);
}
.swatch { box-shadow: 0 0 10px var(--c); }
.swatch[aria-checked="true"] { border-color: #fff; box-shadow: 0 0 0 3px #ffffff22, 0 0 22px var(--c); }
.check { display: flex; align-items: center; gap: 8px; margin: -4px 0 14px; font-size: 15px; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--aurora); }
.mode-note { margin: -6px 0 14px; min-height: 2.9em; }
.creator-actions { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.creator-panel .error { margin: 6px 0 12px; }
.btn:disabled { opacity: .5; cursor: default; }
@media (max-width: 860px) {
  .creator { grid-template-columns: 1fr; grid-template-rows: 45vh minmax(0, 1fr); }
  .creator-panel { border-left: 0; border-top: 3px solid var(--ink); padding-top: 20px; box-shadow: none; }
}

/* ---------- stations in the Lighthold ---------- */

.station-tag {
  position: absolute;
  left: 0;
  top: 0;
  padding: 3px 10px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--night) 72%, transparent);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  transition: border-color .12s, color .12s, background-color .12s;
}
.station-tag.hover { border-color: var(--aurora); color: var(--aurora-ink); background: var(--aurora); }
.station-tag[hidden] { display: none; }
.station-panel {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  width: min(380px, calc(100vw - 44px));
  padding: 6px 22px 16px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: var(--night-2);
  box-shadow: 6px 6px 0 var(--shadow);
}
.station-panel[hidden] { display: none; }
.station-panel h2 { margin: 14px 36px 2px 0; font-size: 24px; letter-spacing: -.02em; }
.station-who { margin: 0 0 8px; color: var(--teal); font-weight: 700; font-size: 15px; }
.station-panel p { color: var(--ink-soft); font-size: 16px; }
.station-soon { padding: 8px 12px; border: 2px dashed var(--line); border-radius: 8px; color: var(--muted) !important; font-size: 14px !important; }
.station-close {
  position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px; padding: 0;
  border: 2px solid var(--ink); border-radius: 50%;
  background: none; font-size: 18px; font-weight: 800; line-height: 1;
}
@media (hover: hover) { .station-close:hover { background: var(--aurora); color: var(--aurora-ink); border-color: var(--aurora); } }

/* ---------- in a rift ---------- */

.minimap {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 200px;
  height: 200px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: color-mix(in srgb, #02030a 70%, transparent);
  pointer-events: none;
  transition: width .15s, height .15s, top .15s, right .15s;
}
.minimap.big {
  top: 50%;
  right: 50%;
  width: min(80vh, 80vw);
  height: min(80vh, 80vw);
  transform: translate(50%, -50%);
  background: color-mix(in srgb, #02030a 82%, transparent);
  border-color: var(--ink);
}
.rift-banner {
  position: absolute;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 26px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--night-2);
  box-shadow: 5px 5px 0 var(--violet);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -.02em;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity .8s, transform .8s;
}
.rift-banner.gone { opacity: 0; transform: translate(-50%, -14px); }
.station-panel .btn { margin: 4px 0 8px; }

/* ---------- the combat bar ---------- */

.hud {
  position: absolute;
  left: 50%;
  bottom: 54px;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 14px;
  pointer-events: none;
}
.orb {
  position: relative;
  width: 86px;
  height: 86px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  overflow: hidden;
  background: #05060c;
  box-shadow: 4px 4px 0 var(--shadow);
}
.orb-fill { position: absolute; left: 0; right: 0; bottom: 0; transition: height .12s; }
.orb.life .orb-fill { background: radial-gradient(circle at 40% 30%, #ff8a8a, #c0263a 55%, #5a0c18); }
.orb.mana .orb-fill { background: radial-gradient(circle at 40% 30%, #9fd0ff, #2f5fd8 55%, #10205a); }
.orb-text { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; font-size: 18px; text-shadow: 0 1px 3px #000; }
.slots { display: flex; gap: 6px; padding: 6px; border: 2px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--night) 82%, transparent); }
.slot { position: relative; width: 48px; height: 48px; border: 2px solid var(--ink); border-radius: 8px; background: var(--night-2); overflow: hidden; }
.slot.empty { border-color: var(--line); opacity: .55; }
.slot kbd { position: absolute; left: 2px; top: 2px; font-size: 9px; padding: .1em .3em; }
.slot-count { position: absolute; right: 4px; bottom: 2px; font-weight: 900; font-size: 13px; }
.slot-icon { position: absolute; inset: 9px; border-radius: 50%; }
.slot.roll .slot-icon { background: conic-gradient(from 200deg, transparent 0 25%, var(--ink-soft) 25% 60%, transparent 60%); border-radius: 50%; inset: 12px; }
.slot.flare .slot-icon { background: radial-gradient(circle, #fff 0 15%, var(--aurora) 30%, transparent 70%); }
.slot.pot .slot-icon { inset: 12px 15px 8px; border-radius: 40% 40% 45% 45%; }
.slot.pot.life .slot-icon { background: linear-gradient(#ff8a8a, #c0263a); }
.slot.pot.mana .slot-icon { background: linear-gradient(#9fd0ff, #2f5fd8); }
.slot.spent .slot-icon { filter: grayscale(1) brightness(.5); }
.slot-cd { position: absolute; inset: 0; background: conic-gradient(#000b var(--cd, 0deg), transparent 0); }

.floater { position: absolute; left: 0; top: 0; font-weight: 900; font-size: 18px; pointer-events: none; text-shadow: 0 2px 3px #000, 0 0 2px #000; white-space: nowrap; }
.floater.hit { color: #f4f0e6; }
.floater.crit { color: var(--gold); font-size: 24px; }
.floater.hurt { color: #ff6b6b; }
.floater.heal { color: var(--aurora); }
.floater.info { color: var(--teal); font-size: 15px; }

.death { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle, #1a050cbb, #000e); animation: fade-in .8s; }
.death-box { text-align: center; }
.death-box h2 { font-size: clamp(36px, 6vw, 64px); margin: 0 0 8px; letter-spacing: -.03em; color: #ff6b6b; }
.death-box p { color: var(--ink-soft); margin: 0 0 22px; }
@keyframes fade-in { from { opacity: 0; } }

.enemy-tag {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}
.enemy-tag[hidden] { display: none; }
.enemy-name { font-weight: 900; font-size: 16px; color: #e0c8ff; text-shadow: 0 1px 3px #000; }
.enemy-tag.elite .enemy-name { color: var(--gold); }
.enemy-bar { width: 260px; height: 12px; border: 2px solid var(--ink); border-radius: 6px; background: #120814; overflow: hidden; }
.enemy-bar span { display: block; height: 100%; background: linear-gradient(#e0507a, #8a1a3a); transition: width .1s; }

/* ---------- run state, toasts ---------- */

.run-box {
  position: absolute;
  top: 60px;
  left: 16px;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 4px 10px;
  padding: 8px 12px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--night) 80%, transparent);
  font-size: 14px;
  font-weight: 700;
  pointer-events: none;
}
.run-level { grid-column: 1 / -1; font-size: 15px; font-weight: 900; }
.charge { width: 150px; height: 10px; border: 2px solid var(--ink); border-radius: 6px; background: #0a0716; overflow: hidden; }
.charge-fill { display: block; height: 100%; background: linear-gradient(90deg, #5a2dbf, #a37cff); transition: width .2s; }
.run-box.full .charge-fill { background: linear-gradient(90deg, #a37cff, #ff7ac6); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { filter: brightness(1.5); } }
.charge-text { color: #c9b6ff; }
.run-points { grid-column: 1 / -1; color: var(--gold); }
.floater.points { color: var(--gold); font-size: 15px; }
.toasts { position: absolute; top: 76px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast { padding: 7px 16px; border: 2px solid var(--violet); border-radius: 999px; background: var(--night-2); font-weight: 700; font-size: 15px; transition: opacity .6s; }
.toast.important { border-color: var(--rose); box-shadow: 4px 4px 0 var(--violet); font-size: 17px; max-width: 70vw; text-align: center; border-radius: 14px; }
.toast.gone { opacity: 0; }
.slot.skill .slot-icon { inset: 8px; border-radius: 6px; }
.slot.skill-erdspalter .slot-icon { background: linear-gradient(160deg, transparent 40%, #8a8fae 40% 48%, transparent 48% 58%, #8a8fae 58% 64%, transparent 64%), radial-gradient(circle at 50% 80%, #6a5030, #2a1a10); }
.slot.skill-faecherschuss .slot-icon { background: conic-gradient(from 160deg at 50% 90%, transparent 0 0deg, #9fffe0 2deg 4deg, transparent 4deg 10deg, #9fffe0 10deg 12deg, transparent 12deg 18deg, #9fffe0 18deg 20deg, transparent 20deg 26deg, #9fffe0 26deg 28deg, transparent 28deg 34deg, #9fffe0 34deg 36deg, transparent 36deg), #11202a; }
.slot.skill-feuerball .slot-icon { background: radial-gradient(circle at 45% 55%, #fff6c0, #ff9a40 35%, #c0301a 65%, #200805 80%); border-radius: 50%; }
.slot.no-mana .slot-icon { filter: saturate(.2) brightness(.6); }
.slot.no-mana { border-color: #2f5fd8; }
.run-sparks { grid-column: 1 / -1; color: var(--aurora); font-size: 13px; }
.enemy-tag.boss .enemy-name { font-size: 20px; color: #ff9ad0; letter-spacing: -.01em; }
.enemy-tag.boss .enemy-bar { width: 440px; height: 16px; }
.enemy-tag.boss .enemy-bar span { background: linear-gradient(#b05aff, #5a1aa0); }

/* ---------- the escape ---------- */

.aurora-arrow { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; pointer-events: none; color: var(--aurora); font-weight: 900; text-shadow: 0 0 10px var(--aurora), 0 2px 3px #000; }
.arrow-head { font-size: 34px; line-height: 1; }
.arrow-dist { font-size: 14px; }
.aurora-hold { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); width: 220px; height: 12px; border: 2px solid var(--ink); border-radius: 6px; background: #071410; overflow: hidden; pointer-events: none; }
.aurora-hold[hidden] { display: none; }
.aurora-hold span { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--aurora)); }
.death.won { background: radial-gradient(circle, #05201acc, #000e); }
.death.won h2 { color: var(--aurora); }
.won-loot { margin: 0 auto 22px; max-width: 420px; }
.won-loot h3 { font-family: var(--serif); font-weight: 700; letter-spacing: .06em; font-size: 15px; color: var(--muted); margin: 0 0 8px; text-transform: uppercase; }
.won-loot ul { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 4px; }
.won-loot li { color: var(--c); font-weight: 600; text-shadow: 0 0 12px color-mix(in srgb, var(--c) 50%, transparent); }
.won-loot p { margin: 0; color: var(--muted); font-size: 15px; }
.won-stats { display: grid; grid-template-columns: repeat(3, auto); gap: 6px 26px; justify-content: center; margin: 0 0 22px; }
.won-stats div { display: flex; flex-direction: column; }
.won-stats dt { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.won-stats dd { margin: 0; font-size: 24px; font-weight: 900; }
.rift-choice { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 10px; }
.mute-btn { width: 34px; height: 34px; padding: 0; border: 2px solid var(--ink); border-radius: 50%; background: color-mix(in srgb, var(--night) 70%, transparent); font-size: 15px; line-height: 1; }
@media (hover: hover) { .mute-btn:hover { background: var(--aurora); } }
.hurt-vignette { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .35s; background: radial-gradient(ellipse at center, transparent 55%, #c0102aaa 100%); }

/* ======================================================================
   The in-game interface: dark glass with a thin edge of light, and the
   aurora's colours wherever something matters. Only on game pages
   (body.game); the website keeps its family look.
   ====================================================================== */

@font-face {
  font-family: "Cinzel";
  src: url("fonts/cinzel/cinzel-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Cinzel";
  src: url("fonts/cinzel/cinzel-latin-ext.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

body.game {
  --glass: rgba(7, 9, 20, 0.72);
  --glass-edge: rgba(190, 220, 255, 0.16);
  --aurora-ring: conic-gradient(from var(--spin, 0deg), #5cf2b4, #3fd3e6, #a37cff, #ff7ac6, #5cf2b4);
  --text-light: #e6ecff;
  --text-dim: #9aa4c4;
  --fantasy: "Cinzel", Georgia, serif;
}
@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spin { to { --spin: 360deg; } }

/* the glass shared by panels */
body.game .run-box,
body.game .station-panel,
body.game .toast,
body.game .minimap,
body.game .enemy-bar,
body.game .rift-banner {
  border: 1px solid var(--glass-edge);
  background: var(--glass);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 30px #0009, inset 0 1px 0 #ffffff12;
}

/* ---------- the bar ---------- */

body.game .hud { bottom: 46px; gap: 0; align-items: center; }
body.game .slots {
  gap: 6px;
  padding: 9px 16px;
  margin: 0 -12px;
  border: 1px solid var(--glass-edge);
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 30px #000a, inset 0 1px 0 #ffffff12;
  position: relative;
  z-index: 1;
}
body.game .slot-sep { width: 1px; margin: 6px 4px; background: linear-gradient(#0000, #a37cff88, #0000); }
body.game .slot {
  width: 48px;
  height: 48px;
  border: 1px solid #ffffff1c;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #151a30, #05060c 75%);
  box-shadow: inset 0 0 10px #000;
  transition: box-shadow .25s, border-color .25s;
}
body.game .slot.empty { opacity: .35; }
body.game .slot.skill:not(.cooling):not(.no-mana), body.game .slot.flare:not(.cooling) { border-color: #5cf2b455; box-shadow: inset 0 0 10px #000, 0 0 10px #5cf2b422; }
body.game .slot-icon { inset: 9px; border-radius: 50%; background: none !important; display: grid; place-items: center; }
body.game .slot-icon svg { width: 100%; height: 100%; }
body.game .slot.flare .slot-icon svg, body.game .slot.skill-faecherschuss .slot-icon svg { filter: drop-shadow(0 0 4px #5cf2b4cc); }
body.game .slot.skill-feuerball .slot-icon svg { filter: drop-shadow(0 0 4px #ff7a2acc); }
body.game .slot kbd {
  left: 50%; right: auto; top: auto; bottom: -3px;
  transform: translateX(-50%);
  font: 700 9px/1 var(--font);
  padding: 1px 4px;
  border: 1px solid #ffffff22;
  border-radius: 999px;
  background: #05060c;
  color: var(--text-dim);
}
body.game .slot-count { right: auto; left: 3px; top: 1px; bottom: auto; color: var(--text-light); text-shadow: 0 1px 2px #000; font-size: 11px; }
body.game .slot-cd { background: conic-gradient(#000c var(--cd, 0deg), transparent 0); border-radius: 50%; }
body.game .slot-secs { position: absolute; inset: 0; display: grid; place-items: center; font: 700 16px/1 var(--fantasy); color: var(--text-light); text-shadow: 0 1px 3px #000, 0 0 6px #000; }
body.game .slot.no-mana .slot-icon { filter: grayscale(.7) brightness(.55); }
body.game .slot.no-mana { box-shadow: inset 0 0 12px #4a6aff88; }

/* ---------- orbs of light ---------- */

body.game .orb {
  width: 100px;
  height: 100px;
  border: 0;
  border-radius: 50%;
  position: relative;
  z-index: 2;
  background: radial-gradient(circle, #04050c 60%, #000 100%);
  box-shadow: 0 10px 30px #000c, inset 0 0 20px #000;
}
/* a thin ring in the aurora's colours, turning slowly */
body.game .orb::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--aurora-ring);
  -webkit-mask: radial-gradient(circle, transparent 0 calc(50% - 2.5px), #000 calc(50% - 1.5px));
  mask: radial-gradient(circle, transparent 0 calc(50% - 2.5px), #000 calc(50% - 1.5px));
  animation: spin 14s linear infinite;
  opacity: .8;
}
body.game .orb-fill { overflow: hidden; border-radius: 0 0 50px 50px; transition: height .2s ease-out; }
body.game .orb.life .orb-fill { background: linear-gradient(#ff8aa8, #d8264e 55%, #4a0618); box-shadow: 0 0 24px #ff3a6a66; }
body.game .orb.mana .orb-fill { background: linear-gradient(#8ae6ff, #4a6aff 55%, #1a0a5a); box-shadow: 0 0 24px #5a8aff66; }
/* the liquid's surface: two slowly turning rounded squares cut a wave */
body.game .orb-wave {
  position: absolute;
  left: 50%;
  top: 0;
  width: 220%;
  height: 220%;
  margin-left: -110%;
  margin-top: -206%;
  border-radius: 42%;
  background: #04050c;
  animation: wave 7s linear infinite;
  opacity: .9;
}
body.game .orb-wave.two { border-radius: 45%; opacity: .45; animation-duration: 11s; animation-direction: reverse; }
@keyframes wave { to { transform: rotate(360deg); } }
body.game .orb-glass {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(ellipse 40% 26% at 38% 22%, #ffffff40, #fff0 70%),
    radial-gradient(circle, #fff0 62%, #ffffff10 72%, #0005 100%);
  pointer-events: none;
}
body.game .orb-text { font: 700 19px/1 var(--fantasy); color: #fff; text-shadow: 0 2px 4px #000, 0 0 8px #000; z-index: 1; }
body.game .orb.life.low { animation: lowlife 1s ease-in-out infinite; }
@keyframes lowlife { 50% { box-shadow: 0 0 34px #ff2a5a, inset 0 0 20px #000; } }

/* ---------- panels and words ---------- */

body.game .run-box { border-radius: 24px; padding: 12px 18px; }
body.game .run-level { font: 700 16px/1.2 var(--fantasy); color: var(--text-light); letter-spacing: .06em; }
body.game .charge { border: 1px solid #ffffff1a; border-radius: 999px; height: 7px; background: #04050c; overflow: hidden; }
body.game .charge-fill { background: linear-gradient(90deg, #5cf2b4, #3fd3e6, #a37cff); box-shadow: 0 0 10px #5cf2b488; }
body.game .station-panel { border-radius: 28px; }
body.game .station-panel h2 { font-family: var(--fantasy); font-weight: 700; color: var(--text-light); letter-spacing: .04em; }
body.game .station-close { border-color: var(--glass-edge); color: var(--text-light); }
body.game .toast { border-radius: 999px; font-family: var(--fantasy); font-weight: 600; color: var(--text-light); letter-spacing: .03em; }
body.game .toast.important { border-color: #a37cff88; font-size: 18px; box-shadow: 0 0 24px #a37cff44, 0 10px 30px #0009; border-radius: 18px; }
body.game .enemy-name { font: 700 17px/1.2 var(--fantasy); letter-spacing: .05em; color: #e6d0ff; text-shadow: 0 2px 4px #000, 0 0 10px #6a2dff88; }
body.game .enemy-tag.boss .enemy-name { font-size: 24px; color: #ffc8f0; }
body.game .enemy-bar { border-radius: 999px; height: 8px; overflow: hidden; }
body.game .enemy-bar span { background: linear-gradient(90deg, #6a2dff, #c58bff); box-shadow: 0 0 8px #a37cff; }
body.game .enemy-tag.boss .enemy-bar span { background: linear-gradient(90deg, #ff7ac6, #a37cff); }
body.game .minimap { border-radius: 50%; box-shadow: 0 0 0 1px #5cf2b433, 0 0 26px #5cf2b41a, 0 10px 30px #0009; }
body.game .minimap.big { border-radius: 28px; }
body.game .floater { font-family: var(--fantasy); font-weight: 700; -webkit-text-stroke: 1px #000a; }
body.game .floater.crit { font-size: 28px; color: #fff0b0; text-shadow: 0 0 12px #ffc84a, 0 2px 3px #000; }
body.game .death-box h2 { font: 700 clamp(40px, 7vw, 76px)/1.05 var(--fantasy); letter-spacing: .04em; text-shadow: 0 0 30px #c0102a88, 0 4px 8px #000; }
body.game .death.won h2 { text-shadow: 0 0 30px #5cf2b488, 0 4px 8px #000; }
body.game .won-stats dd { font-family: var(--fantasy); }
body.game .rift-banner { font-family: var(--fantasy); font-weight: 700; letter-spacing: .08em; border-radius: 999px; }
body.game .hud-hint { bottom: 8px; font-size: 12px; border-color: #ffffff14; background: #04050ccc; color: var(--text-dim); }
body.game .station-tag { font-family: var(--fantasy); border: 1px solid var(--glass-edge); background: var(--glass); color: var(--text-light); letter-spacing: .04em; }
body.game .station-tag.hover { background: #e6ecff; color: #05060c; border-color: #fff; box-shadow: 0 0 16px #5cf2b466; }
body.game .game-bar .to-hub,
body.game .mute-btn {
  border: 1px solid var(--glass-edge);
  background: var(--glass);
  color: var(--text-light);
  font-family: var(--fantasy);
  font-weight: 600;
  letter-spacing: .04em;
  box-shadow: 0 4px 14px #0008;
}
body.game .game-bar .to-hub:hover,
body.game .mute-btn:hover { border-color: #5cf2b4aa; box-shadow: 0 0 16px #5cf2b444, 0 4px 14px #0008; }
body.game .small-mark { font-family: var(--fantasy); font-weight: 700; letter-spacing: .08em; color: var(--text-light); }
/* the sound panel under the speaker button */
.sound-ctl { position: relative; }
.sound-panel {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 30;
  display: grid; gap: 10px; min-width: 210px; padding: 14px 16px;
  border: 1px solid var(--glass-edge, #ffffff22); border-radius: 16px;
  background: var(--glass, #070914e0); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 12px 30px #000a; color: var(--text-light, #e6ecff); font-size: 13px;
}
.sound-panel[hidden] { display: none; }
.sound-panel label { display: grid; gap: 4px; }
.sound-panel label.check { display: flex; gap: 8px; align-items: center; }
.sound-panel input[type="range"] { accent-color: #5cf2b4; width: 100%; }
@media (prefers-reduced-motion: reduce) {
  body.game .orb::before, body.game .orb-wave { animation: none; }
}

/* ---------- gear: inventory, stash, character sheet ---------- */

.gear-window {
  position: absolute;
  top: 74px;
  max-height: calc(100% - 214px);
  width: 372px;
  padding: 4px 18px 14px;
  overflow-y: auto;
  scrollbar-width: thin;
  border: 1px solid var(--glass-edge, #ffffff22);
  border-radius: 28px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px #0009, inset 0 1px 0 #ffffff12;
  z-index: 5;
}
.gear-window[hidden] { display: none; }
.inv-window { right: 16px; }
.stash-window, .sheet-window, .shop-window, .smith-window { left: 16px; }
.gear-window h2 { margin: 14px 36px 6px 0; font: 700 22px/1.2 var(--serif); letter-spacing: .05em; color: var(--text-light, var(--ink)); }
.gear-window h3 { margin: 12px 0 6px; font: 700 12px/1.2 var(--serif); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.gear-hint { margin: 8px 0 0; font-size: 12px; line-height: 1.4; color: var(--muted); }

.gear-doll { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.gear-doll .item-cell { aspect-ratio: 1; border-radius: 16px; }
.gear-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.gear-grid .item-cell { aspect-ratio: 1; border-radius: 9px; }
.item-cell {
  --c: #ffffff;
  position: relative;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #ffffff14;
  background: radial-gradient(circle at 50% 40%, #ffffff08, #02030a99 70%);
  color: #ffffff2a;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.item-cell svg { width: 66%; height: 66%; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.item-cell.empty { cursor: default; }
.item-cell.full {
  color: var(--c);
  border-color: color-mix(in srgb, var(--c) 45%, transparent);
  background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--c) 22%, transparent), #02030acc 75%);
  box-shadow: inset 0 0 12px color-mix(in srgb, var(--c) 18%, transparent);
}
.item-cell.full svg { filter: drop-shadow(0 0 3px color-mix(in srgb, var(--c) 70%, transparent)); }
.item-cell.gewoehnlich { color: #e8ecf7; }
.item-cell.legendaer, .item-cell.relikt { box-shadow: inset 0 0 14px color-mix(in srgb, var(--c) 30%, transparent), 0 0 10px color-mix(in srgb, var(--c) 30%, transparent); }
.item-cell.unmet::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: #ff3b5c22; box-shadow: inset 0 0 0 1px #ff6b6b88; }
@media (hover: hover) {
  .item-cell.full:hover { border-color: var(--c); box-shadow: 0 0 14px color-mix(in srgb, var(--c) 45%, transparent), inset 0 0 14px color-mix(in srgb, var(--c) 30%, transparent); transform: translateY(-1px); }
}
.gear-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 14px; }
.gear-gold { color: var(--gold); font-weight: 700; text-shadow: 0 0 10px #ffc84a44; }
.gear-count { color: var(--muted); font-variant-numeric: tabular-nums; }

.stash-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0 10px; }
.stash-tab { padding: 3px 11px; border: 1px solid #ffffff1c; border-radius: 999px; background: #02030a88; color: var(--muted); font-size: 13px; }
.stash-tab.on { border-color: var(--aurora); color: var(--aurora); box-shadow: 0 0 10px #5cf2b433; }

/* the tooltip: one box, and the worn item beside it */
.item-tips { position: absolute; left: 0; top: 0; display: flex; gap: 8px; align-items: flex-start; pointer-events: none; z-index: 9; }
.item-tips[hidden] { display: none; }
.item-tip {
  --c: #ffffff;
  width: 290px;
  padding: 12px 16px 10px;
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
  border-radius: 18px;
  background: #060914ee;
  box-shadow: 0 0 24px color-mix(in srgb, var(--c) 16%, transparent), 0 12px 30px #000c;
  font-size: 14px;
  line-height: 1.4;
}
.tip-head { margin: 0 0 4px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.tip-name { margin: 0; font: 700 18px/1.2 var(--serif); letter-spacing: .03em; color: var(--c); text-shadow: 0 0 14px color-mix(in srgb, var(--c) 45%, transparent); }
.item-tip.gewoehnlich .tip-name { color: #eef2ff; }
.tip-kind { margin: 2px 0 8px; font-size: 12px; color: var(--muted); }
.tip-values { list-style: none; margin: 0; padding: 0; }
.tip-values li { display: flex; justify-content: space-between; gap: 10px; color: var(--ink-soft); }
.tip-values .tip-big { color: var(--ink); font-weight: 700; font-size: 16px; }
.tip-values .tip-affix { color: #9fc4ff; }
.tip-values .tip-own { color: var(--gold); }
.tip-values .tip-effect { margin-top: 6px; color: var(--c); font-style: italic; }
.tip-gap { height: 6px; }
.tip-range { flex: none; color: #ffffff4d; font-size: 12px; font-variant-numeric: tabular-nums; }
.tip-need { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.tip-need .unmet { color: var(--red); font-weight: 700; }
.tip-worth { margin: 4px 0 0; font-size: 12px; color: #ffc84a99; }

/* the character sheet */
.sheet-level { margin: 0; font: 700 15px/1.2 var(--serif); color: var(--aurora); letter-spacing: .06em; }
.sheet-rows { margin: 0; }
.sheet-row { display: grid; grid-template-columns: 1fr auto; padding: 4px 10px; border-radius: 10px; font-size: 14px; }
.sheet-row dt { color: var(--ink-soft); }
.sheet-row dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.sheet-row.open-able { cursor: pointer; }
.sheet-row.open-able dt::after { content: " ›"; color: var(--muted); }
.sheet-row.open dt::after { content: " ⌄"; }
@media (hover: hover) { .sheet-row.open-able:hover { background: #ffffff0a; } }
.sheet-row.open { background: #5cf2b40d; box-shadow: inset 0 0 0 1px #5cf2b422; }
.sheet-sources { grid-column: 1 / -1; list-style: none; margin: 6px 0 2px; padding: 6px 0 0; border-top: 1px solid #ffffff12; }
.sheet-sources li { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 13px; }
.sheet-sources li span { font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.sheet-sources .sheet-note { margin-top: 4px; color: var(--teal); }

/* experience: a band of light along the bottom of the slots */
.xp { position: absolute; left: 26px; right: 26px; bottom: -1px; height: 3px; border-radius: 999px; background: #ffffff10; overflow: hidden; }
.xp-fill { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #a37cff, #5cf2b4); box-shadow: 0 0 8px #5cf2b4aa; transition: width .4s; }
.won-xp { color: #bfffe9 !important; font-weight: 700; text-shadow: 0 0 12px #5cf2b466; }

/* ---------- the Firmament ---------- */

.firm-window { position: absolute; inset: 0; z-index: 8; background: #03040b; }
.firm-window[hidden] { display: none; }
.firm-sky { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.firm-side {
  position: absolute; top: 74px; right: 16px; bottom: 24px; width: 320px;
  padding: 4px 18px 14px; overflow-y: auto; scrollbar-width: thin;
  border: 1px solid var(--glass-edge, #ffffff22); border-radius: 28px;
  background: color-mix(in srgb, #060914 78%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px #0009, inset 0 1px 0 #ffffff12;
}
.firm-side h2 { margin: 14px 36px 6px 0; font: 700 24px/1.2 var(--serif); letter-spacing: .06em; color: var(--text-light, var(--ink)); }
.firm-side h3 { margin: 14px 0 6px; font: 700 12px/1.2 var(--serif); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.firm-points { margin: 0; font: 700 17px/1.3 var(--serif); color: var(--aurora); text-shadow: 0 0 14px #5cf2b455; }
.firm-points.none { color: var(--muted); text-shadow: none; }
.firm-pending { margin: 4px 0 0; color: var(--ink-soft); font-size: 14px; }
.firm-changes { list-style: none; margin: 0; padding: 0; }
.firm-changes li { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--ink-soft); padding: 2px 0; }
.firm-changes .up { color: var(--aurora); font-variant-numeric: tabular-nums; }
.firm-changes .down { color: var(--red); font-variant-numeric: tabular-nums; }
.firm-changes .firm-named { color: var(--gold); }
.firm-buttons { display: flex; gap: 8px; margin: 14px 0 4px; flex-wrap: wrap; }
.firm-tip {
  --c: #bfe8ff;
  position: absolute; left: 0; top: 0; width: 300px; pointer-events: none; z-index: 2;
  padding: 10px 14px; border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  background: #060914ee; box-shadow: 0 0 22px color-mix(in srgb, var(--c) 18%, transparent), 0 12px 30px #000c;
  font-size: 13px; line-height: 1.45; color: var(--ink-soft);
}
.firm-tip[hidden] { display: none; }
.firm-tip h4 { margin: 0; font: 700 17px/1.25 var(--serif); color: var(--c); letter-spacing: .03em; }
.firm-tip p { margin: 3px 0 0; }
.firm-tip .firm-tip-kind { margin: 0 0 6px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.firm-tip .firm-tip-state { margin-top: 8px; color: #ffffff80; font-size: 12px; }

/* the bar's places in the Firmament, and the picker */
.firm-bar { display: flex; gap: 6px; }
.firm-bar .slot { width: 46px; height: 46px; padding: 0; border-radius: 50%; border: 1px solid #ffffff22; background: radial-gradient(circle, #ffffff08, #02030a); cursor: pointer; }
.firm-bar .slot.skill { border-color: #5cf2b466; box-shadow: 0 0 10px #5cf2b422; }
.firm-bar .slot-icon { position: absolute; inset: 8px; display: grid; place-items: center; }
.firm-bar .slot-icon svg { width: 100%; height: 100%; }
.firm-bar kbd { position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); font-size: 9px; color: var(--muted); background: none; border: 0; }
.slot .slot-count { position: absolute; right: 3px; bottom: 1px; font: 700 10px/1 var(--serif); color: #ffd27a; text-shadow: 0 1px 2px #000; }
body.game .slot.skill, body.game .slot.empty { cursor: pointer; }
.bar-picker {
  position: absolute; z-index: 12; padding: 10px 12px; max-width: 330px;
  border: 1px solid var(--glass-edge, #ffffff22); border-radius: 20px;
  background: #060914f0; box-shadow: 0 0 24px #5cf2b422, 0 12px 30px #000c;
}
.bar-picker[hidden] { display: none; }
.bar-picker p { margin: 0 0 8px; font: 700 13px/1.3 var(--serif); letter-spacing: .06em; color: var(--text-light, var(--ink)); }
.bar-picker-grid { display: grid; grid-template-columns: repeat(5, 48px); gap: 6px; }
.bar-pick { position: relative; width: 48px; height: 48px; padding: 7px; border: 1px solid #ffffff1c; border-radius: 50%; background: radial-gradient(circle, #ffffff0a, #02030a); color: var(--muted); font-size: 18px; }
.bar-pick svg { width: 100%; height: 100%; }
.bar-pick span { position: absolute; right: 2px; bottom: 0; font: 700 10px/1 var(--serif); color: #ffd27a; }
.bar-pick.on { border-color: var(--aurora); box-shadow: 0 0 12px #5cf2b455; }
@media (hover: hover) { .bar-pick:hover { border-color: #5cf2b4aa; transform: translateY(-1px); } }

/* the Northern Light boards */
.firm-north h4 { margin: 10px 0 4px; font: 700 12px/1.2 var(--serif); letter-spacing: .12em; text-transform: uppercase; color: #9fe8ff; }
.firm-north-points { margin: 0 0 4px; font: 700 14px/1.3 var(--serif); color: #9fe8ff; text-shadow: 0 0 12px #3fd3e655; }
.firm-north-row { display: grid; grid-template-columns: 1fr auto 26px; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-soft); padding: 2px 0; }
.firm-north-have { color: var(--muted); font-variant-numeric: tabular-nums; }
.firm-north-plus { width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 1px solid #3fd3e688; background: #02030a; color: #9fe8ff; font-weight: 800; }
.firm-north-plus:disabled { opacity: .3; cursor: default; }
.xp.north .xp-fill { background: linear-gradient(90deg, #3fd3e6, #5cf2b4, #a37cff); }

/* the merchant, and asking before what can't be undone */
.shop-offer { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 12px; margin: 10px 0 4px; padding: 8px; border-radius: 18px; background: linear-gradient(90deg, #b07cff22, transparent); }
.shop-offer .item-cell { aspect-ratio: 1; border-radius: 16px; }
.shop-offer span { font: 700 14px/1.2 var(--serif); letter-spacing: .06em; color: #d8c0ff; }
.shop-grid { grid-template-columns: repeat(5, 1fr); }
.shop-grid .item-cell { border-radius: 14px; }
.tip-price { margin: 6px 0 0; font-weight: 700; color: var(--gold); }
.tip-price.unmet { color: var(--red); }
.confirm-back { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: #02030ab0; }
.confirm-box { width: min(420px, calc(100% - 32px)); padding: 18px 22px; border-radius: 24px; border: 1px solid #a37cff66; background: #060914f2; box-shadow: 0 0 30px #a37cff33, 0 14px 40px #000c; }
.confirm-box p { margin: 0 0 12px; color: var(--ink-soft); }
.confirm-input { width: 100%; margin: 0 0 12px; padding: 8px 12px; border-radius: 12px; border: 1px solid #ffffff2a; background: #02030a; color: var(--ink); font: inherit; }
.confirm-buttons { display: flex; gap: 8px; flex-wrap: wrap; }

/* the smith */
.smith-mats { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.mat { padding: 4px 10px; border-radius: 999px; border: 1px solid #ffffff1a; background: #02030a99; font-size: 13px; color: var(--ink-soft); }
.mat b { font-variant-numeric: tabular-nums; }
.mat-eisensplitter b { color: #c9d0ea; }
.mat-daemmerstaub b { color: #b07cff; }
.mat-sonnengold b { color: var(--gold); }
.smith-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.smith-yield { margin: 8px 0 0; display: grid; gap: 2px; font-size: 13px; }
.smith-yield div { display: grid; grid-template-columns: 1fr auto; }
.smith-yield dd { margin: 0; color: var(--muted); }
.smith-field { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 8px; margin: 6px 0; font-size: 14px; color: var(--ink-soft); }
.smith-field select { padding: 6px 10px; border-radius: 12px; border: 1px solid #ffffff2a; background: #02030a; color: var(--ink); font: inherit; font-size: 14px; }
.smith-cost { margin: 10px 0 8px; font-weight: 700; color: var(--gold); }
.smith-cost.unmet { color: var(--red); }
.smith-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 4px; }
.smith-list li { --c: var(--ink); display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 6px 10px; border-radius: 12px; background: #ffffff08; font-size: 13px; cursor: pointer; }
.smith-list li.locked { opacity: .45; cursor: default; }
.smith-list li.broken .smith-name { text-decoration: line-through; }
.smith-name { color: var(--c); font-weight: 700; }
.smith-price { color: var(--gold); font-variant-numeric: tabular-nums; }
.tip-durab { margin: 6px 0 0; font-size: 12px; color: #ffb060; }
.tip-broken { margin: 6px 0 0; font-size: 12px; font-weight: 700; color: var(--red); }

/* the Hall of the Fallen */
.hall-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; max-height: 52vh; overflow-y: auto; }
.hall-list li { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: center; padding: 6px 10px; border-radius: 16px; background: linear-gradient(90deg, #ffc07012, transparent); }
.hall-list canvas { width: 54px; height: 72px; opacity: .8; filter: drop-shadow(0 0 6px #ffc07033); }
.hall-list div { display: grid; gap: 2px; font-size: 13px; color: var(--muted); }
.hall-list b { font: 700 16px/1.2 var(--serif); letter-spacing: .04em; color: var(--gold); }
.death.fallen h2 { color: var(--gold) !important; text-shadow: 0 0 30px #ffc07066, 0 4px 8px #000 !important; }

/* the mirror */
.mirror { display: grid; justify-items: center; gap: 8px; margin-top: 6px; }
.mirror canvas { width: 120px; height: 160px; border-radius: 50% / 40%; background: radial-gradient(ellipse at 50% 60%, #a37cff22, #02030a 70%); box-shadow: inset 0 0 20px #a37cff33; }
.mirror-row { display: grid; grid-template-columns: 34px 1fr 34px; gap: 8px; align-items: center; width: 100%; text-align: center; font-size: 14px; color: var(--ink-soft); }
.mirror-row button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid #ffffff2a; background: #02030a; color: var(--ink); font-size: 18px; }

/* waiting star points, and a word of warning at the flame */
.star-nudge {
  position: absolute; left: 50%; bottom: 58px; transform: translateX(-50%); z-index: 4;
  padding: 10px 22px; border-radius: 999px; border: 1px solid #5cf2b488;
  background: linear-gradient(90deg, #5cf2b422, #a37cff33); color: #e8fff8;
  font: 700 15px/1.2 var(--serif); letter-spacing: .05em;
  box-shadow: 0 0 22px #5cf2b455, 0 8px 24px #000a;
  animation: nudge 2.4s ease-in-out infinite;
}
.star-nudge[hidden] { display: none; }
@keyframes nudge { 50% { box-shadow: 0 0 34px #5cf2b4aa, 0 8px 24px #000a; } }
.station-warn { padding: 8px 12px; border-radius: 12px; border: 1px solid #ffc84a66; background: #ffc84a14; color: #ffe0a0 !important; font-size: 14px !important; }

/* while the guardian drinks the light */
.boss-note {
  position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%); z-index: 4;
  padding: 8px 20px; border-radius: 999px; border: 1px solid #b05cff99;
  background: #14061ecc; color: #f0d8ff; font: 700 15px/1.3 var(--serif); letter-spacing: .03em;
  box-shadow: 0 0 26px #8a2dff66; pointer-events: none; white-space: nowrap;
}
.boss-note[hidden] { display: none; }
.boss-note.safe { border-color: #5cf2b499; color: #d8fff0; box-shadow: 0 0 26px #5cf2b455; background: #06140fcc; }

/* the tooltip's sections */
.tip-section { margin: 10px 0 4px; padding-top: 6px; border-top: 1px solid #ffffff12; font: 700 10px/1.2 var(--serif); letter-spacing: .16em; text-transform: uppercase; color: #ffffff66; }
.tip-section.attrs { color: #ffd27aaa; }
.tip-section.effect { color: color-mix(in srgb, var(--c) 80%, transparent); }
.tip-values li { align-items: baseline; padding: 1px 0; }
.tip-label { min-width: 0; }
.tip-num { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); }
.tip-values .tip-attr { color: #ffe6b0; }
.tip-values .tip-attr .tip-num { color: #ffd27a; }
.tip-values .tip-affix .tip-num { color: #cfe2ff; }
.tip-values .tip-own .tip-num { color: var(--gold); }
.tip-values .tip-base .tip-num { color: #e8ecf7; }
.tip-values .tip-effect { font-style: italic; }
.tip-values .tip-effect .tip-num { color: var(--c); font-style: normal; }

/* the potions fill again with kills */
body.game .slot.pot::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: conic-gradient(var(--ring, #ff5a6e) var(--meter, 0deg), transparent 0);
  -webkit-mask: radial-gradient(circle, transparent 62%, #000 64%); mask: radial-gradient(circle, transparent 62%, #000 64%);
  opacity: .85; transition: --meter .3s;
}
body.game .slot.pot.mana::before { --ring: #4f8aff; }

/* champions and the affixes of elites */
.enemy-affixes { display: block; font: 600 12px/1.3 var(--serif); letter-spacing: .04em; color: #ffd27acc; text-shadow: 0 1px 3px #000; }
.enemy-affixes:empty { display: none; }
body.game .enemy-tag.champion .enemy-name { color: #b8ccff; text-shadow: 0 2px 4px #000, 0 0 10px #4f7aff88; }
body.game .enemy-tag.champion .enemy-affixes { color: #b8ccffcc; }
.mod-line { margin: 6px 0 0 !important; padding: 8px 12px; border-radius: 12px; border: 1px solid #ff6b8a55; background: #ff6b8a12; color: #ffc8d4 !important; font-size: 14px !important; }
.run-mods { display: block; margin-top: 4px; font-size: 12px; color: #ffb0c0; max-width: 260px; }

/* the potions' charges: a clear badge at the upper right, never cut off */
body.game .slot.pot { overflow: visible; }
body.game .slot.pot .slot-count {
  left: auto; right: -5px; top: -5px; bottom: auto; z-index: 2;
  min-width: 19px; height: 19px; padding: 0 4px; border-radius: 999px;
  display: grid; place-items: center;
  font: 800 12px/1 var(--font); color: #fff;
  background: #05060c; border: 1px solid var(--ring, #ff5a6e);
  box-shadow: 0 0 8px color-mix(in srgb, var(--ring, #ff5a6e) 60%, transparent);
}
body.game .slot.pot.mana .slot-count { border-color: #4f8aff; box-shadow: 0 0 8px #4f8aff99; }
body.game .slot.pot.spent .slot-count { color: var(--muted); border-color: #ffffff33; box-shadow: none; }
.run-leave { grid-column: 1 / -1; justify-self: start; pointer-events: auto; font-size: 12px; padding: 3px 10px; }

/* ---------- ranking tablet ---------- */
.rank-window { left: 50%; transform: translateX(-50%); width: min(620px, calc(100vw - 32px)); }
.rank-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin: 4px 0 6px; }
.rank-season { padding: 6px 10px; border: 1px solid var(--glass-edge, #ffffff33); border-radius: 12px; background: #0b0a1c; color: var(--text-light, #fff); font: inherit; font-size: 14px; }
.rank-modes { display: flex; gap: 6px; }
.rank-modes .btn { margin: 0; }
.rank-modes .btn.on { border-color: var(--aurora); color: var(--aurora); }
.rank-legend, .rank-entry { display: grid; grid-template-columns: 40px 44px 1fr 74px 76px 58px; gap: 8px; align-items: center; }
.rank-rift { white-space: nowrap; }
.rank-window .paper-doll { max-width: 340px; }
.rank-legend { margin: 10px 0 2px; padding: 0 8px; font: 700 11px/1.2 var(--serif); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.rank-legend .rank-col-hero { grid-column: 2 / 4; }
.rank-legend .rank-col-place { text-align: center; }
.rank-legend span:nth-child(n+3) { text-align: right; }
.rank-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rank-entry { width: 100%; padding: 4px 8px; border: 1px solid transparent; border-radius: 16px; background: linear-gradient(90deg, #ffffff08, transparent); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.rank-entry:hover, .rank-entry:focus-visible { border-color: var(--aurora); background: linear-gradient(90deg, #5cf2b41a, transparent); }
.rank-row.own .rank-entry { border-color: #5cf2b466; }
.rank-row.fallen .rank-entry { opacity: .7; }
.rank-place { font: 700 18px/1 var(--serif); text-align: center; color: var(--muted); }
.rank-row.top1 .rank-place { color: #ffd27a; }
.rank-row.top2 .rank-place { color: #d8e4ff; }
.rank-row.top3 .rank-place { color: #ffb08a; }
.rank-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; min-width: 0; }
.rank-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-name small { flex-basis: 100%; color: var(--muted); font-size: 12px; }
.rank-badge { color: #ffd27a; }
.rank-cross { color: var(--muted); }
.rank-rift, .rank-points, .rank-time { text-align: right; font-variant-numeric: tabular-nums; }
.rank-rift { font-weight: 800; color: #c9b6ff; }
.rank-points { color: var(--gold); }
.rank-time { color: var(--muted); font-size: 13px; }
.rank-gap { text-align: center; color: var(--muted); }
.rank-back { margin: 6px 0 4px !important; }
.rank-hero { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: center; }
.rank-hero p { margin: 2px 0; }
.rank-hero-name { margin: 0 !important; font: 700 22px/1.2 var(--serif) !important; text-transform: none !important; letter-spacing: .03em !important; color: var(--text-light, #fff) !important; }
.rank-badge-line { color: #ffd27a; font-size: 13px; }
.rank-skills, .rank-keys { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rank-skills li { display: grid; grid-template-columns: 92px 1fr auto; gap: 8px; align-items: center; }
.rank-skills kbd { padding: 2px 8px; border: 1px solid #ffffff33; border-radius: 8px; font-size: 12px; text-align: center; }
.rank-skills small { color: var(--aurora); }
.rank-keys li { color: #ffd27a; }
.won-rank { color: #ffd27a; font-weight: 700; }
@media (max-width: 560px) {
  .rank-legend, .rank-entry { grid-template-columns: 28px 1fr 56px 64px; }
  .rank-figure, .rank-time, .rank-col-time { display: none; }
  .rank-legend .rank-col-hero { grid-column: auto; }
}

/* ---------- settings: interface size, larger text, colour-blind mode ---------- */
body.game .hud, body.game .run-box, body.game .toasts, body.game .enemy-tag, body.game .boss-note, body.game .hud-hint,
body.game .station-panel, body.game .gear-window, body.game .item-tips, body.game .firm-window, body.game .menu-box,
body.game .confirm-box, body.game .death-box { zoom: var(--ui, 1); }
body.game.big-text .station-panel, body.game.big-text .gear-window, body.game.big-text .item-tips, body.game.big-text .firm-window,
body.game.big-text .menu-box, body.game.big-text .confirm-box, body.game.big-text .death-box, body.game.big-text .toasts, body.game.big-text .hud-hint { zoom: calc(var(--ui, 1) * 1.18); }
body.colorblind .item-cell.full::after { content: attr(data-r); position: absolute; top: 3px; left: 6px; font: 800 11px/1 var(--sans, sans-serif); color: var(--c); text-shadow: 0 0 3px #000; }
body.no-bars .enemy-tag .enemy-bar { display: none; }

/* ---------- the menu (Esc) ---------- */
.menu-back { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; background: #02030ccc; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.menu-back[hidden] { display: none; }
.menu-box { width: min(360px, calc(100vw - 32px)); max-height: calc(100% - 48px); overflow-y: auto; padding: 10px 24px 20px; border: 1px solid var(--glass-edge, #ffffff22); border-radius: 28px; background: var(--glass, #0b0a1cee); box-shadow: 0 20px 60px #000a; }
.menu-box.wide { width: min(640px, calc(100vw - 32px)); }
.menu-box h2 { margin: 14px 0 4px; font: 700 24px/1.2 var(--serif); letter-spacing: .05em; color: var(--text-light, #fff); }
.menu-note { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.menu-list { display: grid; gap: 8px; }
.menu-list .btn { margin: 0; width: 100%; }
.menu-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.menu-head .btn { margin: 10px 0 0; }
.menu-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0 8px; padding-bottom: 8px; border-bottom: 1px solid #ffffff1a; }
.menu-tab { padding: 6px 12px; border: 1px solid transparent; border-radius: 999px; background: none; color: var(--muted); font: 700 13px/1.2 inherit; cursor: pointer; }
.menu-tab:hover { color: var(--text-light, #fff); }
.menu-tab.on { border-color: var(--aurora); color: var(--aurora); }
.menu-body { display: grid; gap: 2px; }
.set-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; min-height: 40px; padding: 4px 8px; border-radius: 12px; }
.set-row:hover { background: #ffffff08; }
.set-row.clash { background: #ff5a6e14; }
.set-label { display: grid; font-size: 15px; }
.set-label small { color: #ff8a9a; font-size: 12px; }
.set-hint { margin: 2px 8px 8px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.set-check input { width: 20px; height: 20px; accent-color: var(--aurora); }
.set-range { display: flex; align-items: center; gap: 10px; }
.set-range input { width: 160px; accent-color: var(--aurora); }
.set-range output { min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
.set-choice { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.set-choice .btn, .set-key, .set-reset { margin: 0 !important; }
.set-choice .btn.on { border-color: var(--aurora); color: var(--aurora); }
.set-key { min-width: 110px; }
.set-key.clash { border-color: #ff5a6e; color: #ff8a9a; }
.set-keys { display: grid; gap: 2px; }
.set-reset { justify-self: start; margin-top: 8px !important; }
@media (max-width: 560px) {
  .set-row { grid-template-columns: 1fr; }
  .set-range input { width: 120px; }
}

/* ---------- the rulebook ---------- */
.rules { position: absolute; inset: 40px max(16px, calc(50% - 480px)); z-index: 41; display: grid; grid-template-rows: auto 1fr; border: 1px solid var(--glass-edge, #ffffff22); border-radius: 28px; background: var(--glass, #0b0a1cf2); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 20px 60px #000a; overflow: hidden; zoom: var(--ui, 1); }
body.big-text .rules { zoom: calc(var(--ui, 1) * 1.18); }
.rules[hidden] { display: none; }
.rules-head { position: relative; display: flex; align-items: center; gap: 16px; padding: 14px 64px 12px 24px; border-bottom: 1px solid #ffffff1a; }
.rules-head h2 { margin: 0; font: 700 24px/1.2 var(--serif); letter-spacing: .05em; color: var(--text-light, #fff); }
.rules-search { flex: 1; min-width: 0; padding: 9px 14px; border: 1px solid #ffffff33; border-radius: 999px; background: #0b0a1c; color: var(--text-light, #fff); font: inherit; }
.rules-search:focus { outline: none; border-color: var(--aurora); }
.rules-head .station-close { top: 50%; transform: translateY(-50%); right: 18px; }
.rules-main { display: grid; grid-template-columns: 200px 1fr; min-height: 0; }
.rules-nav { display: flex; flex-direction: column; gap: 2px; padding: 12px 8px 12px 16px; overflow-y: auto; border-right: 1px solid #ffffff12; }
.rules-nav a { padding: 6px 10px; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: 14px; }
.rules-nav a:hover, .rules-nav a:focus-visible { background: #ffffff0d; color: var(--text-light, #fff); }
.rules-body { padding: 8px 28px 24px; overflow-y: auto; scrollbar-width: thin; }
.rules-section h3 { margin: 18px 0 6px; font: 700 13px/1.2 var(--serif); letter-spacing: .14em; text-transform: uppercase; color: var(--aurora); }
.rules-rule { padding: 10px 0; border-bottom: 1px solid #ffffff0d; }
.rules-rule h4 { margin: 0 0 4px; font-size: 16px; color: var(--text-light, #fff); }
.rules-rule p, .rules-rule li { margin: 4px 0; color: var(--ink-soft, #c9cbe0); font-size: 14px; line-height: 1.5; }
.rules-rule ul { margin: 4px 0; padding-left: 20px; }
.rules-rule mark { background: #5cf2b440; color: inherit; border-radius: 3px; padding: 0 1px; }
.rules-count, .rules-none { color: var(--muted); font-size: 13px; }
@media (max-width: 700px) {
  .rules { inset: 12px; }
  .rules-main { grid-template-columns: 1fr; }
  .rules-nav { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid #ffffff12; max-height: 30vh; }
}
.rift-banner small { display: block; margin-top: 2px; font-size: .62em; letter-spacing: .06em; opacity: .85; }

/* ---------- the collapse countdown ---------- */
.collapse-timer { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); display: grid; gap: 6px; justify-items: center; padding: 8px 18px 10px; border: 1px solid #5cf2b455; border-radius: 18px; background: #050814cc; pointer-events: none; zoom: var(--ui, 1); }
.collapse-timer[hidden] { display: none; }
.collapse-text { font: 700 16px/1.2 var(--fantasy, serif); letter-spacing: .06em; color: #bfffe9; }
.collapse-bar { width: 260px; height: 6px; border-radius: 3px; background: #ffffff1a; overflow: hidden; }
.collapse-bar span { display: block; height: 100%; background: linear-gradient(90deg, #5cf2b4, #bfffe9); transition: width .25s linear; }
.collapse-timer.late { border-color: #ff5a6e88; animation: pulse 0.8s ease-in-out infinite; }
.collapse-timer.late .collapse-text { color: #ff9aa8; }
.collapse-timer.late .collapse-bar span { background: linear-gradient(90deg, #ff5a6e, #ffb0b8); }

/* ---------- the figure with its places, drag and drop ---------- */
.paper-doll { display: grid; grid-template-columns: 54px 1fr 1fr 54px; grid-template-rows: repeat(6, 54px) 54px; gap: 6px; position: relative; }
.paper-doll .item-cell { width: 54px; height: 54px; border-radius: 14px; }
.paper-doll .doll-bottom { justify-self: center; }
.doll-figure { grid-column: 2 / 4; grid-row: 1 / 7; width: 100%; height: 100%; object-fit: contain; pointer-events: none; opacity: .9; }
.paper-doll .item-cell.fits { box-shadow: 0 0 0 2px var(--aurora), 0 0 14px #5cf2b466; }
.paper-doll .item-cell.fits.empty { border-color: var(--aurora); }
.item-cell.dragging { opacity: .35; }
.drop-over { outline: 2px dashed var(--aurora); outline-offset: 3px; border-radius: 14px; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 100; width: 52px; height: 52px; display: grid; place-items: center; border: 2px solid var(--c); border-radius: 14px; background: #0b0a1ce6; color: var(--c); pointer-events: none; box-shadow: 0 8px 24px #000a, 0 0 16px color-mix(in srgb, var(--c) 40%, transparent); }
.drag-ghost svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; }

/* ---------- not enough mana or life: the screen's edge glows ---------- */
.deny-edge { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.deny-edge.mana { box-shadow: inset 0 0 90px 10px #2f6bff99; }
.deny-edge.life { box-shadow: inset 0 0 90px 10px #ff3a5a99; }
.deny-edge.on { animation: deny-glow .55s ease-out; }
@keyframes deny-glow { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
.orb.deny { animation: orb-deny .45s ease-out; }
@keyframes orb-deny { 30% { transform: scale(1.08); filter: brightness(1.6); } }

/* ---------- sliders: an aurora fills exactly the value (0 % empty, 100 % full) ---------- */
input.aurora-range { -webkit-appearance: none; appearance: none; height: 22px; background: transparent; cursor: pointer; --p: 50%; }
input.aurora-range:focus { outline: none; }
input.aurora-range::-webkit-slider-runnable-track {
  height: 10px; border-radius: 5px; border: 1px solid #ffffff22;
  background: linear-gradient(90deg, #5cf2b4, #3fd3e6 35%, #a37cff 70%, #ff7ac6) 0 0 / var(--p) 100% no-repeat, #0b0a1c;
  box-shadow: 0 0 10px color-mix(in srgb, #5cf2b4 calc(var(--p) * 0.4), transparent);
}
input.aurora-range::-moz-range-track { height: 10px; border-radius: 5px; border: 1px solid #ffffff22; background: #0b0a1c; }
input.aurora-range::-moz-range-progress { height: 10px; border-radius: 5px; background: linear-gradient(90deg, #5cf2b4, #3fd3e6 35%, #a37cff 70%, #ff7ac6); }
input.aurora-range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -5px; border-radius: 50%; border: 2px solid #bfffe9; background: #0b0a1c; box-shadow: 0 0 10px #5cf2b4aa; }
input.aurora-range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #bfffe9; background: #0b0a1c; box-shadow: 0 0 10px #5cf2b4aa; }
.sound-panel input.aurora-range { width: 100%; }

/* ---------- the rift charge until the guardian: bottom right ---------- */
.charge-aurora { position: absolute; right: 18px; bottom: 150px; width: 280px; display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: end; padding: 10px 14px 12px; border-radius: 18px; border: 1px solid #ffffff1a; background: #050814cc; pointer-events: none; zoom: var(--ui, 1); --charge: 0%; }
.charge-aurora[hidden] { display: none; }
.ca-label { font: 700 12px/1.2 var(--fantasy, serif); letter-spacing: .08em; color: #c9e8ff; }
.ca-value { font: 800 18px/1 var(--fantasy, serif); color: #bfffe9; text-shadow: 0 0 10px #5cf2b4aa; }
.ca-track { grid-column: 1 / -1; position: relative; height: 14px; border-radius: 7px; background: #060815; border: 1px solid #ffffff1f; box-shadow: inset 0 2px 6px #000a; overflow: hidden; }
.ca-fill { position: absolute; left: 0; top: 0; bottom: 0; width: var(--charge); border-radius: 7px; transition: width .4s ease-out;
  background: linear-gradient(90deg, #1d6b5a, #5cf2b4 35%, #3fd3e6 60%, #a37cff 85%, #ff7ac6);
  box-shadow: 0 0 12px #5cf2b466; }
.charge-aurora.full { border-color: #ff7ac688; }
.charge-aurora.full .ca-fill { animation: ca-pulse 1.2s ease-in-out infinite; }
.charge-aurora.full .ca-value, .charge-aurora.full .ca-label { color: #ffd0ec; }
@keyframes ca-pulse { 50% { filter: brightness(1.45); } }
@media (prefers-reduced-motion: reduce) { .charge-aurora.full .ca-fill { animation: none; } }

/* ---------- merchant and smith, larger and tidier ---------- */
.shop-window, .smith-window { width: min(560px, calc(100vw - 420px)); min-width: 380px; }
.trade-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.gold-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid #ffc84a55; background: #1a1406cc; color: var(--gold); font-size: 16px; white-space: nowrap; }
.gold-chip svg, .price svg, .mat svg, .smith-tab svg, .pick svg, .drop-zone svg, .forge-go svg, .yield-got svg, .btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.price { display: inline-flex; align-items: center; gap: 4px; color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; }
.price svg { width: 14px; height: 14px; }
.price.unmet { color: var(--red); }
.shop-offer { display: grid; grid-template-columns: 72px 1fr; align-items: center; gap: 14px; margin: 10px 0 6px; padding: 10px; border-radius: 20px; border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); background: linear-gradient(90deg, color-mix(in srgb, var(--c) 18%, transparent), transparent); }
.shop-offer .item-cell { width: 72px; height: 72px; border-radius: 18px; }
.shop-offer div { display: grid; gap: 2px; }
.offer-tag { font: 700 11px/1.2 var(--serif); letter-spacing: .14em; text-transform: uppercase; color: #d8c0ff; }
.shop-offer b { color: var(--c); font-size: 16px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { padding: 5px 12px; border-radius: 999px; border: 1px solid #ffffff22; background: #02030a99; color: var(--muted); font: 700 13px/1.2 inherit; cursor: pointer; }
.chip.on { border-color: var(--aurora); color: var(--aurora); }
.ware-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.ware { display: grid; justify-items: center; gap: 4px; padding: 8px 6px; border-radius: 16px; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 10%, transparent), #ffffff05); border: 1px solid #ffffff12; text-align: center; }
.ware .item-cell { width: 58px; height: 58px; border-radius: 14px; }
.ware-name { font-size: 12px; line-height: 1.2; color: var(--c); min-height: 2.4em; }
.drop-zone { display: flex; align-items: center; gap: 10px; margin: 12px 0 6px; padding: 14px; border: 2px dashed #ffffff26; border-radius: 18px; color: var(--muted); font-size: 13px; }
.drop-zone svg { width: 26px; height: 26px; color: var(--aurora); }
.drop-over .drop-zone, .drop-zone.drop-over { border-color: var(--aurora); color: var(--text-light, #fff); }
.smith-mats { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.mat { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; border: 1px solid #ffffff1a; background: #02030a99; font-size: 13px; color: var(--ink-soft); }
.mat svg { width: 16px; height: 16px; }
.mat-eisensplitter { color: #c9d0ea; }
.mat-daemmerstaub { color: #c9a8ff; }
.mat-sonnengold { color: var(--gold); }
.mat span { color: var(--muted); }
.mat.unmet b { color: var(--red); }
.smith-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0 6px; }
.smith-tab { display: grid; justify-items: center; gap: 4px; padding: 10px 4px; border-radius: 16px; border: 1px solid #ffffff1a; background: #02030a99; color: var(--muted); font: 700 12px/1.2 inherit; cursor: pointer; }
.smith-tab svg { width: 24px; height: 24px; }
.smith-tab.on { border-color: #ff9a40; color: #ffc890; background: linear-gradient(180deg, #ff8a3a22, transparent); }
.pick-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pick { --c: var(--ink-soft); display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 14px; border: 1px solid #ffffff1f; background: #02030a99; color: var(--c); font: 600 13px/1.2 inherit; cursor: pointer; }
.pick-row.slots .pick { flex-direction: column; width: 72px; padding: 8px 4px; font-size: 11px; text-align: center; }
.pick-row.slots .pick svg { width: 24px; height: 24px; }
.pick.on { border-color: var(--aurora); box-shadow: 0 0 0 1px var(--aurora) inset, 0 0 12px #5cf2b433; color: var(--text-light, #fff); }
.pick-row.affixes .pick { font-size: 12px; }
.cost-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 8px; color: var(--muted); font-size: 13px; }
.forge-go { display: inline-flex; align-items: center; gap: 8px; width: 100%; justify-content: center; margin-top: 4px !important; }
.smith-yield { display: grid; gap: 4px; }
.yield-row { display: grid; grid-template-columns: 120px 1fr; align-items: center; padding: 4px 10px; border-radius: 10px; background: #ffffff06; font-size: 13px; }
.yield-got { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); }
.repair-list, .affix-list { display: grid; gap: 6px; margin: 8px 0; }
.repair-row { display: grid; grid-template-columns: 54px 1fr auto; gap: 12px; align-items: center; padding: 6px 8px; border-radius: 16px; background: #ffffff06; }
.repair-row .item-cell { width: 54px; height: 54px; border-radius: 14px; }
.repair-info { display: grid; gap: 4px; }
.repair-info b { color: var(--c); font-size: 14px; }
.repair-info small { color: var(--muted); }
.repair-row.broken .repair-info small { color: var(--red); }
.durab { height: 6px; border-radius: 3px; background: #ffffff14; overflow: hidden; }
.durab span { display: block; height: 100%; background: linear-gradient(90deg, #ff5a6e, #ffc84a 50%, #5cf2b4); }
.repair-row .btn { display: inline-flex; align-items: center; gap: 6px; margin: 0 !important; }
.reforge-head { display: flex; align-items: center; gap: 12px; margin: 6px 0; }
.reforge-head b { color: var(--c); font-size: 16px; }
.affix-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 6px 10px; border-radius: 12px; background: #ffffff06; font-size: 13px; }
.affix-row.locked { opacity: .45; }
.affix-row .btn { display: inline-flex; align-items: center; gap: 6px; margin: 0 !important; }


/* ---------- the start: the hero played last, standing in their light ---------- */
.front.start { display: grid; gap: 24px; }
.start-hero { display: grid; grid-template-columns: minmax(260px, 380px) 1fr; align-items: center; gap: 32px; margin-top: 12px; }
.portrait-stage { position: relative; display: grid; place-items: end center; }
.portrait-stage::after { content: ""; position: absolute; left: 12%; right: 12%; bottom: 6%; height: 14%; border-radius: 50%; background: radial-gradient(#000a, transparent 70%); z-index: -1; }
.hero-portrait { display: block; width: 100%; height: auto; }
.hero-portrait.small { width: 56px; height: 72px; }
.start-kicker { margin: 0; color: var(--aurora); font-weight: 700; letter-spacing: .04em; }
.start-name { margin: 4px 0 6px; font: 700 clamp(34px, 6vw, 58px)/1.05 var(--fantasy, serif); letter-spacing: .04em; }
.start-hero.ironman .start-name, .choose-side.ironman .start-name { color: var(--gold); }
.start-line { margin: 0 0 22px; color: var(--ink-soft); }
.start-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn.big { padding: 14px 30px; font-size: 18px; }
.start-empty { text-align: center; padding: 40px 0; }
@media (max-width: 720px) { .start-hero { grid-template-columns: 1fr; text-align: center; } .start-actions { justify-content: center; } .portrait-stage { max-width: 280px; margin: 0 auto; } }

/* ---------- the hero choice ---------- */
.choose-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.choose-grid { display: grid; grid-template-columns: 1fr minmax(260px, 340px); gap: 24px; align-items: start; }
.choose .hero-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.choose .hero-card { display: block; padding: 0; border: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; transform: none; }
.hero-pick { display: grid; grid-template-columns: 56px 1fr; align-items: center; gap: 14px; padding: 10px 16px; border-radius: 20px; color: inherit; text-decoration: none; border: 1px solid #ffffff14; background: #070a18b3; transition: border-color .2s, background .2s; }
.hero-pick:hover, .hero-pick:focus-visible { border-color: #5cf2b455; background: #5cf2b40d; }
.hero-card.picked .hero-pick { border-color: var(--aurora); background: linear-gradient(90deg, #5cf2b41a, transparent); }
.hero-card.new .hero-pick { border: 2px dashed #ffffff26; }
.new-plus { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; border: 2px solid #5cf2b466; color: var(--aurora); font-size: 30px; }
.choose-side { position: sticky; top: 20px; display: grid; justify-items: center; gap: 4px; padding: 16px 20px 20px; border-radius: 28px; border: 1px solid #ffffff1a; background: #070a18cc; text-align: center; }
.choose-side .hero-portrait { max-width: 260px; }
.choose-side .start-name { font-size: 34px; }
.choose-side .start-line { margin-bottom: 14px; }
.choose-side .hero-delete { margin-top: 10px; }
@media (max-width: 760px) { .choose-grid { grid-template-columns: 1fr; } .choose-side { position: static; order: -1; } }
