@font-face {
  font-family: Alegreya;
  src: url('./assets/fonts/alegreya.woff2') format('woff2');
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: Manrope;
  src: url('./assets/fonts/manrope.woff2') format('woff2');
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #101b24;
  --paper: #f5ead0;
  --gold: #f2cf92;
  --muted: #a7baba;
  --faint: #829696;
  --mint: #a6e2c5;
  --edge: #c3a77848;
  --border: #bdcfc529;
  --serif: Alegreya, Georgia, serif;
  --sans: Manrope, system-ui, sans-serif;
  font: 650 14px/1.45 var(--sans);
  color: var(--paper);
  background: #101b24;
  -webkit-tap-highlight-color: transparent;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body { position: fixed; inset: 0; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; padding: 0; cursor: pointer; border: 0; background: none; touch-action: manipulation; }
button[disabled] { cursor: default; }
button:focus-visible { outline: 2px solid #ffdb9c; outline-offset: 3px; z-index: 1; }
p, h1, h2, h3, dl, dd { margin: 0; }
.icon { width: 1.4em; height: 1.4em; display: inline-block; flex: none; vertical-align: middle; }
.eyebrow {
  display: block;
  color: var(--gold);
  font-size: .73rem;
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.art-tile {
  display: inline-block;
  flex: none;
  background: url('./assets/sprites.webp') var(--art-x) var(--art-y) / 800% 400% no-repeat;
}
.no-script { position: absolute; inset: 50% 20px auto; z-index: 30; padding: 20px; text-align: center; background: var(--ink); }
#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
  user-select: none;
  -webkit-user-select: none;
  --left-safe: max(14px, env(safe-area-inset-left));
  --right-safe: max(14px, env(safe-area-inset-right));
  --top-safe: max(12px, env(safe-area-inset-top));
  --bottom-safe: max(13px, env(safe-area-inset-bottom));
}
#world { width: 100%; height: 100%; display: block; position: absolute; inset: 0; touch-action: none; }
#world-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg,#06111e90,transparent 27%,transparent 73%,#060f197e),
    radial-gradient(ellipse at 50% 50%,transparent 47%,#080d1761 120%);
}
.button {
  min-height: 45px;
  min-width: 90px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg,#293b42,#202e38);
  border-radius: 6px;
  padding: 10px 15px;
  line-height: 1.25;
  font-weight: 800;
  font-size: .91rem;
  white-space: normal;
  text-align: center;
  transition: background-color .12s, border-color .12s, filter .12s, transform .10s;
  box-shadow: inset 0 1px #fff0c517, 0 3px 7px #060e1759;
}
.button:not(:disabled):hover, .icon-button:hover { border-color: #e5cb9a9c; filter: brightness(1.13); }
.button:not(:disabled):active, .icon-button:active { transform: translateY(1px) scale(.98); }
.button.primary {
  color: #24201c;
  background: linear-gradient(180deg,#f8e1ae,#e0b576);
  border-color: #ffe9ba;
  box-shadow: inset 0 0 0 2px #7f552322, inset 0 1px #fff6cf, 0 6px 16px #0e0e1890;
}
.button.primary .icon { width: 1.34em; height: 1.34em; }
.button.quiet { color: #c5d1cc; background: #1727309e; box-shadow: none; }
.button:disabled { opacity: .43; }
.button.mini { min-height: 34px; min-width: auto; padding: 6px 10px; font-size: .76rem; }
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border: 1px solid #c3aa7754;
  border-radius: 7px;
  background: linear-gradient(180deg,#23353ce0,#14232ece);
  box-shadow: inset 0 1px #eedbb51e, 0 3px 13px #050e1663;
  color: var(--paper);
  transition: filter .12s, transform .10s;
}
.icon-button .icon { width: 20px; height: 20px; }
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  min-width: 18px;
  border: 1px solid #b1bdbb64;
  border-radius: 3px;
  padding: 0 4px;
  font: 800 .66rem var(--sans);
  color: #ddded0;
  background: #13202bd9;
  box-shadow: 0 1px #0a131a;
}
.gamepad .keyboard-key, .pad-key { display: none; }
.gamepad .pad-key { display: inline; }

#title-screen { position: absolute; inset: 0; isolation: isolate; overflow: hidden; background: #142a30; }
.cover-art, .cover-shade, .cover-edge { position: absolute; inset: 0; pointer-events: none; }
.cover-art img { width: 100%; height: 100%; object-fit: cover; object-position: center 54%; }
.cover-shade {
  background: linear-gradient(90deg,#09151ee8 0%,#091720b3 30%,#0d1d2730 57%,transparent 76%),
    linear-gradient(0deg,#0b131edd,transparent 38%), linear-gradient(180deg,#0c17276b,transparent 22%);
}
.cover-edge {
  inset: 7px;
  border: 1px solid #dbb98439;
  outline: 1px solid #080f1576;
  outline-offset: 2px;
  border-radius: 2px;
}
.cover-edge::before, .cover-edge::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border: 1px solid #dfbf7d9e;
}
.cover-edge::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.cover-edge::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; }
.title-content {
  position: absolute;
  width: min(58vw, 710px);
  left: max(7vw, calc(var(--left-safe) + 10px));
  top: 50%;
  transform: translateY(-44%);
}
.title-sigil { display: flex; align-items: center; gap: 10px; width: min(210px,60%); margin-bottom: 6px; }
.title-sigil img { width: 54px; height: 54px; flex: none; filter: drop-shadow(0 1px 5px #17100f); }
.title-sigil span { height: 1px; background: linear-gradient(90deg, transparent, #debb7dae); width: 100%; }
.title-sigil span:last-child { transform: scaleX(-1); }
.title-content h1 {
  font: 800 clamp(66px, 11vw, 165px)/.87 var(--serif);
  letter-spacing: -.042em;
  margin-left: -.027em;
  color: #f9e9c4;
  text-shadow: 0 4px 1px #523c2688, 0 10px 28px #081218d4;
}
.title-content p {
  margin: clamp(14px, 2.45vw, 27px) 0 24px;
  font: 600 clamp(17px,2.25vw,27px)/1.16 var(--serif);
  color: #e8d8ae;
  text-shadow: 0 2px 6px #050d15;
  max-width: 31rem;
}
#title-actions { display: flex; gap: 11px; align-items: stretch; flex-wrap: wrap; }
.opening { min-width: min(234px,100%); min-height: 55px; justify-content: space-between; padding-inline: 21px; font-size: 1.04rem; }
.title-hero { padding-inline: 15px; }
.title-tools { position: absolute; right: calc(var(--right-safe) + 5px); top: calc(var(--top-safe) + 6px); display: flex; gap: 8px; z-index: 1; }

#hud { position: absolute; inset: 0; pointer-events: none; }
#hud button { pointer-events: auto; }
#hud[inert] button { pointer-events: none; }
.hud-top {
  position: absolute;
  top: var(--top-safe);
  left: var(--left-safe);
  right: var(--right-safe);
  display: grid;
  grid-template-columns: minmax(160px,1fr) auto minmax(110px,1fr);
  align-items: start;
  gap: 10px;
}
.player-panel {
  justify-self: start;
  display: flex;
  align-items: center;
  min-width: 182px;
  height: 53px;
  padding: 3px 10px 3px 3px;
  gap: 7px;
  border: 1px solid #d6bd8361;
  border-radius: 8px;
  background: linear-gradient(100deg,#152733f4,#152731cf);
  box-shadow: inset 0 1px #f4dcaf12, 0 4px 13px #06141b69;
  position: relative;
}
.hero-portrait {
  display: grid; place-items: center;
  width: 42px; height: 42px; flex: none;
  border-radius: 5px;
  border: 1px solid #cdb68765;
  background: radial-gradient(circle at 54% 22%,#86775a,#3f4848 45%,#102830 100%);
  overflow: hidden;
}
.hero-portrait .art-tile { width: 54px; height: 54px; transform: translate(1px,4px); }
.vitals { flex: 1; min-width: 0; display: grid; gap: 4px; }
.vitals-top { display: flex; justify-content: space-between; align-items: baseline; gap: 7px; color: #dce5da; font-size: .67rem; white-space: nowrap; letter-spacing: .015em; }
.vitals-top strong { font-size: .75rem; color: var(--gold); }
.health-track, .xp-track {
  display: block; overflow: hidden;
  height: 7px;
  border-radius: 5px;
  background: #0c151ebd;
  border: 1px solid #0006;
  box-shadow: 0 1px #ffffff18;
}
.health-track span, .xp-track span, .boss-track div, .stagger-track span { display: block; height: 100%; transition: width .11s linear; }
.health-track span { background: linear-gradient(180deg,#ffbd8b,#e96870); box-shadow: 0 0 7px #fd956d8c; }
.xp-track { height: 3px; }
.xp-track span { background: #eed98c; }
.status-dot { position: absolute; left: 36px; top: 2px; width: 10px; height: 10px; border: 2px solid #202f32; border-radius: 50%; background: #fdd387; box-shadow: 0 0 8px #fdd387aa; }
.location {
  justify-self: center;
  min-width: 185px; max-width: 460px;
  text-align: center;
  filter: drop-shadow(0 2px 3px #0a1518);
  text-shadow: 0 2px 4px #0c1724, 0 0 16px #0d1826;
  padding: 0 15px 3px;
}
.location .eyebrow { color: var(--region,var(--gold)); }
.location strong { display: block; font: 800 clamp(22px,3vw,34px)/1.06 var(--serif); margin: 2px 0 5px; }
.progress-gems { display: flex; align-items: center; justify-content: center; gap: 8px; height: 10px; }
.progress-gems i { display: inline-block; width: 6px; height: 6px; border: 1px solid #e8e0b272; transform: rotate(45deg); background: #192b36b8; }
.progress-gems .keeper { border-radius: 50%; width: 7px; height: 7px; }
.progress-gems .done { background: #9e947a; }
.progress-gems .here { background: var(--region,var(--gold)); box-shadow: 0 0 8px var(--region,var(--gold)); border-color: #fff3cc; }
.hud-tools { justify-self: end; display: flex; gap: 8px; }
#fight-status {
  position: absolute;
  top: calc(var(--top-safe) + 74px);
  left: 50%; transform: translateX(-50%);
  color: #e8dfc7;
  padding: 3px 9px;
  background: #0c1a21d0;
  border: 1px solid #c4b38c58;
  border-radius: 4px;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  white-space: nowrap;
}
.boss-meter {
  position: absolute;
  width: min(390px,74vw);
  top: calc(var(--top-safe) + 75px);
  left: 50%;
  transform: translateX(-50%);
  filter: drop-shadow(0 2px 3px #080f16);
}
.boss-meter > div:first-child {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  margin: 0 3px 3px;
  color: #ffe7b5;
  font: 800 17px/1.02 var(--serif);
  text-shadow: 0 2px 4px #050914;
}
#boss-phase { color: #ffce90; font: 800 .67rem var(--sans); text-transform: uppercase; }
.boss-track {
  padding: 2px;
  height: 12px;
  background: #150f19ef;
  border: 1px solid #efbc8b9b;
  border-radius: 5px;
  position: relative;
}
.boss-track div { background: linear-gradient(180deg,#f69481,#be5967); border-radius: 2px; box-shadow: 0 0 8px #f2996d77; }
.boss-track i { position: absolute; width: 1px; height: 100%; background: #1b1524c9; top: 0; left: 51%; }
.stagger-track { display: block; margin: 3px 4px 0; height: 2px; background: #131d26a6; }
.stagger-track span { background: #f1c57b; }
.chapter-line {
  position: absolute;
  top: calc(var(--top-safe) + 123px);
  left: 50%; transform: translateX(-50%);
  text-align: center;
  font: 600 18px/1.18 var(--serif);
  color: #fff0c9;
  text-shadow: 0 2px 4px #0b1517;
  width: min(90%,420px);
  padding: 4px 7px;
  background: radial-gradient(ellipse,#0c1527be,transparent 75%);
}
.hint {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--bottom-safe) + 90px);
  max-width: min(86%,390px);
  width: max-content;
  border: 1px solid #d5bd845c;
  border-radius: 5px;
  padding: 7px 12px;
  color: #f7e6bf;
  background: #132632e8;
  box-shadow: 0 3px 15px #0b141a5e;
  text-align: center;
  font-size: .82rem;
}
.passage {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--bottom-safe) + 91px);
  width: max-content;
  max-width: calc(100% - var(--left-safe) - var(--right-safe));
  animation: rise .2s ease-out both;
}
.passage .button { min-height: 48px; }
.interact-key { margin-left: 1px; color: #e4dcc7; }
.desktop-keys {
  position: absolute;
  bottom: calc(var(--bottom-safe) + 3px);
  left: var(--left-safe);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: #c0c6b7;
  font-size: .65rem;
  text-shadow: 0 2px 5px #0b1420;
}
.desktop-keys kbd { margin-inline-end: 2px; }
.touch .desktop-keys, .gamepad .desktop-keys { display: none; }

.actions {
  position: absolute;
  left: 50%; bottom: var(--bottom-safe);
  transform: translateX(-50%);
  display: flex;
  align-items: start;
  gap: 10px;
  height: 70px;
}
.combat-button {
  --tone: #f4d296;
  --lit: #d9b677;
  width: 65px; height: 65px;
  border-radius: 50%; position: relative;
  color: var(--tone);
  touch-action: none;
  box-shadow: 0 5px 13px #050d18aa;
  transition: filter .12s, transform .10s;
}
.combat-button.ring { --tone: #a9efd4; --lit:#8bf0cb; }
.combat-button.step { --tone: #c2d7f5; --lit:#9cc1f6; }
.combat-button.tonic { --tone: #bdedc0; --lit:#a9e3ad; }
.combat-button.pressed, .combat-button:active { transform: scale(.93); filter: brightness(1.25); }
.action-ring {
  position: absolute; inset: 0;
  border: 1px solid #dec89754;
  border-radius: inherit;
  background: conic-gradient(var(--lit) 0 var(--fill),#293f4add var(--fill) 100%);
  opacity: .89;
}
.cut .action-ring, .tonic .action-ring { background: #7d6a4fb5; }
.tonic .action-ring { background: #385d4e; }
.action-face {
  position: absolute; inset: 3px;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 2px;
  border: 1px solid #f4e3ba27;
  border-radius: inherit;
  background: radial-gradient(ellipse at 50% 22%,#354955ee,#172c39f7 73%);
  font-weight: 800; font-size: .69rem; letter-spacing: .035em;
  text-shadow: 0 1px 2px #11191f;
}
.action-face .icon { width: 24px; height: 24px; }
.cut .action-face { background: radial-gradient(ellipse at 50% 25%,#634633,#303035 70%,#1d2831); }
.tonic .action-face { background: radial-gradient(ellipse at 50% 28%,#2d4d47,#142a31); }
.action-key {
  position: absolute;
  right: 50%; transform: translateX(50%);
  bottom: -6px;
  border: 1px solid #8e9e9f74; border-radius: 4px;
  background: #0c1922;
  min-width: 18px; height: 15px; padding: 0 4px;
  color: #e0dfd1; font-size: .62rem; line-height: 13px;
}
.action-count {
  position: absolute;
  top: 0; right: 0;
  display: grid; place-items: center;
  width: 19px; height: 19px;
  border-radius: 50%;
  color: #20352f;
  background: #b7ddad;
  border: 1px solid #243b3b;
  font-size: .69rem; font-weight: 800;
}
.tonic.waiting .action-face { opacity: .68; filter: saturate(.35); }
.combat-button.step.waiting .action-face { color: #a5b7cd; }
.ring.ready { box-shadow: 0 0 19px #8df9caa1, 0 3px 15px #0a1921; }
.ring.ready .action-face {
  inset: 4px; background: radial-gradient(ellipse at 50% 35%,#326b65,#164056 76%);
  color: #d0ffe5;
  text-shadow: 0 0 7px #88f7d0ac;
}
.tonic.urgent { box-shadow: 0 0 0 2px #b6e2b9ae, 0 0 20px #97dcaa8c; }
.cut-combo { position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; }
.cut-combo i { width: 3px; height: 3px; transform: rotate(45deg); background: #ddc39d; opacity: .27; }
.combo-1 .cut-combo i:first-child, .combo-2 .cut-combo i:nth-child(-n+2), .combo-3 .cut-combo i { opacity: 1; background: #ffe098; box-shadow: 0 0 5px #ffcf95; }

.joystick { display: none; }
.touch .joystick {
  display: grid;
  place-items: center;
  position: absolute; left: var(--joy-x, calc(var(--left-safe) + 48px)); top: var(--joy-y, calc(100% - var(--bottom-safe) - 53px));
  width: 86px; height: 86px;
  transform: translate(-50%,-50%);
  border: 1px solid #d4d9b779;
  border-radius: 50%;
  background: #1627338c;
  box-shadow: 0 0 0 3px #121e286b, inset 0 0 15px #8bafa026;
}
.touch .joystick:not(.held) { left: calc(var(--left-safe) + 48px); top: calc(100% - var(--bottom-safe) - 53px); opacity: .78; }
.joy-halo, .joy-diamond, .joy-thumb { grid-area: 1 / 1; pointer-events: none; }
.joy-halo { width: 68px; height: 68px; border: 1px dashed #ded9b83a; border-radius: 50%; }
.joy-diamond { width: 81%; height: 81%; border: 1px solid #e8e2c021; transform: rotate(45deg) scale(.76); border-radius: 6px; }
.joy-thumb {
  width: 39px; height: 39px; border: 1px solid #e1d7b6ac; border-radius: 50%;
  background: radial-gradient(circle at 39% 31%,#657d7b9e,#304553c9 73%);
  box-shadow: inset 0 1px #f5e1b34a, 0 3px 5px #0b1821ad;
}
.joy-caption {
  position: absolute; bottom: 7px; left: 50%; transform: translateX(-50%);
  font-size: .66rem; font-weight: 800; color: #efe7c9;
}
.touch .actions {
  transform: none; left: auto; right: var(--right-safe);
  width: 188px; height: 135px;
  display: block;
}
.touch .combat-button { position: absolute; }
.touch .combat-button.cut { width: 73px; height: 73px; right: 0; bottom: 1px; }
.touch .combat-button.step { width: 55px; height: 55px; right: 79px; bottom: 0; }
.touch .combat-button.ring { width: 62px; height: 62px; right: 52px; bottom: 69px; }
.touch .combat-button.tonic { width: 46px; height: 46px; right: 141px; bottom: 9px; }
.touch .tonic .action-face .icon { width: 18px; height: 18px; }
.touch .tonic .action-face { font-size: .58rem; gap: 0; }
.touch .action-key, .touch .interact-key { display: none; }
.touch .hint { bottom: calc(var(--bottom-safe) + 139px); }
.touch .passage { bottom: calc(var(--bottom-safe) + 139px); }

#modal {
  position: absolute; inset: 0; z-index: 8;
  display: grid; place-items: center;
  background: #08131ec1;
  padding: var(--top-safe) var(--right-safe) var(--bottom-safe) var(--left-safe);
  touch-action: pan-y;
}
.panel {
  position: relative;
  display: flex; flex-direction: column;
  width: min(100%,585px);
  max-height: 100%;
  min-height: 0;
  border: 1px solid #b3986a9c;
  border-radius: 9px;
  background: linear-gradient(140deg,#1d353e,#172831 42%,#121e29 100%);
  box-shadow: 0 19px 70px #020a10ba, inset 0 1px #f7dfb52b, inset 0 0 0 3px #090f185c;
  overflow: hidden;
  animation: panel-in .18s ease-out both;
}
.panel.wide { width: min(100%,860px); }
.panel.compact { width: min(100%,441px); }
.panel.reward-panel { width: min(100%,650px); }
.panel.receipt { width: min(100%,625px); }
.panel-head {
  position: relative;
  flex: none;
  display: flex; justify-content: space-between; align-items: start;
  padding: 20px 24px 12px;
}
.panel-head::after {
  content: '';
  position: absolute;
  height: 1px;
  left: 22px; right: 22px; bottom: 0;
  background: linear-gradient(90deg,#d9ba874c,#c5aa7d1a 72%,transparent);
  pointer-events: none;
}
.panel-head .eyebrow { margin-bottom: 3px; }
.panel h2 { font: 800 clamp(29px,4.6vw,43px)/.98 var(--serif); letter-spacing: -.02em; color: #f6e1bb; }
.panel h2:focus { outline: none; }
.close-panel { flex: none; margin: -2px -3px 0 8px; width: 37px; height: 37px; }
.close-panel .icon { width: 19px; height: 19px; }
.panel-body {
  position: relative;
  padding: 15px 23px 20px;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: #63726a #192632;
  scrollbar-width: thin;
}
.panel-lead { color: #bdcbc3; font-size: .94rem; margin-bottom: 13px; }
.panel-body > .button.quiet { margin-top: 12px; }
.tabs {
  flex: none;
  display: flex; gap: 9px; padding: 3px 23px 0;
  border-bottom: 1px solid #c8c0a927;
}
.tabs button {
  position: relative;
  min-height: 41px; padding: 0 13px;
  border-bottom: 2px solid transparent;
  color: #a8bbba; font-size: .83rem; font-weight: 800;
}
.tabs button.selected { color: #f3d9a8; border-color: #ebcb8d; }
.tabs button:not(.selected):hover { color: #f4edd4; }
.tab-dot { display: inline-block; margin-left: 5px; margin-bottom: 1px; width: 5px; height: 5px; border-radius: 50%; background: #ffda8e; }
.empty-note { color: #aabab8; font-size: .83rem; line-height: 1.46; padding: 8px 0; }
.positive { color: #b0e8c5 !important; }
.pause-rows { display: grid; gap: 8px; }
.pause-rows .button { justify-content: space-between; text-align: left; min-height: 43px; }

.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; width: 100%; text-align: left;
  min-height: 51px; padding: 8px 2px;
  border-bottom: 1px solid #adbfb424;
}
.setting-row:hover strong { color: var(--gold); }
.setting-row strong, .setting-row small { display: block; }
.setting-row strong { margin-bottom: 2px; }
.setting-row small { color: var(--muted); font-size: .75rem; }
.switch { width: 40px; height: 23px; border-radius: 13px; border: 1px solid #adb9a162; background: #111f2a; flex: none; }
.switch i { display: block; height: 15px; width: 15px; margin: 3px; border-radius: 50%; background: #8d9f9e; transition: translate .14s; }
.switch.on { background: #365748; border-color: #9dddb1a8; }
.switch.on i { transform: translateX(17px); background: #bde8b8; }
.controls-list { display: grid; }
.controls-list > div {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; padding: 8px 0; min-height: 39px;
  border-bottom: 1px solid #adbfb424;
}
.controls-list dt { color: #f0dfbd; font-weight: 800; font-size: .83rem; white-space: nowrap; }
.controls-list .icon { color: var(--gold); margin-right: 4px; }
.controls-list dd { color: var(--muted); font-size: .77rem; text-align: right; }

.choices, .verse-list { display: grid; gap: 8px; }
.choice {
  position: relative; display: flex; gap: 11px; align-items: center;
  min-width: 0; min-height: 70px; padding: 11px;
  width: 100%; text-align: left;
  background: linear-gradient(102deg,#263a43,#162732);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent,var(--gold)); border-radius: 5px;
  box-shadow: 0 4px 8px #06101a51;
}
button.choice:hover:not(:disabled) { background: linear-gradient(108deg,#354952,#1a2e3b); border-color: var(--accent,var(--gold)); }
.choice:disabled { opacity: .44; }
.choice-copy { display: grid; gap: 3px; flex: 1; }
.choice-copy strong { color: #f4e4c4; font: 800 22px/1.05 var(--serif); }
.choice-copy small { color: #bdc9c4; font-size: .79rem; line-height: 1.34; }
.choice .eyebrow { color: var(--accent,var(--gold)); font-size: .62rem; }
.choice-arrow { color: var(--accent,var(--gold)); width: 18px; }
.gear-icon {
  display: inline-grid; place-items: center;
  width: 39px; height: 39px; flex: none;
  border: 1px solid #aeb8a54b;
  border-radius: 6px;
  background: radial-gradient(circle at 43% 36%,#ffffff18,#14252dcc);
  color: var(--accent,var(--gold));
}
.gear-icon .icon { width: 22px; height: 22px; }
.reward-row {
  display: flex; align-items: center; gap: 10px;
  margin-top: 12px; flex-wrap: wrap;
}
.spark-reward { color: #e8c683; white-space: nowrap; }
.spark-reward .icon { width: 16px; height: 16px; }
.reward-gear {
  flex: 1 1 235px; min-width: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 7px; border: 1px solid #c6c1a438; border-radius: 5px; background: #14242d;
  color: var(--accent);
}
.reward-gear div { flex: 1; min-width: 0; }
.reward-gear strong { display: block; line-height: 1.1; }
.reward-gear small, .reward-row > small { display: block; color: var(--muted); font-size: .72rem; }
.worn-text { color: #afdfbe; font-size: .72rem; padding-right: 4px; }
.memory-note { color: #d4c2a0; border-top: 1px solid #bca97b3d; margin-top: 11px; padding-top: 9px; font: 600 16px/1.21 var(--serif); }
.memory-note .icon { color: var(--gold); width: 16px; height: 16px; margin-right: 3px; }
.defeat-scene {
  display: flex; align-items: center; gap: 12px;
  padding: 2px 0 14px;
  color: #c5d1c9;
}
.defeat-scene .art-tile { width: 64px; height: 64px; background-color: #192d36; border-radius: 50%; border: 1px solid #b08d5c74; }
.defeat-scene p { font-size: .88rem; }

.stats-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0,1fr);
  background: #0f20295e;
  border: 1px solid #c6c8a93a;
  border-radius: 6px;
  padding: 7px 4px;
}
.stat-line {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  text-align: left;
  line-height: 1.15;
  padding: 2px 3px;
}
.stat-line + .stat-line { border-left: 1px solid #bac5ad29; }
.stat-line .icon { color: #d5bc8a; width: 17px; height: 17px; }
.stat-line strong { display: block; font-weight: 800; font-size: .95rem; color: #f3e6c6; white-space: nowrap; }
.stat-line span { display: block; color: #a5b9b6; font-size: .64rem; padding-top: 2px; font-weight: 770; white-space: nowrap; }
.gear-slots { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin: 12px 0 9px; }
.gear-slots button { display: flex; justify-content: center; align-items: center; gap: 5px; min-height: 38px; border: 1px solid #bfc9ad40; border-radius: 5px; color: #aabebb; background: #172a35; font-size: .78rem; }
.gear-slots button.selected { border-color: #ddb9809d; color: var(--gold); background: #323c3f; }
.gear-layout { display: grid; gap: 8px; grid-template-columns: minmax(220px,1.05fr) minmax(180px,1fr); align-items: start; }
.item-detail {
  padding: 13px;
  border: 1px solid #bfc3ad52; border-top: 2px solid var(--accent);
  border-radius: 6px;
  background: linear-gradient(139deg,#2c3c45,#172733);
}
.item-detail header { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.item-detail header .gear-icon { width: 46px; height: 46px; }
.item-detail .eyebrow { color: var(--accent); font-size: .62rem; }
.item-detail h3 { font: 800 24px/1.03 var(--serif); margin-top: 2px; color: #f2e3c3; }
.item-power {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 6px 1px; border-block: 1px solid #c8c9b12e;
  color: #c2cfc5; gap: 8px; font-size: .77rem;
}
.item-power strong { color: var(--accent); font: 800 24px/1.05 var(--serif); }
.item-detail p { color: #bccbc5; font-size: .79rem; margin-top: 8px; }
.affix { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--accent); font-size: .76rem; }
.affix span { color: #c9cfc5; }
.affix span strong { color: var(--accent); }
.item-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 11px; }
.item-actions .button { min-height: 36px; min-width: 67px; padding: 6px 8px; font-size: .74rem; gap: 5px; }
.item-actions .button span { color: #edcc8f; white-space: nowrap; }
.item-actions .button span .icon { width: 13px; height: 13px; }
.forged-label { font-size: .75rem; color: var(--gold); }
.gear-list { display: grid; gap: 6px; }
.gear-row {
  display: flex; align-items: center; gap: 8px;
  min-height: 53px; width: 100%; text-align: left;
  padding: 5px 8px; border: 1px solid #bfc3ad35; border-radius: 5px; background: #162a36;
}
.gear-row.selected { background: #283d48; border-color: #d0be9185; }
.gear-row:hover { border-color: var(--accent); }
.gear-row .gear-icon { width: 32px; height: 32px; }
.gear-row .gear-icon .icon { width: 18px; height: 18px; }
.gear-text { flex: 1; min-width: 0; }
.gear-text strong { display: block; font-weight: 800; font-size: .79rem; color: var(--accent); }
.gear-text span { display: block; font-size: .67rem; color: #acbcb7; }
.wearing { color: #9ad6b5; width: 16px; }
.gear-arrow { color: #919e9c; width: 15px; }

.skill-summary { display: flex; justify-content: space-between; align-items: center; gap: 9px; color: var(--muted); font-size: .75rem; margin-bottom: 13px; }
.skill-summary > span:first-child { color: #f1d59d; font-size: .88rem; }
.tree { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.tree-branch { min-width: 0; }
.tree-branch h3 { font: 800 24px/1.05 var(--serif); color: var(--gold); margin: 0 0 7px 3px; }
.skill-card {
  display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 5px 7px;
  position: relative; width: 100%; min-height: 90px;
  background: linear-gradient(140deg,#253a44,#182a37);
  border: 1px solid #c8cbbb37; border-radius: 5px;
  padding: 8px; margin-bottom: 7px; text-align: left;
}
.skill-card.trained { border-color: #d7bc7a8a; }
.skill-card:disabled { opacity: .66; }
.skill-card:not(:disabled):hover { border-color: #e4c58e; }
.skill-card .gear-icon { width: 28px; height: 28px; --accent: #e7c68e; }
.skill-card .gear-icon .icon { width: 17px; height: 17px; }
.skill-info strong, .skill-info span, .skill-info small { display: block; }
.skill-info strong { color: #f4e5c4; font-size: .80rem; margin-bottom: 2px; }
.skill-info span { color: #b9cac2; font-size: .72rem; }
.skill-info small { color: #b6a48b; font-size: .64rem; margin-top: 2px; }
.pips { grid-column: 2; display: flex; gap: 5px; margin-top: 1px; }
.pips i { width: 11px; height: 4px; border-radius: 1px; background: #0b1c29; border: 1px solid #b6ba9b57; }
.pips i.filled { background: #eaca8c; }

.chart-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 11px; }
.chart-main {
  overflow: hidden;
  display: flex; flex-direction: column; position: relative; justify-content: flex-end; min-height: 241px;
  padding: 13px; border: 1px solid #b4ba9e5e; border-radius: 6px;
  background: radial-gradient(ellipse at 77% 33%,#425852,#213542 57%,#152632);
  isolation: isolate;
}
.chart-illustration { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.chart-illustration::after {
  position: absolute; inset: 0; content: ''; pointer-events: none;
  background: linear-gradient(0deg,#14242dec,transparent 74%),linear-gradient(90deg,#14242dda,transparent 88%);
}
.chart-illustration .art-tile { position: absolute; width: 130px; height: 130px; filter: drop-shadow(0 5px 5px #0d172383); }
.chart-illustration .art-tile:nth-child(1) { width: 155px; height: 155px; right: 0; top: -3px; }
.chart-illustration .art-tile:nth-child(2) { right: 92px; top: 19px; opacity: .65; }
.chart-illustration .art-tile:nth-child(3) { right: -24px; top: 35px; opacity: .66; }
.chart-name .eyebrow { color: var(--accent); }
.chart-name h3 { font: 800 clamp(27px,4.4vw,47px)/.97 var(--serif); color: #fae7bc; margin: 4px 0 5px; }
.chart-name p { font: 600 17px/1.19 var(--serif); color: #d0d1ba; }
.chart-choice { display: grid; gap: 5px; margin-top: 11px; }
.chart-choice .button { justify-content: space-between; text-align: left; }
.chart-choice small { color: var(--muted); font-size: .66rem; }
.tier-choices { display: flex; gap: 5px; padding: 1px 0 2px; }
.tier-choices button {
  min-height: 27px; padding: 4px 7px; font-size: .65rem;
  border: 1px solid #bfc09c55; border-radius: 4px; background: #172a35;
  white-space: nowrap;
}
.tier-choices button.selected { color: #ffdf9a; border-color: #e3c3819e; }
.tier-choices button:disabled { opacity: .53; }
.tier-choices .icon { width: 12px; height: 12px; margin-left: 3px; }
.region-list { display: grid; gap: 5px; }
.region-card {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 47px; width: 100%; text-align: left;
  padding: 4px 8px; border: 1px solid #adbeb031; border-radius: 5px; background: #192c37;
}
.region-card > span:nth-child(2) { flex: 1; }
.region-card .gear-icon { width: 31px; height: 31px; }
.region-card .gear-icon .icon { width: 18px; height: 18px; }
.region-card strong, .region-card small { display: block; }
.region-card strong { color: #f0dfbf; font-weight: 800; font-size: .84rem; }
.region-card small { color: #afc0bb; font-size: .65rem; }
.region-card > .icon { color: var(--accent); width: 15px; }
.region-card.selected { border-color: #d9bd8190; background: #2a3c42; }
.region-card:disabled { opacity: .50; }
.region-card:not(:disabled):hover { border-color: var(--accent); }
.voyage-list { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; margin-top: 11px; }
.voyage-card { display: flex; align-items: start; gap: 8px; padding: 10px; border: 1px solid #afbdb04f; border-radius: 5px; background: #172a36; }
.voyage-card .eyebrow { color: var(--accent); font-size: .63rem; }
.voyage-card h3 { font: 800 23px/1.04 var(--serif); margin: 3px 0 5px; }
.voyage-card p { color: #bfccbf; font-size: .76rem; }
.voyage-card small { display: block; color: #9dadae; font-size: .70rem; margin-top: 5px; }
.voyage-card .button { margin-top: 7px; min-height: 35px; padding: 5px 8px; font-size: .75rem; }
.hub-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; }
.journal-top { display: grid; gap: 10px; }
.journal-bells { display: flex; justify-content: center; gap: min(3vw,15px); }
.journal-bells span { display: grid; place-items: center; width: 35px; height: 41px; color: #697d82; border: 1px solid #a6b0aa37; background: #142633; border-radius: 4px; }
.journal-bells .rung { color: var(--accent); border-color: #bdaf8577; background: #263d43; box-shadow: 0 0 11px #e9c47421; }
.section-title { margin: 16px 0 7px; font: 800 23px/1.05 var(--serif); color: #eedab0; }
.journal-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 7px; }
.journal-detail { display: flex; align-items: center; gap: 7px; min-height: 59px; padding: 7px; background: #182b36; border: 1px solid #abb8ad32; border-radius: 5px; }
.journal-detail h3 { color: var(--accent); font: 800 18px/1.15 var(--serif); }
.journal-detail p { color: var(--muted); font-size: .72rem; }
.journal-detail .icon { color: var(--accent); width: 28px; height: 28px; }
.journal-detail .art-tile { width: 44px; height: 44px; }

.receipt-art {
  position: relative; overflow: hidden;
  display: grid; place-items: center;
  height: 112px;
  border: 1px solid #cbb07a7a; border-radius: 6px;
  background: url('./assets/cover.webp') center 37% / cover no-repeat;
  isolation: isolate;
}
.receipt-art::after { content: ''; position: absolute; inset: 0; background: #10232c82; z-index: -1; }
.receipt-bell {
  width: 65px; height: 65px;
  display: grid; place-items: center;
  border: 1px solid var(--accent); border-radius: 50%; color: var(--accent);
  background: radial-gradient(circle,#31474b,#142935);
  box-shadow: 0 0 0 4px #1f313bb9,0 0 33px #fde0a75c;
}
.receipt-bell .icon { width: 36px; height: 36px; }
.receipt-art.is-dawn { height: clamp(99px,28vh,224px); }
.receipt-art img { width: 100%; height: 100%; object-fit: cover; object-position: center 47%; }
.receipt-quote { font: 600 19px/1.19 var(--serif); color: #efdbb3; margin: 10px 0 12px; }
.receipt-actions { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-top: 12px; }

#toast {
  position: absolute; z-index: 5; right: var(--right-safe);
  top: calc(var(--top-safe) + 51px);
  display: grid; justify-items: end;
  gap: 5px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 7px; width: max-content; max-width: 280px;
  padding: 7px 9px; border: 1px solid #d3c3a063; border-left: 2px solid var(--accent);
  border-radius: 5px; background: #142631ee; box-shadow: 0 4px 13px #08131c91;
  animation: panel-in .17s ease-out both;
}
.toast strong, .toast small { display: block; }
.toast strong { color: var(--accent); font-weight: 800; font-size: .78rem; }
.toast small { color: #c2cbc2; font-size: .64rem; }
.toast .icon { color: var(--accent); }
.modal-open #toast { display: none; }

@keyframes rise { from { opacity: 0; margin-bottom: -6px; } to { opacity: 1; margin-bottom: 0; } }
@keyframes panel-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

@media (min-width: 685px) {
  .choices.three { grid-template-columns: repeat(3,1fr); }
  .choices.three .choice {
    display: grid; grid-template-columns: 1fr auto; align-items: start;
    gap: 7px; padding: 12px; min-height: 132px;
  }
  .choices.three .gear-icon { grid-area: 1 / 1; }
  .choices.three .choice-copy { grid-area: 2 / span 2; }
  .choices.three .choice-arrow { grid-area: 1 / 2; align-self: center; }
}
@media (max-width: 700px) and (orientation: portrait) {
  .cover-shade {
    background: linear-gradient(0deg,#0e1925 0,#0e1925ed 9%,#0d1c27d9 24%,#13272c4f 52%,transparent 75%),linear-gradient(180deg,#0916208a,transparent 26%);
  }
  .cover-art img { object-position: 55% 40%; }
  .title-content {
    left: calc(var(--left-safe) + 8px); right: calc(var(--right-safe) + 8px); width: auto;
    top: auto; bottom: max(39px, calc(var(--bottom-safe) + 17px));
    transform: none; text-align: center;
  }
  .title-content h1 { font-size: clamp(67px, 21vw, 120px); margin-left: 0; }
  .title-sigil { width: 150px; margin: 0 auto 6px; gap: 7px; }
  .title-sigil img { width: 42px; height: 42px; }
  .title-content p { margin: 13px auto 16px; font-size: 18px; }
  #title-actions { justify-content: center; }
  .opening { min-height: 51px; min-width: 218px; }
  .title-tools { right: calc(var(--right-safe) + 2px); top: calc(var(--top-safe) + 3px); gap: 6px; }
  .title-tools .icon-button { width: 38px; height: 38px; }
  .hud-top { grid-template-columns: 1fr auto; }
  .player-panel { min-width: 147px; height: 46px; padding-right: 8px; }
  .hero-portrait { width: 36px; height: 36px; }
  .hero-portrait .art-tile { width: 48px; height: 48px; }
  .status-dot { left: 33px; width: 9px; height: 9px; }
  .hud-tools { grid-column: 2; gap: 6px; }
  .hud-tools .icon-button { width: 39px; height: 40px; }
  .location { position: absolute; top: 55px; left: 50%; transform: translateX(-50%); padding-inline: 0; width: 100%; }
  .location strong { font-size: clamp(21px,6.6vw,29px); }
  #fight-status { top: calc(var(--top-safe) + 112px); }
  .boss-meter { top: calc(var(--top-safe) + 114px); }
  .chapter-line { top: calc(var(--top-safe) + 152px); font-size: 15px; }
  #toast {
    top: auto; bottom: calc(var(--bottom-safe) + 193px);
    left: var(--left-safe); right: auto; justify-items: start;
  }
  .toast { max-width: 230px; padding: 5px 7px; }
}

@media (max-width: 620px) {
  .panel-head { padding: 16px 15px 10px; }
  .panel-head::after { left: 14px; right: 14px; }
  .panel-body { padding: 12px 13px 15px; }
  .tabs { padding-left: 13px; }
  .chart-grid, .voyage-list, .gear-layout, .tree, .journal-grid { grid-template-columns: 1fr; }
  .chart-main { min-height: 158px; }
  .voyage-list { margin-top: 8px; }
  .region-list { gap: 4px; }
  .region-card { min-height: 40px; }
  .tree { gap: 9px; }
  .skill-card { min-height: 61px; }
  .tree-branch h3 { font-size: 20px; }
  .item-detail { padding: 9px; }
  .stat-line .icon { width: 14px; height: 14px; }
  .stat-line strong { font-size: .82rem; }
  .stat-line span { font-size: .58rem; }
  .choice { padding: 8px; min-height: 59px; }
  .choice-copy strong { font-size: 20px; }
  .choice-copy small { font-size: .73rem; }
  .choices .gear-icon { width: 34px; height: 34px; }
  .choices .gear-icon .icon { width: 20px; height: 20px; }
}

@media (max-height: 510px) and (orientation: landscape) {
  .title-sigil { margin-bottom: 3px; }
  .title-sigil img { width: 42px; height: 42px; }
  .title-content h1 { font-size: clamp(60px,10.5vw,97px); }
  .title-content p { margin: 10px 0 14px; font-size: 19px; }
  .opening { min-height: 44px; min-width: 183px; }
  .player-panel { height: 45px; min-width: 143px; }
  .hero-portrait { width: 34px; height: 34px; }
  .hero-portrait .art-tile { width: 47px; height: 47px; }
  .location strong { font-size: 22px; }
  .location { min-width: 150px; }
  #fight-status { top: calc(var(--top-safe) + 51px); }
  .boss-meter { top: calc(var(--top-safe) + 51px); width: min(280px,54vw); }
  .chapter-line { top: calc(var(--top-safe) + 85px); font-size: 14px; }
  .hud-tools .icon-button { width: 37px; height: 37px; }
  .touch .actions { width: 181px; height: 91px; }
  .touch .combat-button.cut { width: 63px; height: 63px; }
  .touch .combat-button.step { width: 48px; height: 48px; right: 66px; }
  .touch .combat-button.ring { width: 55px; height: 55px; right: 48px; bottom: 47px; }
  .touch .combat-button.tonic { width: 42px; height: 42px; right: 121px; bottom: 0; }
  .touch .combat-button .icon { width: 19px; height: 19px; }
  .touch .hint, .touch .passage { bottom: calc(var(--bottom-safe) + 12px); max-width: min(52vw,365px); }
  .touch .hint { padding: 5px 7px; }
  .touch .passage .button { min-height: 41px; }
  .touch .joystick { width: 75px; height: 75px; }
  .touch .joystick:not(.held) { top: calc(100% - var(--bottom-safe) - 41px); }
  .joy-halo { width: 58px; height: 58px; }
  .joy-thumb { width: 34px; height: 34px; }
  .panel-head { padding-top: 13px; padding-bottom: 9px; }
  .panel h2 { font-size: 30px; }
  #toast { top: calc(var(--top-safe) + 43px); }
  .receipt-art { height: 82px; }
}
@media (max-width: 385px) and (orientation: portrait) {
  .cover-edge { inset: 5px; }
  .title-content { bottom: max(31px,calc(var(--bottom-safe) + 13px)); }
  .title-tools .icon-button { width: 35px; height: 35px; }
  .passage .button { min-width: 184px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
