:root {
  color-scheme: dark;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  background: #142d40;
  color: #fff4dc;
  --night: #18293c;
  --slate: #344357;
  --ink: #352214;
  --quiet-ink: #60452e;
  --paper: #fff1d5;
  --gold: #fec32c;
  --blue: #63a3ed;
  --blue-ink: #102b44;
  --player-life: #64cd1f;
  --enemy-life: #f7564e;
  --danger: #9d2b24;
  --radius: 18px;
  --bounce: cubic-bezier(.2, .76, .37, 1.18);
  --cave: url('./assets/scenes/cave-base.webp');
}

*, *::before, *::after { box-sizing: border-box; }
body {
  min-width: 280px;
  min-height: 100svh;
  margin: 0;
  -webkit-user-select: none;
  user-select: none;
  background: radial-gradient(ellipse at top, #24474b, #102a31 66%, #0e202a);
}
img { -webkit-user-drag: none; pointer-events: none; }
button, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:disabled { cursor: default; }
button:focus-visible, textarea:focus-visible {
  outline: 3px solid #125891;
  outline-offset: 3px;
  box-shadow: 0 0 0 3px #fff7dd;
}
h1, h2, p, ul { margin: 0; }
h1 { line-height: 1.17; letter-spacing: .02em; }
h1:focus { outline: none; }
.art { display: block; object-fit: contain; min-width: 0; user-select: none; pointer-events: none; }
.icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 1.26em; height: 1.26em; line-height: 1; font-weight: 900; vertical-align: middle; }
.icon .art { flex: none; width: 100%; height: 100%; max-width: 100%; max-height: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45em;
  min-height: 46px;
  padding: 8px 15px;
  border: 2px solid transparent;
  border-radius: 12px;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font-weight: 780;
  line-height: 1.25;
  transition: transform .12s ease-out, filter .12s, background-color .12s;
}
.button:not(:disabled):hover { filter: brightness(1.06); }
.button:not(:disabled):active { transform: translateY(2px); }
.button.primary {
  min-height: 50px;
  color: #322014;
  background: linear-gradient(#ffdb68, var(--gold) 58%, #f5ad23);
  border-color: #97551d;
  border-radius: 15px;
  box-shadow: inset 0 2px 0 #fff4ae, inset 0 -3px 0 #d98223, 0 3px 0 #77461636;
  font-size: 1.09rem;
}
.button.secondary { background: linear-gradient(#95caf7, var(--blue)); color: var(--blue-ink); border-color: #28567b; box-shadow: inset 0 1px 0 #d6ebff; }
.button.quiet { color: var(--ink); }
.button.quiet:not(:disabled):hover { background: #7f55251e; }
.button:disabled { background: #e4d6bb; color: #5f5545; border-color: #a99a80; box-shadow: none; }
.button.icon-only { width: 44px; padding: 0; }

.stats {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  margin-bottom: 15px;
  border: 2px solid #deb480;
  border-radius: 16px;
  background: #7a6653;
  box-shadow: 0 4px 0 #12192770;
  overflow: hidden;
}
.stat { position: relative; display: flex; align-items: center; gap: 8px; flex: 1 1 95px; min-width: 0; min-height: 69px; padding: 7px 12px; background: linear-gradient(#283b52, var(--night)); }
.stat > div { min-width: 0; }
.stat > .icon { width: 30px; height: 30px; }
.stat-label { display: block; color: #f7e4be; line-height: 1.15; font-size: .9rem; font-weight: 670; }
.stat strong { color: #fff8e3; font-size: 1.65rem; line-height: 1.06; font-variant-numeric: tabular-nums; }
.life-stat { flex: 1.5 1 160px; }
.life-stat > div { width: 100%; }
.life-stat > .icon { width: 41px; height: 41px; }
.health { position: relative; display: block; min-width: 0; }
.health-numbers { display: inline-flex; align-items: baseline; gap: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.health-numbers > span { opacity: .87; font-size: .92em; font-weight: 690; }
.health-track { display: block; position: relative; height: 10px; margin-top: 3px; background: var(--slate); border: 1px solid #302821; border-radius: 4px; overflow: hidden; }
.health-numbers [data-life-value] { display: inline-block; min-width: var(--digits); text-align: right; }
.health-track > span { display: grid; grid-template-columns: repeat(var(--segments),minmax(0,1fr)); height: 100%; }
.health-track i + i { border-left: 1px solid #433c38; }
.health-track i[data-full] { background: var(--cell-color,linear-gradient(#a8ed63,#63bd32)); }
.hit-float { position: absolute; top: -.35em; right: 0; z-index: 2; font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1; font-weight: 920; color: #ffad98; text-shadow: 0 2px 0 #6d241c, 0 0 4px #55211e; opacity: 0; pointer-events: none; }
.stat-change strong { display: inline-block; animation: value-up .54s var(--bounce); }
.stat-delta { position: absolute; top: 4px; right: 3px; z-index: 1; min-width: 24px; padding: 1px 4px; border-radius: 9px; text-align: center; background: #18293c; color: #ffe180; font-weight: 860; animation: stat-float .78s ease-out both; pointer-events: none; }
[data-stat='life'] .gain { color: #c9ff95; }
.stat-delta.spend { color: #ffad98; }

.scene { width: 100%; margin-inline: auto; }
.scene-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 14px;
  min-height: 54px;
  margin-bottom: 10px;
  padding: 0 3px;
}
.scene-heading h1 {
  color: #fff2cc;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  font-weight: 900;
  text-shadow: 0 2px 0 #382622, 0 3px 10px #0b1c30;
}
.current-location { display: flex; align-items: center; gap: 5px; color: #fff2cc; font-weight: 660; text-shadow: 0 1px 4px #142d40; }
.current-location strong { color: #ffdf88; }
.current-location .icon { width: 1.4em; height: 1.4em; }
.explore-heading { align-items: end; }
.explore-heading > div:first-child { min-width: 160px; }
.explore-heading .dragon-hint { margin: 0 0 2px auto; }

.dragon-hint { display: flex; align-items: end; gap: 5px; width: fit-content; max-width: min(100%, 380px); margin: 9px 3px; }
.dragon-hint > .icon { width: 64px; height: 64px; filter: drop-shadow(0 2px 1px #13283c); }
.dragon-bubble {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  margin-bottom: 7px;
  padding-inline: 11px 2px;
  border: 2px solid #b78b5f;
  border-radius: 20px;
  background: #fff6df;
  color: var(--ink);
  box-shadow: 0 2px 3px #2a171937;
}
.dragon-bubble::before {
  content: '';
  position: absolute;
  top: 53%;
  left: -6px;
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  background: inherit;
  border: solid #b78b5f;
  border-width: 0 0 2px 2px;
}
.dragon-bubble p { font-weight: 730; line-height: 1.4; font-size: .97rem; }
.dragon-bubble .button { align-self: start; flex: none; min-height: 44px; }

.map {
  min-width: 0;
  padding: 10px;
  border: 2px solid #845432;
  border-radius: 19px;
  background: linear-gradient(#efc990, #eab67b);
  color: var(--ink);
  box-shadow: inset 0 0 0 2px #fff0c0a8, 0 5px 0 #3923188e, 0 13px 30px #1017245c;
}
.map-board {
  position: relative;
  height: clamp(275px, 39vh, 395px);
  border: 1px solid #b98c5d;
  border-radius: 12px;
  background: linear-gradient(#fff3cc20, #dea65110), url('./assets/maps/parchment.webp') center / cover, #f7dfad;
}
.map-board.short-map { height: clamp(210px, 31vh, 300px); }
.map-trails { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.map-trails path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.trail-open { --road: #9a582d; --road-width: 6.5px; --verge: #ebc595; --verge-width: 10.5px; --direction: #ffe0aa; }
.trail-traveled { --road: #845e42; --road-width: 4px; --verge: #e3c397; --verge-width: 6.5px; --direction: #f9dbab; }
.trail-future { --road: #8d745d; --road-width: 2.5px; --direction: #8d745d; }
.trail-verge { stroke: var(--verge); stroke-width: var(--verge-width); }
.trail-line { stroke: var(--road); stroke-width: var(--road-width); }
.trail-future .trail-line { stroke-dasharray: 3 5.5; }
.trail-direction { stroke: var(--direction); stroke-width: 1.3px; }
.map-hero {
  position: absolute;
  inset: 0 auto auto 0;
  z-index: 3;
  pointer-events: none;
  --hero-size: clamp(40px, 6vw, 66px);
}
.map-hero::before {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: calc(var(--hero-size) * .57);
  height: 8px;
  border-radius: 50%;
  background: #38251981;
  translate: -50% -55%;
}
.map-hero .art {
  position: absolute;
  inset: 0 auto auto 0;
  width: var(--hero-size);
  height: var(--hero-size);
  max-width: none;
  object-position: center bottom;
  translate: -50% -100%;
  filter: drop-shadow(0 1px 1px #382519bf);
}
.map-hero.faces-left .art { scale: -1 1; }
.map-hero.walking .art { animation: map-footsteps 180ms ease-in-out infinite alternate; }
.map-board:has(.map-hero:not([hidden])) .node-mark > .icon-hero { visibility: hidden; }
@keyframes map-footsteps { to { translate: -50% calc(-100% - 4px); } }
.map-node {
  position: absolute;
  top: var(--wide-y);
  left: var(--wide-x);
  transform: translate(-50%, -42%);
  z-index: 1;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 3px;
  width: max-content;
  max-width: 29%;
  min-width: 48px;
  min-height: 49px;
  padding: 1px 2px;
  color: var(--ink);
  background: none;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
}
.node-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 83px;
  height: 62px;
  border: 2px solid #765d57;
  border-radius: 45% 45% 12px 12px / 36% 36% 12px 12px;
  background: linear-gradient(#61738a, #354b64);
  box-shadow: inset 0 2px 0 #b8bdcd, 0 2px 0 #6751418c;
}
.node-mark > .art, .node-mark > .icon:not(.icon-hero) { width: 86%; height: 86%; }
.node-mark > .icon-hero { position: absolute; top: -7px; left: -15px; width: 37px; height: 37px; filter: drop-shadow(0 1px 2px #201a16); }
.node-label { max-width: 100%; padding: 2px 6px; border: 1px solid #b28964; border-radius: 12px; background: #fff2d6; font-size: .88rem; font-weight: 810; line-height: 1.16; overflow-wrap: anywhere; }
.map-node.here .node-mark { border-color: #ffcf62; box-shadow: inset 0 1px 0 #ffeab4, 0 0 0 2px #9b4e14; background: #69513f; }
.map-node.here .node-label { background: #8d4c23; border-color: #733918; color: #fff5cd; }
.map-node.available .node-mark { border-color: #fff1ad; outline: 2px solid #a46128; background: linear-gradient(#6a7585, #414e65); }
.map-node.available .node-label { border-color: #955c23; background: #ffe5a8; }
.map-node.later .node-mark { background: #71808c; }
.map-node.passed .node-mark { border-color: #8b7451; }
.map-node.closed .node-mark { border: 2px dashed #685b53; background: #b6a28c; }
.map-node.closed .node-mark > .art, .map-node.closed .node-mark > .icon { filter: grayscale(1); opacity: .64; }
.map-node.inspecting .node-mark { outline: 3px solid #1461a5; outline-offset: 3px; }
.map-node:hover .node-label { text-decoration: underline; text-underline-offset: 2px; }
.node-done, .node-lock { position: absolute; top: -4px; right: -7px; display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid #fff1c8; border-radius: 50%; font-size: .76rem; color: #fff1c8; background: #32551e; }
.node-lock { background: #63504a; }
.button:disabled .icon-lock,.map-legend .icon-lock { --lock-cutout: #ead6ab; }
.node-arrival .icon-hero { animation: node-arrive .46s var(--bounce) both; }
.map-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin-top: 8px; color: #502d1a; font-size: .88rem; font-weight: 760; }
.map-legend span { display: inline-flex; align-items: center; gap: 3px; }
.map-legend i { display: inline-grid; place-items: center; flex: none; width: 15px; height: 15px; border: 2px solid #a46128; border-radius: 4px; background: #ffe49c; font-size: .65rem; font-style: normal; }
.map-legend .legend-done { color: #fff1c8; background: #32551e; border-color: #32551e; }
.room-group { display: inline-flex; align-items: center; font-size: .96rem; }
.room-group .icon + .icon { margin-left: -.42em; }

.scene-nav { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px; margin: 13px 2px 0; }
.scene-nav:empty { display: none; }
.routes h2 { margin: 0 0 6px; font-size: .97rem; font-weight: 800; text-shadow: 0 1px 4px #123; }
.route-buttons { display: flex; flex-wrap: wrap; gap: 7px; }
.route-buttons .button { min-width: 114px; text-align: left; }
.route-buttons .button > .art, .route-buttons .button > .icon:first-child { width: 24px; height: 24px; }
.route-buttons .button .icon:last-child { margin-left: 4px; }
.supplies { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.supplies > span { font-weight: 690; font-size: .9rem; }

.room-card, .battle-summary {
  min-width: 0;
  border: 2px solid #a37148;
  border-radius: 15px;
  background: linear-gradient(#fff6df, #f9e3b8);
  color: var(--ink);
}
.enemy-preview, .damage-list, .shop-list { padding: 0; list-style: none; }
.damage-list li span { margin-right: auto; }
.room-loot, .reward-totals { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.room-loot { margin-top: 7px; }
.reward-badge { display: inline-flex; align-items: center; gap: 5px; border: 1px solid #b7844e; border-radius: 10px; padding: 4px 8px; background: #ffebbd; color: #543116; font-weight: 760; }
.reward-badge strong { font-size: 1.27em; font-variant-numeric: tabular-nums; line-height: 1.08; }
.room-condition { margin: 3px 0; color: #5e3f28; font-weight: 655; font-size: .94rem; }
.action-feedback { width: fit-content; margin: 8px 0; padding: 6px 9px; border: 1px solid #9fa972; border-radius: 9px; background: #e7f0cf; color: #365922; font-size: .95rem; font-weight: 740; animation: arrive .23s ease-out both; }

.item-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 9px;
  border: 2px solid #b0844e;
  border-radius: 15px;
  background: linear-gradient(#fff6df, #f6dfb2);
  color: var(--ink);
  text-align: center;
  box-shadow: 0 4px 0 #37251883;
}
.item-card.unavailable { border-color: #ac9478; background: #ede2ca; }
.item-art { position: relative; width: 100%; height: clamp(67px, 11vh, 97px); background: radial-gradient(ellipse, #f7bc5671, transparent 65%); }
.item-card.unavailable .item-art { background: none; }
.item-art .art { position: absolute; inset: 0; width: min(92%, 120px); height: 100%; margin: auto; }
.item-card h3 { margin: 0; color: #472716; font-size: 1.17rem; line-height: 1.14; font-weight: 900; }
.item-effect { color: #5b3e26; font-weight: 710; line-height: 1.18; }
.item-effect b { font-size: 1.22em; color: #713716; font-variant-numeric: tabular-nums; white-space: nowrap; }
.item-issue { color: #61513c; font-size: .78rem; line-height: 1.19; }
.item-purchase { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; width: 100%; gap: 5px 8px; margin-top: auto; }
.item-purchase .button { min-height: 44px; padding-inline: 10px; }
.item-purchase .button:not(:disabled) { border-color: #a36324; background: #ffd365; color: #482713; box-shadow: inset 0 1px #ffe8a4, 0 2px 0 #ba792f4d; }
.price { display: inline-flex; align-items: center; gap: 3px; color: #563017; font-variant-numeric: tabular-nums; font-weight: 820; }
.price strong { font-size: 1.3rem; }

.hero-battler, .enemy-figure { position: relative; isolation: isolate; display: grid; place-items: center; min-width: 0; }
.hero-battler { width: min(100%, 302px); height: clamp(150px, 34vh, 310px); align-self: center; justify-self: center; }
.battler-art { position: relative; z-index: 1; width: 100%; height: 100%; filter: drop-shadow(0 2px 2px #201b28); }
.ground-shadow { position: absolute; z-index: 0; bottom: 2px; left: 14%; width: 72%; height: 13%; border-radius: 50%; background: #111828a3; }
.hero-battler .ground-shadow { bottom: 5%; }
.strike-effect { position: absolute; z-index: 2; width: 58%; height: 30%; top: 40%; left: 36%; border-top: 4px solid #ffda76; border-radius: 70% 48% 28% 20%; opacity: 0; pointer-events: none; }
.enemy { position: relative; display: grid; min-width: 0; justify-items: stretch; align-content: end; padding: 3px; border: 2px solid transparent; border-radius: 13px; background: transparent; color: var(--ink); text-align: center; }
button.enemy:not(:disabled) { cursor: pointer; }
.enemy-figure { width: min(100%, 230px); height: clamp(95px, 25vh, 231px); margin: 0 auto; }
.enemy.selected .ground-shadow { background: #9c672849; box-shadow: 0 0 0 2px #ffdc72; }
.enemy-marker { display: none; position: absolute; top: -15px; z-index: 2; padding: 1px 5px; white-space: nowrap; border-radius: 6px; font-weight: 850; font-size: .76rem; }
.selected-marker { border: 1px solid #8c4f1b; background: #ffda6a; color: #482519; }
.dead-marker { border: 1px solid #645d56; background: #69605a; color: #fff0d9; }
.enemy.selected .selected-marker, .enemy.dead .dead-marker { display: inline-flex; align-items: center; }
.chest-display, .loot-display { position: relative; display: grid; place-items: center; height: clamp(160px, 27vw, 256px); }
.chest-display .chest-art { position: absolute; left: 50%; bottom: 0; width: min(85%, 263px); height: 95%; transform: translateX(-50%); filter: drop-shadow(0 5px 5px #231916a3); }
.chest-display .reward-art { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); width: 39%; height: 51%; filter: drop-shadow(0 0 13px #ffd3639c); }
.chest-reveal .reward-art { animation: prize .53s var(--bounce) both; }
.loot-display { display: flex; align-items: center; justify-content: center; }
.loot-display .icon { width: min(57%, 167px); height: 70%; filter: drop-shadow(0 4px 2px #32212289); }
.loot-display .icon + .icon { width: min(34%, 94px); height: 41%; margin-left: -14px; align-self: end; margin-bottom: 13%; }
.loss-mark .icon { width: min(46%, 115px); filter: saturate(.6); }
.reward-title { color: #fff3d5; font-size: clamp(1.24rem, 3vw, 1.85rem); font-weight: 890; line-height: 1.2; text-shadow: 0 2px 4px #392820; }
.reward-totals { margin: 8px 0; }
.reward-totals:empty { display: none; }
.reward-totals .reward-badge { padding: 5px 9px; }
.reward-totals .reward-badge strong { font-size: 1.55em; }
.chest-note { color: #fff2d3; font-size: .9rem; font-weight: 690; margin: 5px 0; }
.reward-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 9px; }
.stars { margin-top: 7px; color: #ffd85c; font-size: 2.26rem; line-height: 1.05; letter-spacing: .09em; text-shadow: 0 1px 3px #4f2f12; }
.stars span { color: #fff0ca; }
.battle-summary { margin: 11px 0 0; padding: 8px 11px; border-width: 1px; }
.battle-summary h2 { margin-bottom: 5px; font-size: 1.02rem; font-weight: 850; }
.recap { display: flex; flex-wrap: wrap; gap: 3px 9px; color: var(--quiet-ink); font-size: .93rem; }
.recap strong { color: #4d2b15; font-size: 1.1em; font-weight: 880; }
.damage-list { display: grid; gap: 3px; margin-top: 6px; }
.damage-list li { display: flex; align-items: center; justify-content: space-between; border-radius: 8px; font-size: .91rem; padding: 5px 7px; background: #fff1d5; }
.dialog-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
dialog { color: var(--ink); width: min(440px, calc(100% - 28px)); background: var(--paper); border: 2px solid #93603a; border-radius: var(--radius); padding: 19px; box-shadow: 0 7px 0 #36211b82; }
dialog[open] { animation: arrive .23s ease-out both; }
dialog::backdrop { background: #101c2ebd; }
dialog h2 { font-size: 1.25rem; }
dialog p { margin: 9px 0; color: var(--quiet-ink); }
dialog p:empty { display: none; }
.dialog-actions { justify-content: flex-start; }
dialog textarea { width: 100%; min-height: 100px; margin-top: 8px; border-radius: 6px; -webkit-user-select: text; user-select: text; }

@keyframes arrive { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes node-arrive { from { opacity: .2; transform: translateY(-11px) scale(.86); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes value-up { 41% { transform: scale(1.12); } }
@keyframes stat-float { 0% { opacity: .5; transform: translateY(5px); } 22%, 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-4px); } }
@keyframes prize { from { opacity: .35; transform: translate(-50%, 24px) scale(.63); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .stat-delta { opacity: 1; }
}

/* The cover is a single landscape. Everything above the painted doorway stays live. */
.home {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  overflow: clip;
  background: #203e40 url('./assets/scenes/forest-gate.webp') 56% center / cover;
}
.home::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, #072b30ac, #07383d56 39%, transparent 68%), linear-gradient(0deg, #12252c88, transparent 28%);
}
.home-tools { position: absolute; top: 14px; right: 3vw; z-index: 2; }
.home-tools .button { background: #132e32e8; color: #fff0c7; }
.home-stage { position: relative; width: min(100%, 1480px); min-height: 100svh; margin: auto; display: flex; align-items: center; }
.home-copy { position: relative; width: 51%; padding: 38px 0 42px clamp(32px, 8vw, 134px); }
.title-plaque h1 {
  width: max-content; margin: 0; transform: rotate(-4deg);
  font: 1000 clamp(66px, 7.8vw, 132px)/1.05 'Microsoft YaHei', system-ui, sans-serif;
  letter-spacing: -.045em; color: #fff4d0; -webkit-text-stroke: .055em #573325; paint-order: stroke fill;
  text-shadow: 0 .065em #71381e, 0 .12em #332026, .045em .13em #332026;
}
.title-plaque h1 span { display: block; font-size: 1.36em; color: #ffce51; }
.home-copy p { width: fit-content; margin: 32px 0 18px; padding: 5px 10px; border-left: 3px solid #ffd268; color: #fff5d4; background: #103136cb; font-weight: 750; }
.home-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.home-actions .primary { min-height: 62px; padding: 12px 26px; font-size: clamp(19px, 2vw, 27px); }
.entrance-visual { position: absolute; inset: 0; pointer-events: none; }
.entrance-visual img { position: absolute; object-fit: contain; filter: drop-shadow(0 8px 4px #352b2370); }
.home-hero { width: 28%; height: 49%; left: 54%; bottom: 7%; }
.home-chest { width: 13%; height: 21%; left: 80%; bottom: 9%; }
.home-dragon { width: 14%; height: 24%; left: 49%; bottom: 48%; transform: rotate(-9deg); }

.game-shell { width: min(100%, 1270px); margin: auto; padding: 0 clamp(12px, 3vw, 44px) 26px; }
.game-header, .game-name, .header-actions { display: flex; align-items: center; }
.game-header { min-height: 50px; justify-content: space-between; gap: 6px; }
.game-name { gap: 15px; }
.game-logo { color: #ffedc5; font-size: 1.16rem; font-weight: 950; text-shadow: 0 2px #30231f; }
.game-logo > span { color: #ffd163; }
.mode-name { color: #e2dbb8; font-size: .88rem; font-weight: 680; }
.header-actions .button { min-height: 44px; color: #fff0cf; font-size: .87rem; padding: 6px 10px; }
.header-actions .button:hover:not(:disabled) { background: #234958; }
.header-actions .button:disabled { background: transparent; border-color: transparent; opacity: .6; }
.stats { align-items: stretch; gap: 0; background: #132c33; border: 1px solid #93764b; border-radius: 12px; margin-bottom: 0; overflow: visible; box-shadow: 0 4px 12px #081a235c; }
.stat { flex: 0 1 auto; min-height: 61px; padding: 6px clamp(8px, 1.5vw, 24px); background: none; border-right: 1px solid #68817b5c; }
.stat:last-child { border: 0; }
.stat-label { font-size: .79rem; color: #e9e2c4; }
.stat strong { font-size: 1.45rem; }
.life-stat { flex: 1 1 150px; max-width: 262px; }
.life-stat .health { display: grid; grid-template-columns: auto minmax(20px, 1fr); align-items: center; gap: 6px; }
.life-stat .health-track { margin: 2px 0 0; height: 12px; }
.stats.prologue-stats { width: fit-content; min-width: min(345px,100%); }
.stats.prologue-stats .life-stat { min-width: 156px; }
[data-stat='gold'] strong { color: #ffda71; }
.scene { margin-top: 16px; }
.scene-heading { min-height: 44px; margin: 0 0 12px; padding: 0; }
.scene-heading h1 { font-size: clamp(27px,3.2vw,44px); }
.button.primary, .item-purchase .button:not(:disabled) {
  background: linear-gradient(#ffe381 0%, #ffc740 55%, #ffb529 100%); color: #432814;
  border: 2px solid #774725; border-radius: 16px; box-shadow: inset 0 2px #fff1aa, inset 0 -3px #dc8925, 0 3px #402a20;
}
.button.primary:disabled { background: #ded3b8; color: #615849; border-color: #8b7f6c; box-shadow: inset 0 1px #fff0d3; }
.button.secondary { background: #254c56; color: #ffedcc; border: 1px solid #9aa593; box-shadow: inset 0 1px #dce8bb38, 0 2px #162e32; }
.scene-nav { align-items: center; justify-content: space-between; margin-top: 14px; padding: 8px 2px; }
.routes { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.routes h2 { margin: 0 5px 0 0; color: #f2dcac; }
.route-buttons .button { font-weight: 720; }
.dragon-hint { align-items: center; }
.dragon-bubble { margin: 0; border-color: #956840; }
.dragon-hint > .icon { width: 62px; height: 62px; }

/* Atlas and room inspection */
body:has(.explore-scene) { background: linear-gradient(#112d34ed,#112d34c9), url('./assets/scenes/forest-gate.webp') center / cover fixed; }
.scene-arrival { animation: arrive .22s ease-out; }
.explore-heading { align-items: center; }
.explore-heading > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; }
.map { position: relative; padding: 0; border: 3px solid #996435; border-radius: 18px 12px 17px 10px; overflow: hidden; background: #f5deab; }
.map-board, .map-board.short-map { height: clamp(340px, 48svh, 500px); border: 0; border-radius: 0; background: #f3deb1 url('./assets/maps/illustrated-atlas.webp') center / 100% 100%; }
.map-board.short-map { height: clamp(292px, 44svh, 440px); }
.map-node { transform: translate(-50%, -44%); gap: 0; }
.node-mark, .map-node:is(.here,.available,.passed,.closed,.later) .node-mark {
  width: clamp(67px,7.8vw,108px); height: clamp(56px,6.6vw,93px); border: 0; border-radius: 12px; outline: none;
  background: transparent; box-shadow: none;
}
.node-mark > .art, .node-mark > .icon:not(.icon-hero) { width: 97%; height: 97%; filter: drop-shadow(0 3px 1px #533e2866); }
.map-node:is(.here,.available,.passed,.closed,.later) .monster-door { background: url('./assets/maps/gate-arch.webp') center bottom / contain no-repeat; }
.monster-door > .art, .monster-door > .room-group { align-self: end; width: 61%; height: 64%; margin-bottom: 4%; }
.monster-door > .room-group { display: flex; justify-content: center; align-items: end; }
.monster-door .room-group .icon { width: 45%; height: 85%; }
.map-node:is(.later,.closed) .node-mark { filter: saturate(.37); }
.map-node.available .node-mark { filter: drop-shadow(0 0 3px #ffb500) drop-shadow(0 0 5px #ffe047); }
.node-mark > .icon-hero { top: auto; left: -9px; bottom: -2px; width: 45%; height: 48%; background: #ffd978; border: 2px solid #734120; border-radius: 50%; }
.node-label { position: relative; background: #fff0cd; font-size: clamp(13px,1.1vw,16px); border: 1px solid #ac8252; padding: 2px 8px; border-radius: 5px; }
.map-node.available .node-label { background: #ffe082; color: #49331d; }
.node-caption { position: absolute; top: 100%; padding: 1px 6px 2px; border-radius: 0 0 7px 7px; background: #564530; color: #fff4d4; font-size: .73rem; font-weight: 850; white-space: nowrap; }
.map-node.available .node-caption { background: #436243; }
.map-node.inspecting .node-label { outline: 3px solid #2467a1; }
.map-node.inspecting .node-mark { outline: none; }
.node-done, .node-lock { right: 0; top: 6px; }
.map-legend { padding: 5px 8px; margin: 0; border-top: 1px solid #a276494a; font-size: .8rem; }
.map-dock { display: flex; justify-content: space-between; align-items: start; gap: 12px; flex-wrap: wrap; }
.map-dock .dragon-hint { max-width: 46%; }
#room-preview { position: fixed; z-index: 6; container-type: inline-size; transform-origin: var(--room-tip-x) var(--room-tip-y); }
#room-preview::before, #room-preview::after {
  content: ''; position: absolute; z-index: 1; pointer-events: none;
  left: var(--room-tip-x); top: var(--room-tip-y);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  transform-origin: 50% 100%;
  transform: translate(-50%, -100%) rotate(var(--room-tip-angle));
}
#room-preview::before { width: 20px; height: 12px; background: #a37148; }
#room-preview::after { width: 15px; height: 9px; background: #ffedcc; }
.room-card {
  display: flex; flex-direction: column;
  padding: 6px 10px 8px; border-radius: 13px;
  background: linear-gradient(#fff5db,#ffe7bf); box-shadow: 0 6px 18px #1c221b7d;
}
#room-preview:has(.room-card-opening) { animation: room-card-in .15s ease-out; }
@keyframes room-card-in { from { opacity: .5; scale: .98; } to { opacity: 1; scale: 1; } }
.room-card-head { display: flex; align-items: center; gap: 6px; }
.room-card-head h2 { flex: 1; color: #402514; font-size: 1.3rem; font-weight: 900; }
.room-card-head h2:focus { outline: none; }
.room-card-head .icon-only { flex: none; font-size: 1.25rem; }
.room-stamp { display: grid; place-items: center; width: 34px; height: 32px; }
.room-stamp > .art, .room-stamp > .icon { width: 100%; height: 100%; }
.room-stamp .room-group { font-size: .73rem; }
.enemy-preview { display: grid; gap: 4px; }
.enemy-preview li {
  display: grid; grid-template-columns: 48px 1fr 1fr; grid-template-rows: auto auto;
  align-items: center; gap: 0 8px; padding: 3px 7px; border: 1px solid #cfa976;
  border-radius: 8px; background: #fff6df;
}
.enemy-preview li > .art { grid-row: 1/3; width: 48px; height: 42px; }
.enemy-preview li > strong { grid-column: 2 / -1; }
.enemy-preview li > span { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; font-size: .88rem; }
.enemy-preview b { color: #613511; font-size: 1.27em; font-variant-numeric: tabular-nums; }
.enemy-preview[data-count="2"] { grid-template-columns: repeat(2,minmax(0,1fr)); }
.enemy-preview[data-count="2"] li { grid-template-columns: repeat(2,auto); gap: 0 3px; padding-inline: 4px; }
.enemy-preview[data-count="2"] li > .art { grid-area: 1 / 1; width: 26px; height: 29px; }
.enemy-preview[data-count="2"] li > strong { grid-area: 1 / 1 / 2 / 3; padding-left: 30px; font-size: .9rem; }
.enemy-preview[data-count="2"] li > span { gap: 2px; font-size: .77rem; }
@container (max-width: 254px) {
  .enemy-preview[data-count="2"] li { grid-template-columns: 1fr; grid-template-rows: repeat(3,auto); }
  .enemy-preview[data-count="2"] li > .art { width: 24px; height: 24px; }
  .enemy-preview[data-count="2"] li > strong { grid-column: 1; padding-left: 26px; }
}
.enemy-preview[data-count="3"] { grid-template-columns: repeat(3,minmax(0,1fr)); }
.enemy-preview[data-count="3"] li { display: flex; flex-direction: column; gap: 0; padding-inline: 3px; }
.enemy-preview[data-count="3"] li > .art { width: 36px; height: 28px; }
.enemy-preview[data-count="3"] li > strong { font-size: .88rem; line-height: 1.2; }
.enemy-preview[data-count="3"] li > span { line-height: 1; }
.room-card .room-loot { margin-top: 4px; }
.room-card .reward-badge { padding: 1px 6px; font-size: .88rem; }
.room-card .room-condition { margin: 2px 0; font-size: .88rem; }
.room-card-foot {
  display: flex; align-items: start; gap: 6px;
  border-top: 1px solid #c9a06c; margin-top: 4px; padding-top: 6px;
}
.room-card-foot .supplies { flex: none; gap: 2px; }
.room-card-foot .supplies .button { min-height: 44px; width: 100%; padding-inline: 6px; font-size: .9rem; white-space: nowrap; }
.room-card-foot > .primary { flex: 1; min-width: 0; min-height: 44px; padding-inline: 7px; }
.room-card .action-feedback { margin: 3px 0; padding: 3px 6px; }
.room-card:has(.shop-preview) { padding-block: 4px 7px; }
.shop-preview { margin: 0; padding: 0; list-style: none; }
.shop-preview li {
  display: grid; grid-template-columns: 22px max-content minmax(0,1fr) auto;
  align-items: center; gap: 4px; padding-inline: 1px;
  border-bottom: 1px solid #a7744040; font-size: .88rem; line-height: 1.15;
}
.shop-preview .product-art { width: 22px; height: 20px; }
.shop-preview .item-effect { font-size: .8rem; }
.shop-preview .price strong { font-size: 1.12rem; }
@container (max-width: 232px) {
  .enemy-preview[data-count="3"] li > span { gap: 2px; font-size: .78rem; }
  .room-card .reward-badge { padding-inline: 4px; font-size: .8rem; }
  .room-card-foot > .primary { font-size: .9rem; }
  .room-card-foot > .primary .icon { display: none; }
}


/* Real stock sits in front of the painted counter. */
.market { position: relative; isolation: isolate; border: 2px solid #a17449; border-radius: 14px; overflow: hidden; background: #553321; box-shadow: 0 5px 14px #06182088; }
.shop-stage { position: relative; height: clamp(220px,32svh,370px); background: #794635 url('./assets/scenes/merchant-counter.webp') center / 100% 125%; }
.shop-stage .scene-heading { position: absolute; z-index: 2; inset: 12px 17px auto; align-items: start; }
.shop-stage h1 { width: fit-content; padding: 5px 12px 8px; color: #fff0b4; background: #4c2b1cf2; border: 1px solid #e3b76e; border-radius: 5px 5px 12px 12px; font-size: clamp(23px,2.8vw,36px); }
.shop-cast { position: absolute; overflow: hidden; height: 76%; width: 42%; left: 29%; bottom: 11%; }
.merchant-art { width: 100%; height: 117%; object-position: center top; filter: drop-shadow(0 5px 2px #381e1b); }
.shop-stage .dragon-hint { position: absolute; z-index: 1; max-width: min(32%,320px); bottom: 8%; left: 3%; margin: 0; }
.counter { position: relative; margin-top: -8px; padding: 13px clamp(10px,3vw,50px) 18px; border-top: 4px ridge #bd7744; background: linear-gradient(168deg,#744527,#4e3024); }
.shop-list { display: grid; grid-template-columns: repeat(var(--products),minmax(0,1fr)); width: min(100%,1040px); margin: auto; gap: clamp(7px,1.2vw,17px); }
.shop-list:has(> :nth-child(2):last-child) { max-width: 570px; }
.item-card { position: relative; padding: 8px 8px 10px; gap: 4px; border: 2px solid #b5803e; border-radius: 12px 12px 8px 8px; background: radial-gradient(ellipse at 50% 15%, #fffae0, #f5d698); }
.item-card h3 { font-size: clamp(17px,1.5vw,22px); }
.item-card.unavailable { background: #e2d2ae; }
.item-art { height: clamp(64px,10svh,102px); }
.item-purchase .button { min-height: 44px; min-width: min(100%,110px); gap: 8px; }
.price { color: inherit; }
.item-effect { font-size: .96rem; }
.item-effect b { color: #794221; font-size: 1.35em; }
.shop-scene .action-feedback { margin: 0 auto 10px; }

/* One cave and one floor plane for the entire encounter. */
body:has(.battle-scene) { background: linear-gradient(0deg,#09242bd9,transparent 27%,transparent 73%,#0a202bd9), var(--cave) center / cover fixed; }
.battle-scene { margin-top: 15px; }
.battle-scene .scene-heading { align-items: center; }
.hero-battler { align-self: end; justify-self: center; width: 98%; height: clamp(175px,37svh,358px); margin-bottom: 36px; }
.enemy-figure { height: clamp(135px,24svh,226px); }
.battler-art { position: absolute; inset: 0; object-position: center bottom; }
.hero-battler .ground-shadow { bottom: 0; }
.enemy-marker { left: 50%; transform: translateX(-50%); }
.hit-float { top: 17%; right: 14%; font-size: clamp(32px,4.2vw,59px); color: #fff1b3; -webkit-text-stroke: .09em #84321f; paint-order: stroke fill; text-shadow: 0 .065em #552825; }
#target-prompt { color: #fff1c9; font-size: clamp(16px,2vw,22px); font-weight: 850; }
#turn-feedback { color: #e0dfc5; font-size: .9rem; margin-top: 3px; }
#turn-feedback:empty { display: none; }

/* The prize and the next action share one vertical axis. */
body:has(.reward-scene) { background: linear-gradient(#0c2935b5,#17343a99 55%,#0f2832df), var(--cave) center / cover fixed; }
body:has(.won) { background: linear-gradient(#0b2f34a8,#18383cae),url('./assets/scenes/forest-gate.webp') 65% center / cover fixed; }
.reward-scene { width: min(100%,980px); text-align: center; }
.reward-scene .scene-heading { justify-content: center; margin: 18px 0 0; }
.reward-scene h1 { font-size: clamp(30px,4vw,54px); color: #ffeaac; text-shadow: 0 3px #634529, 0 6px 7px #173239; }
.reward-stage { display: grid; justify-items: center; padding: 0 0 12px; }
.chest-display, .loot-display { width: min(100%,450px); height: clamp(145px,25svh,248px); background: radial-gradient(ellipse at 50% 70%,#ffd45f63,transparent 68%); }
.chest-display .chest-art { height: 80%; }
.chest-display .reward-art { top: 0; height: 50%; }
.loss-mark { background: none; }
.loss-mark > .art { width: 80%; height: 92%; }
.reward-details { width: fit-content; max-width: 100%; padding: 8px 20px 15px; border-radius: 18px; background: #143238e8; }
.reward-title { font-size: clamp(19px,2.3vw,30px); }
.reward-actions, .reward-totals, .recap { justify-content: center; }
.reward-actions .primary { min-width: 170px; font-size: 1.22rem; }
.reward-totals .reward-badge { background: #fff0be; color: #5b3518; }
.score-line { display: flex; align-items: center; justify-content: center; gap: 12px; margin-block: 6px; }
.score-line .stars { margin: 0; }
.lost > .dragon-hint > .icon { display: none; }
.lost > .dragon-hint .dragon-bubble::before { display: none; }
@media (min-width: 651px) {
  .end-panel .scene-heading { margin-top: clamp(28px,6svh,90px); }
  .end-panel .chest-display { height: clamp(200px,32svh,340px); }
}
.reward-scene > .dragon-hint { margin: 8px auto; text-align: left; }
.battle-summary { width: fit-content; max-width: 100%; margin: 6px auto 0; padding: 8px 16px; background: #fff0d3; }
.reward-scene .scene-nav { justify-content: center; }
.damage-list { min-width: min(230px,100%); padding: 0; }
.end-panel.lost .reward-stage { padding-bottom: 2px; }


@media (max-width: 850px) {
  .game-shell { padding-inline: 14px; }
  .stat { flex: 1 1 auto; padding-inline: 7px; gap: 4px; min-height: 53px; }
  .stat > .icon { width: 24px; height: 24px; }
  .life-stat { flex: 1.7 1 98px; }
  .life-stat .health { display: block; }
  .life-stat .health-track { height: 8px; }
  .shop-stage .dragon-hint { max-width: 37%; }
  .shop-list { gap: 6px; }
  .dragon-hint > .icon { width: 49px; height: 49px; }
  .map-board { min-height: 330px; }
}
@media (max-width: 650px) {
  .home { background-position: 70% center; }
  .home::before { background: linear-gradient(0deg,#082a30f5,transparent 41%),linear-gradient(115deg,#10313177,transparent 60%); }
  .home-stage { display: block; }
  .home-copy { display: grid; align-content: end; justify-items: center; width: 100%; min-height: 100svh; padding: 0 14px max(5svh,20px); }
  .title-plaque { position: absolute; top: max(8svh,50px); left: 7%; }
  .title-plaque h1 { font-size: clamp(53px,15vw,90px); }
  .home-copy p { margin: 10px 0; font-size: 1rem; }
  .home-actions { justify-content: center; }
  .home-actions .primary { min-height: 56px; font-size: 20px; }
  .home-hero { width: 56%; height: 40%; left: 31%; bottom: 22%; }
  .home-chest { width: 22%; height: 15%; left: 73%; bottom: 23%; }
  .home-dragon { width: 25%; height: 19%; left: 23%; bottom: 48%; }
  .home-tools { top: 4px; right: 8px; }
  .game-shell { padding: 0 8px 20px; }
  .game-header { min-height: 44px; }
  .game-name { gap: 7px; }
  .game-logo { font-size: .97rem; }
  .mode-name { font-size: .74rem; }
  .header-actions .button { padding: 5px; font-size: .78rem; }
  .stats { display: flex; flex-wrap: wrap; width: 100%; border-radius: 9px; padding: 2px; }
  .stats.prologue-stats { min-width: 0; }
  .stat { min-height: 43px; padding: 3px 5px; flex: 1 0 auto; gap: 3px; }
  .stat > .icon { width: 20px; height: 20px; }
  .stat-label { font-size: .76rem; }
  .stat strong { font-size: 1.16rem; }
  .life-stat, .stats.prologue-stats .life-stat { min-width: 94px; flex: 1 0 94px; }
  .life-stat > .icon { width: 25px; height: 25px; }
  .life-stat .health-numbers > span { font-size: .78rem; }
  .life-stat .health-track { margin: 0; height: 7px; }
  .stats:not(.prologue-stats) { display: grid; grid-template-columns: 1.25fr .78fr .83fr; }
  .stats:not(.prologue-stats) .stat { min-width: 0; padding: 3px 6px; }
  .stats:not(.prologue-stats) .stat:nth-child(3n) { border-right: 0; }
  .stats:not(.prologue-stats) .stat:nth-child(n+4) { border-top: 1px solid #68817b5c; }
  .stats:not(.prologue-stats) .stat:nth-child(n+4) > div { display: flex; gap: 4px; align-items: baseline; }
  .stats:not(.prologue-stats) .stat:nth-child(n+4) { min-height: 34px; }
  .stats [data-stat="key"] { grid-column: 1/-1; }
  .stats [data-stat="value"] .stat-label { white-space: nowrap; }
  .scene { margin-top: 10px; }
  .scene-heading { margin-bottom: 8px; min-height: 38px; }
  .scene-heading h1 { font-size: 1.6rem; }
  .scene-heading .button { min-height: 44px; padding: 6px 10px; font-size: .93rem; }
  .explore-heading > div { display: grid; gap: 0; }
  .current-location { font-size: .85rem; }
  .map-board { --step: 88px; height: calc(var(--rows) * var(--step) + 28px); min-height: 0; background-size: auto 100%; }
  .map-board.short-map { height: clamp(210px,32svh,290px); min-height: 0; background-size: cover; }
  .map-board:not(.short-map) .map-node { top: calc(10px + var(--row) * var(--step)); left: var(--x); transform: translateX(-50%); }
  .node-mark, .map-node:is(.here,.available,.passed,.closed,.later) .node-mark { width: 62px; height: 51px; }
  .short-map .map-node .node-mark { width: 77px; height: 65px; }
  .node-caption { font-size: .67rem; }
  .node-label { font-size: .8rem; padding: 2px 5px; }
  .map-legend { font-size: .72rem; gap: 3px 8px; }
  .map-dock { display: block; }
  .map-dock .dragon-hint, .dragon-hint { max-width: 100%; }
  .dragon-bubble p { font-size: .9rem; }
  .scene-nav { margin: 6px 0; gap: 6px; }
  .routes { gap: 6px; }
  .routes h2 { font-size: .87rem; }
  .route-buttons { gap: 5px; }
  .route-buttons .button { padding: 5px 9px; font-size: .9rem; min-width: 0; }
  .shop-stage { height: clamp(160px,24svh,210px); background-size: 128% 115%; }
  .shop-stage .scene-heading { inset: 6px 7px auto; }
  .shop-stage h1 { font-size: 1.23rem; }
  .shop-stage .dragon-hint { left: 5px; bottom: 4px; max-width: 54%; }
  .shop-stage .dragon-hint > .icon { width: 32px; height: 36px; }
  .shop-stage .dragon-bubble p { font-size: .8rem; }
  .shop-cast { left: 45%; width: 43%; height: 75%; bottom: 8%; }
  .counter { padding: 7px 7px 10px; }
  .shop-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .item-card { padding: 5px; gap: 3px; }
  .item-art { height: clamp(50px,8svh,76px); }
  .item-card h3 { font-size: 1.05rem; }
  .item-issue { font-size: .78rem; }
  .item-effect { font-size: .88rem; }
  .hero-battler { height: clamp(112px,25svh,218px); margin-bottom: 42px; }
  .enemy { padding: 1px; }
  .enemy-figure { height: clamp(76px,18svh,156px); }
  .enemy-marker { font-size: .68rem; }
  #turn-feedback { font-size: .8rem; line-height: 1.25; }
  .reward-scene .scene-heading { margin-top: 8px; }
  .reward-scene h1 { font-size: 1.95rem; }
  .reward-actions, .reward-totals { gap: 6px; }
  .reward-actions .primary { min-width: 135px; }
  .reward-details { padding: 8px 10px 12px; }
  .chest-display,.loot-display { height: clamp(140px,24svh,210px); }
}
@media (max-width: 365px) {
  .game-shell { padding-inline: 5px; }
  .header-actions .icon-log { display: none; }
  .hero-battler { height: 125px; }
  .stats.prologue-stats .stat { padding-inline: 3px; }
  .stats:not(.prologue-stats) { grid-template-columns: 1.16fr 1.06fr .85fr; }
  .stats:not(.prologue-stats) .stat:nth-child(n+4) { padding-inline: 3px; }
  .stats [data-stat="value"] > .icon { width: 16px; }
  .enemy-preview li { padding-inline: 4px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .home-copy { padding-block: 22px; }
  .title-plaque h1 { font-size: clamp(42px,8svh,62px); }
  .home-copy p { margin: 14px 0 8px; }
  .home-actions .primary { min-height: 45px; }
  .stats { position: relative; }
}
