@font-face {
  font-family: "DotGothic16";
  src: url("fonts/DotGothic16-Regular.ttf") format("truetype");
  font-display: swap;
  font-weight: 400;
  font-style: normal;
}

:root {
  --navy-950: #080f20;
  --navy-900: #0d1730;
  --navy-800: #142341;
  --navy-700: #1b3155;
  --ink: #101a2c;
  --ivory: #f7ebd0;
  --ivory-soft: #eadfca;
  --paper: #182a49;
  --line: #d7b879;
  --line-muted: #657393;
  --amber: #e1a34f;
  --amber-light: #f5d486;
  --red: #d66c63;
  --green: #91c791;
  --blue: #8eb8dc;
  --shadow: 0 14px 32px rgba(2, 6, 17, .34);
  --font-body: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
  --font-display: "DotGothic16", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--navy-950); scroll-behavior: smooth; }
body {
  min-width: 280px;
  margin: 0;
  color: var(--ivory);
  background:
    radial-gradient(circle at 50% -12%, rgba(77, 106, 163, .33), transparent 36rem),
    repeating-linear-gradient(0deg, rgba(247, 235, 208, .028) 0 1px, transparent 1px 4px),
    var(--navy-950);
  font-family: var(--font-body);
  line-height: 1.7;
}
button, input, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, textarea:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--amber-light);
  outline-offset: 3px;
}
button:disabled { cursor: not-allowed; opacity: .48; }
img { max-width: 100%; }
.app-shell { width: min(1280px, calc(100% - 32px)); margin: auto; padding: 18px 0 64px; }
body.title-view .app-shell { width: min(1440px, calc(100% - 32px)); padding-top: 16px; }
body.title-view .site-header, body.title-view .step-nav { display: none; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--ivory); text-decoration: none; }
.brand-mark { position: relative; width: 38px; height: 38px; flex: 0 0 38px; border: 1px solid var(--line); background: var(--navy-800); }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; background: var(--amber); }
.brand-mark::before { width: 18px; height: 3px; left: 9px; top: 17px; }
.brand-mark::after { width: 3px; height: 18px; left: 16px; top: 9px; }
.brand-title { display: block; font-family: var(--font-display); font-weight: 400; letter-spacing: .12em; font-size: clamp(16px, 2.4vw, 22px); white-space: nowrap; }
.brand-subtitle { display: block; color: var(--ivory-soft); font-size: 12px; }
.progress-readout { color: var(--amber-light); border: 1px solid var(--line); padding: 6px 10px; white-space: nowrap; font-size: 13px; }
.step-nav { margin-bottom: 18px; border-top: 1px solid var(--line-muted); border-bottom: 1px solid var(--line-muted); }
.step-nav ol { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0; padding: 0; margin: 0; list-style: none; }
.step-nav li { position: relative; min-width: 0; padding: 8px 4px; color: #9da9c1; text-align: center; font-size: 12px; }
.step-nav li + li::before { content: ""; position: absolute; top: 50%; left: 0; width: 1px; height: 14px; background: var(--line-muted); transform: translateY(-50%); }
.step-nav li.active { color: var(--amber-light); background: rgba(225, 163, 79, .09); font-weight: 700; }
.screen[hidden] { display: none !important; }
.screen-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 30px 0 18px; }
.kicker { margin: 0 0 4px; color: var(--amber-light); font-size: 12px; letter-spacing: .18em; font-weight: 700; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: var(--font-display); line-height: 1.25; }
h1 { margin-bottom: 8px; font-size: clamp(27px, 4.8vw, 52px); }
h2 { margin-bottom: 10px; font-size: clamp(21px, 3vw, 32px); }
h3 { margin-bottom: 7px; font-size: 17px; }
.screen-head p:not(.kicker) { margin-bottom: 0; color: var(--ivory-soft); }
.double-frame { position: relative; border: 1px solid var(--line); background: rgba(13, 23, 48, .82); box-shadow: var(--shadow); }
.double-frame::after { content: ""; position: absolute; inset: 4px; pointer-events: none; border: 1px solid rgba(215, 184, 121, .52); }
.double-frame > * { position: relative; z-index: 1; }
.panel { padding: clamp(16px, 2vw, 28px); }
.subpanel { border: 1px solid var(--line-muted); background: rgba(20, 35, 65, .78); padding: 14px; }
.body-muted { color: var(--ivory-soft); }
.small-note { color: #aab5c8; font-size: 13px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.btn {
  position: relative;
  min-height: 42px;
  border: 1px solid var(--line);
  padding: 9px 15px;
  background: var(--navy-800);
  color: var(--ivory);
  cursor: pointer;
  font-weight: 700;
  font-family: var(--font-display);
  transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}
.btn:hover:not(:disabled) { border-color: var(--amber-light); background: var(--navy-700); transform: translateY(-1px); }
.btn.primary { background: var(--amber); color: var(--ink); border-color: var(--amber-light); }
.btn.primary:hover:not(:disabled) { background: var(--amber-light); }
.btn.info { background: #245c91; border-color: #9bc8ec; color: #f5fbff; }
.btn.info:hover:not(:disabled) { background: #3378b8; border-color: #c2e1fa; }
.btn.ghost { background: transparent; }
.btn.danger { border-color: var(--red); color: #ffd1c7; }
.btn.small { min-height: 34px; padding: 5px 10px; font-size: 13px; }
.btn[data-icon]::before { content: attr(data-icon); margin-right: 7px; color: var(--amber-light); }

/* 0: タイトル。専用キービジュアルを主役にし、冒険の入口だけを独立させます。 */
.title-screen { min-height: min(820px, calc(100vh - 30px)); display: grid; align-items: stretch; }
.title-stage { position: relative; min-height: min(820px, calc(100vh - 30px)); overflow: hidden; isolation: isolate; background: var(--navy-950); }
.title-stage::before { content: ""; position: absolute; z-index: -2; inset: 0; background: linear-gradient(90deg, rgba(8, 15, 32, .14) 0%, rgba(8, 15, 32, .06) 52%, transparent 100%), linear-gradient(0deg, rgba(8, 15, 32, .44), transparent 57%); pointer-events: none; }
.title-stage::after { content: ""; position: absolute; z-index: -1; inset: 0; background: radial-gradient(circle at 72% 24%, rgba(245, 212, 134, .14), transparent 18rem), linear-gradient(0deg, rgba(8, 15, 32, .16), transparent 55%); pointer-events: none; }
.title-keyvisual { position: absolute; z-index: -3; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; animation: title-keyvisual-in 1s ease both; }
.title-copy { position: relative; z-index: 3; display: flex; width: min(680px, 50%); min-height: min(820px, calc(100vh - 30px)); flex-direction: column; justify-content: center; padding: clamp(28px, 4vw, 60px); animation: title-copy-in .75s ease both; }
.title-label { margin: 0; color: var(--amber-light); font-family: var(--font-display); font-size: clamp(12px, 1.5vw, 16px); letter-spacing: .12em; }
.title-screen h1 { display: grid; margin: 7px 0 9px; color: var(--ivory); font-size: clamp(44px, 5.6vw, 72px); line-height: .98; letter-spacing: .06em; text-shadow: 4px 5px 0 rgba(8, 15, 32, .9), 0 0 26px rgba(245, 212, 134, .26); }
.title-screen h1 span { white-space: nowrap; }
.title-screen h1 span:last-child { color: var(--amber-light); }
.title-subtitle { margin: 0 0 19px; color: var(--amber-light); font-family: var(--font-display); font-size: clamp(18px, 2.8vw, 30px); letter-spacing: .12em; text-shadow: 2px 2px 0 rgba(8, 15, 32, .9); }
.title-lead { max-width: 470px; margin-bottom: 25px; color: var(--ivory-soft); font-size: clamp(16px, 2vw, 19px); }
.title-actions { align-items: stretch; }
.title-actions .btn { min-height: 52px; padding-inline: 20px; font-size: 15px; }
.title-save-state { color: var(--amber-light); }

/* 1: 導入。背景と文章の領域を分け、竜のシルエットを覆いません。 */
.hero-panel { position: relative; min-height: 610px; overflow: hidden; display: grid; align-items: end; background: var(--navy-900); }
.hero-panel::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8, 15, 32, .78) 0%, rgba(8, 15, 32, .48) 41%, rgba(8, 15, 32, .06) 78%), url("assets/valley.png") center / cover no-repeat; }
.hero-dragon { position: absolute; right: 4%; bottom: 3%; width: min(43%, 530px); max-height: 70%; object-fit: contain; object-position: bottom right; filter: drop-shadow(0 12px 7px rgba(0, 0, 0, .5)); }
.hero-copy { max-width: 720px; padding: clamp(30px, 6vw, 72px); }
.hero-copy h1 { max-width: 670px; font-size: clamp(35px, 6vw, 72px); letter-spacing: .04em; }
.hero-copy .lead { max-width: 580px; color: var(--ivory-soft); font-size: clamp(15px, 2vw, 18px); }
.mission-facts { display: grid; grid-template-columns: repeat(3, minmax(90px, 1fr)); gap: 8px; max-width: 560px; margin: 22px 0; }
.mission-fact { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line-muted); padding: 9px 8px; }
.mission-fact span { display: block; color: #aab5c8; font-size: 12px; }
.mission-fact b { display: block; color: var(--amber-light); font-size: 21px; }

/* 2: 敵情報 */
.intel-grid { display: grid; grid-template-columns: minmax(320px, .92fr) minmax(0, 1.08fr); gap: 16px; }
.intel-scene { position: relative; min-height: 520px; overflow: hidden; background: linear-gradient(180deg, rgba(8, 15, 32, .08), rgba(8, 15, 32, .56)), url("assets/valley.png") center / cover no-repeat; }
.intel-scene::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(8, 15, 32, .2), transparent 62%); pointer-events: none; }
.intel-dragon { position: absolute; right: 0; bottom: 0; width: 94%; height: 60%; object-fit: contain; object-position: bottom right; opacity: .78; }
.intel-copy { position: absolute; z-index: 1; inset: 0; padding: clamp(20px, 4vw, 34px); display: flex; flex-direction: column; justify-content: space-between; }
.boss-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 470px; }
.boss-fact { padding: 9px; border: 1px solid rgba(215, 184, 121, .68); background: rgba(8, 15, 32, .72); }
.boss-fact span { display: block; color: #aab5c8; font-size: 11px; }
.boss-fact b { color: var(--amber-light); font-size: 23px; }
.attack-plan { display: grid; gap: 6px; max-width: 520px; }
.attack-line { display: grid; grid-template-columns: 68px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 8px 10px; border-left: 2px solid var(--amber); background: rgba(8, 15, 32, .76); }
.attack-line strong { color: var(--amber-light); white-space: nowrap; }
.strategy-sheet { display: grid; gap: 14px; align-content: start; }
.formula-strip { border: 1px solid var(--line); padding: 12px; color: var(--ivory); background: rgba(225, 163, 79, .09); }
.formula-strip b { color: var(--amber-light); }
.optional-details { border: 1px solid var(--line-muted); padding: 10px 12px; background: rgba(20, 35, 65, .55); }
.optional-details summary { color: var(--amber-light); cursor: pointer; font-weight: 700; }
.math-example { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid rgba(101, 115, 147, .45); padding: 7px 0; color: var(--ivory-soft); font-size: 13px; }
.math-example b { color: var(--amber-light); }
.hint-list { display: grid; gap: 6px; padding-left: 21px; margin: 0; color: var(--ivory-soft); }
.hint-list li::marker { color: var(--amber); }
.memo-field { display: grid; gap: 6px; }
.memo-field label { color: var(--amber-light); font-weight: 700; }
textarea { width: 100%; min-height: 96px; border: 1px solid var(--line-muted); border-radius: 0; padding: 10px; resize: vertical; color: var(--ivory); background: #0c162b; line-height: 1.65; }
textarea::placeholder { color: #7f8ba6; }

/* 3: 仲間選択 */
.selection-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.hero-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.hero-card { display: grid; grid-template-rows: 200px auto auto minmax(3.6em, auto) 1fr auto; gap: 9px; min-width: 0; border: 1px solid var(--line-muted); padding: 12px; background: rgba(20, 35, 65, .82); }
.hero-card.selected { border-color: var(--amber); background: rgba(225, 163, 79, .1); }
.hero-card-head { display: flex; min-height: 58px; justify-content: space-between; gap: 8px; align-items: start; }
.hero-card h3 { margin-bottom: 0; font-family: var(--font-display); }
.hero-card .impact-text { min-height: 3.6em; margin-bottom: 0; }
.hero-card .growth-table { align-self: start; min-width: 0; }
.hero-card > .btn { align-self: end; }
.role-chip { display: inline-flex; align-items: center; gap: 5px; color: var(--amber-light); font-size: 12px; white-space: nowrap; }
.role-mark { position: relative; display: inline-block; width: 13px; height: 13px; border: 1px solid currentColor; }
.role-mark[data-role="attack"] { transform: rotate(45deg); }
.role-mark[data-role="defense"] { border-radius: 50% 50% 0 0; }
.role-mark[data-role="recovery"]::after { content: ""; position: absolute; width: 5px; height: 5px; left: 3px; top: 3px; background: currentColor; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.stat-box { padding: 6px 3px; border-top: 1px solid var(--line-muted); text-align: center; }
.stat-box span { display: block; color: #aab5c8; font-size: 11px; }
.stat-box b { color: var(--ivory); font-size: 17px; }
.impact-text { min-height: 42px; margin: 0; color: var(--ivory-soft); font-size: 13px; }
.selection-side { position: sticky; top: 14px; display: grid; gap: 12px; }
.selected-party { display: grid; gap: 8px; }
.selected-party h2 { font-size: 20px; }
.party-slot { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line-muted); padding: 6px 0; }
.party-slot .slot-number { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid var(--amber); color: var(--amber-light); font-weight: 700; }
.party-slot.empty { color: #8a96af; }
.party-slot .sprite { width: 40px; height: auto; aspect-ratio: var(--sprite-frame-ratio, 1); flex: 0 0 40px; }
.party-slot .sprite-sheet { width: 300%; }
.compact-note { margin: 0; color: var(--ivory-soft); font-size: 13px; }

/* 4: 育成 */
.lab-layout { display: block; }
.lab-main { display: grid; gap: 14px; }
.formation-panel { padding: 16px; }
.formation-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.formation-head h2 { margin-bottom: 3px; font-size: 22px; }
.formation-slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.formation-slot { position: relative; min-width: 0; border: 1px solid var(--line-muted); padding: 8px; background: rgba(8, 15, 32, .68); text-align: center; cursor: grab; touch-action: none; }
.formation-slot.dragging { opacity: .42; }
.formation-slot.drag-over { border-color: var(--amber-light); box-shadow: 0 0 0 2px rgba(245, 212, 134, .22); }
.formation-slot .slot-number { position: absolute; z-index: 2; top: 5px; left: 5px; width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--amber); color: var(--amber-light); background: var(--navy-950); font-size: 12px; font-weight: 700; }
.formation-slot strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.slot-controls { display: flex; justify-content: center; gap: 5px; margin-top: 7px; }
.slot-controls .btn { min-height: 30px; padding: 3px 7px; font-size: 12px; }
.growth-detail { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; }
.growth-cards { display: grid; grid-template-columns: 1fr; gap: 10px; }
.growth-card { display: grid; grid-template-columns: minmax(140px, 160px) minmax(0, 1fr); gap: 14px; align-items: start; border: 1px solid var(--line-muted); padding: 12px; background: rgba(20, 35, 65, .82); }
.growth-card.active { border-color: var(--amber); }
.growth-card-head { display: flex; gap: 10px; align-items: center; }
.growth-card-head h3 { margin-bottom: 2px; }
.growth-card-head p { margin: 0; color: var(--amber-light); font-size: 12px; }
.growth-card .stat-row { margin: 10px 0; }
.skill-panel { display: grid; gap: 6px; margin-top: 8px; }
.skill-panel strong { color: var(--amber-light); font-size: 13px; }
.skill-entry { border-left: 2px solid var(--line-muted); padding: 5px 8px; color: #bfc9d9; font-size: 12px; }
.skill-entry.active { border-left-color: var(--amber); color: var(--ivory); background: rgba(225, 163, 79, .1); }
.growth-table { display: grid; gap: 0; border-top: 1px solid var(--line-muted); }
.growth-table-title { display: block; padding: 7px 0 5px; color: var(--amber-light); font-family: var(--font-display); font-size: 13px; }
.growth-row.skill-entry { display: grid; grid-template-columns: 30px 70px minmax(0, 1fr); gap: 7px; align-items: start; min-width: 0; border-left: 0; border-bottom: 1px solid rgba(101, 115, 147, .5); padding: 7px 6px; }
.growth-row.current { border: 1px solid var(--amber); border-bottom-color: var(--amber); background: rgba(225, 163, 79, .12); }
.growth-row.superseded { color: #9ea9bc; }
.growth-rank { color: var(--amber-light); font-family: var(--font-display); }
.growth-threshold { color: #aab5c8; font-size: 11px; }
.growth-skill { display: grid; gap: 2px; min-width: 0; }
.growth-class { color: var(--ivory); font-family: var(--font-display); font-size: 12px; }
.growth-skill-text { color: #c4cfdf; font-size: 12px; }
.growth-status { color: #9ea9bc; font-size: 11px; font-style: normal; }
.growth-row.current .growth-status { color: var(--amber-light); font-weight: 700; }
.skill-targets { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.target-chip { display: inline-flex; border: 1px solid var(--line-muted); padding: 3px 6px; color: var(--ivory-soft); font-size: 11px; }
.target-chip[data-target="dragon"] { border-color: var(--red); color: #ffc1b4; }
.target-chip[data-target="ally"] { border-color: var(--green); color: #c7edc7; }
.fruit-control { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 6px; margin-top: 11px; border-top: 1px solid var(--line-muted); padding-top: 9px; }
.fruit-control b { color: var(--amber-light); }
.fruit-control .btn { min-height: 32px; padding: 4px 8px; }
.lab-side { position: sticky; top: 14px; display: grid; gap: 12px; }
.resource-panel h2 { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; font-size: 20px; }
.fruit-remaining { color: var(--amber-light); font-size: 27px; }
.fruit-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 13px 0; }
.fruit-token { position: relative; aspect-ratio: 1; border: 1px solid var(--line-muted); background: var(--navy-800) url("assets/fruit.png") center / 70% auto no-repeat; }
.fruit-token.used { opacity: .27; filter: grayscale(.6); }
.fruit-token.used::after { content: ""; position: absolute; inset: 50% 7px auto; height: 1px; background: var(--red); transform: rotate(-25deg); }
.rule-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; color: var(--ivory-soft); font-size: 12px; }
.rule-list li { border-left: 2px solid var(--line); padding-left: 8px; }
.connection-list { display: grid; gap: 6px; margin-top: 10px; }
.connection { border-left: 2px solid var(--amber); padding: 7px 9px; background: rgba(225, 163, 79, .09); color: var(--ivory-soft); font-size: 12px; }
.selected-growth { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.selected-growth > div:first-child { margin-bottom: 9px; }
.selected-growth-info { display: grid; gap: 7px; }
.selected-growth-info h3 { margin: 0; color: var(--amber-light); font-family: var(--font-display); }
.selected-growth-info .skill-panel { margin: 0; }
.lab-memo { display: grid; gap: 6px; }
.lab-memo label { color: var(--amber-light); font-weight: 700; }
.launch-reason { min-height: 21px; color: #ffd0be; font-size: 13px; }

/* 5: 戦闘。舞台とログは別の領域に置きます。 */
.battle-topbar { display: flex; justify-content: space-between; align-items: start; gap: 15px; }
.battle-controls { display: flex; flex-wrap: wrap; gap: 7px; }
.battle-layout { display: grid; grid-template-columns: minmax(0, 1.38fr) minmax(290px, .62fr); gap: 14px; align-items: stretch; }
.battle-scene { position: relative; min-height: 610px; overflow: hidden; background: linear-gradient(180deg, rgba(8, 15, 32, .02), rgba(8, 15, 32, .36)), url("assets/valley.png") center / cover no-repeat; }
.battle-scene::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(8, 15, 32, .25), transparent 48%); pointer-events: none; }
.dragon-art { position: absolute; z-index: 1; right: 7%; top: 10%; width: 50%; max-height: 43%; object-fit: contain; object-position: center; filter: drop-shadow(0 12px 7px rgba(0, 0, 0, .62)); }
.dragon-hud { position: absolute; z-index: 3; right: 14px; top: 14px; width: min(290px, 44%); border: 1px solid var(--line); padding: 10px; background: rgba(8, 15, 32, .85); }
.dragon-hud h2 { margin-bottom: 4px; font-size: 18px; }
.hp-track { height: 10px; border: 1px solid var(--line-muted); background: var(--navy-950); }
.hp-fill { height: 100%; background: var(--amber); transition: width .24s ease; }
.hud-values { display: flex; justify-content: space-between; color: var(--ivory-soft); font-size: 12px; }
.battle-party { position: absolute; z-index: 2; right: 14px; bottom: 14px; left: 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; align-items: end; }
.battle-hero { border: 1px solid var(--line-muted); padding: 7px; background: rgba(8, 15, 32, .84); text-align: center; transition: transform .2s ease, border-color .2s ease, filter .2s ease; }
.battle-hero.active { transform: translateY(-8px); border-color: var(--amber-light); }
.battle-hero.hit { border-color: var(--red); }
.battle-hero.support { border-color: var(--green); }
.battle-hero.enemy-target { border-color: var(--red); box-shadow: 0 0 0 2px rgba(214, 108, 99, .2), 0 0 18px rgba(214, 108, 99, .3); }
.battle-hero.heal-target { border-color: var(--green); box-shadow: 0 0 0 2px rgba(145, 199, 145, .2), 0 0 18px rgba(145, 199, 145, .32); }
.battle-hero.shield-target { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(142, 184, 220, .22), 0 0 18px rgba(142, 184, 220, .28); }
.battle-hero.buff-target { border-color: var(--amber-light); box-shadow: 0 0 0 2px rgba(245, 212, 134, .2), 0 0 18px rgba(245, 212, 134, .28); }
.battle-hero.dead { filter: grayscale(1); opacity: .46; }
.battle-hero { position: relative; }
.battle-hero strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.mini-hp { height: 6px; margin: 4px 0; border: 1px solid var(--line-muted); background: var(--navy-950); }
.mini-hp i { display: block; height: 100%; background: var(--green); transition: width .24s ease; }
.battle-float { position: absolute; z-index: 4; color: var(--amber-light); font-weight: 800; pointer-events: none; animation: rise-and-fade 1s ease both; }
.battle-float.party { color: #ffc1b4; }
.battle-float.heal { color: var(--green); }
.battle-card-float { position: absolute; z-index: 5; top: 18%; right: 8px; color: #ffc1b4; font-weight: 800; pointer-events: none; animation: rise-and-fade 1s ease both; }
.battle-card-float.heal { color: var(--green); }
.battle-card-effect { position: absolute; z-index: 3; inset: 12% 12% 18%; pointer-events: none; border: 2px solid currentColor; }
.heal-aura-card { color: var(--green); border-radius: 50%; box-shadow: 0 0 16px rgba(145, 199, 145, .72), inset 0 0 12px rgba(145, 199, 145, .28); animation: magic-cast .72s ease both; }
.shield-aura-card { color: var(--blue); border-radius: 10px; box-shadow: 0 0 16px rgba(142, 184, 220, .72), inset 0 0 12px rgba(142, 184, 220, .25); animation: magic-cast .72s ease both; }
.buff-aura-card { color: var(--amber-light); border-radius: 50%; box-shadow: 0 0 16px rgba(245, 212, 134, .72), inset 0 0 12px rgba(245, 212, 134, .28); animation: magic-cast .72s ease both; }
.enemy-impact-card { color: #ffc1b4; transform: rotate(-12deg); box-shadow: 0 0 15px rgba(214, 108, 99, .72); animation: battle-slash .55s ease both; }
.battle-effects { position: absolute; z-index: 4; inset: 0; overflow: hidden; pointer-events: none; }
.battle-effect { position: absolute; display: block; pointer-events: none; }
.attack-slash { right: 28%; top: 31%; width: 150px; height: 12px; border-top: 4px solid var(--amber-light); border-bottom: 2px solid rgba(245, 212, 134, .5); transform: rotate(-24deg); filter: drop-shadow(0 0 7px rgba(245, 212, 134, .76)); animation: battle-slash .55s ease both; }
.magic-cast { left: 35%; bottom: 38%; width: 54px; height: 54px; border: 3px solid var(--blue); border-radius: 50%; box-shadow: 0 0 18px rgba(142, 184, 220, .9), inset 0 0 12px rgba(142, 184, 220, .8); animation: magic-cast .72s ease both; }
.dragon-impact { right: 17%; top: 28%; width: 82px; height: 82px; border: 4px solid var(--amber-light); border-radius: 50%; box-shadow: 0 0 22px rgba(245, 212, 134, .9); animation: dragon-impact .7s ease both; }
.enemy-telegraph { right: 18%; top: 23%; width: 110px; height: 110px; border: 3px solid rgba(214, 108, 99, .86); border-radius: 50%; box-shadow: 0 0 22px rgba(214, 108, 99, .55); animation: enemy-telegraph .7s ease both; }
.enemy-impact { right: 23%; top: 39%; width: 80px; height: 12px; border-top: 5px solid #ffc1b4; transform: rotate(38deg); filter: drop-shadow(0 0 8px rgba(214, 108, 99, .8)); animation: battle-slash .55s ease both; }
.battle-log { display: grid; grid-template-rows: auto auto 1fr auto; min-height: 610px; padding: 16px; }
.battle-log h2 { margin-bottom: 4px; font-size: 23px; }
.phase-readout { color: var(--amber-light); font-size: 13px; }
.event-card { min-height: 138px; margin: 14px 0; border: 1px solid var(--line); padding: 13px; background: rgba(225, 163, 79, .09); }
.event-card strong { display: block; color: var(--amber-light); margin-bottom: 6px; }
.event-card p { margin-bottom: 8px; }
.event-target { display: flex; flex-wrap: wrap; gap: 5px; }
.battle-log-list { min-height: 0; overflow-y: auto; max-height: 320px; position: relative; border-top: 1px solid var(--line-muted); overscroll-behavior: contain; }
.battle-log-line { display: grid; grid-template-columns: 27px 1fr; gap: 7px; border-bottom: 1px solid rgba(101, 115, 147, .44); padding: 7px 2px; color: #b7c2d5; font-size: 12px; }
.battle-log-line.current { color: var(--ivory); background: rgba(225, 163, 79, .09); }
.battle-log-line .log-index { color: var(--amber); text-align: right; }
.battle-legend { display: flex; flex-wrap: wrap; gap: 8px 12px; color: #aab5c8; font-size: 12px; }
.legend-item::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 5px; border: 1px solid currentColor; }
.legend-item.attack { color: var(--amber-light); }
.legend-item.support { color: var(--green); }
.legend-item.damage { color: #ffc1b4; }
.battle-stopped { color: #ffd0be; font-size: 12px; }

/* 6: 結果 */
.result-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 16px; }
.result-layout.defeat-analysis { grid-template-columns: 1fr; }
.result-layout.defeat-analysis .result-scene { display: none; }
.result-scene { position: relative; min-height: 470px; overflow: hidden; background: linear-gradient(0deg, rgba(8, 15, 32, .48), rgba(8, 15, 32, .06)), url("assets/valley.png") center / cover no-repeat; }
.result-scene .dragon-art { top: 12%; right: 10%; width: 76%; max-height: 58%; opacity: .74; }
.result-scene.victory { background: linear-gradient(0deg, rgba(8, 15, 32, .22), rgba(8, 15, 32, .02)), url("assets/victory-result-v2.png") center / cover no-repeat; }
.result-scene.victory .dragon-art { display: none; }
.result-scene.victory::before { content: "討伐完了"; position: absolute; z-index: 2; top: 22px; left: 22px; border: 1px solid var(--amber); padding: 7px 10px; color: var(--amber-light); background: rgba(8, 15, 32, .7); letter-spacing: .12em; }
.result-scene.defeat { border-color: var(--red); background-image: linear-gradient(0deg, rgba(49, 14, 21, .9), rgba(54, 18, 27, .34)), url("assets/valley.png"); }
.result-scene.defeat .dragon-art { opacity: .62; filter: saturate(.65) sepia(.22) drop-shadow(0 12px 7px rgba(0, 0, 0, .62)); }
.result-scene.defeat .result-caption .rank { color: #ffc1b4; }
.result-caption { position: absolute; z-index: 2; right: 22px; bottom: 22px; left: 22px; }
.result-caption .rank { color: var(--amber-light); font-family: var(--font-display); font-size: clamp(36px, 8vw, 72px); line-height: 1; }
.result-caption p { margin: 8px 0 0; font-size: 17px; }
.result-panel { display: grid; align-content: start; gap: 12px; }
.result-analysis-heading { margin-bottom: 0; color: var(--amber-light); font-size: clamp(22px, 3vw, 30px); }
.result-panel h2 { margin-bottom: 0; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.result-stat { border-top: 1px solid var(--line); padding: 7px; text-align: center; }
.result-stat span { display: block; color: #aab5c8; font-size: 11px; }
.result-stat b { color: var(--amber-light); font-size: 20px; }
.member-results { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.member-result { border: 1px solid var(--line-muted); padding: 5px; text-align: center; font-size: 11px; }
.member-result.dead { border-color: var(--red); color: #ffc1b4; }
.feedback-list { display: grid; gap: 6px; }
.feedback-item { border-left: 2px solid var(--green); padding: 7px 9px; color: var(--ivory-soft); font-size: 13px; }
.feedback-item.issue { border-left-color: var(--red); }
.compare-box { border-top: 1px solid var(--line-muted); padding-top: 10px; }
.compare-box h3 { color: var(--amber-light); font-size: 15px; }
.compare-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.compare-value { border: 1px solid var(--line-muted); padding: 6px; text-align: center; font-size: 12px; }
.compare-value span { display: block; color: #aab5c8; }
.victory-banner { position: relative; min-height: 560px; overflow: hidden; margin-bottom: 16px; background: linear-gradient(90deg, rgba(8, 15, 32, .48), rgba(8, 15, 32, .06) 78%), url("assets/victory-result-v2.png") center / cover no-repeat; }
.victory-banner::before { content: ""; position: absolute; z-index: 0; inset: -18%; pointer-events: none; background: radial-gradient(circle at 78% 20%, rgba(245, 212, 134, .46), transparent 22%), radial-gradient(circle at 58% 12%, rgba(225, 163, 79, .24), transparent 18%); animation: victory-light-bloom 1.6s ease-out both; }
.victory-copy { max-width: none; padding: 46px clamp(22px, 5vw, 64px) 34px; background: linear-gradient(90deg, rgba(8, 15, 32, .56), rgba(8, 15, 32, 0) 72%); }
.victory-label { margin: 0 0 8px; color: var(--amber-light); font-family: var(--font-display); font-size: 14px; letter-spacing: .22em; }
.victory-copy h1, .victory-copy h2 { margin-bottom: 6px; color: var(--amber-light); font-size: clamp(30px, 5vw, 54px); text-shadow: 3px 3px 0 rgba(8, 15, 32, .8); }
.victory-lead { margin-bottom: 16px; color: var(--ivory); font-family: var(--font-display); font-size: clamp(18px, 2.4vw, 26px); }
.victory-party { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 10px; margin: 22px 0 14px; max-width: 1100px; }
.victory-member { display: grid; justify-items: center; gap: 3px; min-width: 0; border: 1px solid rgba(245, 212, 134, .72); padding: 6px 4px; background: rgba(8, 15, 32, .58); text-align: center; }
.victory-member.dead { border-color: rgba(214, 108, 99, .9); color: #ffc1b4; }
.victory-member .sprite.medium { width: min(100%, 220px); }
.victory-member strong, .victory-member span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-display); font-size: 11px; }
.victory-member span { color: var(--ivory-soft); font-family: var(--font-body); }
.victory-confetti { position: absolute !important; inset: 0; z-index: 0 !important; pointer-events: none; opacity: .8; background-image: radial-gradient(circle at 18% 22%, var(--amber-light) 0 3px, transparent 4px), radial-gradient(circle at 31% 14%, var(--amber) 0 2px, transparent 3px), radial-gradient(circle at 61% 19%, var(--ivory) 0 2px, transparent 3px), radial-gradient(circle at 77% 31%, var(--amber-light) 0 3px, transparent 4px), radial-gradient(circle at 89% 17%, var(--amber) 0 2px, transparent 3px), radial-gradient(circle at 70% 62%, var(--ivory) 0 2px, transparent 3px); animation: victory-confetti-drift 4s ease-in-out infinite alternate; }
.result-layout[hidden], .victory-banner[hidden], .defeat-banner[hidden] { display: none !important; }
.defeat-banner { position: relative; min-height: 430px; overflow: hidden; margin-bottom: 16px; border-color: rgba(214, 108, 99, .9); background: linear-gradient(90deg, rgba(49, 14, 21, .82) 0%, rgba(49, 14, 21, .44) 43%, rgba(49, 14, 21, .1) 100%), url("assets/defeat-result-v2.png") center / cover no-repeat; }
.defeat-sparks { position: absolute !important; inset: 0; z-index: 0 !important; pointer-events: none; opacity: .9; background-image: radial-gradient(circle at 16% 34%, #ffc1b4 0 2px, transparent 3px), radial-gradient(circle at 28% 18%, #e1a34f 0 2px, transparent 4px), radial-gradient(circle at 44% 55%, #d66c63 0 2px, transparent 4px), radial-gradient(circle at 64% 22%, #e1a34f 0 2px, transparent 4px), radial-gradient(circle at 82% 42%, #ffc1b4 0 2px, transparent 4px), radial-gradient(circle at 92% 17%, #e1a34f 0 2px, transparent 4px); animation: defeat-sparks-drift 2.8s ease-in-out infinite alternate; }
.defeat-copy { position: relative; z-index: 2; display: flex; width: min(62%, 700px); min-height: 430px; flex-direction: column; justify-content: center; padding: 42px clamp(22px, 5vw, 64px); background: linear-gradient(90deg, rgba(49, 14, 21, .88), rgba(49, 14, 21, .45) 72%, transparent); }
.outcome-label { margin: 0 0 8px; color: #ffc1b4; font-family: var(--font-display); font-size: 14px; letter-spacing: .18em; }
.defeat-banner h1 { max-width: 670px; margin-bottom: 10px; color: #ffc1b4; font-size: clamp(32px, 5.6vw, 66px); line-height: 1.15; text-shadow: 3px 3px 0 rgba(49, 14, 21, .86); }
.defeat-banner p:not(.outcome-label) { max-width: 520px; margin-bottom: 20px; color: var(--ivory-soft); font-size: clamp(16px, 2vw, 20px); }

/* 7: 振り返り */
.debrief-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .75fr); gap: 16px; }
.mapping-table { width: 100%; border-collapse: collapse; }
.mapping-table th, .mapping-table td { border-bottom: 1px solid var(--line-muted); padding: 10px 8px; text-align: left; vertical-align: top; }
.mapping-table th { color: var(--amber-light); font-size: 12px; }
.mapping-table td { color: var(--ivory-soft); font-size: 13px; }
.reflection-list { display: grid; gap: 9px; }
.reflection-item { border-left: 2px solid var(--amber); padding: 8px 10px; background: rgba(225, 163, 79, .08); }
.reflection-item b { display: block; color: var(--amber-light); font-size: 12px; }
.reflection-item p { margin: 3px 0 0; color: var(--ivory-soft); font-size: 13px; }
.debrief-question { color: var(--ivory-soft); }

/* 資産の読み込み失敗時も絵文字へ戻さず、状態を明示します。 */
.sprite { position: relative; width: min(100%, 140px); height: auto; overflow: hidden; display: grid; place-items: end start; margin: 0 auto; background: linear-gradient(180deg, rgba(27, 49, 85, .2), rgba(8, 15, 32, .75)); aspect-ratio: var(--sprite-frame-ratio, 1); }
.sprite-v3 { aspect-ratio: var(--sprite-frame-ratio, 1); }
.sprite::before { content: ""; position: absolute; right: 14%; bottom: 0; left: 14%; height: 7px; border-top: 1px solid var(--line-muted); background: rgba(8, 15, 32, .8); }
.sprite-sheet { display: block; width: 300%; height: 100%; max-width: none; object-fit: fill; transform: translateX(calc(var(--sprite-stage, 0) * -33.333333%)); transform-origin: left bottom; }
.sprite.missing .sprite-sheet { display: none; }
.sprite.missing::after { content: "画像準備中"; position: absolute; inset: 0; display: grid; place-items: center; color: #aab5c8; font-size: 12px; }
.sprite.tiny { width: 40px; height: auto; margin: 0; aspect-ratio: var(--sprite-frame-ratio, 1); }
.sprite.tiny::before { height: 3px; }
.sprite.tiny .sprite-sheet { height: 100%; }
.sprite.battle-size { width: min(100%, 140px); height: auto; }
.sprite.medium { width: min(100%, 140px); height: auto; }
.hero-card .sprite.medium { width: min(100%, 200px); }
.formation-slot .sprite.medium { width: min(100%, 120px); }
.growth-card > .sprite.medium { width: min(100%, 160px); }

dialog { width: min(760px, calc(100% - 24px)); border: 1px solid var(--line); border-radius: 0; padding: 0; color: var(--ivory); background: var(--navy-900); box-shadow: 0 24px 70px rgba(0, 0, 0, .62); }
dialog::backdrop { background: rgba(3, 7, 17, .82); }
.growth-dialog::backdrop { background: rgba(8, 15, 32, .78); }
.growth-dialog[open] .dialog-inner { animation: growth-dialog-in .32s ease both; }
.dialog-inner { position: relative; padding: 24px; }
.dialog-inner::after { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(215, 184, 121, .52); pointer-events: none; }
.dialog-content { position: relative; z-index: 1; }
.growth-question { margin: -2px 0 9px; color: var(--amber-light); font-family: var(--font-display); font-size: 20px; }
.compare-stages { display: grid; grid-template-columns: 1fr 46px 1fr; gap: 10px; align-items: center; margin: 16px 0; }
.compare-stage { border: 1px solid var(--line-muted); padding: 10px; background: rgba(20, 35, 65, .78); }
.compare-stage h3 { margin-bottom: 3px; color: var(--amber-light); }
.compare-stage p { margin: 4px 0 0; color: var(--ivory-soft); font-size: 12px; }
.compare-stage .sprite.medium { width: min(100%, 220px); }
.growth-target-list { display: grid; gap: 4px; margin-top: 8px; border-top: 1px solid var(--line-muted); padding-top: 7px; }
.growth-target-list .target-chip { width: fit-content; }
.compare-arrow { color: var(--amber-light); text-align: center; font-size: 23px; }
.dialog-actions { display: flex; justify-content: end; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.toast { position: fixed; z-index: 20; right: 18px; bottom: 18px; max-width: min(420px, calc(100% - 36px)); border: 1px solid var(--amber); padding: 10px 13px; color: var(--ivory); background: var(--navy-900); box-shadow: var(--shadow); }
.toast[hidden] { display: none; }

@keyframes rise-and-fade { from { opacity: 0; transform: translateY(12px); } 25% { opacity: 1; } to { opacity: 0; transform: translateY(-30px); } }
@keyframes title-copy-in { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes title-keyvisual-in { from { opacity: 0; transform: scale(1.025); } to { opacity: 1; transform: scale(1); } }
@keyframes growth-dialog-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes battle-slash { from { opacity: 0; transform: translateX(35px) rotate(-24deg) scale(.7); } 35% { opacity: 1; } to { opacity: 0; transform: translateX(-8px) rotate(-24deg) scale(1.08); } }
@keyframes magic-cast { from { opacity: 0; transform: scale(.35); } 35% { opacity: 1; } to { opacity: 0; transform: scale(1.5); } }
@keyframes dragon-impact { from { opacity: 0; transform: scale(.35); } 35% { opacity: 1; } to { opacity: 0; transform: scale(1.22); } }
@keyframes enemy-telegraph { from { opacity: 0; transform: scale(.72); } 35% { opacity: 1; } to { opacity: 0; transform: scale(1.15); } }
@keyframes victory-confetti-drift { from { transform: translateY(4px); opacity: .48; } to { transform: translateY(-9px); opacity: .9; } }
@keyframes victory-light-bloom { from { opacity: 0; transform: scale(.86); } 45% { opacity: 1; } to { opacity: .72; transform: scale(1); } }
@keyframes defeat-sparks-drift { from { transform: translateY(8px); opacity: .42; } to { transform: translateY(-12px); opacity: .95; } }
@media (max-width: 1020px) {
  .title-screen, .title-stage { min-height: auto; }
  .title-stage { display: flex; flex-direction: column; }
  .title-stage::before { display: none; }
  .title-stage::after { z-index: 0; inset: 26% 0 0; background: linear-gradient(0deg, rgba(8, 15, 32, .74) 4%, rgba(8, 15, 32, .24) 72%, transparent 100%); }
  .title-keyvisual { position: relative; z-index: 1; inset: auto; width: 100%; height: auto; flex: 0 0 auto; aspect-ratio: 1672 / 941; object-fit: contain; object-position: center top; }
  .title-copy { width: 100%; min-height: 0; flex: 1 1 auto; justify-content: flex-start; padding: 34px clamp(28px, 4vw, 60px) 46px; background: linear-gradient(0deg, rgba(8, 15, 32, .78), rgba(8, 15, 32, .42) 78%, transparent 100%); }
}
@media (max-width: 1020px) {
  .selection-layout, .lab-layout { grid-template-columns: 1fr; }
  .selection-side, .lab-side { position: static; }
  .selection-side { grid-template-columns: 1fr 1fr; }
  .lab-side { grid-template-columns: 1fr; }
  .battle-layout { grid-template-columns: 1fr; }
  .battle-log { min-height: 390px; }
  .battle-log-list { max-height: 240px; }
}
@media (max-width: 760px) {
  .app-shell { width: min(100% - 20px, 600px); padding-top: 10px; }
  .site-header { align-items: flex-start; flex-wrap: wrap; }
  .progress-readout { margin-left: auto; }
  .title-screen, .title-stage { min-height: 700px; }
  .title-copy { padding: 28px 22px 42px; }
  .title-label { font-size: 12px; letter-spacing: .08em; }
  .step-nav li { font-size: 10px; }
  .step-nav li:nth-child(1)::after { content: "導入"; }
  .step-nav li:nth-child(2)::after { content: "敵"; }
  .step-nav li:nth-child(3)::after { content: "仲間"; }
  .step-nav li:nth-child(4)::after { content: "育成"; }
  .step-nav li:nth-child(5)::after { content: "戦闘"; }
  .step-nav li:nth-child(6)::after { content: "結果"; }
  .step-nav li:nth-child(7)::after { content: "振返り"; }
  .step-nav li { color: transparent; height: 32px; }
  .step-nav li::after { color: #9da9c1; }
  .step-nav li.active::after { color: var(--amber-light); }
  .screen-head { align-items: start; flex-direction: column; }
  .hero-panel { min-height: 650px; }
  .hero-panel::before { background: linear-gradient(90deg, rgba(8, 15, 32, .68), rgba(8, 15, 32, .22)), url("assets/valley.png") center / cover no-repeat; }
  .hero-dragon { right: -3%; width: 74%; max-height: 47%; opacity: .72; }
  .hero-copy { padding: 28px 20px; align-self: end; }
  .hero-copy h1 { font-size: clamp(31px, 11vw, 52px); }
  .intel-grid, .result-layout, .debrief-grid { grid-template-columns: 1fr; }
  .intel-scene { min-height: 430px; }
  .hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .growth-detail { grid-template-columns: 1fr; }
  .growth-card { grid-template-columns: 1fr; }
  .growth-card > .sprite.medium { width: min(100%, 150px); }
  .growth-row.skill-entry { grid-template-columns: 27px 58px minmax(0, 1fr); gap: 5px; padding-inline: 4px; }
  .formation-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .growth-cards { grid-template-columns: 1fr; }
  .lab-side, .selection-side { grid-template-columns: 1fr; }
  .dragon-hud { position: relative; top: auto; right: auto; width: calc(100% - 28px); margin: 14px; }
  .battle-scene { min-height: 660px; }
  .dragon-art { top: 18%; width: 75%; right: 12%; max-height: 36%; }
  .battle-hero .sprite.battle-size { width: min(100%, 100px); }
  .battle-party { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .battle-log { min-height: 440px; }
  .result-scene { min-height: 400px; }
  .result-stats { grid-template-columns: 1fr; }
  .member-results { grid-template-columns: repeat(2, 1fr); }
  .compare-stages { grid-template-columns: 1fr; }
  .compare-arrow { transform: rotate(90deg); }
  .compare-stage .sprite.medium { width: min(100%, 160px); height: auto; }
  .victory-banner { min-height: 480px; }
  .victory-copy { padding: 34px 20px; }
  .victory-party { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .victory-member .sprite.medium { width: min(100%, 170px); }
  .defeat-banner { min-height: 450px; }
  .defeat-copy { width: 100%; min-height: 450px; justify-content: end; padding: 28px 20px; background: linear-gradient(0deg, rgba(49, 14, 21, .94), rgba(49, 14, 21, .52) 66%, transparent); }
}
@media (max-width: 430px) {
  .hero-grid { grid-template-columns: 1fr; }
  .title-screen h1 { font-size: clamp(28px, 11vw, 48px); }
  .title-subtitle { font-size: 17px; }
  .title-lead { font-size: 15px; }
  .mission-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .mission-fact b { font-size: 18px; }
  .boss-facts { grid-template-columns: 1fr; max-width: 145px; }
  .attack-line { grid-template-columns: 57px minmax(0, 1fr); }
  .attack-line b { grid-column: 2; }
  .formation-slots { gap: 5px; }
  .battle-controls .btn { flex: 1 1 auto; }
  .defeat-banner { min-height: 400px; }
  .defeat-copy { min-height: 400px; padding: 24px 16px; }
  .defeat-banner h1 { font-size: clamp(30px, 9vw, 42px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
