/* AutiSIM · China build: same as style.css, but only system fonts (no requests to Google Fonts) */
/* Autisim
   Layout: a graph-paper notebook. Body readout on the left, a live sensory waveform above every scene card.
   Calm, low-arousal palette by default; overload pushes noise, heat and chromatic fringing into the page. */
:root {
  --bg: #edf0eb;
  --grid: rgba(43, 70, 66, 0.07);
  --surface: #f8f8f4;
  --surface-2: #e4e8e2;
  --ink: #1c2326;
  --ink-2: #525d65;
  --ink-3: #858f97;
  --line: #d1d7d0;
  --au: #94640f;
  --au-2: #c6922c;
  --au-soft: #f0e1bc;
  --calm: #2b7770;
  --calm-soft: #d2e6e2;
  --warn: #b26e0c;
  --warn-soft: #f3e2c2;
  --heat: #c13f28;
  --heat-soft: #f5d5cd;
  --night: #4a6aa6;
  --c-jh: #bd4468;
  --c-wy: #4868a4;
  --c-mom: #9a6234;
  --c-zh: #2a7857;
  --c-cm: #8853a4;
  --c-np: #66707a;
  --c-me: #94640f;
  --shade: rgba(28, 38, 40, 0.16);
  --noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 1 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  --f-display: "Avenir Next", "Segoe UI Variable Display", "Segoe UI", "Helvetica Neue", "Songti SC", "STSong", "SimSun", "Source Han Serif SC", serif;
  --f-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", system-ui, sans-serif;
  --f-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "PingFang SC", "Microsoft YaHei", monospace;
  --fs: 16px;
  --r: 10px;
  --ov: 0;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111517; --grid: rgba(190, 215, 210, 0.045); --surface: #181d20; --surface-2: #222a2e; --ink: #e3e7e3; --ink-2: #a2acb1; --ink-3: #6e7980; --line: #2b3337;
    --au: #e2b252; --au-2: #d9a540; --au-soft: #3b2f15; --calm: #6db7ad; --calm-soft: #17302e; --warn: #e6a646; --warn-soft: #382a13; --heat: #ef6b51; --heat-soft: #3d1d16; --night: #8ea9df;
    --c-jh: #ec7d9c; --c-wy: #8ea9df; --c-mom: #d59d6c; --c-zh: #6cc39b; --c-cm: #c093dc; --c-np: #9aa3ad; --c-me: #e2b252; --shade: rgba(0, 0, 0, 0.45);
    --noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111517; --grid: rgba(190, 215, 210, 0.045); --surface: #181d20; --surface-2: #222a2e; --ink: #e3e7e3; --ink-2: #a2acb1; --ink-3: #6e7980; --line: #2b3337;
  --au: #e2b252; --au-2: #d9a540; --au-soft: #3b2f15; --calm: #6db7ad; --calm-soft: #17302e; --warn: #e6a646; --warn-soft: #382a13; --heat: #ef6b51; --heat-soft: #3d1d16; --night: #8ea9df;
  --c-jh: #ec7d9c; --c-wy: #8ea9df; --c-mom: #d59d6c; --c-zh: #6cc39b; --c-cm: #c093dc; --c-np: #9aa3ad; --c-me: #e2b252; --shade: rgba(0, 0, 0, 0.45);
  --noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  color-scheme: dark;
}
:root[data-size="s"] { --fs: 15px; }
:root[data-size="l"] { --fs: 18.5px; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: var(--fs); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: var(--f-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
button:focus-visible, input:focus-visible, .opt:focus-within { outline: 2px solid var(--au-2); outline-offset: 2px; }
.mono { font-family: var(--f-mono); }
.ic { width: 1.1rem; height: 1.1rem; flex: none; }

.app { position: relative; min-height: 100vh; }
.app:not([data-screen="game"]) .topbar,
.app:not([data-screen="game"]) .layout { display: none; }
.app[data-screen="game"] .front { display: none; }
.front { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* ---------------- top bar ---------------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.bar {
  max-width: 76rem; margin: 0 auto; display: flex; align-items: center; gap: .9rem; flex-wrap: wrap;
  padding-block: .55rem;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.brand { display: inline-flex; align-items: center; gap: .5rem; border: 0; background: transparent; cursor: pointer; padding: 0; }
.brand .word { font: 750 1.15rem/1 var(--f-display); letter-spacing: -.02em; color: var(--au); }
.brand .word span { color: var(--ink); }
.brand .word em { font-style: normal; color: var(--calm); }
.tile { display: inline-grid; grid-template-rows: auto 1fr; width: 2rem; height: 2.1rem; padding: .12rem .2rem; border: 1.5px solid var(--au); border-radius: 4px; color: var(--au); line-height: 1; text-align: left; }
.tile small { font: 500 .44rem/1 var(--f-mono); }
.tile b { font: 750 .92rem/1 var(--f-display); text-align: center; align-self: center; }
.tile em { font: .62rem/1 var(--f-mono); font-style: normal; text-align: center; }
.clock { display: flex; align-items: baseline; gap: .55rem; font-size: .88rem; color: var(--ink-2); min-width: 0; }
.clock b { color: var(--ink); font-weight: 700; white-space: nowrap; }
.clock span { white-space: nowrap; }
.clock .mono { font-size: .78rem; color: var(--ink-3); }
.chips-top { display: flex; gap: .4rem; flex-wrap: wrap; flex: 1; justify-content: flex-end; min-width: 0; }
.tchip { display: inline-flex; align-items: center; gap: .3rem; font: 500 .74rem/1 var(--f-mono); padding: .32rem .6rem; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.tchip .ic { width: .85rem; height: .85rem; }
.tchip.hot { color: var(--heat); background: var(--heat-soft); border-color: transparent; }
.tchip.calm { color: var(--calm); background: var(--calm-soft); border-color: transparent; }
.tools { display: flex; gap: .2rem; }
.tool { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .6rem; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--ink-2); font-size: .85rem; font-weight: 500; cursor: pointer; }
.tool:hover { background: var(--surface); border-color: var(--line); color: var(--ink); }
.only-narrow { display: none; }

.strip { display: none; gap: .35rem; max-width: 76rem; margin: 0 auto; padding-block: 0 .55rem; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); cursor: pointer; }
.mini { flex: 1; min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: .35rem; row-gap: .2rem; align-items: center; padding: .32rem .45rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.mini .ic { width: 1rem; height: 1rem; grid-row: span 2; }
.mini-bar { height: .3rem; background: var(--surface-2); border-radius: 9px; overflow: hidden; }
.mini-bar i { display: block; height: 100%; width: 0; background: var(--calm); transition: width .5s ease; }
.mini-val { font: .66rem/1 var(--f-mono); font-variant-numeric: tabular-nums; text-align: left; }

/* ---------------- layout ---------------- */
.layout {
  display: grid; grid-template-columns: 17rem minmax(0, 1fr); gap: 1.5rem;
  max-width: 76rem; margin: 0 auto; padding-block: 1.25rem 4rem;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.stage { min-width: 0; display: grid; gap: .9rem; align-content: start; }

/* ---------------- readout ---------------- */
.readout { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 4.4rem); align-self: start; display: grid; gap: 1.15rem; max-height: calc(100vh - 5.5rem); overflow: auto; padding-right: .2rem; }
.r-sec h3, .ending h3 { margin: 0 0 .55rem; font: 500 .7rem/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.meter { display: grid; gap: .28rem; margin-bottom: .6rem; }
.m-head { display: flex; align-items: center; gap: .45rem; font-size: .88rem; }
.m-head .ic { width: 1.05rem; height: 1.05rem; color: var(--ink-2); }
.m-nm { flex: 1; min-width: 0; }
.m-val { font: 500 .78rem var(--f-mono); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.m-bar { position: relative; height: .42rem; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.m-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: inherit; background: var(--calm); transition: width .6s cubic-bezier(.2, .7, .2, 1), background-color .4s; }
.meter.capped .m-bar::after { content: ""; position: absolute; top: 0; bottom: 0; left: var(--cap); right: 0; background: repeating-linear-gradient(45deg, transparent 0 3px, var(--line) 3px 5px); }
.meter.limited .m-bar::after { background: repeating-linear-gradient(45deg, transparent 0 3px, color-mix(in srgb, var(--heat) 45%, transparent) 3px 5px); }
.meter[data-lvl="warn"] .m-bar i, .mini[data-lvl="warn"] .mini-bar i { background: var(--warn); }
.meter[data-lvl="bad"] .m-bar i, .mini[data-lvl="bad"] .mini-bar i { background: var(--heat); }
.meter[data-lvl="gold"] .m-bar i, .mini[data-lvl="gold"] .mini-bar i { background: var(--au-2); }
.meter[data-lvl="bad"] .m-val, .mini[data-lvl="bad"] { color: var(--heat); }
.meter.small .m-bar { height: .3rem; }
.m-desc { display: none; margin: 0; font-size: .78rem; line-height: 1.5; color: var(--ink-3); }
.readout.in-modal { position: static; max-height: none; overflow: visible; }
.readout.in-modal .m-desc { display: block; }
.app.st-high .m-st .ic { color: var(--heat); animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.18); } }

.people { display: grid; gap: .2rem; }
.person { display: flex; gap: .6rem; align-items: flex-start; padding: .3rem 0; }
.avatar { width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; font-size: .8rem; color: var(--surface); background: var(--c, var(--c-np)); }
.person.unknown .avatar { background: var(--surface-2); color: var(--ink-3); }
.p-body { flex: 1; min-width: 0; }
.p-nm { font-size: .88rem; font-weight: 700; }
.p-nm small { font: 400 .72rem var(--f-mono); color: var(--ink-3); margin-left: .2rem; }
.p-state { font-size: .78rem; color: var(--ink-2); line-height: 1.4; }
.p-bar { height: 3px; margin-top: .3rem; border-radius: 9px; background: var(--surface-2); overflow: hidden; }
.p-bar i { display: block; height: 100%; width: 0; background: var(--c, var(--c-np)); transition: width .6s ease; }
.items { display: flex; flex-wrap: wrap; gap: .35rem; }
.item { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .55rem .25rem .4rem; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); font-size: .78rem; color: var(--ink-2); }
.item .ic { width: .95rem; height: .95rem; color: var(--au); }

.s-jh { --c: var(--c-jh); } .s-wy { --c: var(--c-wy); } .s-mom { --c: var(--c-mom); } .s-zh { --c: var(--c-zh); }
.s-cm { --c: var(--c-cm); } .s-np { --c: var(--c-np); } .s-me { --c: var(--c-me); }

/* ---------------- waveform strip ---------------- */
.wave { position: relative; height: 7.25rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; transition: border-color .4s; }
.wave canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.wave-label { position: absolute; inset: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: .65rem .85rem; pointer-events: none; }
.wl-place b { display: block; font: 650 1.05rem/1.25 var(--f-display); }
.wl-place span { font: .74rem var(--f-mono); color: var(--ink-3); letter-spacing: .03em; }
.wl-read { display: grid; justify-items: end; gap: .1rem; font-size: .74rem; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.wl-read .ic { width: .85rem; height: .85rem; vertical-align: -2px; }

/* ---------------- scene card ---------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1.4rem 1.5rem 1.3rem; box-shadow: 0 1px 0 var(--shade), 0 10px 28px -18px var(--shade); }
.sc-head { display: grid; gap: .35rem; margin-bottom: .95rem; }
.tag { font: 500 .7rem/1.2 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--au); }
.sc-head h2 { margin: 0; font: 650 1.45rem/1.25 var(--f-display); letter-spacing: -.01em; text-wrap: balance; }
.sc-text { display: grid; gap: .7rem; font-size: 1.04rem; line-height: 1.8; max-width: 42em; }
.sc-text p, .intro-text p, .e-text p { margin: 0; }
.sc-text > *, .intro-text > *, .e-text > * { animation: rise .45s ease both; animation-delay: var(--d, 0ms); }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } }
.thought { color: var(--ink-2); font-style: italic; padding-left: .8rem; border-left: 2px solid var(--line); }
.burst { font: 700 1.1rem/1.5 var(--f-display); color: var(--heat); letter-spacing: .02em; }
.say { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .65rem; align-items: baseline; }
.say .who { font-size: .76rem; font-weight: 700; white-space: nowrap; padding: .12rem .55rem; border-radius: 99px; color: var(--c); background: var(--surface-2); background: color-mix(in srgb, var(--c) 13%, transparent); }
.say.me .who { color: var(--surface); background: var(--c); }
.sc-text.prior { opacity: .6; font-size: .97rem; }
.sc-text.prior > * { animation: none; }
.chosen { display: flex; gap: .55rem; align-items: baseline; margin: 1rem 0 .2rem; padding: .6rem .85rem; border-radius: 8px; background: var(--au-soft); font-weight: 700; line-height: 1.5; }
.chosen span { color: var(--au); }
.sc-text.result { margin-top: .9rem; }
.card.overload { border-color: var(--heat); }

.deltas { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
.deltas.pre { margin: 0 0 .95rem; }
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .24rem .55rem .24rem .42rem; border-radius: 99px; font-size: .78rem; background: var(--surface-2); color: var(--ink-2); animation: rise .35s ease both; }
.chip .ic { width: .95rem; height: .95rem; }
.chip b { font: 500 .78rem var(--f-mono); font-variant-numeric: tabular-nums; }
.chip.t-good { background: var(--calm-soft); color: var(--calm); }
.chip.t-bad { background: var(--heat-soft); color: var(--heat); }
.chip.t-warn { background: var(--warn-soft); color: var(--warn); }
.mini-av { width: 1rem; height: 1rem; border-radius: 50%; display: grid; place-items: center; font-size: .58rem; font-weight: 700; color: var(--surface); background: var(--c); }

.choices { list-style: none; margin: 1.3rem 0 0; padding: 0; display: grid; gap: .55rem; }
.choice { width: 100%; text-align: left; display: grid; grid-template-columns: 1.9rem minmax(0, 1fr); gap: .75rem; align-items: start; padding: .8rem .95rem; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; transition: border-color .15s, background-color .15s, transform .15s; }
.choice:hover { border-color: var(--au-2); background: var(--surface); }
.choice:active { transform: translateY(1px); }
.choice .key { width: 1.9rem; height: 1.9rem; border-radius: 6px; display: grid; place-items: center; font: 500 .85rem var(--f-mono); color: var(--au); background: var(--au-soft); }
.choice .key .ic { width: 1rem; height: 1rem; }
.c-body { display: grid; gap: .25rem; min-width: 0; }
.c-t { font-weight: 700; line-height: 1.45; }
.c-d { font-size: .86rem; color: var(--ink-2); line-height: 1.5; }
.c-lock { font-size: .8rem; color: var(--ink-3); line-height: 1.5; }
.choice.locked { cursor: not-allowed; background: transparent; border-style: dashed; }
.choice.locked .c-t { color: var(--ink-3); }
.choice.locked .key { background: var(--surface-2); color: var(--ink-3); }
.choice.locked:hover { border-color: var(--line); }
.choice.nudge { animation: nudge .3s; }
@keyframes nudge { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
/* the missing path: visible, never reachable */
.choice.nt { background: transparent; border-style: dashed; cursor: help; }
.choice.nt:hover { border-color: var(--ink-3); background: transparent; }
.choice.nt .key { background: transparent; border: 1px dashed var(--ink-3); color: var(--ink-3); }
.nt-tag { font: 500 .64rem/1.2 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.choice.nt .c-t { color: var(--ink-3); filter: blur(.4px); transition: filter .4s, letter-spacing .4s; }
.choice.nt:hover .c-t { filter: blur(1px); letter-spacing: .06em; }
.nt-w { display: inline-block; transition: transform .55s cubic-bezier(.2, .8, .2, 1), opacity .55s; }
.choice.nt.trying .nt-w { transform: translate(var(--dx), var(--dy)) rotate(var(--r)); opacity: .18; }
.nt-fail { display: grid; gap: .3rem; }
.nt-fail:empty { display: none; }
.nt-line { font-size: .88rem; line-height: 1.6; color: var(--ink-2); font-style: italic; padding-left: .7rem; border-left: 2px solid var(--line); }
.nt-note { font-size: .78rem; color: var(--ink-3); line-height: 1.5; }
.deltas.nt-cost { margin-top: .1rem; }
.choice.bo-locked { border-color: color-mix(in srgb, var(--heat) 35%, var(--line)); }
.choice.bo-locked .key { color: var(--heat); background: var(--heat-soft); }
.choice.bo-locked .c-lock b { display: block; font: 500 .64rem/1.4 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--heat); }
.choice.bo-locked .c-t { text-decoration: line-through; text-decoration-color: var(--ink-3); }
.friendly .choice.nt .c-t, .friendly .choice.nt:hover .c-t { filter: none; letter-spacing: 0; }
.friendly .choice.nt.trying .nt-w { transform: none; opacity: .35; }
.meter.fresh { animation: fresh 1.6s ease; }
@keyframes fresh { 0% { background: var(--au-soft); box-shadow: 0 0 0 6px var(--au-soft); border-radius: 8px; } 100% { background: transparent; box-shadow: 0 0 0 0 transparent; } }
.item.wish { border-color: var(--au-2); }
.item.wish b { font: 500 .72rem var(--f-mono); color: var(--au); }
.calm-tool[aria-pressed="true"] { color: var(--calm); background: var(--calm-soft); border-color: transparent; }
.snd-tool[aria-pressed="true"] { color: var(--calm); background: var(--calm-soft); border-color: transparent; }
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 20px); z-index: 120; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: .6rem 1rem; border-radius: 99px; background: var(--ink); color: var(--bg); font: 600 .85rem var(--f-body); box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .4); transition: opacity .3s, transform .3s; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.tile.big { cursor: pointer; }
.tile.big.tap { animation: tap .35s ease; }
@keyframes tap { 50% { transform: scale(1.08) rotate(-3deg); } }
.title-screen.golden .wordmark span { color: var(--au); animation-duration: .6s; }
.egg-line { margin: -.6rem 0 0; font: 600 1rem var(--f-display); color: var(--au); }
.egg-count { display: flex; align-items: center; gap: .4rem; }
.egg-count .ic { color: var(--au); }
.create .set-row { margin-top: .2rem; }
.obs { display: grid; gap: .15rem; margin: .8rem 0 0; padding: .55rem .75rem; border-radius: 8px; background: var(--surface-2); font-size: .9rem; line-height: 1.6; color: var(--ink-2); font-style: italic; }
.obs span { font: 500 .64rem/1.3 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; font-style: normal; color: var(--night); }
.e-sub { margin: -.4rem 0 0; font: 600 1.15rem/1.5 var(--f-display); color: var(--calm); text-wrap: balance; }
.gains { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.gains li { display: flex; gap: .55rem; align-items: flex-start; line-height: 1.55; }
.gains .ic { color: var(--calm); margin-top: .2rem; }
.t-row { flex-wrap: wrap; }
.t-row .btn { min-width: 5rem; }
.runs { display: grid; gap: .6rem; }
.run { border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.run summary { display: flex; gap: .8rem; align-items: center; padding: .75rem .9rem; cursor: pointer; list-style: none; }
.run summary::-webkit-details-marker { display: none; }
.run-em { width: 2.4rem; height: 2.4rem; flex: none; color: var(--au); }
.run-main { display: grid; gap: .1rem; min-width: 0; }
.run-main small { color: var(--ink-3); font-size: .78rem; }
.run-main .run-sub { color: var(--calm); }
.run .gains { padding: 0 .9rem .6rem; font-size: .88rem; }
.run-days { display: grid; gap: .7rem; padding: .2rem .9rem .9rem; border-top: 1px dashed var(--line); }
.run-days h4 { margin: .6rem 0 .2rem; font: 650 .85rem var(--f-display); }
.run-days ul { margin: 0; padding-left: 1rem; color: var(--ink-2); font-size: .88rem; display: grid; gap: .15rem; }
.card { position: relative; }
.peek { position: absolute; top: .85rem; right: .9rem; display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .55rem; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--ink-3); font-size: .74rem; font-weight: 600; cursor: pointer; z-index: 1; }
.peek:hover { color: var(--ink); border-color: var(--ink-3); }
.peek .ic { width: .9rem; height: .9rem; }
.card > .peek + .sc-head { padding-right: 5.5rem; }
.log { display: grid; gap: .9rem; }
.log-e { display: grid; gap: .55rem; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.log-e h4 { margin: 0; font: 650 1rem/1.3 var(--f-display); }
.log-when { font: 500 .66rem/1.2 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--au); }
.log-e .sc-text { font-size: .95rem; line-height: 1.7; }
.log-e .sc-text > *, .log-e .chip { animation: none; }
.log-e .chosen { margin: .1rem 0 0; }
.log-e .deltas { margin-top: .2rem; }
.log-e.is-night { border-top: 3px solid var(--night); }
.log-e.is-crisis { border-color: var(--heat); }
.log-diary { margin: 0; padding-left: 1.1rem; color: var(--ink-2); display: grid; gap: .2rem; }
.hints { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .15rem; }
.hint { font: .7rem/1.4 var(--f-mono); padding: .06rem .4rem; border-radius: 5px; background: var(--surface-2); color: var(--ink-2); }
.hint.t-good { color: var(--calm); background: var(--calm-soft); }
.hint.t-bad { color: var(--heat); background: var(--heat-soft); }
.hint.t-warn { color: var(--warn); background: var(--warn-soft); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .72rem 1.2rem; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: .95rem; line-height: 1.3; cursor: pointer; text-align: center; }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn.ghost { background: transparent; }
.btn.small { padding: .35rem .7rem; font-size: .85rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn kbd { font: .7rem var(--f-mono); opacity: .6; }
.btn .ic { width: 1.05rem; height: 1.05rem; }
.sc-actions { display: flex; justify-content: flex-end; margin-top: 1.2rem; }

/* phone */
.phone { display: grid; gap: .45rem; max-width: 27rem; padding: .5rem .75rem .85rem; border: 1px solid var(--line); border-radius: 20px; background: var(--bg); }
.ph-head { display: flex; align-items: center; gap: .45rem; padding: .35rem .2rem .5rem; border-bottom: 1px solid var(--line); font-size: .8rem; font-weight: 700; color: var(--ink-2); }
.ph-dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--calm); }
.ph-sys { font-size: .78rem; color: var(--ink-3); text-align: center; line-height: 1.5; }
.bub { justify-self: start; max-width: 88%; display: grid; gap: .1rem; padding: .42rem .75rem; border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; background: var(--surface); font-size: .95rem; line-height: 1.5; }
.bub .who { font-size: .7rem; font-weight: 700; color: var(--c); }
.bub.me { justify-self: end; background: var(--calm-soft); border-color: transparent; border-radius: 14px 14px 4px 14px; }

/* night */
.kind-night { border-top: 3px solid var(--night); }
.kind-night .tag { color: var(--night); }
.diary { list-style: none; margin: 0; padding: 0; line-height: 2rem; background-image: repeating-linear-gradient(transparent 0 calc(2rem - 1px), var(--line) calc(2rem - 1px) 2rem); }
.diary li { position: relative; padding-left: 1.4rem; }
.diary li::before { content: "—"; position: absolute; left: 0; color: var(--au); }
.diary li.quiet, .quiet { color: var(--ink-3); }
.mask-cost, .warn, .tomorrow { display: flex; gap: .5rem; align-items: center; margin: .9rem 0 0; font-size: .9rem; color: var(--ink-2); }
.bo-why { display: flex; flex-wrap: wrap; gap: .35rem .45rem; align-items: center; margin: .6rem 0 0; font-size: .9rem; color: var(--ink-2); }
.bo-why b { font-weight: 600; margin-right: .2rem; }
.bo-why small { font-size: .78rem; color: var(--ink-3); }
.bo-note { margin: .55rem 0 0; font-size: .86rem; line-height: 1.55; color: var(--ink-2); padding-left: .7rem; border-left: 2px solid var(--line); }
.warn { color: var(--heat); font-weight: 700; }
.tomorrow { font-family: var(--f-mono); font-size: .8rem; color: var(--ink-3); }
.sleep { display: flex; align-items: center; gap: .6rem; margin-top: .9rem; font-size: .9rem; }
.sleep .ic { color: var(--night); }
.sleep-bar { flex: 1; max-width: 12rem; height: .42rem; border-radius: 9px; background: var(--surface-2); overflow: hidden; }
.sleep-bar i { display: block; height: 100%; background: var(--night); }
.overnight { margin-top: 1rem; }
.overnight .tag { color: var(--ink-3); }
.overnight .deltas { margin-top: .45rem; }

/* crisis */
.app.crisis-meltdown .wave { border-color: var(--heat); }
.card.crisis-meltdown { border-color: var(--heat); background: linear-gradient(180deg, var(--heat-soft), var(--surface) 12rem); }
.card.crisis-meltdown .tag { color: var(--heat); }
html:not(.friendly) .card.crisis-meltdown .crisis-text p:first-child { animation: shudder .5s ease 2, rise .45s ease both; font: 700 1.3rem/1.4 var(--f-display); }
@keyframes shudder { 20% { transform: translateX(-2px); } 40% { transform: translateX(2px); } 60% { transform: translateX(-1px); } 80% { transform: translateX(1px); } }
.app.crisis-shutdown .layout { filter: grayscale(.9) contrast(.88); transition: filter 1.4s ease; }
.card.crisis-shutdown .tag { color: var(--ink-3); }
.card.crisis-shutdown .crisis-text > * { animation-duration: 1.6s; animation-delay: calc(var(--d, 0ms) * 4); }
.breathe { display: flex; align-items: center; gap: 1.25rem; margin: 1.4rem 0 .4rem; }
.b-ring { width: 5.5rem; height: 5.5rem; border-radius: 50%; border: 1px dashed var(--line); display: grid; place-items: center; flex: none; }
.b-circle { width: 100%; height: 100%; border-radius: 50%; background: var(--calm-soft); border: 2px solid var(--calm); transform: scale(.55); animation: breathe 12s ease-in-out infinite; }
@keyframes breathe { 0% { transform: scale(.55); } 33% { transform: scale(1); } 50% { transform: scale(1); } 100% { transform: scale(.55); } }
.b-labels { position: relative; height: 1.7rem; min-width: 7rem; font: 650 1.1rem var(--f-display); color: var(--calm); }
.b-labels span { position: absolute; left: 0; top: 0; opacity: 0; animation: 12s linear infinite; }
.b-in { animation-name: lblIn !important; }
.b-hold { animation-name: lblHold !important; }
.b-out { animation-name: lblOut !important; }
@keyframes lblIn { 0%, 31% { opacity: 1; } 33%, 100% { opacity: 0; } }
@keyframes lblHold { 0%, 32% { opacity: 0; } 34%, 48% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes lblOut { 0%, 49% { opacity: 0; } 51%, 97% { opacity: 1; } 100% { opacity: 0; } }
.b-hint { margin: 0; font-size: .82rem; color: var(--ink-3); }
.reboot { display: flex; gap: .45rem; margin: 1.3rem 0 .2rem; }
.reboot span { width: .55rem; height: .55rem; border-radius: 50%; background: var(--ink-3); opacity: .2; animation: boot 2.4s ease-in-out infinite; }
.reboot span:nth-child(2) { animation-delay: .8s; }
.reboot span:nth-child(3) { animation-delay: 1.6s; }
@keyframes boot { 30% { opacity: .9; } 60% { opacity: .2; } }
.battery { position: relative; width: 4.6rem; height: 2rem; margin: 0 0 1rem; border: 2px solid var(--ink-2); border-radius: 6px; display: grid; place-items: center; }
.battery::after { content: ""; position: absolute; right: -6px; top: 50%; width: 4px; height: .8rem; transform: translateY(-50%); background: var(--ink-2); border-radius: 0 2px 2px 0; }
.battery i { position: absolute; left: 3px; top: 3px; bottom: 3px; width: max(5%, calc((100% - 6px) * var(--lvl, 3) / 100)); border-radius: 2px; background: var(--calm); }
.battery.mid i { background: var(--warn); }
.battery.low i { background: var(--heat); }
.battery.draining i { animation: drain 2.6s ease-out both; }
@keyframes drain { from { width: calc(100% - 6px); background: var(--calm); } 60% { background: var(--warn); } }
@media (prefers-reduced-motion: reduce) { .battery.draining i { animation: none; } }
.battery span { position: relative; font: 500 .72rem var(--f-mono); color: var(--ink); }
/* burnout scenes: a bigger battery, with each choice's cost (striped) or gain previewed on hover / focus */
.kind-burnout .battery, .battery.moving { width: 8.5rem; height: 2.4rem; }
.battery i { transition: width .45s ease, background-color .3s; }
.battery em { position: absolute; top: 3px; bottom: 3px; left: calc(3px + (100% - 6px) * var(--a, 0) / 100); width: calc((100% - 6px) * var(--w, 0) / 100); border-radius: 2px; opacity: 0; transition: opacity .2s; }
.battery.pv-cost i { width: max(2%, calc((100% - 6px) * var(--to, 1) / 100)); }
.battery.pv-cost em { min-width: 7px; opacity: 1; background: repeating-linear-gradient(-45deg, var(--heat) 0 3px, transparent 3px 6px); animation: pvblink .9s ease-in-out infinite alternate; }
.battery.pv-gain em { opacity: .5; background: var(--calm); }
@keyframes pvblink { from { opacity: 1; } to { opacity: .35; } }
.battery.moving i { transition: width 1.4s ease, background-color .6s; }
@media (prefers-reduced-motion: reduce) { .battery i, .battery.moving i { transition: none; } .battery.pv-cost em { animation: none; } }
.en-tag { display: inline-flex; justify-self: start; align-items: center; gap: .25rem; font: 500 .75rem var(--f-mono); }
.en-tag .ic { width: .95rem; height: .95rem; }
.en-tag.t-bad { color: var(--heat); } .en-tag.t-good { color: var(--calm); }

/* overload: grain, heat vignette, chromatic fringing on text */
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
.fx-noise { background-image: var(--noise); opacity: calc(var(--ov) * .2); }
.fx-vignette { background: radial-gradient(ellipse at center, transparent 50%, var(--heat) 140%); opacity: calc(var(--ov) * .55); }
.app:not([data-screen="game"]) .fx { display: none; }
.app.ov-high .fx-noise { animation: grain .3s steps(3) infinite; }
@keyframes grain { 33% { background-position: 37px 61px; } 66% { background-position: -53px 19px; } }
.app.ov-high:not(.crisis) .sc-text:not(.prior) { text-shadow: .7px 0 color-mix(in srgb, var(--heat) 50%, transparent), -.7px 0 color-mix(in srgb, var(--calm) 40%, transparent); }
.app.ov-high:not(.crisis) .wave { border-color: var(--heat); }
.friendly .fx { display: none; }
.friendly .app.ov-high .sc-text { text-shadow: none; }
.friendly .wordmark span { animation-duration: 8s; }

/* ---------------- title ---------------- */
.title-screen { max-width: 48rem; margin: 0 auto; min-height: 100vh; display: grid; align-content: center; justify-items: center; gap: 1.3rem; padding-block: 2rem 2.5rem; text-align: center; }
.t-top { justify-self: end; }
.t-mark { display: flex; align-items: center; gap: 1.1rem; }
.tile.big { width: 5.4rem; height: 6.1rem; padding: .35rem .45rem .3rem; border-width: 2px; border-radius: 6px; grid-template-rows: auto 1fr auto; }
.tile.big small { font-size: .78rem; }
.tile.big b { font-size: 2.5rem; }
.tile.big em { font-size: .66rem; }
.wordmark { display: flex; margin: 0; font: 800 clamp(3rem, 12vw, 6.3rem)/1 var(--f-display); letter-spacing: -.035em; }
.wordmark span { display: inline-block; transform-origin: 50% 85%; animation: rock 3.6s ease-in-out infinite; animation-delay: calc(var(--i) * .18s); }
.wordmark span.au { color: var(--au); }
.wordmark span.sim { color: var(--calm); }
.subtitle { margin: -.4rem 0 0; font: 500 .9rem/1.3 var(--f-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2); text-wrap: balance; }
.wordmark:hover span { animation-duration: .7s; }
@keyframes rock { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-.05em) rotate(-2.5deg); } }
.tagline { margin: 0; max-width: 30em; font-size: 1.1rem; color: var(--ink-2); text-wrap: balance; }
.t-wave { width: min(100%, 40rem); height: 5.5rem; }
.t-wave canvas { width: 100%; height: 100%; display: block; }
.t-actions { display: grid; gap: .6rem; width: min(100%, 23rem); }
.t-actions > .btn { width: 100%; flex-direction: column; gap: .1rem; }
.t-actions .btn small { font-weight: 400; font-size: .76rem; opacity: .75; }
.t-row { display: flex; gap: .45rem; }
.t-row .btn { flex: 1 1 auto; padding-inline: .5rem; font-size: .86rem; } /* sized to the label, so long words (Einstellungen, Воспоминания) wrap to a second row instead of spilling out */
.t-row { display: grid; grid-template-columns: 1fr 1fr; } /* a tidy 2 × 2 at every width: long labels (Einstellungen, このゲームについて) never spill or leave one button alone */
.t-note { max-width: 36em; margin: .4rem auto 0; font-size: .8rem; line-height: 1.6; color: var(--ink-3); }
.seg { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.seg button { border: 0; padding: .36rem .72rem; border-radius: 6px; background: transparent; color: var(--ink-2); font-size: .85rem; font-weight: 600; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* ---------------- create / intro / ending ---------------- */
.create, .intro, .ending { max-width: 46rem; margin: 0 auto; display: grid; gap: 1.2rem; padding-block: 1.5rem 4rem; }
.create h2, .intro h2 { margin: 0; font: 700 clamp(1.7rem, 5vw, 2.3rem)/1.15 var(--f-display); letter-spacing: -.015em; }
.sub { margin: -.6rem 0 0; color: var(--ink-2); }
.m-sub { margin: 0; color: var(--ink-2); font-size: .92rem; }
.field { display: grid; gap: .45rem; max-width: 22rem; }
.field label { font: 650 1.1rem var(--f-display); }
.field input { width: 100%; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font: inherit; font-size: 1.05rem; }
fieldset { margin: 0; padding: 0; border: 0; display: grid; gap: .5rem; min-width: 0; }
legend { padding: 0; font: 650 1.1rem var(--f-display); }
.fs-hint { margin: 0; font-size: .88rem; color: var(--ink-2); }
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); gap: .55rem; }
.opt { position: relative; display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); column-gap: .65rem; row-gap: .15rem; padding: .75rem .85rem; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); cursor: pointer; transition: border-color .15s, background-color .15s; }
.opt:hover { border-color: var(--ink-3); }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.opt .ic { width: 1.55rem; height: 1.55rem; grid-row: span 2; color: var(--ink-2); }
.o-t { font-weight: 700; line-height: 1.35; }
.o-d { font-size: .8rem; line-height: 1.45; color: var(--ink-2); }
.opt.on { border-color: var(--au-2); background: var(--au-soft); }
.opt.on .ic { color: var(--au); }
.c-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: flex-end; }
.c-need { font-size: .85rem; color: var(--heat); }

.intro { min-height: 82vh; align-content: center; }
.intro .t-top { justify-self: end; }
.intro-text { display: grid; gap: .95rem; font-size: 1.2rem; line-height: 1.9; }
.intro-text .burst { font-size: 1.35rem; color: var(--au); }
.howto { display: grid; gap: .55rem; font-size: 1rem; line-height: 1.75; }
.howto p { margin: 0; }
.how-stats { display: flex; flex-wrap: wrap; gap: .45rem; }
.hs { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .65rem; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); font-size: .85rem; }
.hs .ic { color: var(--au); }
.dots { display: flex; gap: .4rem; justify-content: center; }
.dots i { width: .45rem; height: .45rem; border-radius: 99px; background: var(--line); transition: width .3s; }
.dots i.on { width: 1.3rem; background: var(--au-2); }

.e-emblem { width: 5rem; height: 5rem; color: var(--au); }
.emblem { width: 100%; height: 100%; }
.ending h1 { margin: 0; font: 800 clamp(2.2rem, 7vw, 3.5rem)/1.05 var(--f-display); letter-spacing: -.02em; text-wrap: balance; }
.e-text { display: grid; gap: .85rem; font-size: 1.1rem; line-height: 1.9; max-width: 40em; }
.ending h3 { margin-top: .8rem; margin-bottom: 0; }
.epi { margin: 0; padding-left: 1.1rem; display: grid; gap: .45rem; color: var(--ink-2); }
.recap { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .5rem; margin: 0; }
.recap div { padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.recap div:last-child { grid-column: 1 / -1; }
.recap dt { font: .68rem/1.3 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.recap dd { margin: .2rem 0 0; font: 650 1.15rem/1.3 var(--f-display); font-variant-numeric: tabular-nums; }
.recap div:last-child dd { font: 600 .95rem/1.5 var(--f-body); }
.found { margin: 0; font: .8rem var(--f-mono); color: var(--au); }

/* ---------------- modal ---------------- */
.modal-root { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.m-back { position: absolute; inset: 0; background: rgba(12, 18, 20, .46); }
.m-panel { position: relative; width: min(100%, 34rem); max-height: min(88vh, 50rem); overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .5); }
.m-panel.wide { width: min(100%, 48rem); }
.m-panel > header { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.2rem .85rem; border-bottom: 1px solid var(--line); background: var(--surface); }
.m-panel > header h2 { margin: 0; font: 650 1.2rem var(--f-display); }
.m-body { display: grid; gap: .95rem; padding: 1rem 1.2rem 1.3rem; }
.icon-btn { width: 2.2rem; height: 2.2rem; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: transparent; cursor: pointer; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: .8rem 1rem; flex-wrap: wrap; }
.set-row small { display: block; font-size: .8rem; color: var(--ink-3); line-height: 1.45; }
.set-row.tall > div { flex: 1; min-width: 12rem; }
.set-row.tall > .snd-pick { flex: 0 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; }
.snd-pick .snd-d { max-width: 17rem; text-align: right; }
.snd-pick .snd-warn { max-width: 17rem; text-align: right; color: var(--heat); }
@media (max-width: 560px) { .set-row.tall > .snd-pick { align-items: flex-start; } .snd-pick .snd-d, .snd-pick .snd-warn { text-align: left; } }
.set-row input[type="range"] { flex: 1; max-width: 14rem; accent-color: var(--calm); }
.set-row.danger { justify-content: flex-start; padding-top: .8rem; border-top: 1px solid var(--line); }
.switch { position: relative; width: 2.7rem; height: 1.55rem; flex: none; border: 1px solid var(--line); border-radius: 99px; background: var(--surface-2); cursor: pointer; transition: background-color .2s; }
.switch span { position: absolute; top: 2px; left: 2px; width: calc(1.55rem - 6px); height: calc(1.55rem - 6px); border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch[aria-checked="true"] { background: var(--calm); border-color: var(--calm); }
.switch[aria-checked="true"] span { transform: translateX(1.15rem); }
.confirm { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0; font-size: .9rem; }
.journal { display: grid; gap: 1rem; }
.journal article { padding: .1rem 0 .1rem .9rem; border-left: 2px solid var(--au-soft); }
.journal h3 { margin: 0 0 .3rem; font: 650 .95rem var(--f-display); }
.journal ul { margin: 0; padding-left: 1rem; color: var(--ink-2); display: grid; gap: .2rem; }
.j-meta { display: flex; gap: .4rem; align-items: center; margin: .35rem 0 0; font-size: .8rem; color: var(--ink-3); }
.j-meta .ic { width: .95rem; height: .95rem; }
.gloss { display: grid; gap: .85rem; margin: 0; }
.gloss dt { font-weight: 700; }
.gloss dd { margin: .2rem 0 0; font-size: .92rem; color: var(--ink-2); line-height: 1.65; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: .6rem; }
.g-card { display: grid; gap: .35rem; justify-items: start; align-content: start; padding: .9rem; border: 1px dashed var(--line); border-radius: 10px; color: var(--ink-3); }
.g-card .emblem { width: 2.6rem; height: 2.6rem; color: var(--au); }
.g-card .g-lock { width: 1.4rem; height: 1.4rem; }
.g-card.got { border-style: solid; background: var(--bg); color: var(--ink); }
.g-card small { font-size: .78rem; line-height: 1.5; }
.about p { margin: 0 0 .7rem; line-height: 1.75; }
.about .credit { margin-top: 1.2rem; padding-top: .8rem; border-top: 1px solid var(--line); font-size: .82em; color: var(--ink-2); }
.about .credit a { color: inherit; }
.about .credit-list { margin: .3rem 0 0; padding-left: 1.1rem; font-size: .8em; color: var(--ink-2); line-height: 1.7; }
.about .credit-list a { color: inherit; }

/* ---------------- narrow screens ---------------- */
@media (max-width: 880px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding-top: .9rem; }
  .layout > .readout { display: none; }
  .strip { display: flex; }
  .tool span { display: none; }
  .only-narrow { display: inline-flex; }
  .chips-top { order: 3; flex-basis: 100%; justify-content: flex-start; }
  .chips-top:empty { display: none; }
  .bar { row-gap: .45rem; }
  .tools { margin-left: auto; }
}
@media (max-width: 560px) {
  html { font-size: calc(var(--fs) * .97); }
  .card { padding: 1.1rem 1rem 1rem; }
  .sc-head h2 { font-size: 1.25rem; }
  .sc-text { font-size: 1rem; line-height: 1.75; }
  .wave { height: 6rem; }
  .clock .mono { display: none; }
  .brand .word { display: none; }
  .bar { gap: .55rem; padding-block: .45rem; }
  .clock { flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.3; }
  .clock span { font-size: .78rem; }
  .tool { padding: .38rem .42rem; }
  .strip { gap: .28rem; }
  .mini { padding: .28rem .35rem; }
  .say { grid-template-columns: minmax(0, 1fr); gap: .2rem; }
  .say .who { justify-self: start; }
  .choice { grid-template-columns: 1.6rem minmax(0, 1fr); gap: .6rem; padding: .7rem .75rem; }
  .choice .key { width: 1.6rem; height: 1.6rem; }
  .t-mark { gap: .7rem; }
  .tile.big { width: 4.2rem; height: 4.8rem; }
  .tile.big b { font-size: 1.9rem; }
  .breathe { gap: .9rem; }
  .b-ring { width: 4.5rem; height: 4.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .wordmark span, .b-circle, .reboot span { animation: none !important; }
  .choice.nt .c-t { filter: none; }
  .choice.nt.trying .nt-w { transform: none; }
  .b-circle { transform: scale(.8); }
  .b-labels span { animation: none !important; opacity: 0; }
  .b-labels .b-in { opacity: 1; }
}

/* special ending: speaking up */
.g-card.special { border-color: var(--au); }
.g-card.special.got { box-shadow: inset 0 0 0 1px var(--au); }
.author-card { display: grid; gap: .8rem; }
.author-card p { margin: 0; line-height: 1.85; }
.author-card .tag { justify-self: start; }
.author-card .ac-reveal { margin-top: .4rem; font: 700 1.2rem/1.6 var(--f-display); color: var(--au); text-wrap: balance; }
.author-card .ac-foot { font-size: .85rem; color: var(--ink-3); }
.author-card .btn { justify-self: start; margin-top: .4rem; }

/* an option that takes a few tries to find */
.stuck-tag { font: 500 .64rem/1.2 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.choice.stuck .c-t { color: var(--ink-3); filter: blur(.6px); transition: filter .5s, color .5s; }
.choice.stuck[data-try="1"] .c-t { filter: blur(.4px); }
.choice.stuck[data-try="2"] .c-t { filter: blur(.2px); color: var(--ink-2); }
.choice.stuck.ready .c-t { filter: none; color: var(--ink); }
.choice.stuck.ready .stuck-tag { color: var(--au); }
.stuck-line { display: grid; gap: .3rem; font-size: .88rem; color: var(--ink-2); }
.stuck-line:empty { display: none; }

/* easter eggs in the gallery, and the card about the scattered words */
.egg-head { margin: 1.2rem 0 .2rem; font: 500 .7rem/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.g-card.egg .egg-ic { width: 1.6rem; height: 1.6rem; color: var(--au); }
.g-card.egg.got b { color: var(--au); }
.nt-card .ac-reveal { color: var(--ink); }
.nt-card .ac-reveal.drift .nt-w { transform: translate(var(--dx), var(--dy)) rotate(var(--r)); opacity: .25; }

/* the Au egg: a gold infinity, drawn in one stroke */
.gold-inf { width: min(9rem, 40vw); margin: -.4rem auto -.2rem; }
.gold-inf svg { display: block; width: 100%; height: auto; overflow: visible; }
.gold-inf path { fill: none; stroke: url(#goldGrad); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: infDraw 1.8s cubic-bezier(.45, .05, .25, 1) forwards, infGlow 3s ease-in-out 1.8s infinite; filter: drop-shadow(0 2px 6px rgba(212, 160, 23, .35)); }
@keyframes infDraw { to { stroke-dashoffset: 0; } }
@keyframes infGlow { 50% { filter: drop-shadow(0 2px 12px rgba(246, 215, 122, .65)); } }
.friendly .gold-inf path { animation: infDraw 2.6s ease forwards; }
@media (prefers-reduced-motion: reduce) { .gold-inf path { animation: none; stroke-dashoffset: 0; } }

/* language menu */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lang-pick { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .65rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); }
.lang-pick .ic { width: 1rem; height: 1rem; flex: none; }
.lang-pick select { appearance: none; -webkit-appearance: none; background: transparent; border: 0; font: 500 .88rem/1.2 var(--f-body); color: var(--ink); padding: 0 .15rem; cursor: pointer; }
.lang-pick select:focus-visible { outline: 2px solid var(--au); outline-offset: 3px; border-radius: 4px; }
.lang-pick option { color: #1b1f22; }
/* fonts for scripts the Latin display fonts don't cover */
:root[lang="ja"] { --f-body: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, system-ui, sans-serif; --f-display: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif; }
:root[lang="ko"] { --f-body: "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif; --f-display: "AppleMyungjo", "Noto Serif KR", "Batang", serif; }
:root[lang="ru"] { --f-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; --f-display: Georgia, "Times New Roman", serif; }

/* words lost in the noise (loud place, high sensory load); hover or tap the line to read them */
.say.noisy .muf { opacity: .16; filter: blur(2.2px); transition: opacity .35s, filter .35s; }
.say.noisy:hover .muf, .say.noisy:focus .muf { opacity: 1; filter: none; }
.say.noisy:focus { outline: none; }
.say.noisy:focus-visible { outline: 2px solid var(--calm); outline-offset: 2px; }

/* author */
.t-by { margin: .6rem 0 0; font: 500 .78rem var(--f-mono); letter-spacing: .04em; color: var(--ink-3); text-align: center; }
.about .by { margin-top: 1rem; font: 600 .9rem var(--f-mono); color: var(--ink); }
