/* Preserve the original stage, palette and sprite sheets; let bilingual text breathe. */
body { overflow: auto; }
.stage { height: max(820px, calc(100dvh - 36px)); min-height: 820px; }
.topbar { align-items: flex-start; }
.brand h1 { font-size: clamp(26px, 3.7vw, 48px); line-height: 1.08; }
.brand { flex: 1; }
.header-tools { display: grid; gap: 12px; justify-items: end; max-width: 54%; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; }
.toolbar label { display: flex; gap: 8px; align-items: center; font-size: 13px; }
select { padding: 8px; background: #211b23; color: var(--paper); border: 1px solid #ad8650; border-radius: 0; min-height: 42px; }
.small-btn { min-height: 42px; }
.meter { width: 230px; }
.tagline { top: 158px; max-width: 490px; font-size: 14px; }
#progress { color: #ffe2a8; margin-bottom: 5px; }
#saveStatus { display: block; color: #a9c9b0; font-size: 11px; margin-top: 5px; }
#resolution .choice-grid { grid-template-columns: 1fr; }
#resolutionFeedback { color: #ffe2a8; margin-top: 18px; padding-left: 12px; border-left: 3px solid var(--gold); }
#resolutionFeedback:empty { display: none; }
#ending .menu-grid { position: sticky; bottom: -24px; padding: 12px 0; background: #171318; }
#aftermath { border-top: 1px solid #685040; margin-top: 20px; }
.big-menu { top: 45%; width: min(700px, calc(100% - 40px)); max-height: 470px; overflow-y: auto; }
.big-menu h2 { font-size: clamp(28px, 3.5vw, 44px); line-height: 1.15; margin-bottom: 16px; }
.big-menu .menu-note { font-size: 13px; margin: 0 0 16px; }
.chapter-number { color: var(--gold); font-size: 14px; letter-spacing: .22em; margin-bottom: 10px; }
#ending { width: min(780px, calc(100% - 40px)); max-height: calc(100% - 340px); }
#ending h2 { font-size: 28px; }
#ending p { font-size: 16px; }
.panel { bottom: 42px; min-height: 180px; }
.dialogue { padding: 34px 24px 52px; font-size: clamp(17px, 1.7vw, 22px); min-height: 130px; }
.next { clip-path: none; width: auto; height: auto; padding: 6px 16px; color: #160b09; font-size: 15px; font-weight: 900; animation: none; }
.next:disabled { display: none; }
.characters { bottom: 200px; }
.locations, .testimony-box { bottom: 252px; }
.location-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.location-card span { font-size: 12px; font-weight: 600; }
.location-card:disabled { opacity: .65; cursor: not-allowed; }
.reconstruction { color: var(--muted); font-size: 12px; margin: 0 0 10px; }
.pilot-footer { position: absolute; bottom: 10px; left: 24px; right: 24px; font-size: 10px; color: #dbcaa9; }
.evidence-card { cursor: default; }
.evidence-card:hover { transform: none; filter: none; }
.evidence-card p { font-weight: 500; font-size: 15px; line-height: 1.6; }
.evidence-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.evidence-buttons button { color: #fff3d6; background: #3d2222; border-color: #715037; }
dialog { width: min(760px, calc(100% - 24px)); max-height: calc(100dvh - 32px); padding: 22px; border: 2px solid #a5824d; background: #1e1920; color: var(--paper); box-shadow: 0 20px 100px #000; line-height: 1.65; }
dialog::backdrop { background: rgba(7, 5, 9, .8); }
.dialog-header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; position: sticky; top: -22px; background: #1e1920; padding: 12px 0; z-index: 1; }
.dialog-header h2 { margin: 0; font-size: 24px; color: #ffe2a8; }
.dialog-header button { flex-shrink: 0; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
dialog a { color: #f6ce76; text-underline-offset: 3px; overflow-wrap: anywhere; }
dialog h3 { color: #ffe2a8; font-size: 18px; margin-top: 26px; }
dialog h4 { font-size: 13px; color: var(--muted); }
dialog blockquote { margin: 16px 0; padding: 14px 18px; border-left: 3px solid #cd9c45; background: #302832; font-size: 18px; }
.source-section { border-top: 1px solid #5e4a3f; margin-top: 24px; }
:focus-visible { outline: 3px solid #86ded5; outline-offset: 4px; }
.toast { top: 195px; }
html[lang="en"] .brand h1 { font-size: clamp(24px, 3vw, 40px); }
@media (max-width: 760px) {
  .app { padding: 0; }
  .stage { height: auto; min-height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
  .topbar { position: relative; padding: 16px; gap: 16px; }
  .header-tools { max-width: none; width: 100%; justify-items: stretch; }
  .toolbar { justify-content: flex-start; }
  .meter { width: 100%; }
  .tagline { position: relative; inset: auto; margin: 0 16px; padding: 8px 12px; max-width: none; }
  .characters { position: relative; inset: auto; height: 185px; padding: 0 16px; gap: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden; }
  .characters .sprite:nth-child(2) { display: grid; }
  .sprite { min-height: 0; min-width: 0; height: 185px; }
  .portrait { min-width: 0; width: 195px; }
  #spriteLeft .portrait, #spriteRight .portrait { transform: none; }
  .big-menu, .locations, .testimony-box { position: relative; inset: auto; transform: none; width: auto; margin: 0 12px 28px; max-height: none; padding: 18px; }
  .big-menu { margin-top: -80px; }
  #ending { width: auto; max-height: none; }
  .big-menu h2 { font-size: 30px; }
  .big-menu p { font-size: 16px; }
  .location-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .location-card { overflow-wrap: anywhere; }
  .testimony-box { display: block; }
  .court-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 12px; }
  .panel { position: relative; inset: auto; margin: 12px; min-height: 180px; }
  .dialogue { padding: 30px 16px 54px; }
  .pilot-footer { position: relative; inset: auto; padding: 8px 16px 16px; }
  .toast { position: fixed; top: 12px; font-size: 14px; }
  dialog { padding: 16px; }
  .dialog-header { top: -16px; }
  .dialog-actions { max-width: 150px; }
  .dialog-header h2 { font-size: 20px; }
  .dialog-header button { max-width: 145px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
