:root {
  color-scheme: dark;
  --ink: #eef2ed;
  --muted: #9eaaa5;
  --bg: #080d11;
  --panel: #10181e;
  --panel-2: #162128;
  --line: #2a3b42;
  --green: #7de0b0;
  --green-dim: #316c55;
  --amber: #d7a45d;
  --red: #db716d;
  --shadow: 0 22px 70px rgb(0 0 0 / 45%);
  --radius: 14px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 15%, rgb(49 108 85 / 13%), transparent 32rem),
    linear-gradient(145deg, #080d11, #0d151a 62%, #080c0f);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .13;
  background-image: radial-gradient(rgb(255 255 255 / 22%) .55px, transparent .75px);
  background-size: 5px 5px;
  mix-blend-mode: soft-light;
  z-index: 100;
}
button, input, select { font: inherit; }
button { color: inherit; }
button, [role="button"], input, select { touch-action: manipulation; }
button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible, a:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
}
img, video { display: block; max-width: 100%; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 1000; background: var(--ink); color: var(--bg); padding: .7rem 1rem; }
.skip-link:focus { top: 1rem; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.screen { min-height: 100vh; min-height: 100svh; animation: screen-in .45s ease both; }
@keyframes screen-in { from { opacity: 0; } to { opacity: 1; } }
.shell { width: min(1180px, calc(100% - 2rem)); margin-inline: auto; }
.eyebrow { margin: 0 0 .45rem; color: var(--green); font-size: .74rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 760; }
h1, h2, h3 { margin-top: 0; line-height: 1.12; text-wrap: balance; }
h1 { font-size: clamp(2rem, 5vw, 4.6rem); letter-spacing: -.045em; }
h2 { font-size: clamp(1.55rem, 3vw, 2.7rem); letter-spacing: -.025em; }
h3 { font-size: 1.08rem; }
p { text-wrap: pretty; }
.muted { color: var(--muted); }
.accent { color: var(--green); }
.danger { color: var(--red); }
.separator { width: 4.5rem; height: 1px; background: linear-gradient(90deg, var(--green), transparent); margin: 1.2rem 0; }

.btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  min-height: 46px;
  padding: .68rem 1.12rem;
  background: rgb(18 28 34 / 88%);
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s, color .2s;
  font-weight: 700;
}
.btn:hover { border-color: var(--green-dim); background: #17252a; transform: translateY(-1px); }
.btn-primary { background: var(--green); color: #07110d; border-color: var(--green); }
.btn-primary:hover { background: #a1edc8; color: #07110d; }
.btn-ghost { background: transparent; }
.btn-danger { border-color: rgb(219 113 109 / 45%); color: #f0a29f; }
.btn:disabled { opacity: .36; cursor: not-allowed; transform: none; }
.button-row { display: flex; gap: .7rem; flex-wrap: wrap; align-items: center; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; padding: 0; border-radius: 50%; }

/* Menu */
.menu-screen { position: relative; display: grid; place-items: center; overflow: hidden; }
.menu-screen::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(8 13 17 / 98%) 0 38%, rgb(8 13 17 / 42%) 70%, rgb(8 13 17 / 88%)); }
.menu-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(.72) brightness(.55); }
.menu-content { position: relative; z-index: 1; width: min(1180px, calc(100% - 2rem)); display: grid; grid-template-columns: minmax(280px, 560px) 1fr; gap: 4rem; align-items: center; padding-block: 2rem 4rem; }
.brand-logo { width: min(500px, 90vw); height: auto; filter: drop-shadow(0 12px 30px rgb(0 0 0 / 55%)); }
.brand-logo + .menu-list { margin-top: 1.35rem; }
.menu-list { display: grid; gap: .55rem; width: min(360px, 100%); }
.menu-list .btn { border-radius: 6px; justify-content: space-between; display: flex; align-items: center; background: linear-gradient(90deg, rgb(16 24 30 / 92%), rgb(16 24 30 / 48%)); text-align: left; }
.menu-list .btn::after { content: "›"; color: var(--green); font-size: 1.35rem; }
.menu-list .btn:disabled::after { content: "verrouillé"; font-size: .64rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.menu-aside { align-self: end; justify-self: end; max-width: 27rem; }
.menu-quote { margin: 0; color: #e2e8e4; font: clamp(1.15rem, 2vw, 1.55rem)/1.5 Georgia, "Times New Roman", serif; text-wrap: balance; }
.menu-meta { margin: 0; color: #aeb7b3; font-size: .8rem; max-width: 25rem; }
.footer-links { position: absolute; left: 0; right: 0; bottom: max(.9rem, env(safe-area-inset-bottom)); display: flex; justify-content: center; gap: .65rem 1.25rem; flex-wrap: wrap; }
.footer-links a { color: #aeb7b3; font-size: .76rem; text-decoration: none; border-bottom: 1px solid transparent; }
.footer-links a:hover { color: var(--ink); border-color: var(--green-dim); }

/* Modal */
.modal-backdrop { position: fixed; z-index: 500; inset: 0; display: grid; place-items: center; padding: 1rem; background: rgb(2 5 7 / 82%); backdrop-filter: blur(8px); }
.modal { width: min(620px, 100%); max-height: min(820px, calc(100svh - 2rem)); overflow: auto; background: linear-gradient(150deg, #162128, #0d1419); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.2rem, 4vw, 2.2rem); box-shadow: var(--shadow); }
.modal header { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }
.modal > header { margin-bottom: 1.5rem; }
.modal h2 { font-size: 1.65rem; margin-bottom: 0; }
.modal > .button-row { margin-top: 1.5rem; }
.warning-list { padding-left: 1.2rem; color: #c4cdca; margin-block: 1rem 0; }

/* Video and prologue */
.cinematic-screen { background: #020405; display: grid; place-items: center; position: relative; overflow: hidden; }
.cinematic-screen video { width: 100%; height: 100svh; object-fit: contain; }
.cinematic-controls { position: fixed; inset: auto max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) auto; display: flex; gap: .6rem; z-index: 3; }
.video-title { position: fixed; left: max(1rem, env(safe-area-inset-left)); top: max(1rem, env(safe-area-inset-top)); z-index: 3; padding: .5rem .7rem; background: rgb(3 7 9 / 66%); border-left: 2px solid var(--green); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.cinematic-screen.memory::after { content: ""; position: fixed; inset: 0; pointer-events: none; box-shadow: inset 0 0 120px rgb(171 117 57 / 15%); }
.cinematic-screen.surveillance::after { content: ""; position: fixed; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, transparent 0 3px, rgb(255 255 255 / 2%) 3px 4px); }
.cinematic-screen.glitch { animation: glitch-in .32s steps(2); }
@keyframes glitch-in { 0% { filter: contrast(1.6) hue-rotate(15deg); transform: translateX(-3px); } 50% { transform: translateX(2px); } 100% { filter: none; transform: none; } }
.prologue-screen { position: relative; overflow: hidden; background: #020405; }
.prologue-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.64) saturate(.8); }
.prologue-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgb(3 7 10 / 85%) 0 43%, rgb(3 7 10 / 30%) 72%), linear-gradient(0deg, rgb(3 7 10 / 68%), transparent 45%); }
.prologue-content { position: relative; z-index: 2; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; padding: clamp(1.2rem, 6vw, 5rem); width: min(760px, 100%); }
.prologue-text { font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.12rem, 2.2vw, 1.65rem); text-shadow: 0 2px 12px black; }
.prologue-text p { margin: .55rem 0; }
.prologue-nav { display: flex; gap: .75rem; align-items: center; margin-top: 1.3rem; }
.progress-dots { display: flex; gap: .4rem; margin-left: auto; }
.progress-dots span { width: 8px; height: 8px; border-radius: 50%; background: #65716d; }
.progress-dots .active { background: var(--green); box-shadow: 0 0 0 4px rgb(125 224 176 / 13%); }

/* Narrative context around cinematics */
.narrative-screen { position: relative; display: grid; align-items: end; overflow: hidden; background: #020405; }
.narrative-backdrop { position: absolute; inset: 0; background-image: var(--narrative-image); background-size: cover; background-position: center; filter: brightness(.5) saturate(.72); transform: scale(1.01); }
.narrative-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgb(3 7 10 / 94%) 0 45%, rgb(3 7 10 / 34%) 76%), linear-gradient(0deg, rgb(3 7 10 / 78%), transparent 58%); }
.narrative-screen.memory .narrative-backdrop, .narrative-screen.melancholy .narrative-backdrop { filter: brightness(.52) saturate(.68) sepia(.08); }
.narrative-screen.surveillance .narrative-backdrop { filter: brightness(.48) saturate(.55) contrast(1.06); }
.narrative-panel { position: relative; z-index: 2; width: min(790px, 100%); padding: clamp(1.3rem, 6vw, 5rem); }
.narrative-panel h1 { font-size: clamp(2rem, 5vw, 4rem); margin-bottom: 1.4rem; }
.narrative-panel p:not(.eyebrow) { max-width: 68ch; font-size: clamp(1rem, 1.8vw, 1.18rem); color: #d8e0dc; }
.narrative-panel .btn { margin-top: 1rem; }

/* Game shell */
.game-screen { padding-bottom: 4rem; }
.game-header { position: sticky; top: 0; z-index: 30; background: rgb(8 13 17 / 88%); backdrop-filter: blur(14px); border-bottom: 1px solid rgb(42 59 66 / 72%); }
.game-header-inner { min-height: 66px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; }
.mini-brand { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.mini-brand img { width: 150px; height: auto; }
.chapter-label { text-align: center; }
.chapter-label strong { display: block; font-size: .88rem; }
.chapter-label span { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; }
.header-actions { justify-self: end; display: flex; gap: .4rem; }
.game-main { padding-top: clamp(2rem, 6vw, 5rem); }
.case-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(250px, .55fr); gap: clamp(1.2rem, 4vw, 3rem); align-items: start; }
.case-panel { background: linear-gradient(145deg, rgb(18 28 34 / 94%), rgb(11 18 23 / 94%)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.case-body { padding: clamp(1.1rem, 4vw, 2.2rem); }
.case-aside { position: sticky; top: 90px; padding: 1.2rem; }
.case-aside ul { padding-left: 1.1rem; color: var(--muted); font-size: .9rem; }
.skill-tag { display: inline-flex; gap: .45rem; align-items: center; border: 1px solid var(--green-dim); border-radius: 999px; color: #b9efd4; padding: .28rem .62rem; font-size: .75rem; }
.chapter-intro { min-height: calc(100svh - 160px); display: grid; place-items: center; }
.chapter-intro-card { max-width: 760px; text-align: center; padding: clamp(1.4rem, 5vw, 4rem); }
.chapter-number { font-size: clamp(4rem, 16vw, 10rem); font-weight: 900; line-height: .8; color: transparent; -webkit-text-stroke: 1px rgb(125 224 176 / 38%); opacity: .8; }

/* Puzzles */
.puzzle-head { padding: clamp(1.1rem, 4vw, 2rem); background: linear-gradient(115deg, rgb(49 108 85 / 18%), transparent); border-bottom: 1px solid var(--line); }
.puzzle-head h1 { font-size: clamp(1.6rem, 4vw, 3rem); margin-bottom: .5rem; }
.puzzle-work { display: grid; gap: 1rem; margin-top: 1.5rem; }
.puzzle-context { display: grid; gap: .45rem; margin-bottom: 1.25rem; padding: 1rem; border-left: 3px solid var(--green-dim); background: rgb(49 108 85 / 9%); }
.puzzle-context p { margin: 0; }
.puzzle-actions { margin-top: 1.3rem; }
.hint-region { margin-top: 1rem; }
.choice-card { display: grid; grid-template-columns: auto 1fr; gap: .8rem; align-items: start; padding: 1rem; border: 1px solid var(--line); background: #0c1419; border-radius: 9px; cursor: pointer; }
.choice-card:hover { border-color: var(--green-dim); }
.choice-card input { width: 20px; height: 20px; margin-top: .15rem; accent-color: var(--green); }
.choice-card strong { display: block; }
.choice-card small { color: var(--muted); }
.evidence-box { border: 1px solid var(--line); background: #091014; padding: 1rem; border-radius: 10px; }
.evidence-box code { color: #a7e7c6; word-break: break-all; }
.feedback { padding: .9rem 1rem; border-radius: 9px; border-left: 3px solid var(--line); background: #0b1216; }
.feedback.error { border-color: var(--red); color: #efb4b2; }
.feedback.success { border-color: var(--green); color: #c7f2dc; }
.hint-box { border: 1px dashed var(--amber); background: rgb(215 164 93 / 8%); padding: .9rem 1rem; border-radius: 9px; color: #eed8b6; }
.reward-card { text-align: left; padding: clamp(1.2rem, 5vw, 2.5rem); }
.reward-icon { width: 58px; height: 58px; border: 1px solid var(--green); border-radius: 50%; display: grid; place-items: center; color: var(--green); font-weight: 900; margin-bottom: 1rem; box-shadow: 0 0 30px rgb(125 224 176 / 14%); }
.binary-sequence { display: grid; grid-template-columns: repeat(4, minmax(100px, 1fr)); gap: .7rem; }
.binary-cell { padding: 1rem .65rem; text-align: center; background: #071014; border: 1px solid var(--line); border-radius: 8px; font: 700 clamp(.78rem, 2vw, 1rem) ui-monospace, SFMono-Regular, Consolas, monospace; }
.binary-table { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.binary-table button { border: 1px solid var(--line); background: var(--panel-2); border-radius: 7px; padding: .7rem; cursor: pointer; }
.binary-table button[aria-pressed="true"] { border-color: var(--green); background: rgb(49 108 85 / 28%); box-shadow: inset 0 0 0 1px var(--green); color: #d9f7e8; }
.meta-grid, .source-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.meta-row { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid rgb(42 59 66 / 55%); }
.inspect-list { display: grid; gap: .55rem; }
.inspect-btn { display: flex; text-align: left; gap: .7rem; border: 1px solid var(--line); background: #0b1419; border-radius: 8px; padding: .8rem; cursor: pointer; }
.inspect-btn[aria-pressed="true"] { border-color: var(--green); background: rgb(49 108 85 / 17%); }
.checkbox-btn { align-items: center; }
.check-indicator { width: 18px; height: 18px; flex: 0 0 18px; border: 1px solid #7f918a; border-radius: 3px; background: #071014; position: relative; }
.checkbox-btn[aria-pressed="true"] .check-indicator { border-color: var(--green); background: var(--green); }
.checkbox-btn[aria-pressed="true"] .check-indicator::after { content: "✓"; position: absolute; inset: -3px 0 0; display: grid; place-items: center; color: #07110d; font-weight: 900; }
.select-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(160px, .55fr); gap: 1rem; align-items: center; padding: .8rem 0; border-bottom: 1px solid var(--line); }
select, input[type="text"] { width: 100%; color: var(--ink); background: #091116; border: 1px solid #3b4b52; border-radius: 7px; min-height: 44px; padding: .55rem .7rem; }
.token-bank, .passphrase-line { display: flex; flex-wrap: wrap; gap: .55rem; min-height: 58px; padding: .7rem; border: 1px dashed var(--line); border-radius: 9px; }
.token { border: 1px solid var(--green-dim); border-radius: 7px; padding: .55rem .75rem; background: #12241e; cursor: pointer; }
.passphrase-preview { padding: 1rem; font-family: ui-monospace, monospace; color: var(--green); background: #07100d; border-radius: 8px; word-break: break-all; }
.recovery-note { padding: 1rem; border: 1px solid var(--line); border-radius: 9px; background: #111a1f; }
.recovery-note ol { margin-block: .7rem; padding-left: 1.35rem; }
.separator-pattern { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; gap: .4rem; align-items: center; text-align: center; }
.separator-pattern span { padding: .45rem; border: 1px dashed var(--line); border-radius: 5px; color: var(--muted); font-size: .8rem; }
.separator-pattern b { color: var(--green); font: 800 1.2rem ui-monospace, monospace; }
.message-sort { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(150px, .6fr); gap: .8rem; align-items: center; padding: .7rem; border: 1px solid var(--line); border-radius: 8px; }
.profile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.profile-card { display: grid; gap: .25rem; padding: .8rem; border: 1px solid var(--line); border-radius: 8px; background: #0a1318; }
.profile-card span { color: var(--muted); font-size: .84rem; }
.timeline-table { display: grid; gap: .7rem; }
.audio-track { border: 1px solid var(--line); border-radius: 9px; padding: 1rem; background: #091116; }
.audio-explainer, .timeline-explanation { padding: .9rem 1rem; border-left: 3px solid var(--amber); background: rgb(215 164 93 / 8%); border-radius: 7px; }
.wave { height: 54px; opacity: .7; background: repeating-linear-gradient(90deg, var(--green-dim) 0 3px, transparent 3px 7px); mask: linear-gradient(0deg, transparent, black 30% 70%, transparent); }
.redacted { filter: blur(5px); user-select: none; transition: filter .3s; }
.redacted.revealed { filter: none; }
.grid-map { display: grid; grid-template-columns: repeat(5, 44px); gap: 4px; width: max-content; padding: .7rem; background: #050b0e; border: 1px solid var(--line); border-radius: 8px; }
.map-cell { width: 44px; height: 44px; display: grid; place-items: center; background: #132027; border-radius: 3px; font-weight: 800; }
.map-cell.scanned { background: #4a2023; box-shadow: inset 0 0 0 1px rgb(255 137 131 / 42%); }
.map-cell.player { box-shadow: inset 0 0 0 3px var(--green); color: var(--green); }
.map-cell.exit { background: #1d4b38; }
.grid-wrap { position: relative; width: max-content; padding: 22px; }
.wall-camera { position: absolute; z-index: 2; color: #ffaaa6; font-size: 1.1rem; }
.camera-top { top: 0; left: 57%; }
.camera-right { right: 0; top: 58%; }
.path-legend { display: flex; flex-wrap: wrap; gap: .65rem 1rem; color: var(--muted); font-size: .82rem; }
.path-legend span { display: flex; gap: .4rem; align-items: center; }
.path-legend b { width: 22px; height: 22px; display: inline-grid; place-items: center; border-radius: 3px; }
.legend-player { color: var(--green); box-shadow: inset 0 0 0 2px var(--green); }
.legend-exit { color: #baf3d4; background: #1d4b38; }
.legend-scan { background: #4a2023; box-shadow: inset 0 0 0 1px rgb(255 137 131 / 42%); }
.legend-camera { color: #ffaaa6; }
.program-buttons { margin-top: .7rem; }
.program { min-height: 55px; padding: .6rem; display: flex; flex-wrap: wrap; gap: .35rem; background: #071014; border-radius: 8px; }
.instruction { background: #1a2b33; border: 1px solid var(--line); border-radius: 5px; padding: .35rem .55rem; font-family: ui-monospace, monospace; }
.order-list { display: grid; gap: .6rem; }
.order-card { text-align: left; border: 1px solid var(--line); background: #0a1318; border-radius: 8px; padding: .8rem; cursor: pointer; }
.order-card.selected { opacity: .45; }
.ordered-zone { min-height: 80px; display: grid; gap: .5rem; padding: .6rem; border: 1px dashed var(--green-dim); border-radius: 8px; }
.evidence-image { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 9px; border: 1px solid var(--line); }
.statement-box { border-left: 3px solid var(--amber); }
.source-card blockquote { margin: .8rem 0; padding: .8rem; border-left: 2px solid var(--green-dim); background: #070d10; }
.source-facts { display: grid; gap: .55rem; margin: 1rem 0; }
.source-facts div { display: grid; grid-template-columns: minmax(90px, .4fr) 1fr; gap: .6rem; padding-bottom: .45rem; border-bottom: 1px solid rgb(42 59 66 / 48%); }
.source-facts dt { color: var(--muted); }
.source-facts dd { margin: 0; }
.category-definitions { display: grid; grid-template-columns: repeat(2, 1fr); gap: .65rem; }
.category-definitions article { display: grid; gap: .25rem; padding: .8rem; border: 1px solid var(--line); border-radius: 8px; background: #0a1318; }
.category-definitions span { color: var(--muted); font-size: .84rem; }
.claims-title { margin-top: 1.5rem; }

/* Archives and settings */
.subpage { padding-bottom: 4rem; }
.subpage-header { padding: 1rem 0; border-bottom: 1px solid var(--line); background: rgb(8 13 17 / 88%); }
.subpage-header .shell { display: flex; gap: 1rem; align-items: center; justify-content: space-between; }
.subpage-brand { display: flex; align-items: center; gap: 1rem; }
.subpage-brand img { width: 150px; height: auto; }
.subpage-brand h1 { font-size: 1.5rem; margin: 0; }
.subpage-main { padding-top: 2.5rem; }
.tabs { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .5rem; margin-bottom: 1.3rem; }
.tab { white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; background: transparent; padding: .55rem .9rem; cursor: pointer; }
.tab.active { background: var(--green); color: #07110d; border-color: var(--green); }
.archive-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.archive-card { display: flex; flex-direction: column; height: 100%; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); cursor: pointer; text-align: left; padding: 0; }
.archive-card:hover { border-color: var(--green-dim); }
.archive-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; filter: saturate(.75); }
.archive-card-body { display: block; padding: 1rem; }
.archive-card-body strong, .archive-card-body small { display: block; }
.archive-card-body small { margin-top: .35rem; color: var(--green); font-size: .72rem; line-height: 1.4; }
.archive-card-body p { color: var(--muted); font-size: .86rem; margin-bottom: 0; }
.archive-modal-image { width: 100%; border-radius: 8px; margin-bottom: 1rem; }
.archive-modal-copy { display: grid; gap: .4rem; }
.archive-modal-copy p { margin: 0; }
.empty-state { grid-column: 1 / -1; padding: 3rem 1rem; text-align: center; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); }
.setting { display: grid; grid-template-columns: 1fr minmax(180px, .7fr); gap: 1rem; align-items: center; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }
input[type="range"] { width: 100%; accent-color: var(--green); }

/* Ending */
.choice-screen { min-height: 100svh; display: grid; place-items: center; padding: 2rem 0; }
.ending-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.5rem; }
.ending-card { text-align: left; padding: 1.2rem; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; }
.ending-card:hover { border-color: var(--green); transform: translateY(-2px); }
.ending-card p { color: var(--muted); }
.final-screen { display: grid; place-items: center; text-align: center; padding: 2rem 0; }
.final-screen .shell { max-width: 850px; }
.final-line { font-family: Georgia, serif; font-size: clamp(1.35rem, 3.4vw, 2.4rem); }
.final-common { margin-top: 2rem; color: #dce5e1; }
.consequence-screen .shell { max-width: 900px; }
.consequence-copy { display: grid; gap: .65rem; margin-bottom: 1.5rem; }
.consequence-copy p { margin: 0; font-size: 1.05rem; }

.toast-region { position: fixed; z-index: 900; right: 1rem; bottom: 1rem; display: grid; gap: .5rem; width: min(360px, calc(100% - 2rem)); }
.toast { padding: .85rem 1rem; border: 1px solid var(--green-dim); border-radius: 8px; background: #102019; color: #cef2df; box-shadow: var(--shadow); animation: toast-in .25s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 880px) {
  .menu-content { grid-template-columns: 1fr; gap: 1.2rem; }
  .menu-aside { justify-self: start; }
  .case-grid { grid-template-columns: 1fr; }
  .case-aside { position: static; }
  .archive-grid, .ending-choices { grid-template-columns: repeat(2, 1fr); }
  .game-header-inner { grid-template-columns: 1fr auto; }
  .chapter-label { display: none; }
  .meta-grid, .source-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .shell { width: min(100% - 1rem, 1180px); }
  .menu-screen::after { background: linear-gradient(0deg, rgb(8 13 17 / 98%) 0 58%, rgb(8 13 17 / 50%)); }
  .menu-content { align-self: end; padding-bottom: max(1rem, env(safe-area-inset-bottom)); }
  .menu-content { padding-bottom: 5rem; }
  .brand-logo { width: min(390px, 100%); }
  .prologue-shade { background: linear-gradient(0deg, rgb(3 7 10 / 92%) 0 55%, rgb(3 7 10 / 12%)); }
  .prologue-content { padding: 1rem; padding-bottom: max(1rem, env(safe-area-inset-bottom)); }
  .game-header-inner { min-height: 58px; }
  .mini-brand img { width: 122px; }
  .header-actions .label { display: none; }
  .case-panel { border-radius: 10px; }
  .binary-sequence { grid-template-columns: repeat(2, 1fr); }
  .binary-table { grid-template-columns: repeat(2, 1fr); }
  .select-row, .message-sort, .setting { grid-template-columns: 1fr; gap: .45rem; }
  .archive-grid, .ending-choices { grid-template-columns: 1fr; }
  .profile-grid, .category-definitions { grid-template-columns: 1fr; }
  .separator-pattern { grid-template-columns: repeat(7, auto); justify-content: start; overflow-x: auto; padding-bottom: .25rem; }
  .separator-pattern span { min-width: 70px; }
  .narrative-shade { background: linear-gradient(0deg, rgb(3 7 10 / 95%) 0 68%, rgb(3 7 10 / 28%)); }
  .narrative-panel { padding: 1rem; padding-bottom: max(1rem, env(safe-area-inset-bottom)); }
  .subpage-brand img { width: 110px; }
  .grid-map { grid-template-columns: repeat(5, min(15vw, 44px)); }
  .map-cell { width: min(15vw, 44px); height: min(15vw, 44px); }
  .cinematic-screen video { object-fit: contain; }
  .video-title { max-width: calc(100% - 7rem); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
