@import url("/dossier-items.css");
@font-face {
  font-family: Cormorant;
  src: url('/fonts/cormorant.ttf') format('truetype');
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}

@font-face {
  font-family: Manrope;
  src: url('/fonts/manrope.ttf') format('truetype');
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --display: Cormorant, Georgia, serif;
  --body: Manrope, 'Segoe UI', sans-serif;
  --bg: #101b1c;
  --deep: #0c1516;
  --surface: #172325;
  --surface-raised: #1c2b2c;
  --control: #202f30;
  --control-hover: #263838;
  --line: #374440;
  --line-warm: #62523a;
  --ivory: #f2ead7;
  --text: #d6d9cc;
  --muted: #aab8af;
  --gold: #e4be7a;
  --gold-light: #f2d39c;
  --gold-dark: #a57946;
  --gold-ink: #21160d;
  --teal: #8ec1ad;
  --teal-dark: #3d7a68;
  --map-route: #829492;
  --red: #edabab;
  --red-dark: #8d4942;
  --notice: #3a2421;
  --veil: rgb(10 19 20 / 96%);
  --veil-soft: rgb(10 19 20 / 58%);
  --veil-clear: rgb(10 19 20 / 8%);
  --shadow: rgb(3 9 10 / 34%);
  --frame: 1152px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { min-width: 0; overflow-x: clip; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: radial-gradient(ellipse at 55% -5%, var(--surface-raised), var(--bg) 62%);
  font: 500 1rem/1.55 var(--body);
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 4px; }
button:disabled { cursor: default; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { color: var(--ivory); font-family: var(--display); font-weight: 700; line-height: .98; }
strong { font-weight: 800; }

.frame { width: min(var(--frame), calc(100% - 80px)); margin-inline: auto; }
.masthead { border-bottom: 1px solid var(--line); background: var(--deep); }
.masthead-inner { display: flex; justify-content: space-between; align-items: center; min-height: 66px; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 15px; color: var(--ivory); font: 700 1.8rem/1 var(--display); }
.masthead-location { font-size: .79rem; color: var(--muted); }
.crest { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--gold-dark); transform: rotate(45deg); }
.crest span { width: 6px; height: 12px; border: 1px solid var(--gold); }
.game-frame { padding-block: 28px 45px; }
.game-tabs { display: flex; gap: 6px 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line-warm); margin-bottom: 21px; }
.game-tabs a { padding: 9px 10px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-size: .88rem; }
.game-tabs a:hover { color: var(--ivory); }
.game-tabs a[aria-current] { color: var(--gold-light); border-color: var(--gold); }
.screen-title { margin-bottom: 20px; font-size: clamp(3rem, 7vw, 5rem); }
.avatar { display: block; flex: 0 0 auto; aspect-ratio: 1; background: var(--surface-raised) url('/art/appearances.webp') 0 0 / 200%; }
.avatar[data-look="curls"] { background-position: 100% 0; }
.avatar[data-look="raven"] { background-position: 0 100%; }
.avatar[data-look="ash"] { background-position: 100% 100%; }
.avatar-small { width: 82px; border: 1px solid var(--line-warm); }
.avatar-battle { width: min(129px, 100%); margin-inline: auto; border: 1px solid var(--line-warm); }
.screen-heading { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.map-heading { margin-bottom: 12px; }
.map-heading .screen-title { margin-bottom: 0; }
.map-current { color: var(--gold-light); font-size: .82rem; }
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 30%); gap: 16px; align-items: start; }
.trail-map {
  position: relative; height: max(320px, calc(var(--map-rows) * 93px));
  border: 1px solid var(--line-warm); background:
    radial-gradient(ellipse at 45% 15%, rgb(91 123 94 / 17%), transparent 62%),
    radial-gradient(ellipse at 72% 78%, rgb(24 61 64 / 43%), transparent 69%),
    repeating-linear-gradient(0deg, transparent 0 30px, rgb(142 193 173 / 6%) 30px 31px),
    repeating-linear-gradient(90deg, transparent 0 30px, rgb(142 193 173 / 6%) 30px 31px), var(--deep);
}
.map-routes { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.map-site {
  position: absolute; top: var(--map-y); left: var(--map-x); width: var(--map-width);
  transform: translate(-50%, -10px); display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 3px;
  min-height: 44px; text-align: center; line-height: 1.15; color: var(--text);
}
.map-pin {
  display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid currentColor;
  border-radius: 50%; color: var(--teal); background: var(--deep); box-shadow: 0 0 0 2px var(--deep);
}
.map-site[data-zone="combat"] .map-pin { color: var(--red); }
.map-site[data-kind="dungeon"] .map-pin { border-radius: 3px; transform: rotate(45deg) scale(.82); }
.map-site[data-here] .map-pin { color: var(--gold-light); }
.map-site[data-here] .map-pin::after {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor;
}
.map-site-name {
  max-width: 100%; padding: 3px 5px; border: 1px solid transparent; overflow-wrap: anywhere;
  background: var(--deep); font-size: clamp(.67rem, 1.4vw, .83rem); font-weight: 700;
}
.map-site:hover .map-site-name, .map-site[data-selected] .map-site-name {
  color: var(--gold-light); border-color: var(--line-warm);
}
.map-details { padding: 15px 16px 17px; border: 1px solid var(--line-warm); background: var(--surface); }
.map-details h2 { margin-block: 5px 12px; font-size: 2rem; }
.map-details h3 { margin-top: 14px; font-size: 1.35rem; }
.map-zone { color: var(--teal); font-size: .74rem; }
.map-zone[data-zone="combat"] { color: var(--red); }
.map-npcs, .map-exits { margin: 7px 0 0; padding: 0; list-style: none; font-size: .84rem; }
.map-npcs li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 7px; padding-block: 4px; }
.map-npcs small { flex-basis: 100%; color: var(--red); }
.map-npc-level { color: var(--muted); }
.map-exits li + li { margin-top: 3px; }
.map-exits a { color: var(--gold-light); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 690px) {
  .map-layout { grid-template-columns: 1fr; gap: 10px; }
  .trail-map { height: max(290px, calc(var(--map-rows) * 75px)); }
}
.service-entry { padding: 12px 14px; margin-bottom: 8px; background: var(--surface); border: 1px solid var(--line); }
.service-entry h3 { font-size: 1.5rem; margin-bottom: 5px; }
.service-entry .button { margin-top: 8px; }
.skill-atlas-icon { display: inline-block; width: 32px; height: 32px; flex: 0 0 32px; margin-inline-end: 7px;
  background-color: var(--deep); background-repeat: no-repeat; vertical-align: middle; }
.npc-speech { max-width: 65ch; padding: 18px; background: var(--surface); border: 1px solid var(--line); }

.school-location { position: relative; isolation: isolate; border: 1px solid #8b7047; background: #121813; box-shadow: 0 12px 35px #090d0c55; }
.school-stage { position: relative; overflow: hidden; }
.school-panorama { position: relative; }
.school-backdrop { display: block; width: 100%; height: auto; }
.school-heading { position: absolute; inset: 0 0 auto; z-index: 1; padding: clamp(14px, 2.5vw, 32px); pointer-events: none; background: linear-gradient(180deg, #0a100dd9, transparent); text-shadow: 0 2px 6px #100d09; }
.school-heading p, .school-caption { color: #f2d9ab; font: 600 .72rem/1.4 var(--body); text-transform: uppercase; letter-spacing: .15em; }
.school-heading h1 { margin-top: 4px; color: #fff2d8; font: 600 clamp(2.1rem, 4.6vw, 3.9rem)/1 var(--display); }
.school-person { position: absolute; bottom: 7%; width: 22%; height: 65%; transform: translateX(-50%); display: flex; justify-content: center; align-items: flex-end; }
.school-master { left: 32%; }
.school-helper { left: 73%; }
.school-person span { position: relative; padding: .32em 1em; border: 1px solid #a88b59; background: linear-gradient(180deg, #222a20f2, #101712f5); box-shadow: inset 0 0 0 2px #171b16, 0 2px 10px #100e0a80; white-space: nowrap; color: #f8e7c8; font: 600 clamp(.99rem, 1.7vw, 1.38rem)/1.2 var(--display); }
.school-person span::before { content: ''; position: absolute; left: calc(50% - 3px); top: -4px; width: 6px; height: 6px; transform: rotate(45deg); background: #e9cb90; border: 1px solid #604923; }
.school-person:is(:hover, :focus-visible) { outline: none; }
.school-person:is(:hover, :focus-visible) span { border-color: #ffe2a6; background: #353526; box-shadow: 0 0 15px #ecc0776b; }
.school-exits { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 22px; padding: 10px clamp(14px, 2.5vw, 32px); border-top: 1px solid #8b7047; background: linear-gradient(#202821, #131c18); }
.school-exits > span { color: #bfad8e; font: 600 .7rem/1.4 var(--body); text-transform: uppercase; letter-spacing: .14em; }
.school-exits .button, .school-replies a { min-height: 44px; display: inline-flex; align-items: center; gap: 9px; padding: 4px 3px; border: 0; color: #f0d5a4; background: transparent; box-shadow: none; font: 600 1.16rem/1.2 var(--display); }
.school-exits .button:not(:disabled):hover, .school-replies a:hover { color: #fff3d9; text-decoration: underline; text-underline-offset: 4px; background: transparent; }
.school-dialogue { display: grid; align-items: end; min-height: clamp(380px, 43vw, 565px); padding: clamp(16px, 3vw, 40px); }
.school-dialogue-backdrop { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.school-dialogue-backdrop img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.64); }
.school-letter { display: grid; grid-template-columns: clamp(110px, 16vw, 185px) 1fr; align-items: stretch; max-width: 850px; margin-inline: auto; border: 1px solid #a48b5f; box-shadow: 0 4px 24px #0b0d0b99; background: linear-gradient(125deg,#23291e, #101915 86%); }
.school-portrait { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; border-right: 1px solid #806b47; }
.school-words { padding: clamp(16px, 2.6vw, 30px); }
.school-words h1 { margin: 5px 0 12px; font: 600 clamp(2.1rem, 3.4vw, 3rem)/1 var(--display); }
.school-speech { color: #f0e8d5; font: 500 clamp(1.13rem, 1.8vw, 1.43rem)/1.4 var(--display); }
.school-replies { display: flex; flex-wrap: wrap; gap: 0 20px; margin-top: 12px; border-top: 1px solid #574e39; }
@media (max-width: 600px) {
  .school-heading { position: relative; padding: 14px 16px 12px; border-bottom: 1px solid #756240; background: linear-gradient(100deg,#253027,#141d17); }
  .school-panorama { width: 140%; margin-left: -20%; }
  .school-person { width: auto; bottom: 4%; transform: none; }
  .school-master { left: calc(100% / 7 + 5px); right: 50%; }
  .school-helper { left: 53%; right: calc(100% / 7 + 5px); }
  .school-person span { max-width: 100%; text-align: center; white-space: normal; padding-inline: .54em; }
  .school-exits { gap: 0 12px; padding: 7px 12px; }
  .school-exits > span { flex-basis: 100%; margin-top: 3px; }
  .school-dialogue { min-height: 370px; padding: 80px 10px 10px; }
  .school-letter { grid-template-columns: 64px 1fr; padding: 13px; gap: 0 12px; }
  .school-words { display: contents; }
  .school-portrait { grid-row: 1 / 3; width: 64px; height: 78px; border: 1px solid #806b47; }
  .school-caption { align-self: end; font-size: .61rem; }
  .school-words h1 { margin: 4px 0 0; font-size: 1.9rem; }
  .school-speech, .school-replies { grid-column: 1 / -1; margin-top: 12px; }
}
.npc-title { margin-top: 8px; }
.npc-tabs { margin-bottom: 10px; }
.text-link { color: var(--gold-light); text-decoration: underline; text-underline-offset: 3px; font-size: .82rem; }
.item-copy { min-width: 0; overflow-wrap: anywhere; }
.item-properties { display: block; margin-block: 3px; color: var(--gold-light); font-size: .74rem; line-height: 1.4; }
.quest-coins { display:inline-flex;align-items:center;gap:4px;vertical-align:middle;white-space:nowrap; }
.quest-coins .dossier-icon { width:16px; }
.bag-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start;
  min-width: 0; padding: 10px; margin-bottom: 7px; border: 1px solid var(--line);
  border-inline-start: 3px solid var(--rarity); background: var(--surface); }
.bag-item .button { min-height: 37px; padding: 6px 9px; font-size: .76rem; }
.item-icon { width: 39px; aspect-ratio: 1; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden;
  color: var(--rarity); border: 1px solid var(--rarity); background: var(--deep); font-size: 1.3rem; }
.item-icon img { width: 100%; height: 100%; object-fit: cover; }
.appearance-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.appearance-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); }
.appearance-selected { border-color: var(--gold); }
.avatar-option { width: 100%; }
.appearance-copy { display: flex; flex-direction: column; flex: 1; align-items: start; padding: 12px; }
.appearance-copy h2 { font-size: clamp(1.45rem, 3vw, 2.05rem); }
.appearance-copy dl { margin-block: 11px 13px; font-size: .75rem; }
.appearance-copy dl div { margin-bottom: 6px; }
.appearance-copy dt { color: var(--muted); }
.appearance-copy dd { margin: 0; }
.appearance-copy .button, .chosen-look { margin-top: auto; }
.chosen-look { color: var(--gold-light); min-height: 47px; display: grid; align-items: center; }
.notice { padding: 10px 15px; margin-bottom: 14px; border: 1px solid var(--red-dark); background: var(--notice); color: var(--red); font-size: .9rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.cover {
  position: relative;
  display: flex;
  align-items: end;
  min-height: 385px;
  padding: 47px 48px 42px;
  border: 1px solid var(--line-warm);
  background: linear-gradient(90deg, var(--veil) 0%, var(--veil-soft) 38%, var(--veil-clear) 80%),
    linear-gradient(0deg, var(--veil-soft), var(--veil-clear) 65%),
    var(--surface) url('/art/hunts/meadow-field.webp') center 55% / cover no-repeat;
  box-shadow: 0 15px 38px var(--shadow);
}
.cover::before, .cover::after { content: ''; position: absolute; inline-size: 12px; block-size: 12px; border: 1px solid var(--gold-dark); pointer-events: none; }
.cover::before { inset: 7px auto auto 7px; border-right: 0; border-bottom: 0; }
.cover::after { inset: auto 7px 7px auto; border-left: 0; border-top: 0; }
.cover-copy { position: relative; max-width: 540px; }
.cover-island {
  min-height: 285px;
  background: radial-gradient(ellipse at 100% 0%, #304b43 0%, transparent 70%),
    linear-gradient(145deg, var(--surface), #202c2b);
}
.cover-island .cover-copy { max-width: 100%; }
.cover-island h1 { font-size: clamp(2.65rem, 6vw, 4.7rem); }
.location-exits { display: flex; flex-wrap: wrap; gap: 8px; }
.cover-copy .road-link { display: inline-block; margin-bottom: 18px; color: var(--gold-light); text-underline-offset: 4px; }
.cover h1 { font-size: clamp(3.25rem, 7vw, 5.9rem); overflow-wrap: break-word; }
.cover p { max-width: 35ch; margin: 12px 0 25px; color: var(--text); }
.cover .brief { margin-bottom: 9px; color: var(--gold-light); font-size: .85rem; }
.button {
  display: inline-flex;
  min-height: 47px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 18px;
  border: 1px solid var(--line-warm);
  border-radius: 2px;
  background: var(--control);
  color: var(--ivory);
  cursor: pointer;
  font-size: .88rem;
  font-weight: 800;
  text-align: center;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}
.button:not(:disabled):hover { border-color: var(--gold); background: var(--control-hover); }
.button:not(:disabled):active { box-shadow: inset 0 2px 5px var(--shadow); }
.button:disabled { opacity: .62; }
.button-primary { --mark-fill: var(--gold-ink); background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.button-primary:not(:disabled):hover { background: var(--gold-light); }

.camp-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 28px; margin-top: 27px; }
.section-title { font-size: 2rem; }
.chapter { min-width: 0; border-top: 1px solid var(--line-warm); }
.chapter-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 5px 12px; padding-block: 13px 12px; }
.chapter-note { color: var(--muted); font-size: .8rem; }
.hero-profile { display: flex; align-items: center; gap: 17px; padding: 14px; background: var(--surface); border: 1px solid var(--line); }
.portrait { flex: 0 0 auto; display: block; object-fit: cover; background: var(--control); border: 1px solid var(--line-warm); }
.hero-description { min-width: 0; flex: 1; }
.hero-description h3, .errand-copy h3 { font-size: 1.7rem; margin-bottom: 6px; }
.hero-class { margin: 0 0 5px; }
.stat-line { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.stat-line strong { color: var(--ivory); }
.coin-balance { font-size: .8rem; color: var(--gold-light); white-space: nowrap; }
.shop { margin-top: 14px; }
.meter { overflow: clip; height: 7px; background: var(--deep); box-shadow: inset 0 0 0 1px var(--line); }
.meter-fill { display: block; height: 100%; width: var(--amount); background: var(--teal-dark); }
.xp-line { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); font-size: .73rem; }
.xp-line .meter { flex: 1; }
.xp-line .meter-fill { background: var(--gold-dark); }
.item-label { display: block; font-size: .9rem; color: var(--ivory); }
.item-detail { display: block; color: var(--muted); font-size: .75rem; line-height: 1.35; }
.npc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px 13px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.npc-row + .npc-row { margin-top: 8px; }
.npc-row h3 { font-size: 1.6rem; margin-block: 3px 5px; }
.npc-row .button { min-height: 40px; padding: 7px 11px; font-size: .8rem; }
.npc-dialogue { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 8px; font-size: .83rem; }
.npc-actions { display: flex; flex-direction: column; gap: 6px; }
.npc-drops { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 8px; font-size: .8rem; color: var(--muted); }
.npc-drops summary { cursor: pointer; }
.npc-drops ul, .battle-rewards { margin-block: 8px; padding-inline-start: 20px; }
.loot-group { margin-block-start: 8px; padding-inline-start: 8px; border-inline-start: 1px solid var(--line); }
.loot-group strong { color: var(--gold); }
.npc-drops .loot-entries, .battle-rewards { list-style: none; padding-inline-start: 0; }
.loot-entries li, .battle-rewards li { display: flex; align-items: center; gap: 8px; margin-block: 4px; }
.loot-entries li span, .battle-rewards li span { min-width: 0; overflow-wrap: anywhere; }
.battle-controls > [data-action="retreat"] { margin-top: 10px; }
.arena.arena-island { background: linear-gradient(145deg, var(--surface), #202c2b); }
.errand-head { margin-top: 9px; }
.errand {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.3fr);
  min-height: 174px;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: clip;
}
.errand-art { min-height: 100%; display: block; background: var(--surface-raised) center / cover no-repeat; }
.errand-copy { padding: 16px 18px; min-width: 0; align-self: center; }
.errand-copy p { margin-bottom: 12px; font-size: .83rem; color: var(--muted); }
.errand-copy .reward { display: block; margin-bottom: 11px; font-size: .8rem; color: var(--gold); }
.errand-copy .button { min-height: 41px; padding: 7px 12px; }
.errand-progress { margin-bottom: 10px; }
.cleared { color: var(--teal); }

.battle-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 17px; margin-bottom: 16px; }
.battle-top h1 { font-size: clamp(2.35rem, 6vw, 4.2rem); }
.round-label { color: var(--gold); font-size: .88rem; font-variant-numeric: tabular-nums; }
.arena {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.25fr) minmax(0, .8fr);
  align-items: end;
  min-height: 278px;
  gap: 18px;
  padding: 21px;
  border: 1px solid var(--line-warm);
  background: linear-gradient(0deg, var(--veil) 5%, var(--veil-soft) 42%, var(--veil-clear)),
    var(--surface) url('/art/hunts/meadow-battle.webp') center 56% / cover;
}
.fighter { min-width: 0; }
.fighter.enemy { text-align: right; }
.strike-target { background: transparent; border: 0; display: inline-block; max-width: 100%; padding: 0; cursor: crosshair; }
.strike-target:disabled { cursor: default; }
.strike-target:hover:enabled .portrait { border-color: var(--gold); }
.fighter.enemy .portrait {
  width: min(100%, 21vw, 212px);
  height: auto;
  aspect-ratio: 1;
  margin: 0 0 10px auto;
}
.fighter-title { font-size: 1.65rem; overflow-wrap: break-word; }
.health-label { display: block; margin: 3px 0 6px; font-size: .82rem; font-variant-numeric: tabular-nums; }
.health-bar { height: 9px; }
.fighter.enemy .meter-fill { background: var(--red-dark); margin-left: auto; }
.battle-intent { text-align: center; margin-bottom: 14px; min-width: 0; }
.battle-intent h2 { font-size: clamp(1.7rem, 3.5vw, 2.55rem); color: var(--gold-light); }
.battle-intent p { margin-top: 8px; font-size: .83rem; color: var(--text); }
.battle-ring { color: var(--gold); font-size: .73rem; line-height: 1.25; min-height: 1.1em; margin-top: 5px; }
.battle-effects { display: grid; gap: 5px; list-style: none; padding: 0; margin: 8px 0 0; }
.battle-effects li { padding: 4px 8px; border: 1px solid color-mix(in srgb, var(--gold) 42%, transparent); font-size: .76rem; line-height: 1.4; }
.battle-effects strong { color: var(--gold); }
.battle-effects small { display: block; font-size: .72rem; }

.battle-controls { margin-top: 19px; }
.battle-controls h2 { font-size: 1.95rem; margin-bottom: 10px; }
.move-grid { display: grid; gap: 9px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.move {
  display: flex;
  flex-direction: column;
  align-items: start;
  min-height: 111px;
  padding: 12px 13px;
  gap: 5px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-top: 2px solid var(--line-warm);
  border-radius: 2px;
  background: var(--surface);
  color: var(--ivory);
  text-align: left;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.move:not(:disabled):hover { background: var(--control-hover); border-color: var(--gold-dark); }
.move:not(:disabled):active { box-shadow: inset 0 2px 5px var(--shadow); }
.move:disabled { cursor: progress; }
.move-name { color: var(--ivory); font-weight: 800; font-size: .88rem; }
.move-cooldown { float: right; margin-left: .35rem; color: var(--ivory); font-variant-numeric: tabular-nums; }
.move-cooldown.accelerated { color: #91dcfa; }
.move-totals { display: flex; flex-wrap: wrap; gap: 0 11px; font-size: .76rem; font-variant-numeric: tabular-nums; }
.incoming { color: var(--red); }
.outgoing { color: var(--teal); }
.move-effect { color: var(--muted); font-size: .73rem; line-height: 1.35; }
.log { margin-top: 18px; border-top: 1px solid var(--line); }
.log summary { color: var(--text); cursor: pointer; padding: 8px 0; font-size: .85rem; }
.log ul { padding: 0; margin: 0; list-style: none; }
.log li { border-bottom: 1px solid var(--line); padding: 6px 0; color: var(--muted); font-size: .78rem; }
.log strong { color: var(--ivory); }
.last-action { margin-top: 11px; color: var(--muted); font-size: .82rem; }
.outcome { border-top: 1px solid var(--line-warm); padding-top: 12px; }
.outcome p { margin-bottom: 12px; color: var(--muted); }
.outcome .button { margin-right: 6px; }

@media (max-width: 850px) {
  .frame { width: calc(100% - 42px); }
  .appearance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cover { min-height: 342px; padding: 34px; }
  .camp-columns { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .errand { grid-template-columns: minmax(0, .7fr) minmax(0, 1.35fr); }
}

@media (max-width: 520px) {
  .frame { width: calc(100% - 30px); }
  .masthead-inner { min-height: 54px; }
  .brand { font-size: 1.5rem; gap: 10px; }
  .crest { width: 17px; height: 17px; }
  .crest span { height: 9px; }
  .masthead-location { font-size: .7rem; }
  .game-frame { padding-top: 15px; }
  .cover { padding: 23px 19px; min-height: 282px; background-position: center, center, 64% 50%; }
  .cover h1 { font-size: clamp(2.85rem, 11.5vw, 4rem); }
  .cover-island h1 { font-size: clamp(2.35rem, 9vw, 3.4rem); }
  #location-actors { grid-row: 1; }
  .cover p { font-size: .85rem; margin-bottom: 16px; }
  .camp-columns { margin-top: 18px; }
  .avatar-small { width: 64px; }
  .errand { grid-template-columns: minmax(0, .8fr) minmax(0, 1.45fr); }
  .errand-copy { padding: 11px; }
  .errand-copy h3 { font-size: 1.55rem; }
  .battle-top { margin-bottom: 12px; }
  .arena { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 17px; min-height: 0; padding: 13px; }
  .fighter { grid-row: 1; }
  .fighter.enemy .portrait { width: min(100%, 32vw, 144px); }
  .battle-intent { grid-row: 2; grid-column: 1 / -1; margin: 1px 0 0; }
  .fighter-title { font-size: 1.36rem; }
  .battle-intent h2 { font-size: 1.7rem; }
  .battle-intent p { font-size: .77rem; margin-top: 4px; }
  .battle-controls { margin-top: 13px; }
  .move { min-height: 102px; padding: 8px 9px; }
  .move-name { font-size: .8rem; }
  .move-totals { font-size: .71rem; }
  .move-effect { font-size: .69rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; scroll-behavior: auto !important; }
}
#dev-tools:not([hidden]) {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: flex-end;
  gap: 16px; padding: 0 max(16px,env(safe-area-inset-right)); height: 34px;
  color: #e3cca4; background: #151b18; border-bottom: 1px solid #564b39; font: 600 12px/1 var(--body);
}
#dev-tools details { position: relative; }
#dev-tools summary, #dev-tools a { cursor: pointer; display: flex; align-items: center; min-height: 33px; color: inherit; text-decoration: none; }
#dev-tools summary { list-style: none; }
#dev-tools summary::-webkit-details-marker { display: none; }
#dev-tools details > div { position: absolute; right: 0; min-width: 180px; padding: 5px 12px; background: #1c241f; border: 1px solid #786546; }
#dev-tools details a { min-height: 44px; }
#dev-tools a:hover, #dev-tools summary:hover { color: #fff0ce; }
#dev-tools a[hidden] { display: none; }
body:has(#dev-tools:not([hidden])) .armory { height: calc(100svh - 34px); }
body:not(.school-mode):has(#dev-tools:not([hidden])) :is(.creator-window,.patrol-yard) { min-height: calc(100svh - 34px); }
