:root {
  color-scheme: dark;
  --bg: #080a0d;
  --surface: #11151a;
  --surface-2: #181d23;
  --line: #2b323a;
  --line-bright: #48525d;
  --ink: #f1eadf;
  --muted: #9299a1;
  --ember: #e05b36;
  --ember-dark: #84331f;
  --gold: #d8aa5f;
  --green: #6faf82;
  --danger: #e66a61;
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

* {
  box-sizing: border-box;
  scrollbar-width: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
*::-webkit-scrollbar { display: none; width: 0; height: 0; }

html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; background: var(--bg); }

body {
  height: 100dvh;
  background:
    radial-gradient(circle at 50% -10%, rgba(224, 91, 54, 0.13), transparent 35rem),
    linear-gradient(145deg, #080a0d, #0d1115 58%, #080a0d);
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

#app {
  width: min(100%, 520px);
  max-width: 100vw;
  height: 100dvh;
  overflow: hidden;
  margin: 0 auto;
  border-inline: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(8, 10, 13, 0.9);
}

.splash, .auth-screen, .home-screen, .history-screen, .completion-screen, .menu-section-screen {
  height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: max(42px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom));
}

.splash, .auth-screen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.brand-logo {
  display: block;
  width: auto;
  height: 148px;
  flex: 0 0 auto;
  margin-bottom: 24px;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(216, 170, 95, 0.14)) drop-shadow(0 12px 18px rgba(0, 0, 0, 0.58));
}
.splash > .brand-logo { width: auto; height: 168px; margin-bottom: 26px; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--ember);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, .display { font-family: Georgia, "Times New Roman", serif; }
h1 { margin-bottom: 12px; font-size: clamp(2.35rem, 11vw, 3.3rem); letter-spacing: 0.06em; }
h2 { font-size: 1.8rem; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }

.auth-card, .panel, .summary-card, .history-card, .debug-panel {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(26, 31, 37, 0.96), rgba(15, 19, 24, 0.96));
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
}

.auth-card { max-width: 410px; margin-top: 28px; padding: 22px; text-align: left; }
.auth-card h2 { margin-bottom: 8px; }

label { display: block; color: #c4c7ca; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

input {
  width: 100%;
  min-height: 52px;
  margin-top: 8px;
  border: 1px solid var(--line-bright);
  border-radius: 10px;
  outline: none;
  background: #090c10;
  color: var(--ink);
  padding: 0 14px;
}

input:focus { border-color: var(--ember); box-shadow: 0 0 0 3px rgba(224, 91, 54, 0.13); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 17px;
  cursor: pointer;
  background: var(--ember);
  color: #fff8f0;
  font-size: 0.83rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.button:hover { filter: brightness(1.08); }
.button:active { transform: translateY(1px); }
.button:disabled { cursor: not-allowed; opacity: 0.42; filter: grayscale(0.5); }
.button.full { width: 100%; margin-top: 18px; }
.button.secondary { border-color: var(--line-bright); background: #171c22; color: var(--ink); }
.button.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.button.danger { border-color: rgba(230, 106, 97, 0.4); background: rgba(230, 106, 97, 0.1); color: #f19891; }
.button.compact { min-height: 38px; padding: 0 12px; font-size: 0.72rem; }
.button-row { display: flex; gap: 10px; }
.button-row > * { flex: 1; }

.dev-code {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px dashed var(--gold);
  border-radius: 9px;
  color: var(--gold);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: center;
}

.history-screen { padding-inline: 20px; }
.home-screen { padding: 0 0 max(28px, env(safe-area-inset-bottom)); }
.home-header { margin-bottom: 42px; }
.home-screen > .hero-copy { margin-inline: 20px; }
.home-screen > .panel {
  width: calc(100% - 40px);
  margin-inline: auto;
}
.home-brand { display: flex; align-items: center; gap: 13px; }
.home-brand .brand-logo { width: auto; height: 52px; margin: 0 2px 0 0; }
.home-brand h1 { margin: 0; font-size: 1.3rem; }
.menu-button {
  display: inline-flex;
  min-height: 43px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-bright);
  border-radius: 9px;
  background: #151a20;
  color: var(--ink);
  padding: 0 13px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.menu-button span { color: var(--gold); font-size: 1rem; line-height: 1; }
.game-menu-button { min-width: 38px; min-height: 38px; justify-content: center; padding: 0; }
.game-menu-button span {
  width: 16px;
  height: 12px;
  background: linear-gradient(to bottom, var(--gold) 0 2px, transparent 2px 5px, var(--gold) 5px 7px, transparent 7px 10px, var(--gold) 10px 12px);
  font-size: 0;
}
.hero-copy { max-width: 360px; margin-bottom: 30px; }
.hero-copy h2 { margin-bottom: 10px; font-size: 2.3rem; }
.hero-copy p { line-height: 1.6; }
.panel { padding: 18px; }
.panel + .panel { margin-top: 14px; }
.panel-kicker { color: var(--gold); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; }
.panel h3 { margin-bottom: 8px; }

.game-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #080b0f;
}
.game-screen > * { min-width: 0; max-width: 100%; }
.game-topbar {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  min-height: calc(55px + env(safe-area-inset-top));
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 15, 19, 0.96);
}

.game-stats { display: grid; min-width: 0; grid-template-columns: repeat(3, 1fr); }
.top-stat { color: var(--muted); font-size: 0.62rem; font-weight: 800; letter-spacing: 0.12em; text-align: center; text-transform: uppercase; }
.top-stat strong { display: block; margin-top: 2px; color: var(--ink); font-family: Georgia, serif; font-size: 1.1rem; letter-spacing: 0; }
.game-debug-button { min-width: 38px; min-height: 38px; }
.finish-run-button { white-space: nowrap; }
.finish-run-button.finish-run-button-ready {
  border-color: var(--gold);
  background: rgba(216, 170, 95, 0.18);
  color: #ffe2aa;
  animation: finish-ready-pulse 1.6s ease-in-out infinite;
}
@keyframes finish-ready-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(216, 170, 95, 0.12), inset 0 0 10px rgba(216, 170, 95, 0.05);
  }
  50% {
    transform: scale(1.045);
    box-shadow: 0 0 0 4px rgba(216, 170, 95, 0.1), 0 0 18px rgba(216, 170, 95, 0.38), inset 0 0 14px rgba(216, 170, 95, 0.12);
  }
}
.icon-button { min-width: 43px; min-height: 43px; border: 1px solid var(--line); border-radius: 9px; background: #151a20; color: var(--muted); cursor: pointer; }

.map-shell {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #080b0f;
}
.map-game-screen { grid-template-rows: auto minmax(0, 1fr) auto; }
.map-backdrop,
#map-canvas { transition: opacity 140ms ease; }
.map-shell.map-pending .map-backdrop,
.map-shell.map-pending #map-canvas { opacity: 0; }
.map-loading {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 7px;
  background: radial-gradient(circle at 50% 54%, rgba(216, 170, 95, 0.08), transparent 31%), #080b0f;
  color: var(--ink);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 140ms ease, visibility 0s linear 140ms;
}
.map-shell.map-pending .map-loading {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}
.map-reference-stack {
  position: absolute;
  z-index: 4;
  right: 10px;
  bottom: 10px;
  display: flex;
  width: auto;
  max-width: calc(100% - 20px);
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  pointer-events: none;
}
.map-reference {
  width: max-content;
  max-width: 100%;
  color: var(--ink);
  pointer-events: auto;
}
.map-reference[open] { width: max-content; }
.map-reference summary {
  display: flex;
  width: max-content;
  max-width: 100%;
  margin-left: auto;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  border: 1px solid var(--line-bright);
  border-radius: 8px;
  background: rgba(12, 15, 19, 0.94);
  padding: 6px 9px;
  cursor: pointer;
  color: #d8dde1;
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  list-style: none;
  text-transform: uppercase;
}
.map-reference summary::-webkit-details-marker { display: none; }
.map-reference summary::before { color: var(--gold); content: "◇"; }
.map-reference summary span { margin-left: auto; color: var(--gold); }
.map-reference-panel {
  max-height: min(58vh, 430px);
  overflow-y: auto;
  margin-top: 6px;
  border: 1px solid var(--line-bright);
  border-radius: 10px;
  background: rgba(12, 15, 19, 0.97);
  padding: 10px;
}
.combos-reference-panel > .eyebrow { margin: 8px 2px; }
.combos-reference-panel > .eyebrow:first-child { margin-top: 0; }
.combos-open-title { margin-top: 16px !important; }
.rune-label-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  border-bottom: 1px solid var(--line);
  padding: 2px 2px 10px;
  color: var(--ink);
  letter-spacing: 0;
  text-transform: none;
}
.rune-label-toggle strong,
.rune-label-toggle small { display: block; }
.rune-label-toggle strong { font-size: 0.72rem; }
.rune-label-toggle small { margin-top: 2px; color: var(--muted); font-size: 0.61rem; font-weight: 500; }
.rune-label-toggle input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  accent-color: var(--ember);
}
.rune-legend-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.rune-legend-item { display: flex; min-width: 0; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 7px; padding: 5px 6px; }
.rune-legend-item img { width: 27px; height: 27px; flex: 0 0 auto; object-fit: contain; }
.rune-legend-item span { min-width: 0; }
.rune-legend-item strong,
.rune-legend-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rune-legend-item strong { font-size: 0.64rem; }
.rune-legend-item small { margin-top: 2px; color: var(--muted); font-size: 0.56rem; }
.map-shell.map-pending .map-reference-stack { opacity: 0; pointer-events: none; }
.map-loading-rune {
  width: 38px;
  height: 38px;
  color: var(--gold);
  filter: drop-shadow(0 0 8px rgba(216, 170, 95, 0.45));
  font-size: 2rem;
  line-height: 38px;
  text-align: center;
  animation: map-loading-turn 1.4s ease-in-out infinite;
}
.map-loading strong {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.map-loading > span:last-child { color: var(--muted); font-size: 0.7rem; }
.map-backdrop {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  background: #080b0f;
  pointer-events: none;
}
.map-backdrop-parallax,
.map-backdrop-art,
.map-backdrop-glow,
.map-backdrop-embers {
  position: absolute;
  inset: 0;
}
.map-backdrop-parallax {
  inset: -4%;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}
.map-backdrop-art {
  background: url("/assets/backgrounds/forge-floor.webp") center center / cover no-repeat;
}
.map-backdrop-glow {
  transform-origin: 50% 82%;
  background: radial-gradient(
    ellipse at 50% 82%,
    rgba(255, 126, 67, 0.4),
    rgba(224, 91, 54, 0.18) 34%,
    transparent 58%
  );
  mix-blend-mode: screen;
  animation: map-forge-pulse 5.5s ease-in-out infinite;
}
.map-backdrop-fog {
  position: absolute;
  width: 88%;
  aspect-ratio: 1.45;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(190, 205, 214, 0.56), rgba(104, 122, 134, 0.21) 44%, transparent 72%);
  filter: blur(18px);
  opacity: 0.18;
  animation: map-fog-breathe 12s ease-in-out infinite;
}
.map-backdrop-fog-one { top: -4%; left: -28%; }
.map-backdrop-fog-two { right: -28%; bottom: 2%; animation-delay: -6s; }
.map-backdrop-ember {
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: var(--size);
  height: var(--size);
  transform: translate3d(0, 16px, 0) scale(0.6);
  border-radius: 50%;
  background: #ffe0a7;
  box-shadow: 0 0 6px #e05b36, 0 0 12px rgba(224, 91, 54, 0.7);
  opacity: 0;
  animation: map-ember-rise var(--duration) linear infinite;
  animation-delay: var(--delay);
}
.map-game-screen .map-backdrop-glow {
  transform: scale(1);
  opacity: 0.52;
  animation: none;
}
.map-game-screen .map-backdrop-fog,
.map-game-screen .map-backdrop-ember,
.map-game-screen .map-loading-rune,
.map-game-screen .finish-run-button.finish-run-button-ready {
  animation: none;
}
@keyframes map-forge-pulse {
  0%, 100% { transform: scale(0.97); opacity: 0.32; }
  50% { transform: scale(1.04); opacity: 0.72; }
}
@keyframes map-fog-breathe {
  0%, 100% { transform: translate3d(-5px, 4px, 0) scale(0.96); opacity: 0.1; }
  50% { transform: translate3d(12px, -17px, 0) scale(1.06); opacity: 0.28; }
}
@keyframes map-ember-rise {
  0%, 100% { transform: translate3d(0, 16px, 0) scale(0.6); opacity: 0; }
  18% { opacity: 0.75; }
  75% { opacity: 0.35; }
  99% { transform: translate3d(8px, -70px, 0) scale(1.05); opacity: 0; }
}
@keyframes map-loading-turn {
  0%, 100% { transform: rotate(0deg) scale(0.88); opacity: 0.5; }
  50% { transform: rotate(90deg) scale(1.08); opacity: 1; }
}
#map-canvas {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent;
  touch-action: none;
}
#map-canvas canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  background: transparent !important;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
#map-canvas canvas:active { cursor: grabbing; }
.map-fps-display {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 20;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font: 700 12px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.action-dock {
  position: relative;
  z-index: 5;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  background: #0c0f13;
}
.path-strip {
  display: flex;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 100px;
  min-height: 100px;
  align-items: center;
  overflow: hidden;
  border-top: 1px solid #343c45;
  border-bottom: 1px solid #282e35;
  background: #1b1e22;
  color: #f2f0eb;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.path-strip.empty {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  color: #9ca3aa;
  font-size: 0.75rem;
}
.path-strip-prompt {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 12px;
}
.path-strip-or { color: #727980; font-size: 0.64rem; }
.path-strip-rune { color: var(--gold); font-family: Georgia, serif; font-size: 1rem; }
.path-strip.selected {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr) auto;
}
.path-strip-node,
.path-strip-applied {
  display: flex;
  min-width: 0;
  height: 100%;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 12px;
}
.path-strip-node { gap: 5px; border-right: 1px solid #343a41; }
.path-strip-node strong,
.path-strip-node span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.path-strip-node strong { font-size: 0.84rem; }
.path-strip-node span { color: #d4d7da; font-size: 0.68rem; }
.path-strip-applied { gap: 7px; }
.path-strip-applied small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.path-strip-action-list {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 4px;
  overflow: hidden;
}
.path-strip-action-list span {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid rgba(216, 170, 95, 0.35);
  border-radius: 99px;
  background: rgba(216, 170, 95, 0.08);
  color: #e3c894;
  padding: 3px 6px;
  font-size: 0.56rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.path-strip-action-list span.empty { border-color: transparent; background: transparent; color: #777f87; padding-inline: 0; }
.path-strip-applied.gambit-applied { gap: 3px; padding-block: 6px; }
.gambit-effect {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 1px;
}
.gambit-effect-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  color: #d4d7da;
  font-size: 0.48rem;
  font-weight: 800;
  letter-spacing: 0.045em;
  line-height: 1.15;
  white-space: nowrap;
}
.gambit-effect-row span { overflow: hidden; text-overflow: ellipsis; }
.gambit-effect-row strong { color: var(--gold-bright); }
.path-strip-action-list.gambit-other-actions { flex-wrap: wrap; gap: 2px; }
.path-strip-action-list.gambit-other-actions span { padding: 2px 4px; font-size: 0.48rem; }
.path-strip-enter {
  grid-column: 3;
  min-width: 0;
  min-height: 0;
  flex: 0 0 auto;
  align-self: stretch;
  margin: 9px;
  padding: 0 12px;
}
.path-strip-end {
  align-self: stretch;
  border: 0;
  border-left: 1px solid #343a41;
  background: transparent;
  color: #d4d7da;
  padding: 0 18px;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.path-strip-end:hover { background: rgba(216, 170, 95, 0.08); color: #fff; }
.path-strip-end:active { background: rgba(216, 170, 95, 0.14); }
.exercise-screen { width: 100%; height: 100%; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 27px 20px calc(32px + env(safe-area-inset-bottom)); }
.exercise-title { margin: 18px 0 8px; overflow-wrap: anywhere; font-size: clamp(1.8rem, 9vw, 2.8rem); line-height: 1; text-transform: uppercase; }
.set-form { margin: 22px 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.set-form h3 { margin-bottom: 16px; }
.set-list { list-style: none; margin: 0; padding: 0; }
.set-item { display: flex; align-items: center; gap: 12px; min-height: 59px; border-top: 1px solid var(--line); }
.set-number { display: grid; width: 29px; height: 29px; place-items: center; border: 1px solid var(--line-bright); border-radius: 50%; color: var(--muted); font-size: 0.73rem; }
.set-value { flex: 1; font-weight: 700; }
.set-actions { display: flex; gap: 6px; }
.set-actions .button { min-width: 0; padding-inline: 9px; }
.exercise-actions { display: grid; gap: 10px; margin-top: 24px; }
.lockout { margin: 18px 0; padding: 14px; border: 1px solid rgba(230, 106, 97, 0.35); border-radius: 10px; background: rgba(230, 106, 97, 0.08); color: #efaaa4; line-height: 1.45; }

.completion-screen {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  padding-inline: 20px;
}
.completion-header { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.completion-screen h1 { font-size: 2.25rem; }
.completion-header > .muted { margin-bottom: 16px; }
.completion-reward {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 16px;
  border: 1px solid rgba(216, 170, 95, 0.44);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(216, 170, 95, 0.13), rgba(224, 91, 54, 0.07));
  padding: 13px 14px;
}
.completion-reward span,
.completion-reward small { display: block; color: var(--muted); font-size: 0.63rem; letter-spacing: 0.1em; text-transform: uppercase; }
.completion-reward strong { display: block; margin: 3px 0; color: var(--gold); font-family: Georgia, serif; font-size: 1.15rem; }
.completion-reward .button { flex: 0 0 auto; }
.completion-reward.denied { border-color: rgba(224, 91, 54, 0.5); background: linear-gradient(135deg, rgba(224, 91, 54, 0.12), rgba(10, 14, 17, 0.8)); }
.completion-reward.denied strong { color: var(--ember); }
.completion-reward.denied small { max-width: 44ch; line-height: 1.45; letter-spacing: 0.04em; text-transform: none; }
.completion-actions { display: grid; grid-template-columns: 1.25fr 1fr; gap: 10px; }
.completion-details { min-height: 0; overflow-x: hidden; overflow-y: auto; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
.completion-score { margin: 18px 0 16px; padding: 20px; border: 1px solid rgba(216, 170, 95, 0.36); border-radius: 14px; background: rgba(216, 170, 95, 0.06); text-align: center; }
.completion-score > span { color: var(--muted); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; }
.completion-score > strong { display: block; margin: 3px 0 12px; color: var(--gold); font-family: Georgia, serif; font-size: 3rem; }
.completion-score p { margin: 0; color: var(--muted); font-size: 0.8rem; line-height: 1.6; }
.completion-score b { color: var(--gold); }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 24px 0; }
.summary-grid.completion-metrics { grid-template-columns: repeat(4, 1fr); margin-top: 0; }
.summary-stat { padding: 14px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-align: center; }
.summary-stat strong { display: block; margin-bottom: 4px; color: var(--gold); font-family: Georgia, serif; font-size: 1.35rem; }
.summary-stat span { color: var(--muted); font-size: 0.63rem; letter-spacing: 0.08em; text-transform: uppercase; }
.summary-card { margin: 12px 0; padding: 16px; }
.summary-card h3 { margin-bottom: 10px; }
.summary-card-title { display: flex; justify-content: space-between; gap: 12px; }
.summary-card-title strong { color: var(--gold); }
.summary-card-title h3 { margin-bottom: 4px; }
.summary-card-heading { display: flex; min-width: 0; align-items: baseline; gap: 10px; }
.summary-card-heading h3 { overflow-wrap: anywhere; }
.exercise-order { flex: 0 0 auto; color: var(--gold); font-family: Georgia, serif; font-size: 1.05rem; font-weight: 700; }
.summary-set { display: flex; justify-content: space-between; padding: 7px 0; border-top: 1px solid var(--line); color: var(--muted); }

.history-header { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.history-header h1 { margin: 0; font-size: 1.8rem; }
.history-card { margin-bottom: 12px; padding: 16px; }
.history-card-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.history-card h3 { margin-bottom: 5px; }
.history-metrics { display: flex; gap: 15px; color: var(--muted); font-size: 0.78rem; }
.history-score { display: grid; justify-items: end; gap: 2px; }
.history-score > strong { color: var(--gold); font-family: Georgia, serif; font-size: 1.25rem; }
.history-score > span { margin-bottom: 5px; color: var(--muted); font-size: 0.56rem; letter-spacing: 0.12em; text-transform: uppercase; }

.menu-section-screen {
  display: grid;
  height: 100%;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  padding: 0;
}
.section-header {
  position: relative;
  z-index: 10;
  display: grid;
  min-height: calc(78px + env(safe-area-inset-top));
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: 15px;
  margin: 0;
  border-bottom: 1px solid rgba(216, 170, 95, 0.34);
  background:
    radial-gradient(circle at 62% 0, rgba(216, 170, 95, 0.09), transparent 52%),
    linear-gradient(180deg, rgba(17, 22, 26, 0.995), rgba(7, 11, 14, 0.995));
  box-shadow: 0 9px 25px rgba(0, 0, 0, 0.48);
  padding: calc(10px + env(safe-area-inset-top)) 20px 12px;
}
.section-header .button { min-width: 72px; min-height: 44px; padding-inline: 13px; }
.section-header .eyebrow { margin-bottom: 3px; color: var(--gold-bright); font-size: 0.7rem; }
.section-header h1 { margin: 0; color: #f2ebe0; font-size: 1.65rem; letter-spacing: 0.1em; line-height: 1; }
.forge-menu-scroll {
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px 20px calc(36px + env(safe-area-inset-bottom));
}
.forge-menu-screen :is(button, input):focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

/* Floor archive */
.floor-archive-screen { background: #070b0e; }
.floor-archive-toolbar {
  position: sticky;
  z-index: 5;
  top: 0;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(216, 170, 95, 0.2);
  background: linear-gradient(180deg, #070b0e 0 82%, rgba(7, 11, 14, 0.92) 92%, transparent);
  padding-bottom: 16px;
}
.floor-archive-search { box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28); }
.floor-archive-search:focus-within { border-color: var(--gold-bright); box-shadow: 0 0 0 2px rgba(216, 170, 95, 0.2), 0 10px 22px rgba(0, 0, 0, 0.28); }
.floor-archive-search input { text-transform: none; }
.floor-archive-search input:focus-visible { outline: 0; }
.floor-archive-result-count {
  margin: 0 2px 10px;
  color: #929ba1;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.floor-archive-feed { display: grid; gap: 16px; }
.floor-archive-card {
  overflow: hidden;
  border: 1px solid rgba(216, 170, 95, 0.42);
  border-radius: var(--frame-corner);
  background:
    linear-gradient(120deg, rgba(216, 170, 95, 0.055), transparent 35%),
    linear-gradient(155deg, rgba(20, 26, 30, 0.98), rgba(6, 10, 13, 0.99));
  box-shadow: inset 0 0 32px rgba(0, 0, 0, 0.28), 0 18px 38px rgba(0, 0, 0, 0.3);
}
.floor-archive-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(216, 170, 95, 0.26);
  background: linear-gradient(90deg, rgba(216, 170, 95, 0.1), transparent 76%);
  padding: 16px;
}
.floor-archive-card-head .panel-kicker { margin-bottom: 3px; color: var(--gold-bright); }
.floor-archive-card-head h2 { margin: 0; color: #f0e9df; font-size: 1.12rem; letter-spacing: 0.035em; }
.floor-archive-card-head > div:first-child > p:last-child { margin: 5px 0 0; color: #959da3; font-size: 0.68rem; }
.floor-archive-score { min-width: 84px; border-left: 1px solid rgba(216, 170, 95, 0.27); padding-left: 14px; text-align: right; }
.floor-archive-score > strong { display: block; color: var(--gold-bright); font-family: Georgia, serif; font-size: 1.45rem; line-height: 1; }
.floor-archive-score > span { display: flex; align-items: center; justify-content: flex-end; gap: 5px; margin-top: 6px; color: #9da4a9; font-size: 0.58rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.floor-archive-score .core-stat-icon { width: 13px; height: 13px; color: var(--gold-bright); }
.floor-archive-training-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid rgba(126, 138, 148, 0.24); }
.floor-archive-training-metrics > span { min-width: 0; padding: 11px 5px; text-align: center; }
.floor-archive-training-metrics > span + span { border-left: 1px solid rgba(126, 138, 148, 0.22); }
.floor-archive-training-metrics strong { display: block; overflow-wrap: anywhere; color: #ece5dc; font-family: Georgia, serif; font-size: 1rem; line-height: 1.1; }
.floor-archive-training-metrics small { display: block; margin-top: 5px; color: #858f96; font-size: 0.52rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.floor-archive-run-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; border-bottom: 1px solid rgba(126, 138, 148, 0.19); padding: 10px 15px; color: #899299; font-size: 0.65rem; letter-spacing: 0.04em; text-transform: uppercase; }
.floor-archive-run-meta strong { margin-left: 4px; color: #d7d0c7; }
.floor-archive-exercises { list-style: none; margin: 0; padding: 0; }
.floor-archive-exercise { position: relative; padding: 12px 15px; }
.floor-archive-exercise + .floor-archive-exercise { border-top: 1px solid rgba(216, 170, 95, 0.18); }
.floor-archive-exercise.is-search-match { background: linear-gradient(90deg, rgba(216, 170, 95, 0.1), transparent 68%); }
.floor-archive-exercise.is-search-match::before { position: absolute; top: 10px; bottom: 10px; left: 0; width: 2px; background: var(--gold-bright); content: ""; }
.floor-archive-exercise-head { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 9px; }
.floor-archive-exercise-order { color: var(--gold-bright); font-family: Georgia, serif; font-size: 0.9rem; font-weight: 700; line-height: 1.2; }
.floor-archive-exercise-head h3 { margin: 0; overflow-wrap: anywhere; color: #eee8df; font-size: 0.9rem; line-height: 1.25; }
.floor-archive-exercise-head h3 mark { border-radius: 2px; background: rgba(216, 170, 95, 0.28); color: #fff2d8; padding-inline: 2px; }
.floor-archive-exercise-head p { display: flex; min-width: 0; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 2px 5px; margin: 0; color: #9aa2a8; font-size: 0.59rem; letter-spacing: 0.045em; text-align: right; text-transform: uppercase; }
.floor-archive-exercise-head p span { white-space: nowrap; }
.floor-archive-exercise-head p i { color: #606a71; font-style: normal; }
.floor-archive-sets { display: flex; flex-wrap: wrap; gap: 5px; list-style: none; margin: 9px 0 0 39px; padding: 0; }
.floor-archive-sets li { display: grid; min-width: 68px; flex: 0 0 auto; grid-template-rows: repeat(2, auto); overflow: hidden; border: 1px solid rgba(126, 138, 148, 0.38); border-radius: 5px; background: rgba(4, 8, 10, 0.52); color: #e5dfd6; text-align: center; white-space: nowrap; }
.floor-archive-sets strong { border-bottom: 1px solid rgba(126, 138, 148, 0.24); padding: 5px 8px 4px; font-size: 0.7rem; line-height: 1.1; }
.floor-archive-sets span { color: #bbc2c6; padding: 4px 8px 5px; font-size: 0.64rem; line-height: 1.1; }
.floor-archive-chains { border-top: 1px solid rgba(216, 170, 95, 0.23); background: rgba(216, 170, 95, 0.035); padding: 12px 15px 14px; }
.floor-archive-chains > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.floor-archive-chains > div span { color: #949da3; font-size: 0.58rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.floor-archive-chains > div strong { color: var(--gold-bright); font-family: Georgia, serif; font-size: 0.85rem; }
.floor-archive-chains p { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 0; }
.floor-archive-chains p span { display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(216, 170, 95, 0.32); border-radius: 99px; background: rgba(216, 170, 95, 0.07); color: #c5bbae; padding: 5px 8px; font-size: 0.56rem; line-height: 1; }
.floor-archive-chains p b { font-weight: 700; }
.floor-archive-chains p small { border-left: 1px solid rgba(216, 170, 95, 0.25); color: var(--gold-bright); padding-left: 6px; font-size: inherit; }
.floor-archive-chains p .is-empty { border-color: rgba(126, 138, 148, 0.3); background: rgba(126, 138, 148, 0.06); color: #858f96; }
.floor-archive-no-exercises { display: grid; gap: 5px; padding: 22px 16px; text-align: center; }
.floor-archive-no-exercises strong { color: #d7d0c7; font-size: 0.8rem; }
.floor-archive-no-exercises span { color: #899299; font-size: 0.68rem; }
.floor-archive-empty { border: 1px solid rgba(216, 170, 95, 0.3); border-radius: var(--frame-corner); background: rgba(10, 15, 18, 0.72); padding: 28px 20px; text-align: center; }
.floor-archive-empty h2 { margin: 0; color: #e8e1d8; font-size: 1.15rem; }
.floor-archive-empty p { margin: 8px 0 0; color: #929ba1; font-size: 0.76rem; line-height: 1.45; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; margin: -1px; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.codex-screen {
  position: relative;
  background: transparent;
}
.codex-screen::before { content: none; }
.codex-section-toggle {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(216, 170, 95, 0.25);
}
.codex-section-toggle button {
  position: relative;
  min-width: 0;
  min-height: 48px;
  border: 0;
  background: transparent;
  color: #7f878e;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.codex-section-toggle button::after {
  position: absolute;
  right: 20%;
  bottom: -1px;
  left: 20%;
  height: 1px;
  background: transparent;
  content: "";
}
.codex-section-toggle button[aria-selected="true"] { color: #f1e8dc; text-shadow: 0 0 13px rgba(216, 170, 95, 0.2); }
.codex-section-toggle button[aria-selected="true"]::after {
  right: 4%;
  left: 4%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-bright) 20% 80%, transparent);
}
.codex-inventory { position: relative; min-width: 0; }
.codex-filter-rack {
  display: grid;
  grid-template-columns: minmax(138px, 0.9fr) minmax(220px, 1.5fr) 42px;
  align-items: stretch;
  gap: 8px;
  border-block: 1px solid rgba(216, 170, 95, 0.22);
  background: linear-gradient(90deg, rgba(22, 28, 32, 0.82), rgba(8, 12, 15, 0.9));
  padding: 7px 0;
}
.codex-rune-trigger,
.codex-search-trigger {
  border: 1px solid rgba(136, 147, 156, 0.5);
  border-radius: var(--frame-corner);
  background: linear-gradient(180deg, rgba(30, 37, 42, 0.95), rgba(11, 15, 18, 0.98));
  color: var(--ink);
  cursor: pointer;
}
.codex-rune-trigger {
  display: grid;
  min-width: 0;
  min-height: 44px;
  grid-template-columns: 36px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 7px;
  padding: 3px 9px 3px 5px;
  text-align: left;
}
.codex-rune-trigger > img { width: 36px; height: 36px; object-fit: contain; filter: drop-shadow(0 0 6px rgba(216, 170, 95, 0.2)); }
.codex-rune-trigger > span { min-width: 0; }
.codex-rune-trigger small,
.codex-rune-trigger strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.codex-rune-trigger small { color: #7e878e; font-size: 0.49rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.codex-rune-trigger strong { margin-top: 2px; color: #eee8df; font-size: 0.62rem; letter-spacing: 0.06em; text-transform: uppercase; }
.codex-rune-trigger > svg { width: 14px; fill: none; stroke: var(--gold-bright); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; transition: transform 140ms ease; }
.codex-rune-trigger[aria-expanded="true"] { border-color: var(--gold-bright); box-shadow: 0 0 16px rgba(216, 170, 95, 0.12); }
.codex-rune-trigger[aria-expanded="true"] > svg { transform: rotate(180deg); }
.codex-search-trigger { display: grid; width: 42px; min-height: 42px; place-items: center; }
.codex-search-trigger svg,
.codex-search > svg { width: 19px; fill: none; stroke: #b9c0c5; stroke-linecap: round; stroke-width: 1.7; }
.codex-search-trigger[aria-pressed="true"] { border-color: var(--gold-bright); color: var(--gold-bright); }
.codex-search-trigger[aria-pressed="true"] svg { stroke: var(--gold-bright); }
.codex-type-filter { display: grid; min-width: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.codex-type-filter button {
  position: relative;
  min-width: 0;
  border: 0;
  border-left: 1px solid rgba(126, 138, 148, 0.2);
  background: transparent;
  color: #858d94;
  cursor: pointer;
  padding: 0 3px;
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  line-height: 1.15;
  text-transform: uppercase;
}
.codex-type-filter button:first-child { border-left: 0; }
.codex-type-filter button::before {
  display: block;
  width: 5px;
  height: 5px;
  margin: 0 auto 5px;
  transform: rotate(45deg);
  border: 1px solid #4c555c;
  content: "";
}
.codex-type-filter button[aria-pressed="true"] { color: var(--gold-bright); }
.codex-type-filter button[aria-pressed="true"]::before { border-color: var(--gold-bright); background: rgba(216, 170, 95, 0.28); box-shadow: 0 0 7px rgba(216, 170, 95, 0.28); }
.codex-filter-rack button:focus-visible,
.codex-rune-choice:focus-visible,
.codex-section-toggle button:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
.codex-search {
  display: grid;
  min-height: 44px;
  grid-template-columns: 24px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  border-bottom: 1px solid rgba(216, 170, 95, 0.36);
  background: rgba(5, 9, 12, 0.76);
  padding: 0 10px;
}
.codex-search input {
  min-height: 42px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}
.codex-search input:focus { border: 0; box-shadow: none; }
.codex-search input::-webkit-search-cancel-button { display: none; }
.codex-search > button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  background: transparent;
  color: #899198;
  cursor: pointer;
}
.codex-search > button svg { width: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.5; }
.codex-active-pool {
  display: flex;
  min-height: 47px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(126, 138, 148, 0.24);
  padding: 7px 2px;
}
.codex-active-pool > span {
  flex: 0 0 auto;
  color: #737c83;
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.codex-rune-path { display: flex; min-width: 0; align-items: center; gap: 4px; }
.codex-path-rune { display: flex; min-width: 0; align-items: center; gap: 3px; }
.codex-path-rune img { width: 25px; height: 25px; flex: 0 0 auto; object-fit: contain; }
.codex-path-rune > span { color: #a7adb2; font-size: 0.5rem; line-height: 1.1; text-transform: uppercase; }
.codex-path-link { width: 10px; height: 1px; flex: 0 0 auto; background: linear-gradient(90deg, #6d5737, #b68a4b); }
.codex-rune-path.compact { grid-column: 1 / -1; gap: 3px; border-top: 1px solid rgba(126, 138, 148, 0.16); padding-top: 7px; }
.codex-rune-path.compact .codex-path-rune img { width: 19px; height: 19px; opacity: 0.78; }
.codex-rune-path.compact .codex-path-rune > span { display: none; }
.codex-rune-path.compact .codex-path-link { width: 8px; opacity: 0.7; }
.codex-rune-deck {
  position: absolute;
  z-index: 20;
  top: 59px;
  right: 0;
  left: 0;
  max-height: min(66dvh, 560px);
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid rgba(216, 170, 95, 0.64);
  border-radius: var(--frame-corner);
  background:
    radial-gradient(circle at 50% 0, rgba(216, 170, 95, 0.13), transparent 31%),
    linear-gradient(155deg, rgba(20, 26, 30, 0.995), rgba(6, 10, 12, 0.995));
  box-shadow: inset 0 0 0 3px rgba(216, 170, 95, 0.025), 0 26px 58px rgba(0, 0, 0, 0.75);
  padding: 16px 16px 20px;
}
.codex-rune-deck > header { display: flex; align-items: end; justify-content: space-between; gap: 16px; border-bottom: 1px solid rgba(216, 170, 95, 0.2); padding: 0 2px 13px; }
.codex-rune-deck > header p,
.codex-rune-deck > header strong { display: block; margin: 0; text-transform: uppercase; }
.codex-rune-deck > header p { color: var(--gold-bright); font-size: 0.52rem; font-weight: 800; letter-spacing: 0.16em; }
.codex-rune-deck > header strong { margin-top: 3px; color: #f1e9de; font-family: Georgia, serif; font-size: 1rem; letter-spacing: 0.06em; }
.codex-rune-deck > header > span { max-width: 190px; color: #848d94; font-size: 0.58rem; line-height: 1.35; text-align: right; }
.codex-rune-choice {
  position: relative;
  display: grid;
  min-width: 0;
  justify-items: center;
  border: 0;
  background: url("/assets/nodes/base-node.webp") center top / 48px 48px no-repeat;
  color: #a7afb5;
  cursor: pointer;
  padding: 5px 2px 0;
  font-size: 0.5rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
}
.codex-rune-choice img { width: 38px; height: 38px; object-fit: contain; filter: drop-shadow(0 0 5px rgba(216, 170, 95, 0.12)); }
.codex-rune-choice span { display: grid; min-height: 23px; align-items: start; margin-top: 4px; overflow-wrap: normal; hyphens: none; word-break: keep-all; }
.codex-rune-choice[aria-pressed="true"] { background-image: url("/assets/nodes/selected-node.webp"); color: var(--gold-bright); text-shadow: 0 0 8px rgba(216, 170, 95, 0.24); }
.codex-rune-choice[aria-pressed="true"] img { filter: drop-shadow(0 0 7px rgba(216, 170, 95, 0.34)); }
.codex-rune-root { position: relative; display: grid; width: 100px; margin: 13px auto 7px; justify-items: center; }
.codex-rune-root::after { position: absolute; bottom: -8px; left: 50%; width: 1px; height: 13px; background: rgba(216, 170, 95, 0.4); content: ""; }
.codex-rune-choice.root { width: 92px; background-size: 58px 58px; }
.codex-rune-choice.root img { width: 48px; height: 48px; }
.codex-rune-regions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; border-top: 1px solid rgba(216, 170, 95, 0.36); padding-top: 10px; }
.codex-rune-region { min-width: 0; }
.codex-rune-region > .codex-rune-choice { width: 92px; margin: 0 auto 4px; }
.codex-rune-region-branches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; border-top: 1px solid rgba(126, 138, 148, 0.24); padding-top: 8px; }
.codex-rune-branch { min-width: 0; }
.codex-rune-branch > .codex-rune-choice { width: 100%; }
.codex-rune-specifics { display: grid; grid-template-columns: 1fr; margin-top: 3px; border-top: 1px solid rgba(126, 138, 148, 0.16); padding-top: 7px; }
.codex-rune-choice.specific { background-size: 42px 42px; font-size: 0.5rem; }
.codex-rune-choice.specific img { width: 32px; height: 32px; }
.codex-result-count { margin: 13px 2px 10px; color: #7f878d; font-size: 0.58rem; font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase; }
.codex-type-groups { display: grid; gap: 27px; }
.codex-type-heading {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
  border-bottom: 1px solid rgba(216, 170, 95, 0.3);
  padding: 0 2px 8px;
}
.codex-type-heading h3 { margin: 0; color: #f0e9df; font-family: Georgia, serif; font-size: 0.82rem; letter-spacing: 0.1em; text-transform: uppercase; }
.codex-type-heading span { justify-self: end; color: var(--gold-bright); font-size: 0.5rem; letter-spacing: 0.08em; text-transform: uppercase; }
.codex-type-heading b { min-width: 20px; border-left: 1px solid rgba(216, 170, 95, 0.3); padding-left: 8px; color: #8e969c; font-family: Georgia, serif; font-size: 0.7rem; font-weight: 600; text-align: right; }
.codex-exercise-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.codex-exercise-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 116px;
  grid-template-columns: 58px minmax(0, 1fr);
  grid-template-rows: minmax(67px, auto) auto;
  align-items: start;
  column-gap: 8px;
  overflow: hidden;
  border: 1px solid rgba(113, 126, 136, 0.38);
  border-radius: var(--frame-corner);
  background:
    linear-gradient(115deg, rgba(216, 170, 95, 0.055), transparent 44%),
    linear-gradient(155deg, rgba(21, 27, 31, 0.96), rgba(7, 11, 14, 0.98));
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.24), 0 8px 18px rgba(0, 0, 0, 0.24);
  padding: 9px 10px 7px;
}
.codex-exercise-card::before { position: absolute; top: 0; right: 18%; left: 18%; height: 1px; background: linear-gradient(90deg, transparent, rgba(216, 170, 95, 0.65), transparent); content: ""; }
.codex-exercise-glyph {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  background: url("/assets/nodes/base-node.webp") center / contain no-repeat;
}
.codex-exercise-glyph img { width: 39px; height: 39px; object-fit: contain; filter: drop-shadow(0 0 5px rgba(216, 170, 95, 0.12)); }
.codex-exercise-copy { min-width: 0; }
.codex-exercise-card h3 { margin: 2px 0 0; overflow-wrap: normal; color: #f0ebe3; font-family: Georgia, serif; font-size: 0.76rem; letter-spacing: 0.045em; line-height: 1.15; text-transform: uppercase; word-break: keep-all; }
.codex-exercise-card .codex-exercise-copy > p:last-child { margin: 4px 0 0; color: #8e969c; font-size: 0.52rem; line-height: 1.2; }
.codex-exercise-movement { margin: 0; color: var(--gold-bright); font-size: 0.47rem; font-weight: 800; letter-spacing: 0.08em; line-height: 1.2; text-transform: uppercase; }
.codex-empty { border-top: 1px solid rgba(216, 170, 95, 0.24); padding: 28px 2px; }
.codex-empty strong { display: block; margin-bottom: 6px; font-family: Georgia, serif; font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; }
.codex-empty p { margin: 0; color: var(--muted); font-size: 0.75rem; line-height: 1.45; }

/* Codex inventory and field manual */
#app[data-screen="codex"],
#app[data-screen="collectibles"],
#app[data-screen="skills"],
#app[data-screen="stats"],
#app[data-screen="settings"] {
  background:
    linear-gradient(180deg, rgba(5, 8, 10, 0.68), rgba(5, 8, 10, 0.88)),
    radial-gradient(circle at 50% 24%, rgba(216, 170, 95, 0.12), transparent 34%),
    url("/assets/backgrounds/forge-floor.webp") center center / cover no-repeat;
}
.codex-screen {
  background: transparent;
}
.codex-screen::before { display: none; }
.codex-filter-controls { position: relative; display: grid; gap: 8px; }
.codex-filter-rack {
  display: grid;
  grid-template-columns: minmax(140px, 0.76fr) minmax(0, 1.24fr);
  gap: 8px;
  border-block: 1px solid rgba(216, 170, 95, 0.22);
  background: linear-gradient(90deg, rgba(22, 28, 32, 0.82), rgba(8, 12, 15, 0.9));
  padding: 7px 0;
}
.codex-rune-trigger {
  min-height: 52px;
  grid-template-columns: 32px minmax(0, 1fr) 14px;
  gap: 6px;
  padding: 4px 8px 4px 5px;
}
.codex-rune-trigger > img { width: 27px; height: 27px; justify-self: center; object-fit: contain; }
.codex-rune-trigger small { font-size: 0.49rem; letter-spacing: 0.08em; }
.codex-rune-trigger strong { margin-top: 3px; font-size: 0.58rem; letter-spacing: 0.03em; }
.codex-rune-trigger > svg { width: 14px; }
.codex-type-filter {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  border: 0;
  background: transparent;
  container-type: inline-size;
}
.codex-type-filter button {
  display: grid;
  min-width: 0;
  min-height: 52px;
  grid-template-rows: 20px auto;
  place-items: center;
  gap: 3px;
  border: 1px solid rgba(126, 138, 148, 0.42);
  border-radius: var(--frame-corner);
  background: linear-gradient(180deg, rgba(24, 30, 35, 0.96), rgba(8, 12, 15, 0.98));
  color: #8e979e;
  cursor: pointer;
  padding: 5px 1px 4px;
  font-size: clamp(0.34rem, 3.2cqi, 0.45rem);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.1;
  text-transform: uppercase;
}
.codex-type-filter button::before { display: none; }
.codex-type-filter button:first-child { border-left: 1px solid rgba(126, 138, 148, 0.42); }
.codex-type-filter button .codex-exercise-type-icon { width: 24px; height: 20px; object-fit: contain; }
.codex-type-filter button > span {
  display: block;
  width: 100%;
  min-width: 0;
  overflow-wrap: normal;
  hyphens: none;
  text-align: center;
  white-space: nowrap;
  word-break: keep-all;
}
.codex-type-filter button[aria-pressed="true"] {
  border-color: rgba(216, 170, 95, 0.72);
  background: linear-gradient(180deg, rgba(216, 170, 95, 0.15), rgba(216, 170, 95, 0.04));
  color: var(--gold-bright);
  box-shadow: inset 0 0 14px rgba(216, 170, 95, 0.08), 0 0 10px rgba(216, 170, 95, 0.08);
}
.codex-symbol {
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.55;
  vector-effect: non-scaling-stroke;
}
.codex-exercise-type-icon { display: block; object-fit: contain; filter: drop-shadow(0 0 4px rgba(216, 170, 95, 0.22)); }
.codex-exercise-type-icon.compound { transform: scale(1.76); }
.codex-search {
  display: grid;
  min-height: 52px;
  grid-template-columns: 24px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 9px;
  margin: 0;
  border: 1px solid rgba(136, 147, 156, 0.5);
  border-radius: var(--frame-corner);
  background: linear-gradient(180deg, rgba(20, 26, 30, 0.96), rgba(7, 11, 14, 0.98));
  padding: 0 4px 0 12px;
}
.codex-search > svg { width: 20px; }
.codex-search input {
  min-height: 50px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  font-size: 1rem;
  letter-spacing: 0.01em;
}
.codex-search > button {
  width: 44px;
  height: 44px;
  border-left: 1px solid rgba(126, 138, 148, 0.18);
}
.codex-search > button:disabled { opacity: 0.2; }
.codex-active-pool { min-height: 54px; gap: 10px; padding: 8px 2px; }
.codex-active-pool > span { font-size: 0.56rem; }
.codex-rune-path { flex: 1; gap: 3px; }
.codex-path-rune { gap: 4px; }
.codex-path-rune img { width: 21px; height: 21px; object-fit: contain; }
.codex-path-rune > span { font-size: 0.56rem; white-space: nowrap; }
.codex-path-link { width: 8px; }
.codex-rune-path.compact {
  grid-column: 1 / -1;
  gap: 3px;
  border-top: 1px solid rgba(126, 138, 148, 0.16);
  padding-top: 7px;
}
.codex-rune-path.compact .codex-path-rune img { width: 17px; height: 17px; opacity: 0.8; }
.codex-rune-path.compact .codex-path-rune > span { display: none; }
.codex-rune-path.compact .codex-path-link { width: 7px; opacity: 0.7; }
.codex-rune-deck {
  top: calc(100% + 8px);
  max-height: min(68dvh, 610px);
  scrollbar-color: rgba(216, 170, 95, 0.65) rgba(255, 255, 255, 0.06);
  scrollbar-width: thin;
}
.codex-rune-deck::-webkit-scrollbar { display: block; width: 4px; }
.codex-rune-deck::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.06); }
.codex-rune-deck::-webkit-scrollbar-thumb { background: rgba(216, 170, 95, 0.65); }
.codex-rune-choice {
  --codex-node-size: 48px;
  --codex-slot-size: 18px;
  min-height: 71px;
  background-size: var(--codex-node-size) var(--codex-node-size);
  padding-top: 0;
  font-size: 0.55rem;
}
.codex-rune-choice > img {
  width: var(--codex-slot-size);
  height: var(--codex-slot-size);
  margin-top: calc((var(--codex-node-size) - var(--codex-slot-size)) / 2);
  object-fit: contain;
}
.codex-rune-choice.root > img,
.codex-rune-choice.region > img,
.codex-rune-choice.focus > img,
.codex-rune-choice.specific > img {
  width: var(--codex-slot-size);
  height: var(--codex-slot-size);
  margin-top: calc((var(--codex-node-size) - var(--codex-slot-size)) / 2);
  margin-bottom: calc((var(--codex-node-size) - var(--codex-slot-size)) / 2);
}
.codex-rune-choice span { min-height: 20px; margin-top: 7px; overflow-wrap: normal; }
.codex-rune-root { margin-block: 12px 9px; }
.codex-rune-choice.root { --codex-node-size: 58px; --codex-slot-size: 21px; min-height: 82px; }
.codex-rune-regions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.codex-rune-region { min-width: 0; }
.codex-rune-region > .codex-rune-choice { width: 92px; margin: 0 auto 5px; }
.codex-rune-region-branches { grid-template-columns: 1fr; gap: 10px; }
.codex-rune-specifics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  margin-top: 4px;
  padding-top: 7px;
}
.codex-rune-choice.specific { --codex-node-size: 42px; --codex-slot-size: 16px; min-height: 65px; font-size: 0.51rem; }
.codex-rune-choice.specific span { margin-top: 6px; }
.codex-rune-pyramid { container-type: inline-size; padding-top: 10px; }
.codex-rune-level { position: relative; display: grid; align-items: start; }
.codex-rune-level.root { grid-template-columns: minmax(0, 1fr); padding-inline: 38%; }
.codex-rune-level.region { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.codex-rune-level.focus { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.codex-rune-level.specific { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.codex-rune-level + .codex-rune-level { margin-top: 20px; }
.codex-rune-level.region::before,
.codex-rune-level.focus::before,
.codex-rune-level.specific::before {
  position: absolute;
  top: -10px;
  right: 0;
  left: 0;
  height: 1px;
  content: "";
  pointer-events: none;
}
.codex-rune-level.region::before {
  background: linear-gradient(to right, transparent 0 25%, rgba(216, 170, 95, 0.42) 25% 75%, transparent 75% 100%);
}
.codex-rune-level.focus::before {
  background: linear-gradient(to right, transparent 0 12.5%, rgba(216, 170, 95, 0.34) 12.5% 37.5%, transparent 37.5% 62.5%, rgba(216, 170, 95, 0.34) 62.5% 87.5%, transparent 87.5% 100%);
}
.codex-rune-level.specific::before {
  background: linear-gradient(to right,
    transparent 0 6.25%, rgba(126, 138, 148, 0.38) 6.25% 18.75%,
    transparent 18.75% 31.25%, rgba(126, 138, 148, 0.38) 31.25% 43.75%,
    transparent 43.75% 56.25%, rgba(126, 138, 148, 0.38) 56.25% 68.75%,
    transparent 68.75% 81.25%, rgba(126, 138, 148, 0.38) 81.25% 93.75%,
    transparent 93.75% 100%);
}
.codex-rune-level:not(.root) .codex-rune-choice::before {
  position: absolute;
  top: -10px;
  left: 50%;
  width: 1px;
  height: 10px;
  background: rgba(126, 138, 148, 0.4);
  content: "";
}
.codex-rune-level.root .codex-rune-choice::after,
.codex-rune-level.region .codex-rune-choice::after,
.codex-rune-level.focus .codex-rune-choice::after {
  position: absolute;
  bottom: -10px;
  left: 50%;
  width: 1px;
  height: 10px;
  background: rgba(216, 170, 95, 0.36);
  content: "";
}
.codex-rune-level.root .codex-rune-choice { width: 100%; }
.codex-rune-level.region .codex-rune-choice,
.codex-rune-level.focus .codex-rune-choice,
.codex-rune-level.specific .codex-rune-choice { width: 100%; }
.codex-rune-pyramid .codex-rune-choice {
  display: flex;
  min-height: 0;
  flex-direction: column;
  align-items: center;
}
.codex-rune-pyramid .codex-rune-choice > span { margin: 4px 0 0; }
.codex-rune-level.specific .codex-rune-choice {
  --codex-node-size: min(42px, 10cqi);
  --codex-slot-size: min(16px, 4.2cqi);
  min-height: 58px;
  background-size: var(--codex-node-size) var(--codex-node-size);
  padding-inline: 0;
  font-size: clamp(0.36rem, 1.72cqi, 0.43rem);
  line-height: 0.98;
}
.codex-rune-level.specific .codex-rune-choice span {
  min-height: 14px;
  margin-top: 3px;
  overflow-wrap: normal;
  hyphens: none;
  word-break: keep-all;
}
.codex-result-count { margin: 14px 2px 11px; font-size: 0.64rem; }
.codex-type-groups { gap: 24px; }
.codex-type-heading { margin-bottom: 8px; padding-bottom: 8px; }
.codex-type-heading h3 { display: flex; align-items: center; gap: 7px; font-size: 0.84rem; }
.codex-type-heading h3 .codex-exercise-type-icon { width: 26px; height: 22px; }
.codex-type-heading > span { font-size: 0.57rem; }
.codex-type-heading b { font-size: 0.76rem; }
.codex-exercise-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.codex-exercise-card {
  min-height: 116px;
  grid-template-columns: 50px minmax(0, 1fr);
  grid-template-rows: minmax(66px, auto) auto;
  align-items: start;
  column-gap: 8px;
  padding: 9px 9px 7px;
}
.codex-exercise-image-slot {
  display: grid;
  width: 50px;
  min-width: 50px;
  height: 50px;
  min-height: 50px;
  aspect-ratio: 1 / 1;
  align-self: start;
  place-items: center;
  box-sizing: border-box;
  border: 1px dashed rgba(216, 170, 95, 0.38);
  border-radius: var(--frame-corner);
  background: rgba(6, 10, 13, 0.48);
  color: rgba(216, 170, 95, 0.5);
  font-family: Georgia, serif;
  font-size: 1.3rem;
  line-height: 1;
}
.codex-exercise-copy {
  align-self: start;
  padding-top: 3px;
}
.codex-exercise-card h3 {
  margin: 2px 0 0;
  overflow-wrap: normal;
  word-break: keep-all;
  hyphens: none;
  font-size: 0.8rem;
  line-height: 1.22;
}
.codex-exercise-card .codex-exercise-copy > p:last-child {
  margin-top: 5px;
  overflow-wrap: normal;
  hyphens: none;
  font-size: 0.59rem;
  word-break: keep-all;
}
.codex-exercise-movement {
  margin: 0;
  overflow-wrap: normal;
  color: var(--gold-bright);
  hyphens: none;
  font-size: 0.53rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  line-height: 1.2;
  text-transform: uppercase;
  word-break: keep-all;
}
.codex-edict-heading {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(216, 170, 95, 0.42);
  border-radius: var(--frame-corner);
  background:
    linear-gradient(90deg, rgba(216, 170, 95, 0.12), transparent 78%),
    linear-gradient(155deg, rgba(20, 26, 30, 0.98), rgba(6, 10, 13, 0.99));
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.28), 0 14px 30px rgba(0, 0, 0, 0.24);
  padding: 16px 18px;
}
.codex-edict-heading::before {
  position: absolute;
  top: 0;
  right: 18%;
  left: 18%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
  content: "";
}
.codex-edict-heading span { color: var(--gold-bright); font-size: 0.57rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.codex-edict-heading strong { display: block; margin-top: 4px; font-family: Georgia, serif; font-size: 1.08rem; letter-spacing: 0.08em; text-transform: uppercase; }
.codex-edict-heading p { margin: 8px 0 0; color: #a2a9ae; font-size: 0.76rem; line-height: 1.5; }
.codex-edict-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.codex-edict-card {
  min-height: 94px;
  grid-template-columns: 58px minmax(0, 1fr);
  grid-template-rows: auto;
  align-items: center;
  column-gap: 13px;
  padding: 12px 14px;
}
.codex-edict-card .codex-exercise-image-slot { width: 58px; min-width: 58px; height: 58px; min-height: 58px; align-self: center; }
.codex-edict-card .codex-exercise-copy { align-self: center; padding-top: 0; }
.codex-edict-card h3 { margin-top: 3px; font-size: 0.9rem; line-height: 1.2; }
.codex-edict-card .codex-exercise-copy > .codex-edict-description {
  margin: 7px 0 0;
  overflow-wrap: normal;
  color: #a2a9ae;
  font-size: 0.7rem;
  hyphens: none;
  line-height: 1.42;
  word-break: normal;
}
.modal-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: end center;
  padding: 12px max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 50% 50%, rgba(216, 170, 95, 0.08), transparent 38%),
    rgba(1, 4, 6, 0.34);
  backdrop-filter: blur(3px);
}
.modal { width: min(100%, 496px); max-height: 100%; overflow-y: auto; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); border: 1px solid var(--line-bright); border-radius: 18px 18px 0 0; background: #12171c; }
.modal h2 { margin-bottom: 8px; }
.action-deal-modal h2, .action-card-modal h2 { text-transform: uppercase; }
.action-deal-modal > .eyebrow { color: var(--gold-bright); }
.action-deal-modal > .muted { max-width: 340px; margin: 0 auto 20px; line-height: 1.5; }
.action-deal-list {
  display: grid;
  gap: 0;
  margin: 20px 0 0;
  border: 1px solid rgba(216, 170, 95, 0.4);
  background:
    radial-gradient(circle at 50% 50%, rgba(216, 170, 95, 0.07), transparent 30%),
    linear-gradient(145deg, rgba(20, 25, 29, 0.96), rgba(8, 12, 15, 0.96));
  box-shadow: inset 0 0 0 3px rgba(216, 170, 95, 0.025), 0 14px 30px rgba(0, 0, 0, 0.28);
}
.action-deal-list > div {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  padding: 10px 13px;
  text-align: left;
}
.action-deal-list > div + div { border-top: 1px solid rgba(216, 170, 95, 0.18); }
.action-deal-icon { width: 48px; height: 48px; flex: 0 0 auto; object-fit: contain; }
.action-deal-copy { display: grid; min-width: 0; gap: 4px; }
.action-deal-copy strong { font-size: 0.78rem; letter-spacing: 0.09em; text-transform: uppercase; }
.action-deal-copy small { color: #9da4a9; font-size: 0.65rem; line-height: 1.35; }
.action-deal-enter { min-height: 54px; margin-top: 20px; }
.action-card-rune {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 9px;
  color: var(--gold-bright);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.action-card-rune span { color: var(--ember); font-family: Georgia, serif; font-size: 1rem; line-height: 1; }
.action-card-modal h2 {
  margin-bottom: 20px;
}
.action-card-effect {
  max-width: 360px;
  margin: 0 auto 26px;
  border-block: 1px solid rgba(216, 170, 95, 0.24);
  padding: 16px 8px;
  color: #c8cdd2;
  font-size: 0.9rem;
  line-height: 1.55;
  text-align: center;
}
.action-card-controls .button:last-child { flex: 1.18; }
.shift-action-controls { display: grid; gap: 10px; }
.shift-direction-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.shift-action-controls > .button { width: 100%; }
.menu-backdrop { place-items: center; padding: 12px; }
.main-menu {
  width: min(100%, 380px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  border: 1px solid rgba(216, 170, 95, 0.48);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 0, rgba(216, 170, 95, 0.12), transparent 42%),
    linear-gradient(180deg, #171c21, #0f1317);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.68), inset 0 0 28px rgba(216, 170, 95, 0.04);
  padding: 24px 20px;
}
.main-menu-header { margin-bottom: 18px; text-align: center; }
.main-menu-header h2 { margin: 0; color: var(--gold); letter-spacing: 0.16em; text-transform: uppercase; }
.menu-close { width: 38px; height: 38px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 1.4rem; }
.main-menu-item { display: grid; width: 100%; gap: 4px; margin-top: 8px; border: 1px solid var(--line-bright); border-radius: 8px; background: rgba(8, 11, 14, 0.56); color: var(--ink); padding: 13px 12px; cursor: pointer; text-align: center; }
.main-menu-item strong { font-size: 0.86rem; letter-spacing: 0.08em; text-transform: uppercase; }
.main-menu-item span { color: var(--muted); font-size: 0.76rem; }
.main-menu-item.danger strong { color: var(--danger); }
.game-modal-backdrop {
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.game-modal {
  position: relative;
  width: min(calc(100% - 12px), 420px);
  max-height: calc(100dvh - 32px);
  border-color: rgba(216, 170, 95, 0.54);
  background:
    radial-gradient(circle at 50% 0, rgba(216, 170, 95, 0.13), transparent 38%),
    linear-gradient(155deg, rgba(21, 27, 31, 0.995), rgba(7, 11, 14, 0.995));
  box-shadow:
    inset 0 0 0 4px rgba(216, 170, 95, 0.025),
    inset 0 0 50px rgba(0, 0, 0, 0.3),
    0 28px 80px rgba(0, 0, 0, 0.76);
  padding: 32px 24px calc(26px + env(safe-area-inset-bottom));
  text-align: center;
}
.game-modal::before {
  position: absolute;
  top: 0;
  left: 50%;
  width: 96px;
  height: 3px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, var(--ember), var(--gold-bright));
  content: "";
}
.game-modal h2 {
  margin: 3px 0 25px;
  color: #f2ebe0;
  font-size: clamp(2rem, 9vw, 2.55rem);
  letter-spacing: 0.045em;
  line-height: 1;
  text-shadow: 0 3px 15px rgba(0, 0, 0, 0.72);
  text-transform: uppercase;
}
.finish-run-modal h2 { margin-bottom: 25px; }
.finish-run-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: 22px;
  border: 1px solid rgba(216, 170, 95, 0.4);
  background:
    radial-gradient(circle at 50% 50%, rgba(216, 170, 95, 0.07), transparent 30%),
    linear-gradient(145deg, rgba(20, 25, 29, 0.96), rgba(8, 12, 15, 0.96));
  box-shadow: inset 0 0 0 3px rgba(216, 170, 95, 0.025), 0 14px 30px rgba(0, 0, 0, 0.28);
}
.finish-run-summary > div { min-width: 0; padding: 18px 14px; }
.finish-run-summary > div + div { border-left: 1px solid rgba(216, 170, 95, 0.2); }
.finish-run-summary span { display: block; color: #92979b; font-size: 0.6rem; font-weight: 800; letter-spacing: 0.17em; text-transform: uppercase; }
.finish-run-summary strong { display: block; margin-top: 6px; color: var(--gold-bright); font-family: Georgia, serif; font-size: 2.1rem; line-height: 1; text-shadow: 0 0 16px rgba(216, 170, 95, 0.16); }
.finish-run-copy { max-width: 330px; margin: 0 auto 24px; color: #aeb4b9; font-size: 0.86rem; line-height: 1.55; }
.game-modal-controls { gap: 12px; }
.game-modal-controls .button { min-height: 54px; }
.game-modal-controls .button.secondary {
  border-color: rgba(216, 170, 95, 0.32);
  background: linear-gradient(180deg, rgba(31, 38, 43, 0.96), rgba(14, 19, 22, 0.98));
  box-shadow: inset 0 0 0 2px rgba(216, 170, 95, 0.02);
}
.combo-card { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 12px 13px; }
.combo-card + .combo-card { margin-top: 8px; }
.combo-card h3 { margin: 0; font-family: inherit; font-size: 0.78rem; letter-spacing: 0.09em; text-transform: uppercase; }
.combo-card p { margin: 4px 0 0; color: var(--muted); font-size: 0.73rem; }
.combo-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.combo-card-header h3 { padding-top: 2px; }
.combo-focus-badge {
  max-width: 58%;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(145, 174, 195, 0.34);
  border-radius: 999px;
  background: rgba(108, 136, 156, 0.1);
  padding: 3px 7px;
  color: #aebfcb;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.scored-combo { display: flex; align-items: center; justify-content: space-between; border-color: rgba(216, 170, 95, 0.32); }
.scored-combo > div { min-width: 0; flex: 1; }
.scored-combo > strong { color: var(--gold); font-family: Georgia, serif; font-size: 1.1rem; }
.combo-parts { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 9px; }
.combo-part { font-size: 0.7rem; }
.combo-part.complete { color: #92c9a1; }
.combo-part.missing { color: var(--muted); }
.focus-combo-parts { display: grid; grid-template-columns: 1fr; gap: 7px; }
.focus-combo-parts .combo-part { display: flex; align-items: baseline; gap: 5px; }
.focus-combo-parts small { min-width: 0; overflow: hidden; color: #a6afb7; font-size: 0.66rem; text-overflow: ellipsis; white-space: nowrap; }
.focus-combo-parts small b { color: #71808b; font-weight: 800; }
.combo-contributors { margin-top: 9px; color: #929ba3; font-size: 0.65rem; }
.combo-contributors-label { display: block; margin-bottom: 4px; color: #71808b; font-size: 0.57rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.combo-contributors > div { display: flex; min-width: 0; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; }
.combo-contributors i { color: #59636c; font-style: normal; }
.combo-contributor { min-width: 0; color: #a6afb7; }
.combo-contributor b { color: #71808b; font-weight: 800; }
.combo-card .combo-rule { margin-top: 10px; border-top: 1px solid rgba(126, 139, 151, 0.18); padding-top: 8px; color: #929ba3; font-size: 0.68rem; line-height: 1.4; }
.combo-card .combo-rule strong { color: var(--gold); }
.chain-sequence { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 10px; }
.chain-sequence i { color: #66717a; font-size: 0.68rem; font-style: normal; }
.chain-step { color: #92c9a1; font-size: 0.68rem; font-weight: 750; }
.chain-step.needed { color: var(--gold); }
.chain-target { display: flex; justify-content: space-between; gap: 12px; margin-top: 9px; color: var(--muted); font-size: 0.7rem; }
.chain-target strong { color: var(--gold); }
.completion-combos { margin: 25px 0; }

#combo-feedback {
  position: fixed;
  z-index: 55;
  top: 19%;
  left: 50%;
  display: grid;
  min-width: 210px;
  transform: translate(-50%, -12px) scale(0.96);
  border: 1px solid rgba(216, 170, 95, 0.52);
  border-radius: 12px;
  background: rgba(16, 20, 24, 0.96);
  padding: 16px 22px;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transition: 180ms ease;
}
#combo-feedback.visible { transform: translate(-50%, 0) scale(1); opacity: 1; }
#combo-feedback strong { letter-spacing: 0.1em; text-transform: uppercase; }
#combo-feedback span { margin-top: 3px; color: var(--muted); font-size: 0.72rem; }
#combo-feedback b { margin-top: 8px; color: var(--gold); font-family: Georgia, serif; font-size: 1.25rem; }

.debug-panel {
  position: fixed;
  z-index: 12;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  width: min(calc(100% - 24px), 496px);
  max-height: calc(100dvh - 100px);
  margin: 0;
  overflow-y: auto;
  transform: translateX(-50%);
  padding: 14px;
}
.debug-panel summary { cursor: pointer; color: var(--gold); font-weight: 700; }
.debug-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.debug-json { max-height: 340px; overflow: auto; padding: 12px; border-radius: 8px; background: #050709; color: #aeb8c1; font-size: 0.68rem; white-space: pre-wrap; word-break: break-word; }

/* Forged game interface */
:root {
  --gold-bright: #edbd70;
  --gold-deep: #765126;
  --iron-edge: #39434b;
  --iron-black: #090d10;
}

#app {
  border-color: rgba(216, 170, 95, 0.12);
  box-shadow: 0 0 90px rgba(0, 0, 0, 0.74);
}

.button {
  border-color: #9c5b24;
  border-radius: 5px;
  background:
    linear-gradient(180deg, rgba(255, 176, 78, 0.15), transparent 44%),
    linear-gradient(135deg, #a63e14, #6f250e);
  box-shadow:
    inset 0 0 0 2px rgba(255, 180, 83, 0.14),
    inset 0 1px rgba(255, 218, 159, 0.35),
    0 7px 18px rgba(0, 0, 0, 0.28);
  letter-spacing: 0.12em;
}
.button.secondary {
  border-color: #586067;
  background: linear-gradient(180deg, #20262a, #111518);
  box-shadow: inset 0 0 0 1px rgba(216, 170, 95, 0.05);
}
.button.danger { border-color: rgba(185, 65, 48, 0.58); background: linear-gradient(180deg, rgba(119, 36, 25, 0.52), rgba(47, 19, 16, 0.72)); }

.auth-screen {
  position: relative;
  isolation: isolate;
  padding-inline: 26px;
  background:
    radial-gradient(circle at 50% 78%, rgba(224, 91, 54, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(5, 9, 12, 0.76), rgba(5, 8, 10, 0.9)),
    url("/assets/backgrounds/forge-floor.webp") center / cover no-repeat;
}
.auth-screen > * { position: relative; z-index: 1; }
.auth-screen > .brand-logo { width: auto; height: 148px; margin-bottom: 24px; }
.auth-screen > .eyebrow { margin-bottom: 8px; color: #ea6843; }
.auth-screen > h1 {
  margin-bottom: 9px;
  color: #f2ebe0;
  font-size: clamp(2rem, 9vw, 2.8rem);
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.7);
}
.auth-screen > .muted { max-width: 340px; margin-bottom: 0; line-height: 1.5; }
.auth-card {
  max-width: 410px;
  margin-top: 24px;
  border-color: rgba(216, 170, 95, 0.46);
  border-radius: var(--frame-corner);
  background:
    radial-gradient(circle at 50% 0, rgba(216, 170, 95, 0.09), transparent 36%),
    linear-gradient(145deg, rgba(20, 26, 30, 0.98), rgba(8, 12, 15, 0.98));
  box-shadow: inset 0 0 0 3px rgba(216, 170, 95, 0.025), 0 22px 54px rgba(0, 0, 0, 0.48);
  padding: 24px 22px;
}
.auth-card h2 {
  margin-bottom: 8px;
  color: #f1ebe2;
  font-size: 1.35rem;
  letter-spacing: 0.05em;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}
.auth-card .signup-email { font-size: 0.78em; }
.auth-card .muted { line-height: 1.5; }
.auth-card label { color: #b6babd; letter-spacing: 0.14em; }
.auth-card input {
  min-height: 58px;
  border-color: #4b565f;
  border-radius: var(--frame-corner);
  background: rgba(6, 10, 12, 0.86);
  color: #f2ede5;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.32);
}
.auth-card input:focus { border-color: var(--gold-bright); box-shadow: 0 0 0 3px rgba(216, 170, 95, 0.13), inset 0 0 18px rgba(0, 0, 0, 0.32); }
.auth-card input[name="email"] { font-size: 16px; }
.auth-card input[name="otp"] { font-family: Georgia, serif; font-size: 1.35rem; letter-spacing: 0.18em; }
.auth-card .button.full { min-height: 54px; }
.auth-card .button + .button { margin-top: 10px; }
.auth-legal-notice {
  margin: 18px 0 0;
  color: #858c91;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  line-height: 1.4;
}
.auth-card .dev-code {
  border: 1px solid rgba(216, 170, 95, 0.4);
  border-radius: var(--frame-corner);
  background: rgba(216, 170, 95, 0.07);
  color: var(--gold-bright);
  font-family: inherit;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.signup-screen { justify-content: flex-start; }
.signup-screen > .brand-logo { height: 104px; margin-bottom: 16px; }
.signup-card { margin-top: 18px; }
.terms-scroll {
  max-height: min(36dvh, 290px);
  margin: 20px 0 16px;
  overflow-y: auto;
  border: 1px solid rgba(216, 170, 95, 0.28);
  border-radius: var(--frame-corner);
  outline: none;
  background: rgba(4, 7, 9, 0.72);
  padding: 16px;
  color: #b9bec2;
  font-size: 0.76rem;
  line-height: 1.55;
  scrollbar-width: thin;
  scrollbar-color: rgba(216, 170, 95, 0.58) rgba(255, 255, 255, 0.05);
  user-select: text;
  -webkit-user-select: text;
}
.terms-scroll::-webkit-scrollbar { display: block; width: 7px; }
.terms-scroll::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); }
.terms-scroll::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(216, 170, 95, 0.58); }
.terms-scroll:focus { border-color: var(--gold-bright); box-shadow: 0 0 0 3px rgba(216, 170, 95, 0.13); }
.terms-scroll h3 {
  margin: 0 0 4px;
  color: #f1ebe2;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.3;
}
.terms-scroll .terms-effective { margin-bottom: 16px; color: var(--gold); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; }
.terms-scroll h4 { margin: 18px 0 5px; color: #e4ddd3; font-size: 0.76rem; letter-spacing: 0.06em; text-transform: uppercase; }
.terms-scroll p { margin-bottom: 11px; }
.terms-scroll p:last-child { margin-bottom: 0; }
.terms-scroll a,
.settings-legal-copy a { color: var(--gold-bright); user-select: text; -webkit-user-select: text; }
.auth-card .terms-consent {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  margin-bottom: 18px;
  color: #d1d0cc;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.45;
  text-transform: none;
}
.auth-card .terms-checkbox {
  width: 20px;
  min-height: 20px;
  height: 20px;
  margin: 1px 0 0;
  padding: 0;
  accent-color: var(--ember);
}

.game-screen {
  position: relative;
  background: #070b0e;
}
.game-topbar {
  z-index: 10;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 0;
  min-height: calc(60px + env(safe-area-inset-top));
  overflow: visible;
  padding: env(safe-area-inset-top) 0 0;
  border-bottom: 1px solid rgba(216, 170, 95, 0.34);
  background:
    radial-gradient(circle at 50% 0, rgba(216, 170, 95, 0.08), transparent 55%),
    linear-gradient(180deg, rgba(16, 21, 25, 0.99), rgba(8, 12, 15, 0.99));
  box-shadow: 0 9px 25px rgba(0, 0, 0, 0.5), inset 0 -1px rgba(255, 255, 255, 0.025);
}
.game-menu-button {
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  margin-left: 13px;
  border-color: var(--gold-deep);
  border-radius: var(--frame-corner);
  background: linear-gradient(145deg, #171c20, #0b0f12);
  background-clip: padding-box;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}
.game-menu-button span {
  width: 18px;
  height: 13px;
  background: linear-gradient(to bottom, var(--gold-bright) 0 2px, transparent 2px 5.5px, var(--gold-bright) 5.5px 7.5px, transparent 7.5px 11px, var(--gold-bright) 11px 13px);
  filter: drop-shadow(0 0 4px rgba(216, 170, 95, 0.22));
}
.core-stat-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
}
.core-stat-label { display: inline-flex; align-items: center; justify-content: center; gap: 0.42em; }
.home-active-stats { display: flex; align-items: center; gap: 15px; }
.home-active-stats > span { display: inline-flex; align-items: center; gap: 5px; }
.home-active-stats .core-stat-icon { width: 14px; height: 14px; color: var(--gold-bright); }
.game-stats { height: 100%; align-items: stretch; }
.top-stat {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: clamp(3px, 1.4vw, 8px);
  border-left: 1px solid rgba(126, 108, 79, 0.16);
  padding-inline: 2px;
  color: #92979b;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
}
.top-stat:first-child { border-left: 0; }
.top-stat-icon {
  display: block;
  width: clamp(25px, 6.7vw, 34px);
  height: clamp(30px, 7.4vw, 38px);
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.58));
}
.top-stat-copy { display: grid; min-width: 0; justify-items: center; }
.top-stat-label { display: block; line-height: 1; }
.top-stat strong {
  display: block;
  margin-top: 4px;
  color: #f1e8da;
  font-size: 1.1rem;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}
.completion-score > .core-stat-label,
.history-score > .core-stat-label,
.finish-run-summary .core-stat-label { display: inline-flex; }
.completion-score .core-stat-icon { width: 17px; height: 17px; color: var(--gold-bright); }
.core-stat-summary .core-stat-icon { width: 17px; height: 17px; margin-bottom: 4px; color: var(--gold-bright); }
.history-score .core-stat-icon { width: 12px; height: 12px; color: var(--gold-bright); }
.finish-run-summary .core-stat-icon { width: 15px; height: 15px; color: var(--gold-bright); }
.map-reference-stack { right: 17px; bottom: 17px; gap: 7px; }
.map-reference summary {
  position: relative;
  display: inline-flex;
  width: max-content;
  min-height: 38px;
  align-items: center;
  gap: 6px;
  border-color: rgba(190, 128, 54, 0.62);
  border-radius: var(--frame-corner);
  outline: none;
  background:
    linear-gradient(90deg, rgba(216, 170, 95, 0.06), transparent 35%),
    linear-gradient(180deg, rgba(18, 23, 27, 0.98), rgba(9, 13, 16, 0.98));
  padding: 0 11px;
  color: #e8e3dc;
  font-size: 0.64rem;
  letter-spacing: 0.13em;
  box-shadow: inset 0 0 13px rgba(216, 170, 95, 0.04), 0 7px 18px rgba(0, 0, 0, 0.32);
}
.map-reference summary:focus-visible { border-color: var(--gold-bright); box-shadow: 0 0 0 2px rgba(216, 170, 95, 0.16); }
.map-reference summary::before { content: none; }
.map-reference-icon { width: 16px; height: 16px; flex: 0 0 16px; color: var(--gold-bright); }
.map-reference summary .map-reference-label {
  min-width: 0;
  margin: 0;
  overflow: visible;
  color: #e8e3dc;
  white-space: nowrap;
}
.map-reference summary .map-reference-count {
  display: block;
  width: auto;
  height: auto;
  margin: 0 0 0 2px;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--gold-bright);
  font-family: Georgia, serif;
  font-size: 0.72rem;
  line-height: 1;
  text-align: right;
}
.map-reference[open] { width: max-content; }
.map-reference[open] summary { border-color: var(--gold-bright); color: #fff8ed; box-shadow: 0 0 18px rgba(216, 170, 95, 0.16); }
.map-reference[open] .map-reference-frame {
  position: fixed;
  z-index: 18;
  top: calc(clamp(174px, 20.106dvh, 189px) + env(safe-area-inset-top));
  bottom: calc(174px + env(safe-area-inset-bottom));
  left: 50%;
  width: min(calc(100% - 64px), 360px);
  max-height: none;
  margin: 0;
  transform: translateX(-50%);
  background: linear-gradient(145deg, rgba(224, 166, 87, 0.82), rgba(88, 65, 39, 0.72));
  border-radius: var(--frame-corner);
  overflow: hidden;
  padding: 1px;
  clip-path: none;
  filter: drop-shadow(0 24px 36px rgba(0, 0, 0, 0.66));
  pointer-events: auto;
}
.map-reference-panel {
  position: relative;
  width: 100%;
  height: 100%;
  max-height: none;
  border: 0;
  border-radius: var(--frame-corner);
  background:
    radial-gradient(circle at 50% -8%, rgba(216, 170, 95, 0.14), transparent 31%),
    radial-gradient(circle at 50% 45%, rgba(45, 61, 68, 0.17), transparent 58%),
    linear-gradient(145deg, rgba(19, 25, 29, 0.995), rgba(8, 13, 16, 0.995));
  box-shadow: inset 0 0 52px rgba(0, 0, 0, 0.48);
  margin: 0;
  padding: 0;
  clip-path: none;
  overflow: hidden;
}
.map-reference-panel::after {
  position: absolute;
  z-index: 4;
  inset: 8px;
  border: 1px solid rgba(216, 170, 95, 0.13);
  border-radius: calc(var(--frame-corner) - 2px);
  box-shadow: inset 0 0 22px rgba(216, 170, 95, 0.025);
  content: "";
  pointer-events: none;
}
.map-reference-heading {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 0;
  align-content: start;
  margin: 0;
  border: 0;
  padding: 38px 28px 10px;
  text-align: center;
}
.map-reference-heading h2 {
  margin: 0;
  color: #f2e9dc;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.035em;
  line-height: 1.12;
  white-space: nowrap;
}
.map-reference-heading h2::after {
  display: block;
  width: 142px;
  height: 9px;
  margin: 8px auto 5px;
  background:
    linear-gradient(90deg, rgba(216, 170, 95, 0), rgba(216, 170, 95, 0.58) 42%, transparent 42% 58%, rgba(216, 170, 95, 0.58) 58%, rgba(216, 170, 95, 0)) center / 100% 1px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M4 .7 7.3 4 4 7.3.7 4Z' fill='none' stroke='%23d8aa5f' stroke-width='1'/%3E%3C/svg%3E") center / 8px 8px no-repeat;
  content: "";
}
.map-reference-heading p:last-child { margin: 0; color: #a9afb4; font-size: 0.63rem; line-height: 1.45; }
.map-reference[open] > .map-reference-sigil {
  position: fixed;
  z-index: 20;
  top: calc(clamp(141px, 16.596dvh, 156px) + env(safe-area-inset-top));
  left: 50%;
  display: grid;
  width: 66px;
  height: 66px;
  transform: translateX(-50%);
  place-items: center;
  border: 1px solid rgba(216, 170, 95, 0.76);
  border-radius: 50%;
  background: radial-gradient(circle, #192127 0 52%, #0a0f12 54% 66%, #3a3021 68% 70%, #10161a 72%);
  color: var(--gold-bright);
  font-size: 1.7rem;
  box-shadow: 0 0 0 5px rgba(9, 14, 17, 0.86), 0 0 0 6px rgba(216, 170, 95, 0.22), 0 0 28px rgba(216, 170, 95, 0.2);
  pointer-events: none;
}
.map-reference-sigil-icon { width: 36px; height: 36px; filter: drop-shadow(0 0 5px rgba(216, 170, 95, 0.34)); stroke-width: 1.8; }
.rune-label-toggles {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 16px;
  border: 1px solid var(--iron-edge);
  border-bottom: 0;
  background: rgba(6, 10, 13, 0.5);
}
.rune-label-toggle {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 8px 10px;
  background: transparent;
}
.rune-label-toggle + .rune-label-toggle { border-left: 1px solid var(--iron-edge); }
.rune-label-toggle strong { color: var(--gold-bright); font-size: 0.63rem; letter-spacing: 0.14em; text-transform: uppercase; }
.rune-label-toggle small { max-width: 220px; font-size: 0.6rem; line-height: 1.25; }
.rune-label-toggle input {
  appearance: none;
  width: 44px;
  height: 24px;
  min-height: 24px;
  border: 1px solid var(--gold-deep);
  border-radius: 99px;
  background: radial-gradient(circle at 11px 50%, #787f84 0 7px, transparent 7.5px), #101519;
  cursor: pointer;
}
.rune-label-toggle input:checked { border-color: var(--gold-bright); background: radial-gradient(circle at calc(100% - 11px) 50%, var(--gold-bright) 0 7px, transparent 7.5px), #282014; }
.rune-legend-grid {
  position: relative;
  z-index: 1;
  min-height: 0;
  grid-template-rows: repeat(8, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  margin: 0 16px;
  border: 1px solid var(--iron-edge);
  border-radius: 0 0 var(--frame-corner) var(--frame-corner);
}
.rune-legend-item {
  display: grid;
  min-height: 0;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  border: 0;
  border-right: 1px solid var(--iron-edge);
  border-bottom: 1px solid var(--iron-edge);
  border-radius: 0;
  background: rgba(8, 12, 15, 0.42);
  padding: 2px 6px;
}
.rune-legend-item:nth-child(2n) { border-right: 0; }
.rune-legend-item:nth-last-child(-n + 2) { border-bottom: 0; }
.rune-legend-item img { width: 35px; height: 35px; filter: drop-shadow(0 0 5px rgba(216, 170, 95, 0.12)); }
.rune-legend-item strong { color: #ede6da; font-family: Georgia, serif; font-size: 0.7rem; font-weight: 600; }
.rune-legend-item small { margin-top: 1px; font-size: 0.62rem; }
.rune-legend-panel { display: grid; grid-template-rows: 116px 56px minmax(0, 1fr) 48px; overflow-y: hidden; }
.map-reference-footer {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  margin: 0 20px;
  color: #7d858b;
  font-family: Georgia, serif;
  font-size: 0.68rem;
  font-style: italic;
  letter-spacing: 0.04em;
  text-align: center;
}
.map-reference-footer::before {
  width: 100%;
  height: 9px;
  margin-bottom: 7px;
  background:
    linear-gradient(90deg, rgba(216, 170, 95, 0), rgba(216, 170, 95, 0.45) 43%, transparent 43% 57%, rgba(216, 170, 95, 0.45) 57%, rgba(216, 170, 95, 0)) center / 100% 1px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M4 .7 7.3 4 4 7.3.7 4Z' fill='none' stroke='%23956f36' stroke-width='1'/%3E%3C/svg%3E") center / 8px 8px no-repeat;
  content: "";
}
.combos-reference-panel > .eyebrow { color: var(--gold-bright); }
.combos-reference-panel .combo-card { border-color: #3c464d; border-radius: 3px; background: rgba(8, 13, 16, 0.66); }
.map-reference[open] .combos-reference-panel {
  display: grid;
  grid-template-rows: 116px minmax(0, 1fr);
  overflow: hidden;
}
.combos-scroll-body { position: relative; z-index: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 4px 18px 82px; scroll-padding-bottom: 82px; }
.combos-more-cue {
  position: absolute;
  z-index: 5;
  right: 1px;
  bottom: 1px;
  left: 1px;
  display: flex;
  height: 80px;
  align-items: end;
  justify-content: center;
  gap: 8px;
  border-bottom: 1px solid rgba(216, 170, 95, 0.28);
  background: linear-gradient(180deg, transparent 0, rgba(7, 11, 14, 0.97) 36%, rgba(7, 11, 14, 1) 100%);
  padding-bottom: 16px;
  color: var(--gold-bright);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  pointer-events: none;
  text-transform: uppercase;
}
.combos-more-cue b { font-size: 1rem; line-height: 0.8; }
.combos-more-cue[hidden] { display: none; }

.action-dock {
  height: 110px;
  min-height: 110px;
  padding: 8px;
  border-top: 1px solid rgba(216, 170, 95, 0.18);
  background: linear-gradient(180deg, #0e1316, #070b0d);
}
.path-strip {
  --path-strip-identity-width: 136px;
  --path-strip-tail-width: 94px;
  height: 94px;
  min-height: 94px;
  border: 1px solid rgba(216, 170, 95, 0.38);
  border-radius: 4px;
  background:
    radial-gradient(circle at 15% 50%, rgba(216, 170, 95, 0.06), transparent 27%),
    linear-gradient(180deg, #171c1f, #0d1114);
  box-shadow: inset 0 0 0 3px rgba(216, 170, 95, 0.025), inset 0 0 28px rgba(0, 0, 0, 0.34);
}
.path-strip.empty { grid-template-columns: minmax(0, 1fr) minmax(132px, 0.46fr); }
.path-strip.selected { grid-template-columns: var(--path-strip-identity-width) minmax(0, 1fr) var(--path-strip-tail-width); }
.path-strip.future { display: grid; grid-template-columns: var(--path-strip-identity-width) minmax(0, 1fr) var(--path-strip-tail-width); }
:is(.path-strip-glyph, .skill-rune-glyph) { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid rgba(216, 170, 95, 0.54); border-radius: 50%; background: #0b1013; }
.path-strip-glyph { flex: 0 0 36px; margin: 0 0 4px; }
:is(.path-strip-glyph, .skill-rune-glyph) img { width: 28px; height: 28px; object-fit: contain; }
.path-strip-node { align-items: center; gap: 1px; border-right-color: rgba(216, 170, 95, 0.16); padding: 3px 6px; text-align: center; text-transform: uppercase; }
.path-strip-node strong,
.path-strip-node span { width: 100%; }
.path-strip-node strong {
  display: -webkit-box;
  max-height: 2.1em;
  overflow: hidden;
  color: #f1ece4;
  font-family: Georgia, serif;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  line-height: 1.05;
  text-overflow: clip;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.path-strip-node span {
  display: -webkit-box;
  max-height: 2.1em;
  color: var(--gold-bright);
  font-size: 0.5rem;
  line-height: 1.05;
  text-overflow: clip;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.path-strip-applied { padding: 9px; }
.path-strip-action-list {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-wrap: wrap;
  align-content: center;
  justify-content: start;
  gap: 3px;
  overflow: hidden;
}
.path-strip-action-list span { max-width: 100%; flex: 0 1 auto; border-color: rgba(216, 170, 95, 0.32); border-radius: 3px; padding: 2px 4px; font-size: 0.5rem; line-height: 1.1; }
.future-path-guidance {
  display: flex;
  min-width: 0;
  height: 100%;
  grid-column: 2;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  overflow: hidden;
  padding: 10px 14px;
  text-align: center;
}
.future-path-guidance p { max-width: 190px; margin: 0; color: #8f979e; font-size: 0.62rem; font-weight: 600; letter-spacing: 0.03em; line-height: 1.35; text-transform: none; }
.future-path-cue {
  display: flex;
  min-width: 0;
  height: 100%;
  grid-column: 3;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  border-left: 1px solid rgba(216, 170, 95, 0.18);
  padding: 7px 10px;
}
.future-path-status-rune { position: relative; display: grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; }
.future-path-status-rune img { position: absolute; width: 40px; height: 40px; object-fit: contain; filter: brightness(0.74) saturate(0.72); }
.future-path-status-rune svg {
  position: relative;
  width: 15px;
  height: 15px;
  fill: rgba(7, 11, 14, 0.92);
  stroke: var(--gold-bright);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.future-path-cue strong {
  color: #a6adb2;
  font-size: 0.52rem;
  letter-spacing: 0.14em;
}
.path-strip-end.finish-run-button {
  --dock-action-border: #d3a257;
  --dock-action-top: #6c5229;
  --dock-action-bottom: #382a18;
  --dock-action-glow: rgba(216, 170, 95, 0.16);
}
.path-strip-end.finish-run-button {
  margin: 9px;
  border: 1px solid var(--dock-action-border);
  background:
    linear-gradient(180deg, rgba(255, 225, 169, 0.16), transparent 42%),
    linear-gradient(135deg, var(--dock-action-top), var(--dock-action-bottom));
  color: #fff3de;
  box-shadow: inset 0 0 0 2px rgba(255, 219, 153, 0.1), 0 0 18px var(--dock-action-glow);
  padding: 0 17px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.path-strip-end.finish-run-button:hover { filter: brightness(1.12); color: #fffaf0; }
.path-strip-end.finish-run-button.finish-run-button-ready {
  --dock-action-border: var(--gold-bright);
  --dock-action-top: #8b6a33;
  --dock-action-bottom: #49351c;
}
.path-strip.completed {
  display: grid;
  height: 94px;
  min-height: 94px;
  grid-template-columns: var(--path-strip-identity-width) minmax(0, 1fr);
  align-items: stretch;
  text-transform: none;
}
.completed-path-strip-content {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) var(--path-strip-tail-width);
}
.completed-path-strip-meta { display: grid; grid-template-rows: repeat(2, minmax(0, 1fr)); border-left: 1px solid rgba(216, 170, 95, 0.18); }
.completed-path-strip-score { display: grid; place-items: center; color: var(--gold-bright); white-space: nowrap; }
.completed-path-strip-score-value { display: inline-flex; align-items: baseline; gap: 3px; }
.completed-path-strip-score-value strong { color: var(--gold-bright); font-family: Georgia, serif; font-size: 1rem; }
.completed-path-strip-score-value > span { color: var(--muted); font-size: 0.62rem; font-weight: 800; letter-spacing: 0.04em; }
.completed-path-strip-depth { display: flex; align-items: center; justify-content: center; gap: 5px; border-bottom: 1px solid rgba(216, 170, 95, 0.18); color: var(--gold-bright); }
.completed-path-strip-depth .core-stat-icon { width: 17px; height: 17px; stroke-width: 2; }
.completed-path-strip-depth strong { color: var(--ink); font-family: Georgia, serif; font-size: 0.88rem; }
.completed-path-strip-sets {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(var(--completed-set-columns), minmax(0, 1fr));
  grid-template-rows: repeat(var(--completed-set-rows), minmax(0, 1fr));
  align-content: stretch;
  justify-content: stretch;
  gap: 3px;
  overflow: hidden;
  padding: 4px;
}
.completed-path-strip-sets.few { grid-template-columns: repeat(var(--completed-set-columns), 84px); grid-template-rows: 84px; align-content: center; justify-content: start; }
.completed-path-strip-set { display: flex; min-width: 0; min-height: 0; align-items: center; justify-content: center; flex-direction: column; gap: 1px; overflow: hidden; border: 1px solid rgba(216, 170, 95, 0.24); border-radius: 3px; background: rgba(216, 170, 95, 0.05); padding: 2px 4px; }
.completed-path-strip-set > strong { color: var(--ink); font-size: 0.68rem; line-height: 1; white-space: nowrap; }
.completed-path-strip-set > span { color: var(--gold-bright); font-size: 0.6rem; font-weight: 800; line-height: 1; white-space: nowrap; }
.completed-path-strip-sets.compact .completed-path-strip-set > strong { font-size: 0.58rem; }
.completed-path-strip-sets.compact .completed-path-strip-set > span { font-size: 0.52rem; }
.completed-path-strip-sets.dense .completed-path-strip-set { gap: 0; padding: 1px 2px; }
.completed-path-strip-sets.dense .completed-path-strip-set > strong { font-size: 0.5rem; }
.completed-path-strip-sets.dense .completed-path-strip-set > span { font-size: 0.46rem; }

.exercise-game-screen { background: #080c0f; }
.exercise-screen {
  position: relative;
  padding: 34px 26px calc(44px + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(5, 9, 12, 0.9), rgba(5, 8, 10, 0.76) 55%, rgba(9, 8, 7, 0.74)),
    url("/assets/backgrounds/forge-floor.webp") center / cover no-repeat;
}
.exercise-screen::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  background: radial-gradient(circle at 50% 86%, rgba(224, 91, 54, 0.2), transparent 31%);
  content: "";
  pointer-events: none;
}
.exercise-screen > * { position: relative; z-index: 1; }
.exercise-briefing { padding-bottom: 0; }
.exercise-classification span,
.rune-value-panel span,
.seal-result-summary span {
  color: #858c92;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.exercise-draw { margin-top: 0; }
.exercise-draw > .eyebrow { margin-bottom: 9px; color: #ea6843; }
.exercise-title {
  max-width: 455px;
  margin: 0;
  color: #eee7dc;
  font-size: clamp(2.35rem, 10vw, 3.35rem);
  letter-spacing: 0.015em;
  line-height: 0.94;
  text-shadow: 0 3px 15px rgba(0, 0, 0, 0.72);
}
.exercise-classification {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 23px;
  border-block: 1px solid rgba(216, 170, 95, 0.2);
  background: rgba(5, 9, 12, 0.34);
}
.exercise-classification > div { display: grid; min-width: 0; min-height: 74px; align-content: center; padding: 13px 15px; }
.exercise-classification > div + div { border-left: 1px solid rgba(216, 170, 95, 0.16); }
.exercise-classification > div:nth-child(3) { border-top: 1px solid rgba(216, 170, 95, 0.16); border-left: 0; }
.exercise-classification > div:nth-child(4) { border-top: 1px solid rgba(216, 170, 95, 0.16); }
.exercise-classification-copy {
  display: grid;
  min-width: 0;
  grid-template-rows: 10px minmax(34px, auto);
  align-content: center;
  row-gap: 5px;
}
.exercise-classification-copy > span { align-self: start; line-height: 1.1; }
.exercise-classification strong { display: block; align-self: start; margin-top: 0; overflow-wrap: anywhere; color: #f0e8dd; font-size: 0.86rem; line-height: 1.25; text-transform: uppercase; }
.exercise-classification > div:last-child strong { color: var(--gold-bright); font-family: Georgia, serif; font-size: 1.2rem; line-height: 1; }
.exercise-effort-stat .exercise-classification-copy > span { display: flex; align-items: center; gap: 5px; }
.exercise-effort-stat .core-stat-icon { width: 14px; height: 14px; color: var(--gold-bright); }
.exercise-node-identity { grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 10px; }
.exercise-node-identity .exercise-glyph { width: 32px; height: 32px; object-fit: contain; }
.exercise-node-identity strong { color: var(--gold-bright); }
.exercise-rune-effects {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  border: 1px solid rgba(216, 170, 95, 0.28);
  background: rgba(5, 9, 12, 0.5);
  padding: 10px 12px;
}
.exercise-rune-effects > strong {
  color: #92999f;
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.exercise-rune-effect-list { display: flex; min-width: 0; flex-wrap: wrap; gap: 5px; }
.exercise-rune-effect-list span {
  max-width: 100%;
  overflow: hidden;
  border: 1px solid rgba(216, 170, 95, 0.38);
  border-radius: 3px;
  background: rgba(216, 170, 95, 0.08);
  padding: 4px 7px;
  color: #e3c894;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.exercise-briefing.has-rune-effects + .rune-value-panel { margin-top: 12px; }
.rune-value-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  min-height: 104px;
  align-items: stretch;
  margin-top: 24px;
  border: 1px solid rgba(216, 170, 95, 0.48);
  background:
    radial-gradient(circle at 52% 50%, rgba(216, 170, 95, 0.06), transparent 18%),
    linear-gradient(135deg, rgba(29, 34, 37, 0.96), rgba(10, 14, 17, 0.96));
  box-shadow: inset 0 0 0 3px rgba(216, 170, 95, 0.025), 0 13px 28px rgba(0, 0, 0, 0.3);
}
.rune-value-panel > div { display: grid; min-width: 0; align-content: start; padding: 20px 18px; }
.rune-value-panel > div + div { border-left: 1px solid rgba(216, 170, 95, 0.2); }
.rune-value-panel strong { display: block; margin-top: 4px; color: var(--gold-bright); font-family: Georgia, serif; line-height: 1; }
.rune-value-current strong,
.rune-value-next strong { font-size: 2rem; }
.rune-value-panel strong small { color: #a3a9ae; font-family: inherit; font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; }
.rune-value-next > small { display: block; margin-top: 6px; color: #b9bec2; font-size: 0.66rem; line-height: 1.3; }
.rune-value-next.capped strong { color: #aeb4b9; }
.set-form,
.claimed-panel {
  margin: 22px 0;
  border: 1px solid rgba(216, 170, 95, 0.4);
  border-radius: 2px;
  background:
    linear-gradient(145deg, rgba(21, 27, 31, 0.97), rgba(8, 12, 15, 0.97));
  box-shadow: inset 0 0 0 3px rgba(216, 170, 95, 0.025), 0 18px 38px rgba(0, 0, 0, 0.34);
  padding: 24px 22px;
  clip-path: polygon(9px 0, calc(100% - 9px) 0, 100% 9px, 100% calc(100% - 9px), calc(100% - 9px) 100%, 9px 100%, 0 calc(100% - 9px), 0 9px);
}
.set-form h3 { display: flex; align-items: baseline; gap: 7px; margin-bottom: 21px; color: #f1ebe2; font-family: Georgia, serif; font-size: 1.55rem; }
.set-form h3 span { color: var(--gold-bright); font-family: inherit; font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; }
.set-form label { color: #b6babd; letter-spacing: 0.14em; }
.set-form input { min-height: 76px; border-radius: 5px; background: rgba(6, 10, 12, 0.78); color: #f2ede5; font-family: Georgia, serif; font-size: 2.25rem; }
.set-form .button.full { min-height: 60px; margin-top: 24px; font-size: 0.9rem; }
.claimed-panel > .eyebrow { color: #ea6843; }
.claimed-panel > .muted { line-height: 1.5; }
.exercise-actions { margin-top: 22px; }
.exercise-actions .button { width: 100%; min-height: 54px; }
.set-item { border-top-color: rgba(216, 170, 95, 0.16); }
.set-number { border-color: rgba(216, 170, 95, 0.44); color: var(--gold-bright); }

.exercise-dialog > .eyebrow { color: var(--gold-bright); }
.exercise-dialog h2 {
  max-width: 360px;
  margin: 4px auto 22px;
  overflow-wrap: anywhere;
  font-size: clamp(1.75rem, 8vw, 2.25rem);
}
.exercise-dialog-copy {
  max-width: 340px;
  margin: 0 auto 25px;
  border-block: 1px solid rgba(216, 170, 95, 0.24);
  padding: 16px 8px;
  color: #aeb4b9;
  font-size: 0.86rem;
  line-height: 1.55;
}
.seal-exercise-modal .exercise-dialog-copy { border: 0; padding: 0 8px; }
.seal-result-modal {
  display: grid;
  max-height: calc(100dvh - 32px);
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0, rgba(232, 188, 112, 0.2), transparent 42%),
    linear-gradient(155deg, rgba(41, 48, 53, 0.995), rgba(18, 24, 28, 0.995));
  box-shadow:
    inset 0 0 0 4px rgba(216, 170, 95, 0.04),
    inset 0 0 42px rgba(0, 0, 0, 0.18),
    0 28px 80px rgba(0, 0, 0, 0.62);
  padding: 0;
}
.seal-result-scroll {
  min-height: 0;
  overflow-y: auto;
  padding: 32px 24px 8px;
}
.seal-result-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 22px;
  border: 1px solid rgba(216, 170, 95, 0.4);
  background:
    radial-gradient(circle at 50% 50%, rgba(216, 170, 95, 0.07), transparent 34%),
    linear-gradient(145deg, rgba(20, 25, 29, 0.96), rgba(8, 12, 15, 0.96));
  box-shadow: inset 0 0 0 3px rgba(216, 170, 95, 0.025), 0 14px 30px rgba(0, 0, 0, 0.28);
}
.seal-result-summary > div { min-width: 0; padding: 17px 8px; }
.seal-result-summary > div + div { border-left: 1px solid rgba(216, 170, 95, 0.2); }
.seal-result-summary strong {
  display: block;
  margin-top: 7px;
  color: #eee6db;
  font-family: Georgia, serif;
  font-size: 1.45rem;
  line-height: 1;
}
.seal-result-summary strong small { color: #a3a9ae; font-family: inherit; font-size: 0.55rem; letter-spacing: 0.08em; text-transform: uppercase; }
.seal-result-summary .seal-result-score strong { color: var(--gold-bright); }
.seal-result-chains { margin: 0 0 22px; text-align: left; }
.seal-result-chains > .eyebrow { margin-bottom: 10px; color: var(--gold-bright); text-align: center; }
.seal-result-chains .combo-card { background: rgba(7, 11, 14, 0.68); }
.seal-result-controls {
  display: block;
  border-top: 1px solid rgba(216, 170, 95, 0.2);
  background: rgba(10, 14, 17, 0.98);
  box-shadow: 0 -12px 28px rgba(0, 0, 0, 0.24);
  padding: 15px 24px calc(18px + env(safe-area-inset-bottom));
}
.seal-result-controls .button { width: 100%; }
.seal-result-controls .button.full { margin-top: 0; }

.edict-reward {
  margin-top: 24px;
  border-top: 1px solid rgba(216, 170, 95, 0.24);
  padding-top: 22px;
  text-align: left;
}
.edict-reward-heading { text-align: center; }
.edict-reward-heading > .eyebrow { margin-bottom: 6px; color: var(--gold-bright); }
.edict-reward-heading h3 {
  margin: 0;
  color: #f2ebe0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.edict-reward-heading > p:last-child {
  max-width: 340px;
  margin: 8px auto 16px;
  color: #aeb4b9;
  font-size: 0.72rem;
  line-height: 1.45;
}
.edict-reward-options { display: grid; gap: 8px; }
.edict-reward-option {
  display: grid;
  width: 100%;
  min-height: 68px;
  grid-template-columns: 48px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(216, 170, 95, 0.3);
  border-radius: var(--frame-corner);
  background: linear-gradient(145deg, rgba(20, 25, 29, 0.96), rgba(8, 12, 15, 0.96));
  padding: 9px 11px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.edict-reward-option:hover { border-color: rgba(240, 201, 128, 0.68); }
.edict-reward-option:focus-visible,
.edict-reward-slot:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.edict-reward-option.selected {
  border-color: var(--gold-bright);
  background:
    radial-gradient(circle at 12% 50%, rgba(216, 170, 95, 0.15), transparent 34%),
    linear-gradient(145deg, rgba(34, 34, 30, 0.98), rgba(10, 13, 15, 0.98));
  box-shadow: inset 0 0 0 2px rgba(216, 170, 95, 0.08), 0 0 20px rgba(216, 170, 95, 0.08);
}
.edict-reward-choice-mark { color: var(--gold-bright); font-size: 1rem; opacity: 0; }
.edict-reward-option.selected .edict-reward-choice-mark { opacity: 1; }
.edict-reward-bar-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 20px 2px 9px;
  color: #979da2;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.edict-reward-bar-heading strong { color: var(--gold-bright); font-size: 0.68rem; }
.edict-reward-slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.edict-reward-slot {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 78px;
  place-items: center;
  align-content: center;
  gap: 3px;
  border: 1px solid rgba(216, 170, 95, 0.28);
  border-radius: var(--frame-corner);
  background: rgba(7, 11, 14, 0.7);
  padding: 5px 4px;
  color: #d9d7d2;
  text-align: center;
}
button.edict-reward-slot { cursor: pointer; }
button.edict-reward-slot:disabled { cursor: default; opacity: 1; }
.edict-reward-slot img { width: 43px; height: 43px; object-fit: contain; }
.edict-reward-slot strong {
  width: 100%;
  overflow: hidden;
  font-size: 0.53rem;
  letter-spacing: 0.04em;
  line-height: 1.15;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.edict-reward-slot.empty { border-style: dashed; color: #69737b; }
.edict-reward-slot.empty > span { font-family: Georgia, serif; font-size: 1.6rem; line-height: 1; }
.edict-reward-slot.discard-selected {
  border-color: var(--danger);
  background: rgba(112, 31, 27, 0.23);
  box-shadow: inset 0 0 0 2px rgba(230, 106, 97, 0.08);
}
.edict-reward-slot > small {
  position: absolute;
  top: 4px;
  right: 4px;
  border-radius: 3px;
  background: rgba(139, 42, 36, 0.96);
  padding: 2px 4px;
  color: #ffd8d4;
  font-size: 0.42rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.edict-reward-exchange {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  border: 1px solid rgba(216, 170, 95, 0.24);
  border-radius: var(--frame-corner);
  background: rgba(6, 10, 12, 0.66);
  padding: 10px 12px;
  font-size: 0.69rem;
  letter-spacing: 0.05em;
  text-align: center;
  text-transform: uppercase;
}
.edict-reward-exchange span { color: #e38a82; }
.edict-reward-exchange b { color: #798188; }
.edict-reward-exchange strong { color: var(--gold-bright); }
.edict-reward-error {
  margin: 12px 0 0;
  border: 1px solid rgba(230, 106, 97, 0.34);
  border-radius: var(--frame-corner);
  background: rgba(112, 31, 27, 0.18);
  padding: 9px 10px;
  color: #f2aaa4;
  font-size: 0.7rem;
  line-height: 1.4;
  text-align: center;
}
.exercise-dialog-copy strong { color: #f0e8dd; }
.exercise-dialog-controls { margin-top: 0; }
.edit-set-modal .field-row { margin: 4px 0 24px; text-align: left; }
.edit-set-modal label { color: #b6babd; letter-spacing: 0.14em; }
.edit-set-modal input {
  min-height: 64px;
  border-color: #4b565f;
  background: rgba(6, 10, 12, 0.86);
  color: #f2ede5;
  font-family: Georgia, serif;
  font-size: 1.55rem;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.32);
}
.edit-set-modal input:focus { border-color: var(--gold-bright); box-shadow: 0 0 0 3px rgba(216, 170, 95, 0.13), inset 0 0 18px rgba(0, 0, 0, 0.32); }
.finish-run-controls .button.danger,
.delete-set-controls .button.danger {
  border-color: rgba(230, 106, 97, 0.62);
  background:
    linear-gradient(180deg, rgba(255, 178, 152, 0.1), transparent 42%),
    linear-gradient(135deg, #8d3724, #401b16);
  color: #fff1eb;
  box-shadow: inset 0 0 0 2px rgba(255, 205, 188, 0.07), 0 0 18px rgba(157, 52, 36, 0.16);
}

.completion-screen.game-screen {
  grid-template-rows: auto minmax(0, 1fr);
  padding: 0;
  background: #070b0e;
}
.completion-scroll {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 58px 22px max(40px, env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(5, 9, 12, 0.68), rgba(6, 9, 11, 0.9)),
    url("/assets/backgrounds/forge-floor.webp") center / cover no-repeat;
}
.completion-header {
  position: relative;
  margin: 0 auto 20px;
  border: 1px solid rgba(216, 170, 95, 0.5);
  background:
    radial-gradient(circle at 50% 0, rgba(216, 170, 95, 0.12), transparent 32%),
    linear-gradient(155deg, rgba(20, 26, 30, 0.98), rgba(8, 12, 15, 0.98));
  box-shadow: inset 0 0 0 4px rgba(216, 170, 95, 0.025), 0 24px 60px rgba(0, 0, 0, 0.5);
  padding: 48px 22px 24px;
  text-align: center;
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
}
.completion-seal {
  position: absolute;
  top: -35px;
  left: 50%;
  display: grid;
  width: 70px;
  height: 70px;
  transform: translateX(-50%);
  place-items: center;
  border: 2px solid var(--gold-bright);
  border-radius: 50%;
  background: radial-gradient(circle, #2b2418, #0b1013 70%);
  color: var(--gold-bright);
  font-size: 2.1rem;
  box-shadow: 0 0 25px rgba(216, 170, 95, 0.22), inset 0 0 16px rgba(216, 170, 95, 0.11);
}
.completion-header .eyebrow { color: var(--gold-bright); }
.completion-header h1 { margin-bottom: 8px; color: #f2ebe0; font-size: clamp(2rem, 9vw, 2.8rem); }
.completion-reward { border-radius: 3px; background: linear-gradient(135deg, rgba(216, 170, 95, 0.1), rgba(10, 14, 17, 0.8)); text-align: left; }
.completion-actions .button { min-height: 54px; }
.completion-details { overflow: visible; padding: 0; }
.completion-score { border-radius: 3px; background: linear-gradient(145deg, rgba(19, 25, 29, 0.97), rgba(8, 12, 15, 0.97)); box-shadow: inset 0 0 0 3px rgba(216, 170, 95, 0.025); }
.completion-score > strong { color: var(--gold-bright); text-shadow: 0 0 16px rgba(216, 170, 95, 0.18); }
.summary-stat,
.summary-card { border-color: rgba(216, 170, 95, 0.24); border-radius: 3px; background: linear-gradient(145deg, rgba(20, 25, 29, 0.94), rgba(9, 13, 16, 0.94)); }

.main-menu {
  position: relative;
  width: min(calc(100% - 12px), 420px);
  border-color: rgba(216, 170, 95, 0.5);
  border-radius: 2px;
  background:
    radial-gradient(circle at 50% 0, rgba(216, 170, 95, 0.12), transparent 32%),
    linear-gradient(155deg, rgba(21, 27, 31, 0.995), rgba(7, 11, 14, 0.995));
  box-shadow: inset 0 0 0 4px rgba(216, 170, 95, 0.025), inset 0 0 50px rgba(0, 0, 0, 0.28), 0 28px 80px rgba(0, 0, 0, 0.76);
  padding: 20px 24px 24px;
  clip-path: polygon(11px 0, calc(100% - 11px) 0, 100% 11px, 100% calc(100% - 11px), calc(100% - 11px) 100%, 11px 100%, 0 calc(100% - 11px), 0 11px);
}
.main-menu-header { display: grid; justify-items: center; margin-bottom: 5px; border-bottom: 1px solid rgba(216, 170, 95, 0.25); padding: 5px 0 19px; }
.main-menu-header > span { color: var(--gold-bright); font-size: 1.35rem; }
.main-menu-header h2 { margin-top: 3px; color: #f0e7d8; font-family: Georgia, serif; font-size: 1.35rem; letter-spacing: 0.12em; }
.main-menu-header .main-menu-build {
  margin: 7px 0 0;
  color: #ad7e62;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.main-menu-item {
  grid-template-columns: 48px minmax(0, 1fr);
  min-height: 66px;
  align-items: center;
  gap: 13px;
  margin: 0;
  border: 0;
  border-bottom: 1px solid rgba(216, 170, 95, 0.14);
  border-radius: 0;
  background: transparent;
  padding: 10px 4px;
  text-align: left;
}
.main-menu-item:hover { background: linear-gradient(90deg, rgba(216, 170, 95, 0.09), transparent); }
.main-menu-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(216, 170, 95, 0.38);
  border-radius: 50%;
  background: rgba(7, 11, 14, 0.7);
  color: var(--gold-bright) !important;
}
.main-menu-icon-art {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}
.main-menu-copy { min-width: 0; }
.main-menu-copy strong { display: block; color: #f0ebe4; font-size: 0.79rem; letter-spacing: 0.13em; }
.main-menu-copy > span { display: block; margin-top: 4px; color: #9ba1a6; font-size: 0.7rem; line-height: 1.35; }
.main-menu-item.danger { border-top: 1px solid rgba(159, 56, 42, 0.35); }
.main-menu-item.danger .main-menu-icon { border-color: rgba(230, 106, 97, 0.48); }
.main-menu-item.danger .main-menu-copy strong { color: #e66a61 !important; }
.main-menu-secondary {
  min-height: 54px;
  margin-top: 22px;
  border-bottom: 0;
}
.main-menu-secondary .main-menu-icon { width: 38px; height: 38px; border-color: rgba(216, 170, 95, 0.24); color: #b9a77f !important; }
.main-menu-secondary .main-menu-icon-art { width: 22px; height: 22px; }
.main-menu-secondary .main-menu-copy strong { color: #b9b6b1; font-size: 0.72rem; }
.main-menu-secondary .main-menu-copy > span { color: #858b90; }

/* One 8px rounded corner language for every rectangular game surface. */
:root { --frame-corner: 8px; }
:is(
  .auth-card,
  .panel,
  .summary-card,
  .history-card,
  .debug-panel,
  .button,
  .menu-button,
  .icon-button,
  input,
  .path-strip,
  .path-strip-end,
  .map-reference summary,
  .map-reference-frame,
  .map-reference-panel,
  .rune-legend-grid,
  .combo-card,
  .exercise-rune-effects,
  .rune-value-panel,
  .set-form,
  .claimed-panel,
  .completion-header,
  .completion-reward,
  .completion-score,
  .summary-stat,
  .main-menu,
  .modal,
  .forge-board-head,
  .forge-region,
  .stats-specificity-duel,
  .stats-rune,
  .stats-toggle,
  .stats-sheet,
  .stats-exercise-row,
  .action-deal-list,
  .finish-run-summary,
  .seal-result-summary
) {
  border-radius: var(--frame-corner);
  clip-path: none;
}
.rune-label-toggles { border-radius: var(--frame-corner) var(--frame-corner) 0 0; }
.rune-label-toggles + .rune-legend-grid { border-radius: 0 0 var(--frame-corner) var(--frame-corner); }

@media (max-height: 680px) {
  .auth-screen { justify-content: flex-start; }
  .auth-screen > .brand-logo { width: auto; height: 104px; margin-bottom: 16px; }
  .map-reference summary { z-index: 22; }
  .map-reference[open] .map-reference-frame { top: calc(122px + env(safe-area-inset-top)); bottom: calc(174px + env(safe-area-inset-bottom)); }
  .map-reference[open] > .map-reference-sigil { top: calc(89px + env(safe-area-inset-top)); }
  .rune-legend-panel { grid-template-rows: 98px 50px minmax(0, 1fr) 44px; }
  .map-reference[open] .combos-reference-panel { grid-template-rows: 98px minmax(0, 1fr); }
  .map-reference-heading { padding: 35px 24px 5px; }
  .map-reference-heading h2 { font-size: 1.15rem; }
  .map-reference-heading h2::after { margin-block: 4px 2px; }
  .map-reference-heading p:last-child { font-size: 0.56rem; }
  .rune-label-toggle { padding-block: 4px; }
  .rune-label-toggle small { display: none; }
  .rune-legend-item { grid-template-columns: 31px minmax(0, 1fr); padding-block: 1px; }
  .rune-legend-item img { width: 28px; height: 28px; }
  .map-reference-footer::before { margin-bottom: 2px; }
}

@media (min-width: 700px) {
  #app { box-shadow: 0 0 80px rgba(0, 0, 0, 0.5); }
}

@media (max-height: 700px) {
  .exercise-screen { padding-top: 18px; }
}

@media (max-width: 390px) {
  .game-topbar { padding-inline: 9px; }
  .top-stat strong { font-size: 1rem; }
  .game-debug-button { min-width: 34px; padding: 0; }
  .codex-filter-rack { grid-template-columns: minmax(132px, 0.78fr) minmax(0, 1.22fr); gap: 5px; }
  .codex-type-filter { gap: 2px; }
  .codex-type-filter button { padding-inline: 1px; }
  .codex-rune-deck { padding-inline: 11px; }
  .codex-rune-deck > header > span { max-width: 145px; font-size: 0.52rem; }
  .codex-rune-choice { font-size: 0.52rem; }
  .codex-rune-choice.specific { font-size: 0.49rem; }
  .codex-active-pool { align-items: flex-start; }
  .codex-path-rune > span { font-size: 0.52rem; }
  .codex-exercise-card { grid-template-columns: 44px minmax(0, 1fr); gap: 7px; padding-inline: 7px; }
  .codex-exercise-image-slot { width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
  .codex-exercise-card h3 { font-size: 0.75rem; }
  .codex-exercise-card.codex-edict-card { grid-template-columns: 50px minmax(0, 1fr); gap: 10px; padding-inline: 10px; }
  .codex-edict-card .codex-exercise-image-slot { width: 50px; min-width: 50px; height: 50px; min-height: 50px; }
  .codex-edict-card h3 { font-size: 0.84rem; }
  .summary-grid.completion-metrics { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 350px) {
  .exercise-screen { padding-inline: 18px; }
}

/* Forged secondary menu system */
.codex-guide,
.settings-forge,
.skills-command-plate,
.skill-forge-panel,
.forge-board-head,
.forge-region,
.home-screen > .panel {
  overflow: hidden;
  border: 1px solid rgba(216, 170, 95, 0.42);
  border-radius: var(--frame-corner);
  background: linear-gradient(120deg, rgba(216, 170, 95, 0.06), transparent 40%), linear-gradient(155deg, rgba(20, 26, 30, 0.98), rgba(6, 10, 13, 0.99));
  box-shadow: inset 0 0 32px rgba(0, 0, 0, 0.28), 0 18px 38px rgba(0, 0, 0, 0.3);
}

/* How to play */
.codex-guide-heading { border-bottom: 1px solid rgba(216, 170, 95, 0.3); background: linear-gradient(90deg, rgba(216, 170, 95, 0.12), transparent 78%); padding: 18px; }
.codex-guide-heading span { color: var(--gold-bright); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.codex-guide-heading strong { display: block; margin-top: 4px; font-family: Georgia, serif; font-size: 1.35rem; letter-spacing: 0.06em; text-transform: uppercase; }
.codex-guide-heading p { margin: 8px 0 0; color: #aab0b5; font-size: 0.9rem; line-height: 1.5; }
.codex-guide-path { padding: 4px 18px; }
.codex-guide-step { position: relative; display: grid; min-height: 104px; grid-template-columns: 58px minmax(0, 1fr); align-items: center; gap: 14px; padding: 15px 0; }
.codex-guide-step + .codex-guide-step { border-top: 1px solid rgba(126, 138, 148, 0.2); }
.codex-guide-step:not(:last-child)::after { position: absolute; bottom: -16px; left: 28px; width: 1px; height: 32px; background: linear-gradient(var(--gold-deep), rgba(126, 138, 148, 0.4)); content: ""; }
.codex-guide-mark { display: grid; width: 58px; grid-template-columns: 24px 1fr; align-items: center; gap: 6px; color: var(--gold-bright); }
.codex-guide-mark b { color: #737d84; font-family: Georgia, serif; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; }
.codex-guide-mark .codex-symbol { width: 25px; height: 25px; }
.codex-guide-step h2 { margin: 0; font-size: 1.08rem; letter-spacing: 0.05em; text-transform: uppercase; }
.codex-guide-step div > p { margin: 7px 0 0; color: #aab0b5; font-size: 0.9rem; line-height: 1.5; }
.codex-guide-step div > p + p { border-top: 1px solid rgba(126, 138, 148, 0.16); padding-top: 9px; }

/* Stats forge */
.stats-screen { padding: 0; }
.stats-controls { display: grid; gap: 9px; margin-bottom: 16px; }
.stats-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; border: 1px solid rgba(126, 138, 148, 0.48); border-radius: var(--frame-corner); background: rgba(5, 9, 12, 0.82); padding: 5px; }
.stats-toggle button { min-width: 0; min-height: 46px; border: 1px solid transparent; border-radius: calc(var(--frame-corner) - 2px); background: transparent; color: #9aa1a7; cursor: pointer; padding: 4px 7px; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.05em; line-height: 1.15; text-transform: uppercase; }
.stats-toggle button[aria-pressed="true"] { border-color: rgba(216, 170, 95, 0.5); background: linear-gradient(180deg, rgba(216, 170, 95, 0.17), rgba(216, 170, 95, 0.05)); color: var(--gold-bright); box-shadow: inset 0 0 14px rgba(216, 170, 95, 0.08); }
.stats-metric-toggle { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats-metric-toggle button { padding-inline: 3px; font-size: 0.72rem; }
.forge-board-head { position: relative; padding: 20px; }
.forge-board-head::before, .forge-region::before { position: absolute; top: 0; right: 18%; left: 18%; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-bright), transparent); content: ""; }
.forge-board-head::after { content: none; }
.forge-board-title { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.forge-board-title h2 { max-width: 220px; margin: 0; font-size: 1.35rem; }
.stats-total { flex: 0 0 auto; text-align: right; }
.stats-total strong { display: block; color: var(--gold-bright); font-family: Georgia, serif; font-size: 2.55rem; line-height: 0.9; }
.stats-total span { color: #9ea5aa; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.stats-duel { margin-top: 20px; border-top: 1px solid rgba(126, 139, 151, 0.25); padding-top: 14px; }
.stats-duel > p { margin: 0 0 9px; color: #9ea5aa; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.11em; text-align: center; text-transform: uppercase; }
.stats-duel-values { display: flex; justify-content: space-between; gap: 14px; }
.stats-duel-values span { display: flex; min-width: 0; align-items: baseline; gap: 7px; }
.stats-duel-values span:last-child { text-align: right; }
.stats-duel-values strong { overflow: hidden; font-size: 0.78rem; letter-spacing: 0.07em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.stats-duel-values b { color: var(--gold-bright); font-family: Georgia, serif; font-size: 1.08rem; }
.stats-duel-track { display: grid; grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr); align-items: center; gap: 6px; margin-top: 8px; }
.stats-duel-track > span { display: flex; height: 8px; overflow: hidden; border-radius: 99px; background: #222930; }
.stats-duel-track > span.left { justify-content: flex-end; }
.stats-duel-track i { display: block; height: 100%; border-radius: inherit; }
.stats-duel-track .left i { background: linear-gradient(90deg, var(--ember-dark), var(--ember)); }
.stats-duel-track .right i { background: linear-gradient(90deg, var(--gold-bright), #8c672d); }
.stats-duel-track > b { color: var(--gold-bright); font-size: 0.65rem; text-align: center; }
.stats-duel-result { display: block; margin-top: 8px; color: #c0c5c9; font-size: 0.7rem; letter-spacing: 0.05em; text-align: center; text-transform: uppercase; }
.stats-dormant, .stats-rank-note { margin: 14px 2px; border-left: 2px solid var(--ember); padding: 5px 0 5px 11px; color: #aab0b5; font-size: 0.82rem; line-height: 1.45; }
.stats-dormant { color: #dfaaa0; }
.forge-regions { display: grid; gap: 16px; }
.forge-region { position: relative; }
.forge-region-header { display: flex; align-items: center; gap: 13px; border-bottom: 1px solid rgba(216, 170, 95, 0.22); background: linear-gradient(100deg, rgba(224, 91, 54, 0.1), transparent 65%); padding: 15px 17px; }
.forge-region-header > span { display: grid; width: 56px; height: 56px; flex: 0 0 auto; place-items: center; border: 0; background: url("/assets/nodes/base-node.webp") center / contain no-repeat; }
.forge-region-header img { width: 24px; height: 24px; object-fit: contain; }
.forge-region-header .panel-kicker { margin-bottom: 3px; }
.forge-region-header h2 { margin: 0; font-family: inherit; font-size: 0.92rem; letter-spacing: 0.05em; text-transform: uppercase; }
.forge-region > .stats-duel { margin: 0 16px; padding: 15px 0 16px; }
.stats-specificity-duels { display: grid; gap: 0; border-top: 1px solid rgba(126, 138, 148, 0.25); background: rgba(4, 7, 9, 0.28); padding: 0; }
.stats-specificity-duel { border: 0; border-radius: 0; background: transparent; padding: 15px; }
.stats-specificity-duel + .stats-specificity-duel { border-top: 1px solid rgba(126, 138, 148, 0.25); }
.stats-pair-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.stats-pair-heading strong { font-family: Georgia, serif; font-size: 1rem; letter-spacing: 0.06em; text-transform: uppercase; }
.stats-pair-heading span { color: #929aa0; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; }
.stats-specificity-runes { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.stats-specificity-duel > .stats-duel { margin: 12px 2px 0; padding-top: 12px; }
.stats-rune { position: relative; display: grid; min-width: 0; min-height: 176px; justify-items: center; overflow: hidden; border: 1px solid rgba(126, 138, 148, 0.52); border-radius: var(--frame-corner); background: linear-gradient(155deg, rgba(22, 28, 32, 0.98), rgba(7, 11, 14, 0.99)); color: var(--ink); padding: 12px 9px 10px; cursor: pointer; text-align: center; }
.stats-rune::after { position: absolute; inset: auto -30% -65% -30%; height: 95px; border-radius: 50%; background: rgba(224, 91, 54, 0); filter: blur(18px); content: ""; pointer-events: none; }
.stats-rune:hover, .stats-rune:focus-visible { border-color: var(--gold-bright); outline: none; box-shadow: 0 0 0 2px rgba(216, 170, 95, 0.14), inset 0 0 20px rgba(216, 170, 95, 0.05); }
.stats-rune:active { transform: translateY(1px); }
.stats-rune-glyph { position: relative; display: grid; width: 62px; height: 62px; place-items: center; border: 0; transform: none; background: url("/assets/nodes/base-node.webp") center / contain no-repeat; }
.stats-rune-glyph img { width: 24px; height: 24px; transform: none; object-fit: contain; }
.stats-rune-glyph i { position: absolute; inset: 4px; border: 1px solid transparent; border-radius: 50%; }
.stats-rune-name { display: grid; min-height: 34px; align-items: center; margin-top: 5px; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.05em; line-height: 1.25; text-transform: uppercase; }
.stats-rune-value { display: flex; align-items: baseline; gap: 4px; }
.stats-rune-value strong { color: var(--gold-bright); font-family: Georgia, serif; font-size: 1.2rem; }
.stats-rune-value small { color: #9aa1a7; font-size: 0.66rem; letter-spacing: 0.05em; text-transform: uppercase; }
.stats-rune-footer { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 6px; margin-top: 7px; }
.stats-rune-footer em, .stats-rune-footer b { font-size: 0.65rem; font-style: normal; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.stats-rune-footer em { color: #7f888f; }
.stats-rune-footer b { color: var(--gold-bright); }
.stats-rune.rank-kindled::after { background: rgba(224, 91, 54, 0.12); }
.stats-rune.rank-kindled .stats-rune-footer em { color: #c47c65; }
.stats-rune.rank-forged::after { background: rgba(224, 91, 54, 0.2); }
.stats-rune.rank-forged .stats-rune-footer em { color: var(--gold); }
.stats-rune.rank-tempered::after { background: rgba(224, 91, 54, 0.3); }
.stats-rune.rank-tempered .stats-rune-footer em { color: #e4b76e; }
.stats-rune.rank-ironbound::after { background: rgba(224, 91, 54, 0.42); }
.stats-rune.rank-ironbound .stats-rune-footer em { color: #f0cf91; }
.stats-rune.rank-tempered .stats-rune-glyph i, .stats-rune.rank-ironbound .stats-rune-glyph i { border-color: rgba(216, 170, 95, 0.42); animation: stats-rune-ember 2.4s ease-in-out infinite; }
@keyframes stats-rune-ember { 0%, 100% { transform: scale(0.88); opacity: 0.3; } 50% { transform: scale(1.08); opacity: 0.9; } }
.stats-sheet { width: min(calc(100% - 12px), 440px); max-height: calc(100dvh - 32px); overflow-y: auto; text-align: left; }
.stats-sheet::before { background: linear-gradient(90deg, var(--ember), var(--gold-bright)); }
.stats-sheet-header { display: grid; grid-template-columns: 66px minmax(0, 1fr); align-items: center; gap: 14px; margin-bottom: 20px; text-align: left; }
.stats-sheet-header .eyebrow { margin-bottom: 4px; }
.stats-sheet-header h2 { margin: 0; font-family: Georgia, serif; font-size: 1.35rem; letter-spacing: 0.07em; line-height: 1.1; text-transform: uppercase; }
.stats-sheet-glyph { display: grid; width: 66px; height: 66px; place-items: center; border: 0; transform: none; background: url("/assets/nodes/selected-node.webp") center / contain no-repeat; }
.stats-sheet-glyph img { width: 25px; height: 25px; transform: none; object-fit: contain; }
.stats-exercise-list { display: grid; gap: 9px; }
.stats-exercise-row { border: 1px solid rgba(126, 138, 148, 0.45); border-radius: var(--frame-corner); background: rgba(6, 10, 13, 0.66); padding: 14px; }
.stats-exercise-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.stats-exercise-heading h3 { margin: 0; font-family: inherit; font-size: 0.85rem; letter-spacing: 0.05em; text-transform: uppercase; }
.stats-exercise-heading span { flex: 0 0 auto; color: #9aa1a7; font-size: 0.7rem; letter-spacing: 0.07em; text-transform: uppercase; }
.stats-exercise-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.stats-exercise-metrics span { min-width: 0; color: #9aa1a7; font-size: 0.64rem; letter-spacing: 0.03em; text-align: center; text-transform: uppercase; }
.stats-exercise-metrics strong { display: block; overflow: hidden; margin-bottom: 3px; color: var(--gold-bright); font-family: Georgia, serif; font-size: 0.95rem; text-overflow: ellipsis; }
.stats-sheet-empty { border: 1px dashed rgba(126, 138, 148, 0.55); border-radius: var(--frame-corner); padding: 30px 14px; text-align: center; }
.stats-sheet-empty p { margin-bottom: 6px; color: var(--ink); font-weight: 800; text-transform: uppercase; }
.stats-sheet-empty span { color: #9aa1a7; font-size: 0.84rem; }
.stats-sheet-back { margin-top: 18px; }

/* Collectible gallery */
.collectibles-screen { background: transparent; }
.collectible-filters { margin-bottom: 20px; border-block: 1px solid rgba(216, 170, 95, 0.28); background: linear-gradient(145deg, rgba(18, 24, 28, 0.9), rgba(6, 10, 13, 0.92)); }
.collectible-filters > header { display: flex; min-height: 86px; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; }
.collectible-filters > header h2 { margin: 3px 0 0; color: #eee7dd; font-family: Georgia, serif; font-size: 1rem; letter-spacing: 0.07em; text-transform: uppercase; }
.collectible-filters > header p:last-child { margin: 6px 0 0; color: #a7adb2; font-size: 0.7rem; line-height: 1.35; }
.collectible-filters .panel-kicker { margin: 0; }
.collectible-all-filter { min-width: 88px; min-height: 48px; border: 1px solid rgba(150, 161, 170, 0.62); border-radius: var(--frame-corner); background: linear-gradient(180deg, rgba(38, 46, 52, 0.96), rgba(12, 17, 21, 0.98)); color: #d2d6d9; cursor: pointer; padding-inline: 10px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 3px 0 rgba(2, 4, 6, 0.9), 0 7px 14px rgba(0, 0, 0, 0.28); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; transition: transform 100ms ease, border-color 120ms ease, box-shadow 120ms ease, filter 120ms ease; }
.collectible-all-filter:hover, .collectible-all-filter:focus-visible { transform: translateY(-1px); border-color: var(--gold-bright); filter: brightness(1.08); }
.collectible-all-filter:active { transform: translateY(2px); box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(2, 4, 6, 0.9); }
.collectible-all-filter[aria-pressed="true"] { transform: translateY(1px); border-color: var(--gold-bright); background: linear-gradient(180deg, rgba(93, 70, 35, 0.76), rgba(28, 22, 14, 0.98)); color: var(--gold-bright); box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.36), 0 1px 0 rgba(2, 4, 6, 0.9), 0 0 12px rgba(216, 170, 95, 0.12); }
.collectible-rarity-rack { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; border-top: 1px solid rgba(126, 138, 148, 0.24); background: rgba(3, 6, 8, 0.36); padding: 11px 12px 13px; }
.collectible-rarity-rack button { position: relative; display: grid; min-width: 0; min-height: 58px; place-items: center; gap: 6px; border: 1px solid rgba(126, 138, 148, 0.58); border-radius: var(--frame-corner); background: linear-gradient(180deg, rgba(33, 40, 46, 0.96), rgba(9, 13, 17, 0.99)); color: #c0c5c9; cursor: pointer; padding: 9px 5px 8px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.085), 0 3px 0 rgba(2, 4, 6, 0.88), 0 7px 13px rgba(0, 0, 0, 0.24); font-size: 0.65rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; transition: transform 100ms ease, border-color 120ms ease, box-shadow 120ms ease, filter 120ms ease; }
.collectible-rarity-rack button:hover, .collectible-rarity-rack button:focus-visible { transform: translateY(-1px); border-color: var(--collectible-accent); filter: brightness(1.1); }
.collectible-rarity-rack button:active { transform: translateY(2px); box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.52), 0 1px 0 rgba(2, 4, 6, 0.88); }
.collectible-rarity-rack button i { display: block; width: 28px; height: 2px; background: var(--collectible-accent); opacity: 0.42; transition: width 140ms ease, opacity 140ms ease, box-shadow 140ms ease; }
.collectible-rarity-rack button[aria-pressed="true"] { transform: translateY(1px); border-color: var(--collectible-accent); background: linear-gradient(180deg, color-mix(in srgb, var(--collectible-accent) 18%, #222a30), rgba(7, 11, 14, 0.99)); color: var(--collectible-accent); box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(2, 4, 6, 0.9), 0 0 12px color-mix(in srgb, var(--collectible-accent) 16%, transparent); }
.collectible-rarity-rack button[aria-pressed="true"] i { width: 46px; opacity: 1; box-shadow: 0 0 9px var(--collectible-accent); }
.collectible-rarity-rack button[data-rarity="common"][aria-pressed="true"] { box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(2, 4, 6, 0.9); }
.collectible-rarity-rack button[data-rarity="common"][aria-pressed="true"] i { box-shadow: none; }
.collectible-gallery-results { min-height: 220px; }
.collectible-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
.collectible-grid-card { display: block; min-width: 0; border: 0; border-radius: 0; background: transparent; color: inherit; cursor: pointer; padding: 0; transition: transform 150ms ease, filter 150ms ease; }
.collectible-grid-card:hover, .collectible-grid-card:focus-visible { transform: translateY(-3px); filter: brightness(1.07); outline: none !important; }
.collectible-grid-card:focus-visible .collectible-card-canvas { outline: 2px solid var(--collectible-accent); outline-offset: 3px; }
.collectible-card { display: block; width: 100%; min-width: 0; aspect-ratio: 2 / 3; filter: drop-shadow(0 13px 16px rgba(0, 0, 0, 0.48)); }
.collectible-card:not([data-rarity="common"]) { filter: drop-shadow(0 0 8px color-mix(in srgb, var(--collectible-accent) 28%, transparent)) drop-shadow(0 13px 16px rgba(0, 0, 0, 0.48)); }
.collectible-card-canvas { position: relative; display: block; width: 100%; height: 100%; overflow: hidden; container-type: inline-size; }
.collectible-art-window { position: absolute; inset: 7.6% 9.6% 29.7%; display: block; overflow: hidden; background: #050708; }
.collectible-art-window img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.collectible-frame { position: absolute; z-index: 2; inset: 0; display: block; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.collectible-frame-screen { mix-blend-mode: screen; }
.collectible-card-title, .collectible-card-flavor { position: absolute; z-index: 3; right: 16%; left: 16%; display: block; overflow-wrap: anywhere; pointer-events: none; text-align: center; }
.collectible-card-title { top: 76.1%; color: #e7dfd3; font-family: Georgia, serif; font-size: clamp(0.45rem, 3.4cqw, 0.65rem); line-height: 1; letter-spacing: 0.12em; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.9), 0 0 7px rgba(230, 219, 201, 0.12); text-transform: uppercase; transform: translateY(-50%); }
.collectible-card-title > span { display: block; white-space: nowrap; }
.collectible-card-title > span + span { margin-top: 0.2em; }
.collectible-card-flavor { top: 82.1%; color: rgba(207, 205, 199, 0.58); font-family: Georgia, serif; font-size: clamp(0.4rem, 4.1cqw, 0.7rem); font-style: italic; line-height: 1.25; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.86); }
.collectible-card-viewer .collectible-card-title { overflow-wrap: normal; font-size: clamp(0.6rem, 3.2cqw, 0.85rem); }
.collectible-card-viewer .collectible-card-flavor { font-size: clamp(0.7rem, 4.8cqw, 1.25rem); }
.collectible-empty { position: relative; min-height: 220px; border-top: 1px solid rgba(126, 138, 148, 0.28); padding: 52px 18px 30px; text-align: center; }
.collectible-empty::before { position: absolute; top: -1px; left: 50%; width: 96px; height: 2px; background: var(--collectible-accent); box-shadow: 0 0 12px var(--collectible-accent); content: ""; transform: translateX(-50%); }
.collectible-empty strong { display: block; color: #eee8df; font-family: Georgia, serif; font-size: 1rem; letter-spacing: 0.07em; text-transform: uppercase; }
.collectible-empty p { max-width: 270px; margin: 10px auto 0; color: #929aa0; font-size: 0.8rem; line-height: 1.45; }

/* Focused collectible viewer */
.collectible-viewer-backdrop { z-index: 30; place-items: center; padding: 0; background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--collectible-accent) 12%, transparent), transparent 43%), rgba(1, 3, 5, 0.94); backdrop-filter: blur(8px); }
.collectible-viewer { display: grid; width: min(100%, 520px); height: 100dvh; min-height: 0; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; border-inline: 1px solid rgba(255, 255, 255, 0.035); background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--collectible-accent) 7%, transparent), transparent 38%), linear-gradient(180deg, #0d1216, #05080a); box-shadow: 0 0 80px rgba(0, 0, 0, 0.78); }
.collectible-viewer-backdrop[data-rarity="common"] { background: rgba(1, 3, 5, 0.94); }
.collectible-viewer-backdrop[data-rarity="common"] .collectible-viewer { background: linear-gradient(180deg, #0d1216, #05080a); }
.collectible-viewer-header { display: grid; min-height: calc(76px + env(safe-area-inset-top)); grid-template-columns: 74px minmax(0, 1fr) 50px; align-items: end; gap: 12px; border-bottom: 1px solid rgba(216, 170, 95, 0.22); background: rgba(7, 11, 14, 0.82); padding: calc(10px + env(safe-area-inset-top)) 16px 12px; }
.collectible-viewer-header > button { min-height: 42px; border: 1px solid rgba(216, 170, 95, 0.38); border-radius: var(--frame-corner); background: rgba(13, 18, 22, 0.8); color: #d7c6ab; cursor: pointer; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.collectible-viewer-header > div { min-width: 0; text-align: center; }
.collectible-viewer-header h2 { overflow: hidden; margin: 0; color: #f0e9df; font-family: Georgia, serif; font-size: 1rem; letter-spacing: 0.08em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.collectible-viewer-header p { margin: 5px 0 0; color: var(--collectible-accent); font-size: 0.62rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.collectible-viewer-header > span { align-self: center; color: #9ca3a8; font-family: Georgia, serif; font-size: 0.75rem; letter-spacing: 0.05em; text-align: right; white-space: nowrap; }
.collectible-viewer-stage { position: relative; display: grid; min-width: 0; min-height: 0; grid-template-rows: minmax(0, 1fr) auto; place-items: center; overflow: hidden; padding: 12px 18px; }
.collectible-viewer-media { display: grid; width: 100%; height: 100%; min-height: 0; place-items: center; overflow: hidden; touch-action: pan-y; }
.collectible-viewer-track { display: flex; width: 100%; height: 100%; transform: translate3d(calc(-100% + var(--collectible-swipe-x, 0px)), 0, 0); transition: transform 210ms cubic-bezier(0.22, 0.72, 0.2, 1); will-change: transform; }
.collectible-viewer-track.is-dragging { transition: none; }
.collectible-viewer-slide { display: grid; min-width: 0; height: 100%; flex: 0 0 100%; place-items: center; }
.collectible-card-viewer { width: min(100%, calc((100dvh - 250px) * 0.6667)); max-width: 100%; max-height: 100%; }
.collectible-artwork-view { display: grid; width: 100%; height: 100%; min-height: 0; place-items: center; overflow: hidden; touch-action: none; }
.collectible-artwork-view img { display: block; width: 100%; height: 100%; max-height: 100%; border: 1px solid color-mix(in srgb, var(--collectible-accent) 62%, #5d646a); border-radius: var(--frame-corner); object-fit: contain; filter: drop-shadow(0 18px 25px rgba(0, 0, 0, 0.52)); transform: translate3d(var(--collectible-artwork-x, 0), var(--collectible-artwork-y, 0), 0) scale(var(--collectible-artwork-scale, 1)); transform-origin: center; will-change: transform; }
.collectible-viewer-navigation { display: flex; align-items: center; justify-content: center; gap: 10px; padding-top: 10px; }
.collectible-viewer-nav { display: grid; width: 58px; height: 40px; place-items: center; border: 1px solid rgba(216, 170, 95, 0.32); border-radius: var(--frame-corner); background: rgba(8, 12, 15, 0.82); color: #d8c8ad; cursor: pointer; font-family: Georgia, serif; font-size: 1.45rem; line-height: 1; }
.collectible-viewer-nav:hover, .collectible-viewer-nav:focus-visible { border-color: var(--collectible-accent); color: var(--collectible-accent); outline: none; box-shadow: 0 0 14px color-mix(in srgb, var(--collectible-accent) 18%, transparent); }
.collectible-viewer-footer { display: grid; min-height: calc(76px + env(safe-area-inset-bottom)); place-items: start center; border-top: 1px solid rgba(216, 170, 95, 0.2); background: rgba(6, 10, 13, 0.9); padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); }
.collectible-view-toggle { display: grid; width: min(100%, 300px); grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; border: 1px solid rgba(126, 138, 148, 0.46); border-radius: var(--frame-corner); background: rgba(2, 5, 7, 0.7); padding: 5px; }
.collectible-view-toggle button { min-height: 40px; border: 1px solid transparent; border-radius: calc(var(--frame-corner) - 2px); background: transparent; color: #90989e; cursor: pointer; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.collectible-view-toggle button[aria-pressed="true"] { border-color: var(--collectible-accent); background: color-mix(in srgb, var(--collectible-accent) 12%, transparent); color: var(--collectible-accent); box-shadow: inset 0 0 13px color-mix(in srgb, var(--collectible-accent) 8%, transparent); }

/* Skills forge */
.skills-command-plate { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 11px 14px; padding: 15px 16px; }
.skills-command-plate h2 { margin: 0; font-size: 1.12rem; }
.skills-command-plate p:not(.panel-kicker) { margin: 5px 0 0; color: #aab0b5; font-size: 0.8rem; line-height: 1.4; }
.skills-balance { min-width: 70px; align-self: center; border-left: 1px solid rgba(216, 170, 95, 0.28); padding-left: 14px; text-align: center; }
.skills-balance strong { display: block; color: var(--gold-bright); font-family: Georgia, serif; font-size: 2.3rem; line-height: 0.9; }
.skills-balance span { display: block; margin-top: 5px; color: #a0a7ac; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.skills-balance.state-ready { border-left-color: rgba(240, 198, 119, 0.7); }
.skills-balance.state-ready strong { text-shadow: 0 0 16px rgba(216, 170, 95, 0.4); }
.skills-command-plate dl { display: grid; grid-column: 1 / -1; grid-template-columns: 1fr 1fr; margin: 0; border-top: 1px solid rgba(126, 138, 148, 0.25); }
.skills-command-plate dl div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 9px 11px 0; }
.skills-command-plate dl div + div { border-left: 1px solid rgba(126, 138, 148, 0.25); }
.skills-command-plate dt { color: #959da3; font-size: 0.65rem; letter-spacing: 0.08em; text-transform: uppercase; }
.skills-command-plate dd { margin: 0; color: var(--gold-bright); font-family: Georgia, serif; font-size: 1rem; }
.skills-warning { margin: 10px 2px 14px; border-left: 2px solid var(--ember); padding: 3px 0 3px 10px; color: #bec3c7; font-size: 0.76rem; line-height: 1.4; }
.skills-warning strong { color: #efb8ae; }
.skill-forge-panel + .skill-forge-panel { margin-top: 14px; }
.skill-forge-heading { border-bottom: 1px solid rgba(216, 170, 95, 0.27); background: linear-gradient(90deg, rgba(216, 170, 95, 0.09), transparent 72%); padding: 13px 15px 12px; }
.skill-forge-heading .eyebrow { margin-bottom: 2px; }
.skill-forge-heading h2 { margin: 0; font-size: 1.08rem; letter-spacing: 0.06em; text-transform: uppercase; }
.skill-forge-heading > p:last-child:not(.eyebrow) { margin: 5px 0 0; color: #aab0b5; font-size: 0.76rem; line-height: 1.35; }
.skill-control { position: relative; min-width: 0; min-height: 44px; border: 0; border-radius: 0; background: rgba(5, 9, 12, 0.38); color: var(--ink); cursor: pointer; text-align: left; }
.skill-control:hover, .skill-control:focus-visible { z-index: 1; background: linear-gradient(90deg, rgba(216, 170, 95, 0.11), rgba(216, 170, 95, 0.025)); outline: 1px solid var(--gold-bright); outline-offset: -1px; }
.skill-control:active { background: rgba(216, 170, 95, 0.14); }
.skill-control:hover .skill-control-cost, .skill-control:focus-visible .skill-control-cost { transform: translateY(-1px); border-color: #efc77d; filter: brightness(1.08); }
.skill-control:active .skill-control-cost { transform: translateY(1px); box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.46), 0 0 8px rgba(216, 170, 95, 0.18); }
.skill-control:disabled { cursor: default; }
.skill-control:disabled:hover { z-index: auto; background: rgba(5, 9, 12, 0.38); outline: 0; }
.skill-control:disabled:hover .skill-control-cost { transform: none; border-color: rgba(126, 138, 148, 0.34); filter: none; }
.skill-control.state-unaffordable { color: #a7adb1; }
.skill-control.state-maxed { background: rgba(216, 170, 95, 0.055); }
.skill-core-list { display: grid; }
.skill-core-control { display: grid; grid-template-columns: 46px minmax(0, 1fr) 50px; align-items: center; gap: 11px; padding: 10px 13px; }
.skill-core-control + .skill-core-control { border-top: 1px solid rgba(126, 138, 148, 0.24); }
.skill-core-glyph { display: grid; width: 46px; height: 46px; place-items: center; border: 1px solid rgba(216, 170, 95, 0.32); border-radius: var(--frame-corner); background: rgba(4, 7, 9, 0.6); color: var(--gold-bright); }
.skill-core-glyph .codex-symbol { width: 23px; height: 23px; }
.skill-action-wheel { width: 37px; height: 37px; object-fit: contain; }
.skill-control-copy { display: block; min-width: 0; }
.skill-control-heading { display: flex; min-width: 0; align-items: baseline; justify-content: space-between; gap: 10px; }
.skill-control-heading strong { overflow: hidden; color: #f0e9df; font-family: Georgia, serif; font-size: 0.88rem; letter-spacing: 0.06em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.skill-control-heading small { flex: 0 0 auto; color: #8f979d; font-size: 0.63rem; letter-spacing: 0.04em; text-transform: uppercase; }
.skill-control-effect { display: block; margin-top: 4px; color: #b8bec2; font-size: 0.72rem; line-height: 1.25; }
.skill-control-cost { display: grid; width: 48px; min-width: 48px; min-height: 52px; grid-template-rows: 1fr auto; place-items: center; border: 1px solid rgba(126, 138, 148, 0.34); border-radius: var(--frame-corner); background: linear-gradient(180deg, rgba(28, 34, 38, 0.96), rgba(8, 12, 15, 0.98)); padding: 6px 5px 5px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), inset 0 -3px 7px rgba(0, 0, 0, 0.34); transition: transform 100ms ease, border-color 120ms ease, box-shadow 120ms ease, filter 120ms ease; }
.skill-control-plus { position: relative; display: block; width: 17px; height: 17px; color: #7f888e; }
.skill-control-plus::before, .skill-control-plus::after { position: absolute; top: 50%; left: 50%; border-radius: 2px; background: currentColor; content: ""; transform: translate(-50%, -50%); }
.skill-control-plus::before { width: 17px; height: 3px; }
.skill-control-plus::after { width: 3px; height: 17px; }
.skill-control-price { display: flex; align-items: baseline; gap: 2px; line-height: 1; }
.skill-control-price strong { color: var(--gold-bright); font-family: Georgia, serif; font-size: 0.72rem; }
.skill-control-price small { color: #9da4a9; font-size: 0.47rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.skill-control.state-affordable .skill-control-cost { border-color: rgba(240, 198, 119, 0.9); background: linear-gradient(180deg, rgba(74, 54, 28, 0.9), rgba(19, 16, 12, 0.98)); box-shadow: inset 0 1px 0 rgba(255, 236, 193, 0.15), inset 0 -3px 7px rgba(0, 0, 0, 0.38), 0 0 12px rgba(216, 170, 95, 0.2); }
.skill-control.state-affordable .skill-control-plus { color: var(--gold-bright); filter: drop-shadow(0 0 4px rgba(216, 170, 95, 0.46)); }
.skill-control.state-unaffordable .skill-control-cost { opacity: 0.55; }
.skill-control.state-unaffordable .skill-control-cost strong, .skill-control.state-unaffordable .skill-rune-glyph { color: #778087; filter: saturate(0.25); }
.skill-control.state-maxed .skill-control-cost { min-height: 44px; grid-template-rows: auto auto; align-content: center; gap: 4px; opacity: 0.68; }
.skill-control.state-maxed .skill-control-cost strong { color: #b9a579; font-size: 0.75rem; letter-spacing: 0.06em; }
.skill-control.state-maxed .skill-control-cost small { color: #8e969c; font-size: 0.5rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.skill-rank-track { display: flex; width: 100%; gap: 2px; margin-top: 7px; }
.skill-rank-track i { height: 3px; min-width: 2px; flex: 1; border-radius: 99px; background: #323b42; }
.skill-rank-track i.filled { background: linear-gradient(90deg, var(--ember), var(--gold-bright)); box-shadow: 0 0 7px rgba(216, 170, 95, 0.22); }
.skill-rune-forge { overflow: visible; border: 0; background: transparent; box-shadow: none; }
.skill-rune-forge .skill-forge-heading { border: 0; border-bottom: 1px solid rgba(216, 170, 95, 0.3); background: transparent; padding: 5px 2px 12px; }
.skill-rune-board { display: grid; gap: 17px; margin-top: 14px; }
.skill-rune-tier { min-width: 0; }
.skill-tier-heading { margin-bottom: 7px; padding: 0 2px; }
.skill-tier-heading span { color: var(--gold-bright); font-size: 0.66rem; font-weight: 800; letter-spacing: 0.13em; line-height: 1.3; text-transform: uppercase; }
.skill-rune-grid { display: grid; min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.skill-rune-control { display: grid; min-height: 84px; grid-template: "glyph name meta" auto "glyph effect meta" auto "glyph track track" auto / 44px minmax(0, 1fr) auto; align-items: center; column-gap: 6px; overflow: hidden; border: 1px solid rgba(126, 138, 148, 0.42); border-radius: var(--frame-corner); background: radial-gradient(circle at 22px 50%, rgba(216, 170, 95, 0.08), transparent 48px), linear-gradient(145deg, rgba(21, 27, 31, 0.96), rgba(7, 11, 14, 0.98)); padding: 8px 7px 7px; text-align: left; }
.skill-rune-control.state-affordable { border-color: rgba(216, 170, 95, 0.52); box-shadow: inset 0 0 17px rgba(216, 170, 95, 0.035); }
.skill-rune-control.state-maxed { border-color: rgba(216, 170, 95, 0.36); }
.skill-rune-meta { display: grid; min-width: 40px; grid-area: meta; align-self: stretch; align-content: space-between; justify-items: end; gap: 5px; color: #879096; font-size: 0.55rem; }
.skill-rune-meta > small { font-size: inherit; }
.skill-rune-meta .skill-control-cost { width: 40px; min-width: 40px; min-height: 45px; padding: 5px 4px 4px; }
.skill-rune-meta .skill-control-plus { width: 14px; height: 14px; }
.skill-rune-meta .skill-control-plus::before { width: 14px; height: 2px; }
.skill-rune-meta .skill-control-plus::after { width: 2px; height: 14px; }
.skill-rune-meta .skill-control-price strong { font-family: inherit; font-size: 0.61rem; }
.skill-rune-meta .skill-control-price small { font-size: 0.44rem; }
.skill-rune-control.state-maxed .skill-rune-meta .skill-control-cost { min-height: 40px; }
.skill-rune-glyph { grid-area: glyph; justify-self: center; color: var(--gold-bright); }
.skill-rune-glyph img { filter: drop-shadow(0 0 5px rgba(216, 170, 95, 0.18)); }
.skill-rune-name { min-width: 0; grid-area: name; align-self: end; overflow-wrap: anywhere; color: #ece6dd; font-family: Georgia, serif; font-size: 0.68rem; letter-spacing: 0.035em; line-height: 1.12; text-transform: uppercase; }
.skill-rune-control .skill-control-effect { grid-area: effect; align-self: start; margin-top: 3px; font-size: 0.6rem; white-space: nowrap; }
.skill-rune-control .skill-rank-track { grid-area: track; margin-top: 7px; }
.skill-confirmation-glyph { display: grid; width: 72px; height: 72px; margin: 0 auto 12px; place-items: center; border: 1px solid rgba(216, 170, 95, 0.42); border-radius: var(--frame-corner); background: rgba(5, 9, 12, 0.72); color: var(--gold-bright); }
.skill-confirmation-glyph img { width: 40px; height: 40px; object-fit: contain; }
.skill-confirmation-glyph .codex-symbol { width: 34px; height: 34px; }
.skill-confirmation-modal > .eyebrow { color: var(--gold-bright); }
.skill-confirmation-effect { margin: 18px 0; border: 1px solid rgba(216, 170, 95, 0.35); border-radius: var(--frame-corner); background: rgba(5, 9, 12, 0.66); padding: 15px; }
.skill-confirmation-effect span { display: block; margin-bottom: 8px; color: #9ca3a8; font-size: 0.72rem; letter-spacing: 0.09em; text-transform: uppercase; }
.skill-confirmation-effect strong { color: var(--gold-bright); line-height: 1.55; }
.permanent-warning { margin: 18px 0; border: 1px solid rgba(230, 106, 97, 0.4); border-radius: var(--frame-corner); background: rgba(230, 106, 97, 0.09); padding: 13px; color: #e4aaa5; font-size: 0.82rem; line-height: 1.45; }
.permanent-warning strong { color: #f1c0bc; }

/* Settings forge */
.settings-account { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: center; gap: 14px; border-bottom: 1px solid rgba(216, 170, 95, 0.28); background: linear-gradient(90deg, rgba(216, 170, 95, 0.1), transparent 76%); padding: 18px; }
.settings-sigil { display: grid; width: 58px; height: 58px; place-items: center; border: 1px solid rgba(216, 170, 95, 0.4); border-radius: var(--frame-corner); color: var(--gold-bright); }
.settings-sigil .codex-symbol { width: 29px; height: 29px; }
.settings-account h2 { margin: 0; overflow-wrap: anywhere; font-size: 1.05rem; line-height: 1.25; }
.settings-account p:last-child { margin: 6px 0 0; color: #aab0b5; font-size: 0.84rem; line-height: 1.4; }
.settings-group + .settings-group { border-top: 1px solid rgba(216, 170, 95, 0.28); }
.settings-group > header { border-bottom: 1px solid rgba(126, 138, 148, 0.24); padding: 16px 18px 13px; }
.settings-group > header h2 { margin: 0; font-size: 1rem; letter-spacing: 0.05em; text-transform: uppercase; }
.setting-row { position: relative; display: grid; min-height: 92px; grid-template-columns: minmax(0, 1fr) 48px 28px; align-items: center; gap: 10px; padding: 16px 18px; cursor: pointer; text-transform: none; }
.setting-row + .setting-row { border-top: 1px solid rgba(126, 138, 148, 0.2); }
.setting-volume-row { display: grid; min-height: 92px; grid-template-columns: minmax(0, 1fr) minmax(150px, 45%); align-items: center; gap: 18px; padding: 16px 18px; cursor: pointer; text-transform: none; }
.setting-volume-row + .setting-volume-row { border-top: 1px solid rgba(126, 138, 148, 0.2); }
.setting-copy { min-width: 0; }
.setting-copy strong { display: block; color: #f0e9df; font-size: 0.9rem; letter-spacing: 0.06em; text-transform: uppercase; }
.setting-copy > span { display: block; margin-top: 6px; color: #aab0b5; font-size: 0.84rem; font-weight: 400; letter-spacing: 0; line-height: 1.4; }
.setting-row input { position: absolute; width: 1px; height: 1px; min-height: 1px; margin: -1px; overflow: hidden; opacity: 0; pointer-events: none; }
.setting-toggle-track { position: relative; display: block; width: 48px; height: 28px; border: 1px solid #56616a; border-radius: 99px; background: #101519; box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.42); transition: border-color 140ms ease, background 140ms ease; }
.setting-toggle-track i { position: absolute; top: 4px; left: 4px; width: 18px; height: 18px; border-radius: 50%; background: #8b9297; transition: transform 140ms ease, background 140ms ease; }
.setting-row input:checked + .setting-toggle-track { border-color: var(--gold-bright); background: #2b2215; }
.setting-row input:checked + .setting-toggle-track i { transform: translateX(20px); background: var(--gold-bright); box-shadow: 0 0 9px rgba(216, 170, 95, 0.3); }
.setting-row input:focus-visible + .setting-toggle-track { outline: 2px solid var(--gold-bright); outline-offset: 3px; }
.setting-toggle-state { color: #afb5b9; font-size: 0.76rem; font-weight: 800; letter-spacing: 0.06em; text-align: right; text-transform: uppercase; }
.setting-volume-control { display: grid; grid-template-columns: minmax(0, 1fr) 42px; align-items: center; gap: 10px; }
.setting-volume-control input[type="range"] { position: static; width: 100%; height: 24px; min-height: 0; margin: 0; padding: 0; appearance: none; -webkit-appearance: none; border: 0; border-radius: 0; background: transparent; box-shadow: none; opacity: 1; cursor: pointer; }
.setting-volume-control input[type="range"]::-webkit-slider-runnable-track { height: 5px; border-radius: 99px; background: linear-gradient(90deg, #77603a, #d8aa5f); }
.setting-volume-control input[type="range"]::-webkit-slider-thumb { width: 18px; height: 18px; margin-top: -6.5px; appearance: none; -webkit-appearance: none; border: 1px solid #f0c980; border-radius: 50%; background: #171d21; box-shadow: 0 0 0 3px rgba(216, 170, 95, 0.16); }
.setting-volume-control input[type="range"]::-moz-range-track { height: 5px; border: 0; border-radius: 99px; background: linear-gradient(90deg, #77603a, #d8aa5f); }
.setting-volume-control input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border: 1px solid #f0c980; border-radius: 50%; background: #171d21; box-shadow: 0 0 0 3px rgba(216, 170, 95, 0.16); }
.setting-volume-control input[type="range"]:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 4px; }
.setting-volume-control output { color: #d8c6a5; font-size: 0.76rem; font-weight: 800; letter-spacing: 0.03em; text-align: right; }
.settings-legal-copy { padding: 16px 18px 18px; color: #aab0b5; font-size: 0.84rem; line-height: 1.5; user-select: text; -webkit-user-select: text; }
.settings-legal-copy p { margin-bottom: 10px; }
.settings-legal-copy p:last-child { margin-bottom: 0; }

/* Rune reveal */
.exercise-reveal-backdrop {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-top: max(50px, env(safe-area-inset-top));
}
.exercise-reveal-frame {
  position: relative;
  width: min(calc(100% - 64px), 360px);
  max-height: calc(100dvh - 84px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  border-radius: var(--frame-corner);
  background: linear-gradient(145deg, rgba(224, 166, 87, 0.82), rgba(88, 65, 39, 0.72));
  filter: drop-shadow(0 24px 36px rgba(0, 0, 0, 0.66));
  padding: 1px;
}
.exercise-reveal-panel {
  height: auto;
  max-height: inherit;
  overflow-y: auto;
  padding: 0 24px calc(20px + env(safe-area-inset-bottom));
}
.exercise-reveal-panel > * { position: relative; z-index: 1; }
.exercise-reveal-sigil {
  position: absolute;
  z-index: 5;
  top: -33px;
  left: 50%;
  display: grid;
  width: 66px;
  height: 66px;
  transform: translateX(-50%);
  place-items: center;
  border: 1px solid rgba(216, 170, 95, 0.76);
  border-radius: 50%;
  background: radial-gradient(circle, #192127 0 52%, #0a0f12 54% 66%, #3a3021 68% 70%, #10161a 72%);
  color: var(--gold-bright);
  box-shadow: 0 0 0 5px rgba(9, 14, 17, 0.86), 0 0 0 6px rgba(216, 170, 95, 0.22), 0 0 28px rgba(216, 170, 95, 0.2);
}
.exercise-reveal-sigil-icon {
  width: 36px;
  height: 36px;
  overflow: visible;
  filter: drop-shadow(0 0 5px rgba(216, 170, 95, 0.34));
}
.exercise-reveal-sigil-plate {
  fill: rgba(216, 170, 95, 0.2);
  stroke: currentColor;
  stroke-linejoin: round;
  stroke-width: 1.25;
}
.exercise-reveal-sigil-cut {
  fill: #11181c;
  stroke: #f0c980;
  stroke-linejoin: round;
  stroke-width: 0.8;
}
.exercise-reveal-sigil-strike {
  fill: none;
  stroke: #f4dfba;
  stroke-linecap: round;
  stroke-width: 1.35;
}
.exercise-reveal-heading { padding: 47px 4px 4px; }
.exercise-reveal-heading h2 { white-space: normal; }
.exercise-reveal-triad {
  --reveal-rune-line: rgba(216, 170, 95, 0.52);
  --reveal-rune-accent: #d8aa5f;
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: 72px 142px minmax(72px, auto);
  align-items: start;
  margin: 6px auto 0;
}
.exercise-reveal-triad[data-rune-type="burdened"] {
  --reveal-rune-line: rgba(166, 98, 50, 0.68);
  --reveal-rune-accent: #f0af7a;
}
.exercise-reveal-triad[data-rune-type="blood"] {
  --reveal-rune-line: rgba(215, 90, 79, 0.68);
  --reveal-rune-accent: #ff9b90;
}
.exercise-reveal-triad[data-rune-type="cursed"] {
  --reveal-rune-line: rgba(165, 107, 209, 0.68);
  --reveal-rune-accent: #d8b0f1;
}
.exercise-reveal-constellation {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 228px;
  overflow: visible;
}
.exercise-reveal-constellation-path {
  fill: none;
  stroke: var(--reveal-rune-line);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 0.9;
  vector-effect: non-scaling-stroke;
}
.exercise-reveal-constellation-diamond {
  fill: #0a0e11;
  stroke: var(--reveal-rune-accent);
  stroke-linejoin: round;
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}
.exercise-reveal-fact {
  position: relative;
  z-index: 2;
  display: grid;
  width: 100%;
  min-width: 0;
  grid-row: 1;
  align-content: start;
  justify-items: center;
  color: #eee6da;
  padding-inline: 4px;
  text-align: center;
}
.exercise-reveal-movement { grid-column: 1; }
.exercise-reveal-type { grid-column: 2; }
.exercise-reveal-fact > img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(216, 170, 95, 0.22));
}
.exercise-reveal-type > .codex-exercise-type-icon { width: 46px; height: 42px; }
.exercise-reveal-type > .codex-exercise-type-icon.compound { transform: scale(1.35); }
.exercise-reveal-fact strong {
  max-width: 100%;
  margin-top: 3px;
  overflow-wrap: anywhere;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  line-height: 1.12;
}
.exercise-reveal-rune {
  position: relative;
  z-index: 3;
  grid-row: 2;
  grid-column: 1 / -1;
  align-self: center;
  justify-self: center;
  width: 102px;
  height: 102px;
}
.exercise-reveal-node {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.exercise-reveal-name {
  position: relative;
  z-index: 2;
  grid-row: 3;
  grid-column: 1 / -1;
  align-self: end;
  margin: 0;
  overflow-wrap: anywhere;
  padding: 22px 6px 0;
  color: #f2e9dc;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 7vw, 2rem);
  font-weight: 600;
  letter-spacing: 0.015em;
  line-height: 1.02;
  text-align: center;
  text-shadow: 0 3px 15px rgba(0, 0, 0, 0.72);
}
.exercise-reveal-continue {
  width: 100%;
  min-height: 54px;
  margin-top: 24px;
}
.exercise-reveal-continue:focus-visible { outline: none; }

.exercise-choice-panel { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.exercise-choice-panel .exercise-reveal-heading { padding-bottom: 0; }
.exercise-choice-panel .exercise-reveal-heading .eyebrow {
  margin-bottom: 7px;
  color: var(--gold-bright);
}
.exercise-choice-rune {
  width: 116px;
  height: 116px;
  margin: 8px auto 14px;
}
.exercise-choice-rune img { display: block; width: 100%; height: 100%; object-fit: contain; }
.exercise-choice-list { display: grid; gap: 9px; }
.exercise-choice-option {
  display: grid;
  width: 100%;
  min-height: 76px;
  grid-template-columns: 44px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(216, 170, 95, 0.38);
  border-radius: var(--frame-corner);
  background: linear-gradient(145deg, rgba(23, 29, 33, 0.97), rgba(8, 12, 15, 0.97));
  padding: 10px 11px;
  color: #f0e8dd;
  text-align: left;
  cursor: pointer;
}
.exercise-choice-option:hover { border-color: rgba(240, 201, 128, 0.72); }
.exercise-choice-option:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}
.exercise-choice-movement { width: 42px; height: 42px; object-fit: contain; }
.exercise-choice-copy { min-width: 0; }
.exercise-choice-copy strong {
  display: block;
  overflow-wrap: anywhere;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.92rem;
  letter-spacing: 0.025em;
  line-height: 1.15;
}
.exercise-choice-copy small {
  display: block;
  margin-top: 5px;
  color: #a2a9ae;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  line-height: 1.3;
  text-transform: uppercase;
}
.exercise-choice-option > .codex-exercise-type-icon { width: 38px; height: 36px; }
.exercise-choice-option > .codex-exercise-type-icon.compound { transform: scale(1.28); }

@media (max-height: 680px) {
  .exercise-reveal-frame { max-height: calc(100dvh - 74px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .exercise-reveal-panel { padding-inline: 18px; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .exercise-reveal-heading { padding-top: 43px; padding-bottom: 0; }
  .exercise-reveal-triad { grid-template-rows: 62px 120px minmax(58px, auto); margin-top: 2px; }
  .exercise-reveal-constellation { height: 194px; }
  .exercise-reveal-fact > img { width: 36px; height: 36px; }
  .exercise-reveal-type > .codex-exercise-type-icon { width: 42px; height: 36px; }
  .exercise-reveal-fact strong { font-size: 0.68rem; }
  .exercise-reveal-rune { width: 87px; height: 87px; }
  .exercise-reveal-name { padding-top: 16px; font-size: clamp(1.35rem, 6.5vw, 1.7rem); }
  .exercise-reveal-continue { min-height: 50px; margin-top: 18px; }
  .exercise-choice-rune { width: 94px; height: 94px; margin-block: 3px 10px; }
  .exercise-choice-option { min-height: 68px; }
}

@media (prefers-reduced-motion: reduce) {
  .stats-rune-glyph i { animation: none !important; }
  .setting-toggle-track, .setting-toggle-track i { transition: none; }
  .collectible-grid-card, .collectible-all-filter, .collectible-rarity-rack button, .collectible-rarity-rack button i, .collectible-viewer-track { transition: none; }
}

@media (max-width: 430px) {
  .forge-menu-scroll { padding-inline: 16px; }
  .section-header { padding-inline: 16px; }
  .skill-rune-grid { grid-template-columns: 1fr; }
  .stats-specificity-duel { padding-inline: 11px; }
}

@media (max-width: 350px) {
  .exercise-reveal-frame { width: min(calc(100% - 36px), 360px); }
  .exercise-reveal-panel { padding-inline: 14px; }
  .exercise-reveal-fact strong { font-size: 0.66rem; }
  .exercise-reveal-name { font-size: 1.45rem; }
  .forge-menu-scroll { padding-inline: 12px; }
  .section-header { gap: 10px; padding-inline: 12px; }
  .section-header .button { min-width: 66px; }
  .floor-archive-training-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .floor-archive-training-metrics > span:nth-child(3) { border-left: 0; }
  .floor-archive-training-metrics > span:nth-child(n + 3) { border-top: 1px solid rgba(126, 138, 148, 0.22); }
  .floor-archive-exercise { padding-inline: 12px; }
  .floor-archive-sets { margin-left: 0; }
  .codex-section-toggle button { font-size: 0.62rem; }
  .skill-core-control { grid-template-columns: 42px minmax(0, 1fr) 48px; gap: 8px; padding-inline: 9px; }
  .skill-core-glyph { width: 42px; height: 42px; }
  .skill-control-heading strong { font-size: 0.8rem; }
  .skill-control-heading small { font-size: 0.57rem; }
  .stats-specificity-runes { gap: 6px; }
  .stats-rune { padding-inline: 6px; }
  .setting-row { grid-template-columns: minmax(0, 1fr) 48px; }
  .setting-toggle-state { grid-column: 2; }
  .setting-volume-row { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .collectible-filters > header { padding-inline: 10px; }
  .collectible-rarity-rack button { font-size: 0.58rem; letter-spacing: 0.035em; }
  .collectible-grid { gap: 13px 8px; }
  .collectible-viewer-header { grid-template-columns: 64px minmax(0, 1fr) 42px; gap: 8px; padding-inline: 10px; }
  .collectible-viewer-header h2 { font-size: 0.85rem; }
  .collectible-viewer-stage { padding-inline: 12px; }
}
