@font-face {
  font-family: CreaturePixel;
  src: url('assets/Galmuri9.woff2') format('woff2');
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}
:root {
  --ui-ink: #0b1418;
  --ui-panel: #17292c;
  --ui-edge: #607e7b;
  --ui-light: #a4beb1;
  --ui-text: #edf0dc;
  --ui-muted: #b5c6b9;
  --ui-accent: #efbd78;
  --ui-focus: #f8d58c;
}
body, button, input, select {
  font-family: CreaturePixel, system-korean, monospace;
  font-weight: 400;
  font-synthesis: none;
  letter-spacing: 0;
}
body { font-size: 20px; color: var(--ui-text); }
button, input, select { -webkit-tap-highlight-color: transparent; }
button, input, .select-card, .swatch, .brand-mark, .bottom-hud, .track, .pause-panel, #toast { border-radius: 0 !important; }
button, .button, .select-card, .meter .fill, #toast { transition: none; }
h1, h2, .identity strong, .wordmark, .button { font-weight: 400; }
h1 { font-size: 40px; line-height: 1.15; }
h2 { font-size: 30px; line-height: 1.2; }
p { color: var(--ui-muted); line-height: 1.4; }
.eyebrow { font-size: 10px; color: #d0c496; line-height: 1.6; }
.topbar { height: 88px; padding: 20px 4%; }
.wordmark { gap: 12px; font-size: 20px; }
.wordmark small { font-size: 10px; color: var(--ui-muted); margin-top: 2px; }
.brand-mark { width: 36px; height: 36px; background: #233c35; border: 2px solid var(--ui-ink); box-shadow: inset 2px 2px #9ebc9b,inset -2px -2px #42634e,2px 2px var(--ui-ink); font: 20px CreaturePixel,monospace; color: #d5edb8; }
#saved { font-size: 10px; color: #bbdba3; }
.icon-button { width: 40px; height: 40px; background: #243d40; color: #edf0dc; border: 2px solid var(--ui-ink); box-shadow: inset 2px 2px #73948d,inset -2px -2px #304f51,2px 2px var(--ui-ink); }
.icon-button:hover { background: #36585a; }
.icon-button:active { transform: translate(2px,2px); box-shadow: inset 2px 2px #193338; }
svg.lucide { stroke-linecap: square; stroke-linejoin: miter; shape-rendering: crispEdges; }
.icon-button svg, .button svg { width: 20px; height: 20px; flex-shrink: 0; }
.button { min-height: 48px; padding: 9px 20px; gap: 12px; font-size: 20px; line-height: 1.1; color: #222923; background: var(--ui-accent); border: 2px solid var(--ui-ink); box-shadow: inset 2px 2px #fff0bc,inset -2px -2px #ab784c,4px 4px var(--ui-ink); }
/* The hover lift moves the button out from under a cursor resting on its lower edge, which drops the
   hover, drops the lift, and repeats every frame. Keep the pointer target where the button started so
   the lift cannot un-hover itself. */
.button { position: relative; }
.button::after { content: ""; position: absolute; inset: 0 0 -4px; } /* downward only: 2px border + 2px lift from the padding box; sideways would count as overflow */
.button:hover:not(:disabled) { transform: translateY(-2px); background: #f4ce8e; }
.button:active:not(:disabled) { transform: translate(2px,2px); box-shadow: inset 2px 2px #ab784c,inset -2px -2px #fff0bc,2px 2px var(--ui-ink); }
.button.secondary { color: #f0f1df; background: #34555b; border-color: var(--ui-ink); box-shadow: inset 2px 2px #81a39c,inset -2px -2px #203b43,4px 4px var(--ui-ink); }
.button.secondary:hover:not(:disabled) { background: #456b6d; }
.button.ghost { color: #d9e3cf; background: #243731; border-color: var(--ui-ink); box-shadow: inset 2px 2px #648274,inset -2px -2px #152921,4px 4px var(--ui-ink); }
.button.ghost:hover:not(:disabled) { background: #354b3e; }
button:disabled, .button:disabled { opacity: 1; color: #7e9185; background: #23332f; border-color: #15231e; box-shadow: inset 2px 2px #435a4b,inset -2px -2px #17251e,2px 2px #101b18; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px dashed var(--ui-focus); outline-offset: 5px; }
.palette { gap: 12px; flex-shrink: 0; }
.swatch { width: 24px; height: 24px; border: 2px solid var(--ui-ink); box-shadow: inset 2px 2px #ffffff60,inset -2px -2px #00000040,2px 2px var(--ui-ink); }
.intro { padding-top: 112px; padding-bottom: 30px; }
.intro .invitation { font-size: 20px; line-height: 1.4; }
.intro .eyebrow { margin-bottom: 10px; }
.intro-bottom { gap: 16px; }
.subtle { font-size: 15px; color: #c5d5bd; }
.name-input { max-width: 100%; width: 320px; min-height: 48px; font-size: 20px; padding: 10px 16px; color: #f1eccd; background: #111d22; border: 2px solid #819c92; box-shadow: inset 3px 3px #080f13,2px 2px var(--ui-ink); }
.name-input::placeholder { font-size: 20px; color: #8fa698; }
.error { font-size: 15px; color: #f5ac92; }
.selection { max-width: 1240px; padding-top: 112px; }
.section-heading { margin-bottom: 28px; }
.section-heading h1, .selection .section-heading h1 { font-size: 30px; }
.section-heading p:not(.eyebrow) { font-size: 20px; }
.choice-grid { gap: 24px; }
.select-card { padding: 22px; border: 2px solid #a2b699; background: #1d342b; box-shadow: inset 0 0 0 3px #354f39,4px 4px var(--ui-ink); }
.select-card:hover { background: #284332; border-color: #d2dfa6; }
.select-card:nth-child(2) { background: #313736; border-color: #b5b79c; box-shadow: inset 0 0 0 3px #4d5447,4px 4px var(--ui-ink); }
.select-card:nth-child(2):hover { background: #3b4540; }
.select-card:nth-child(3) { background: #223941; border-color: #a2bdc2; box-shadow: inset 0 0 0 3px #3b535d,4px 4px var(--ui-ink); }
.select-card:nth-child(3):hover { background: #2c4852; }
.card-kicker { font-size: 15px; color: #c1d1ba; gap: 8px; flex-wrap: wrap; }
.card-kicker .completed { color: #d3e5a2; }
.select-card h2 { font-size: 30px; }
.select-card p { font-size: 15px; min-height: 52px; }
.part-tags { font-size: 15px; color: #d4dbb9; border-top: 2px dashed #69826b; padding-top: 12px; margin: 12px 0 20px; }
.selection-footer { align-items: flex-start; gap: 24px; }
.selection-footer p { font-size: 15px; white-space: nowrap; padding-top: 10px; }
.selection-footer .actions { gap: 16px; justify-content: flex-end; }
.selection-footer .button.ghost { font-size: 15px; }
.quest { top: 100px; max-width: 350px; padding: 18px 22px; border: 2px solid #a6b98d; background: #16251f; box-shadow: inset 0 0 0 3px #364b36,4px 4px var(--ui-ink); }
.quest .eyebrow { font-size: 10px; }
.quest h2 { font-size: 20px; }
.quest p { font-size: 15px; color: #d4dfc8; line-height: 1.3; }
.pause-btn { top: 100px; }
.edit-parts-btn { top: 152px; }
.bottom-hud { gap: 24px; padding: 16px 20px; grid-template-columns: 200px minmax(0,1fr) minmax(0,1fr) 200px; background: #182723; border: 2px solid #96ad92; box-shadow: inset 0 0 0 3px #364c3d,4px 4px var(--ui-ink); }
.identity { min-width: 0; }
.identity strong { font-size: 20px; line-height: 1.2; display: block; overflow-wrap: anywhere; }
.identity .swatch { width: 16px; height: 16px; }
.meter { min-width: 0; }
.meter label { font-size: 15px; margin-bottom: 8px; gap: 8px; color: #d6dfc6; }
.meter label span { white-space: nowrap; }
.meter .track { position: relative; height: 16px; background: #0d1717; border: 2px solid #75937e; overflow: hidden; }
.meter .track::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg,transparent 0 12px,#172920 12px 14px); pointer-events: none; }
.meter .fill { background: #c8dd8b; box-shadow: inset 0 3px #eff6b9,inset 0 -3px #829e55; }
.meter.hp .fill { background: #eb9f83; box-shadow: inset 0 3px #f9d1ae,inset 0 -3px #ba7159; }
.controls, .state-info small { font-size: 10px; line-height: 1.5; color: #b2c4ae; }
.state-info { font-size: 15px; color: #d6e0ca; }
.interact { border: 2px solid #a9c48d; background: #21352b; color: #ecf0d8; font-size: 20px; box-shadow: inset 0 0 0 2px #436345,4px 4px var(--ui-ink); }
.interact:hover:not(:disabled) { transform: translateX(-50%); }
.hud .interact { bottom: calc(var(--hud-height,120px) + 28px); }
.result { background: #102019ed; }
.result h1 { font-size: 30px; }
.result h2 { font-size: 20px; }
.result>p:not(.eyebrow), .hub>p:not(.eyebrow) { font-size: 20px; }
.rewards { font-size: 15px; gap: 12px 16px; }
.rewards li { padding-left: 18px; position: relative; }
.rewards li::before { content:''; position:absolute; left:0; top:8px; width:8px; height:8px; background:#bddd8f; box-shadow:2px 2px #3d6247; }
.hub { max-width: 1100px; padding-top: 112px; }
.hub h1 { font-size: 30px; }
.hub h2 { font-size: 20px; }
.hub-body { gap: 32px; }
.hub .actions { margin-bottom: 20px; }
#toast { font-size: 15px; max-width: min(600px,calc(100% - 32px)); width: max-content; line-height: 1.4; padding: 14px 20px; background: #26372b; color: #e5ebc5; border: 2px solid #c1ce99; box-shadow: inset 0 0 0 2px #4f6548,4px 4px var(--ui-ink); }
#modal { backdrop-filter: none; background: #060e13db; padding: 20px; overflow-y: auto; }
.pause-panel { width: 420px; max-width: 100%; max-height: calc(100dvh - 40px); overflow-y: auto; padding: 28px; background: #263534; border: 2px solid #c0c9a8; box-shadow: inset 0 0 0 4px #506257,6px 6px #080e11; }
.pause-panel h2 { font-size: 20px; }
.pause-panel p { font-size: 15px; line-height: 1.5; margin-bottom: 12px; }
.pause-panel button { font-size: 20px; }
.laboratory { max-width: 1280px; padding-top: 112px; }
.lab-heading h1 { font-size: 30px; }
.lab-layout { grid-template-columns: minmax(320px,.8fr) minmax(520px,1.2fr); gap: 32px; border-top: 4px double #96aa91; background: #132926f2; padding: 24px; }
.lab-name { font-size: 20px; }
.specimen-stage { height: 330px; border-bottom: 4px double #8da482; background-color: #182e2a; }
.pose-tabs { border: 2px solid #718d7d; gap: 2px; background: #101b1c; }
.pose-tabs button { font-size: 15px; line-height: 1.3; padding: 10px 8px; color: #d2dfc6; background: #293f36; box-shadow: inset 2px 2px #496454,inset -2px -2px #1a2a24; }
.pose-tabs button[aria-selected=true] { color: #20291e; background: #d4d994; box-shadow: inset 2px 2px #f0edb7,inset -2px -2px #979e60; }
.preset-row { gap: 12px; }
.preset-row span { font-size: 15px; }
.preset-row .button { font-size: 15px; padding: 7px 12px; min-height: 40px; }
/* Step one of the part picker: a button per slot, styled like the field it replaces, showing what is worn. */
.slot-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px 16px; margin-top: 18px; }
.slot-button { display: grid; grid-template-columns: minmax(0,1fr) 20px; grid-template-rows: auto auto; align-items: center; column-gap: 8px; text-align: left; min-height: 64px; padding: 8px 10px 8px 12px; border: 2px solid #6d8c7f; color: #e6edcf; background: #112226; box-shadow: inset 2px 2px #070f14,2px 2px var(--ui-ink); font: 15px CreaturePixel,sans-serif; cursor: pointer; }
.slot-button svg { grid-column: 2; grid-row: 1/3; color: #ceddab; }
.slot-button .slot-label { grid-column: 1; font-size: 13px; color: #a9c0af; line-height: 1.2; }
.slot-button .slot-value { grid-column: 1; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.slot-button:hover { background: #1a3238; }
.slot-button:active { transform: translate(2px,2px); box-shadow: inset 2px 2px #070f14; }
/* Step two: the header carries the way back; the grid below is the same gallery the left pane used to hide. */
.picker-head { display: flex; align-items: center; gap: 14px; margin: 0 0 12px; }
.picker-head h2 { margin: 0; font-size: 22px; }
.slot-back { min-height: 40px; padding: 6px 14px; font-size: 15px; gap: 8px; }
.part-choice.part-none .part-none-mark { display: grid; place-items: center; width: 100%; max-width: 112px; aspect-ratio: 1; color: #93a897; }
.part-choice.part-none .part-none-mark svg { width: 34px; height: 34px; }
.lab-stats { border: 0; border-top: 2px dashed #718974; border-bottom: 2px dashed #718974; margin: 22px 0; padding: 16px 0; }
.lab-stats dt { font-size: 15px; color: #a9c0af; }
.lab-stats dd { font-size: 15px; color: #e2e8bf; }
.lab-actions .button { font-size: 20px; min-height: 48px; }
#lab-save-state { font-size: 15px; color: #e6c08a; }
.touch button { border: 2px solid #6b8d7f; border-radius: 0; background: #253f36; box-shadow: inset 2px 2px #83a28d,inset -2px -2px #11271f,2px 2px #0b1611; }
body.playing .topbar { background: #0c1a17b8; }
#screen { scrollbar-color: #94ab89 #182c26; scrollbar-width: thin; }
@media(min-width:1101px) {
  .slot-button { min-height: 56px; }
  .preset-row { margin-bottom: 12px; }
  .lab-stats { margin: 16px 0; padding: 12px 0; gap: 12px 8px; }
  .lab-stats dt,.lab-stats dd { line-height: 1.2; }
  .lab-stats dd { margin-top: 4px; }
}
@media(max-width:1100px) {
  .bottom-hud { grid-template-columns: 160px minmax(0,1fr) minmax(0,1fr); gap: 20px; }
  .state-info { display: none; }
  .lab-layout { grid-template-columns: minmax(0,1fr); }
  .lab-preview-area { max-width: 520px; width: 100%; margin: auto; }
  .selection-footer { flex-direction: column; }
  .selection-footer .actions { justify-content: flex-start; }
  .select-card .button { font-size: 15px; }
}
@media(max-width:650px) {
  .topbar { padding: 16px 18px; height: 76px; }
  .wordmark { font-size: 15px; }
  .brand-mark { width: 32px; height: 32px; }
  .wordmark small { font-size: 10px; }
  .intro { padding-top: 100px; padding-bottom: 24px; }
  .intro h1 { font-size: 30px; }
  .intro .invitation { font-size: 15px !important; }
  .name-input { width: 280px; }
  .selection { padding: 100px 20px 30px; }
  .selection .section-heading h1 { font-size: 30px; }
  .section-heading p:not(.eyebrow) { font-size: 15px; }
  .select-card { grid-template-columns: 100px minmax(0,1fr); padding: 18px; gap: 0 16px; }
  .select-card h2 { font-size: 20px; }
  .select-card p { font-size: 15px; min-height: 0; }
  .select-card .button { font-size: 20px; }
  .part-tags { font-size: 15px; margin: 10px 0; }
  .selection-footer .actions { width: 100%; }
  .selection-footer .actions .button { flex: 1 1 100%; }
  .selection-footer p { white-space: normal; }
  .laboratory { padding: 100px 16px 32px; }
  .lab-heading { flex-wrap: wrap; }
  .lab-heading h1 { font-size: 30px; }
  .lab-heading .button { font-size: 15px; padding: 9px 12px; }
  .lab-layout { padding: 16px; gap: 24px; }
  .specimen-stage { height: 272px; }
  .lab-name { flex-wrap: wrap; }
  .slot-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .slot-button .slot-value { font-size: 17px; }
  .preset-row span { width: 100%; }
  .lab-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .lab-actions .button { flex: 1 1 100%; }
  .quest { left: 14px; top: 88px; max-width: calc(100% - 84px); padding: 12px 14px; }
  .quest h2 { font-size: 20px; margin-bottom: 6px; }
  .quest p { font-size: 15px; }
  .pause-btn { top: 88px; right: 16px; }
  .edit-parts-btn { top: 140px; right: 16px; }
  .bottom-hud { grid-template-columns: minmax(0,1fr) minmax(0,1fr); padding: 12px; left: 12px; right: 12px; gap: 12px; bottom: 12px; }
  .identity { flex-wrap: wrap; }
  .identity strong { font-size: 15px; }
  .identity .palette { margin-top: 0; }
  .meter label { font-size: 15px; white-space: nowrap; gap: 4px; align-items: baseline; }
  .meter label span { font-size: 10px; }
  .controls { display: none; }
  .touch { bottom: calc(var(--hud-height,132px) + 28px); left: 14px; right: 14px; }
  .hud .interact { bottom: calc(var(--hud-height,132px) + 100px); font-size: 15px; }
  .result h1, .hub h1 { font-size: 30px; }
  .result>p:not(.eyebrow), .hub>p:not(.eyebrow) { font-size: 15px; }
  .hub { padding: 100px 24px 32px; }
  .pause-panel { padding: 24px; }
}
@media(prefers-reduced-motion:reduce) {
  .button:hover:not(:disabled), .button:active:not(:disabled), .icon-button:active { transform: none; }
}
/* Isolated parts keep small sensory organs readable without changing their world size. */
.part-gallery{width:100%;min-width:0}

.part-gallery-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.part-choice{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:6px;min-width:0;min-height:150px;padding:8px 4px;background:#182a25;border:2px solid #627969;color:#e7efdb;font:15px CreaturePixel,sans-serif;cursor:pointer}
.part-choice canvas{display:block;width:100%;max-width:112px;aspect-ratio:1;object-fit:contain;image-rendering:pixelated}
.part-choice span{overflow-wrap:anywhere;line-height:1.5}
.part-choice[aria-pressed="true"]{border-color:#edc875;background:#2d392b;box-shadow:inset 0 0 0 2px #8e7848}
.part-choice:hover{background:#304b3d}
.part-choice:focus-visible{outline:3px solid #e9f5c8;outline-offset:2px}
.laboratory .specimen-stage{height:270px;min-height:270px}
@media(pointer:coarse){
  .touch{display:flex;position:absolute;bottom:calc(var(--hud-height,132px) + 28px);left:14px;right:14px;justify-content:space-between;pointer-events:none}
  .touch-group{display:flex;gap:5px}
  .touch button{pointer-events:auto;width:44px;height:44px;color:#d9e6cd;touch-action:none}
  .touch svg{width:20px;height:20px}
  .hud .interact{bottom:calc(var(--hud-height,132px) + 82px)}
}
@media(pointer:coarse) and (max-height:500px){
  body.playing .topbar{height:48px;padding:6px 16px}
  body.playing .wordmark small{display:none}
  .quest{top:56px;left:14px;padding:6px 10px;max-width:330px}
  .quest .eyebrow{font-size:10px;margin-bottom:2px}
  .quest h2{font-size:15px;margin-bottom:2px}
  .quest p{font-size:10px}
  .pause-btn{top:56px;right:14px}
  .edit-parts-btn{top:104px;right:14px}
  .bottom-hud{left:14px;right:14px;bottom:8px;padding:8px 12px;gap:14px;grid-template-columns:130px minmax(0,1fr) minmax(0,1fr)}
  .identity{grid-column:auto}
  .identity strong{font-size:15px}
  .identity .palette{margin-top:4px}
  .identity .swatch{width:12px;height:12px}
  .meter label{font-size:15px}
  .meter label span{font-size:10px}
  .controls{display:none}
  .touch{bottom:calc(var(--hud-height,80px) + 22px)}
}
.touch{align-items:flex-end}
.move-stick{position:relative;flex:0 0 112px;width:112px;height:112px;pointer-events:auto;touch-action:none;user-select:none;background:#172c26dc;border:3px solid #8ba48e;box-shadow:inset 3px 3px #304c3e,inset -3px -3px #0c1a16}
.stick-cross::before,.stick-cross::after{content:'';position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);background:#8ba48e55}
.stick-cross::before{width:72%;height:3px}.stick-cross::after{height:72%;width:3px}
.stick-knob{position:absolute;width:40px;height:40px;left:calc(50% - 20px);top:calc(50% - 20px);transform:translate(var(--stick-x,0px),var(--stick-y,0px));border:2px solid #d1dfb7;background:#506e58;box-shadow:inset 3px 3px #839976,inset -3px -3px #253d31;pointer-events:none}
.touch-actions{display:flex;align-items:flex-end;gap:12px}
.touch .touch-actions button{width:66px;height:66px;touch-action:none}
.touch .touch-attack{background:#684b3c;border-color:#e2b784;margin-bottom:22px}
.touch .touch-flight{background:#344e55;border-color:#91c5c7}
.touch .touch-actions svg{width:28px;height:28px}
.touch button:active{filter:brightness(1.3)}
.quest .senses{margin-top:8px;padding-top:7px;border-top:2px solid #526557}
.senses[hidden],.sense-row[hidden]{display:none}
.sense-row{display:grid;grid-template-columns:20px 30px minmax(0,1fr) 16px;gap:7px;align-items:center;padding:5px 5px 5px 7px;border-left:3px solid currentColor;margin:3px 0;background:#0c1d1980}
.sense-row svg{width:20px;height:20px}
.sense-row strong{font-size:12px;line-height:1.6;white-space:nowrap}
.quest .sense-row p{font-size:12px;line-height:1.6;color:inherit;min-width:0;overflow-wrap:anywhere}
.sense-direction{width:16px;height:16px;display:block;line-height:0}.sense-direction svg{display:block;width:16px;height:16px}
.sense-smell{color:#a9efda}.sense-sound{color:#ffcf8e}
/* Translucent so the terrain under it still reads; the word sits above the icon and names the source once the sense is close enough. */
.source-label{position:fixed;display:flex;flex-direction:column-reverse;align-items:center;gap:3px;min-width:64px;padding:3px 8px 4px;transform:translateX(-50%);border:1px solid;background:#0f1e1b80;font-size:11px;line-height:1.2;white-space:nowrap;text-shadow:1px 1px #07110f;pointer-events:none}
.source-label svg{width:15px;height:15px}.source-label[hidden]{display:none}
.source-smell{color:#a9efda;border-color:#a9efda66}.source-sound{color:#ffcf8e;border-color:#ffcf8e66}
/* A badge pointing toward something not yet seen is an estimate, and looks like one. */
.source-label.estimated{border-style:dashed;background:#0f1e1b59}
@media(max-width:650px){.quest{max-width:min(330px,calc(100% - 84px))}.sense-row{gap:5px}}
@media(max-height:500px){
  body.playing .topbar{height:48px;padding:6px 16px}
  .quest{top:56px;left:14px;padding:6px 10px;max-width:min(330px,calc(100% - 84px))}
  .quest .eyebrow{font-size:10px;margin-bottom:2px}
  .quest h2{font-size:15px;margin-bottom:2px}
  .quest p{font-size:10px}
  .quest .senses{margin-top:4px;padding-top:4px}
  .sense-row{padding:2px 5px 2px 7px}
  .quest .sense-row p,.sense-row strong{font-size:10px;line-height:1.6}
  .pause-btn{top:56px}.edit-parts-btn{top:104px}
}
@media(max-width:360px){.move-stick{flex-basis:96px;width:96px;height:96px}.touch-actions{gap:8px}.touch .touch-actions button{width:58px;height:58px}}
@media(pointer:coarse) and (max-height:500px){.move-stick{flex-basis:96px;width:96px;height:96px}.touch .touch-actions button{width:62px;height:62px}}

#game-viewport{position:fixed;left:0;top:0;width:100%;height:100%;transform-origin:0 0;isolation:isolate;overflow:hidden;container-type:size}
#safe-area-probe{position:fixed;visibility:hidden;pointer-events:none;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
.mobile-wide #world canvas{position:absolute;width:var(--canvas-width)!important;height:var(--canvas-height)!important;left:var(--canvas-left);top:var(--canvas-top);margin:0!important}
.mobile-wide #screen{overscroll-behavior:contain;overflow-x:hidden}
.mobile-wide .pause-panel{max-height:calc(var(--view-height) - 40px)}
.mobile-wide:not(.playing) .topbar{height:52px;padding:8px max(16px,env(safe-area-inset-right)) 8px max(16px,env(safe-area-inset-left))}
.mobile-wide:not(.playing) .wordmark{font-size:15px}.mobile-wide:not(.playing) .wordmark small{display:none}
.mobile-wide .intro{padding:64px 16px 12px;min-height:0;height:var(--view-height)}
.mobile-wide .intro>.eyebrow{display:none}.mobile-wide .intro h1{font-size:20px;margin-bottom:4px}
.mobile-wide .intro .invitation{font-size:12px!important}
.mobile-wide .intro-bottom{display:grid;grid-template-columns:auto auto;gap:8px;justify-items:center}
.mobile-wide .intro-bottom>.subtle,.mobile-wide .intro-bottom>.palette,.mobile-wide .intro-bottom>.error{grid-column:1/-1}
.mobile-wide .intro-bottom>.subtle+.button{grid-column:1/-1}
.mobile-wide .intro-bottom .button{width:180px;min-height:44px;padding:8px 12px;font-size:15px}
.mobile-wide .intro-bottom .name-input{width:200px;min-height:44px;padding:8px;font-size:16px}
.mobile-wide .intro-bottom .error:empty{display:none}.mobile-wide .intro-bottom .subtle{font-size:12px}
.mobile-wide .intro-bottom .swatch{width:16px;height:16px}
.mobile-wide .selection,.mobile-wide .laboratory,.mobile-wide .hub{padding:64px max(16px,env(safe-area-inset-right)) 24px max(16px,env(safe-area-inset-left))}
.mobile-wide .section-heading,.mobile-wide .lab-heading{margin-bottom:12px}
.mobile-wide .section-heading h1,.mobile-wide .lab-heading h1,.mobile-wide .hub h1{font-size:20px;margin-bottom:4px}
.mobile-wide .section-heading .eyebrow,.mobile-wide .lab-heading .eyebrow{margin-bottom:4px}
.mobile-wide .section-heading p:not(.eyebrow){font-size:12px}
.mobile-wide .choice-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.mobile-wide .select-card{display:flex;flex-direction:column;padding:12px;gap:0}
.mobile-wide .card-kicker{font-size:10px;gap:4px}.mobile-wide .select-card .portrait{height:96px}
.mobile-wide .select-card h2{font-size:15px;margin:8px 0}
.mobile-wide .select-card p{font-size:10px;min-height:30px}
.mobile-wide .part-tags{font-size:10px;margin:8px 0;padding-top:8px}
.mobile-wide .select-card .button{font-size:15px;margin-top:auto;min-height:44px;padding:8px}
.mobile-wide .selection-footer{margin-top:16px;gap:12px}
.mobile-wide .selection-footer .actions .button{font-size:12px;min-height:44px;flex:0 1 auto;padding:8px 12px}
.mobile-wide .lab-layout{grid-template-columns:minmax(180px,.8fr) minmax(280px,1.2fr);gap:16px;padding:12px}
.mobile-wide .lab-preview-area{max-width:none;margin:0;align-self:start}
.mobile-wide .laboratory .specimen-stage{height:clamp(140px,calc(var(--view-height) - 190px),220px);min-height:0}
.mobile-wide #lab-preview{width:100%;height:100%;max-width:220px;max-height:220px;min-height:0}
.mobile-wide .lab-heading .button,.mobile-wide .lab-actions .button{font-size:15px}
.mobile-wide .pose-tabs button{font-size:10px}.mobile-wide .part-choice{font-size:12px;min-height:120px}
.mobile-wide .lab-name{font-size:15px}.mobile-wide .lab-stats dt,.mobile-wide .lab-stats dd{font-size:12px}
.mobile-wide .result{padding:60px 16px 12px;display:grid;grid-template-columns:minmax(180px,.8fr) minmax(260px,1.2fr);grid-template-rows:auto auto auto auto auto;gap:4px 16px;align-content:center;justify-items:center}
.mobile-wide .result>.eyebrow{display:none}
.mobile-wide .result>h1{grid-column:1/-1;font-size:20px;line-height:1.4;margin:0;overflow-wrap:anywhere}
.mobile-wide .result>p:not(.eyebrow){grid-column:1/-1;font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.mobile-wide .result>.portrait{grid-column:1;grid-row:3/5;width:min(220px,100%);height:120px}
.mobile-wide .result>h2{grid-column:2;grid-row:3;align-self:end;font-size:16px;margin:0}
.mobile-wide .result>.rewards{grid-column:2;grid-row:4;margin:4px 0;font-size:12px;gap:6px 12px;align-self:start}
.mobile-wide .result>.actions{grid-column:1/-1;gap:12px}
.mobile-wide .result>.actions .button{font-size:15px;min-height:44px;padding:8px 12px}
.mobile-wide .hub-body{grid-template-columns:minmax(180px,.8fr) minmax(260px,1.2fr);gap:20px;margin:16px 0}
.mobile-wide .hub .portrait{height:160px}
.mobile-wide .hub-body .rewards{font-size:12px;margin:12px 0}
.mobile-wide .hub-body .button{font-size:15px;min-height:44px;padding:8px 12px}
body.mobile-landscape .topbar{height:56px;padding:8px max(12px,env(safe-area-inset-right));justify-content:flex-end;background:none}
body.mobile-landscape .wordmark,body.mobile-landscape #saved{display:none}
.mobile-landscape .quest{top:max(8px,env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left));width:min(240px,calc(50% - 134px));max-width:none;padding:6px 8px;background:#16251fdd}
.mobile-landscape .quest>.eyebrow,.mobile-landscape .quest>h2{display:none}
.mobile-landscape #objective{font-size:10px;margin:0;line-height:1.5}
.mobile-landscape .quest .senses{margin-top:4px;padding-top:4px}
.mobile-landscape .sense-row{grid-template-columns:16px 24px minmax(0,1fr) 16px;gap:4px;padding:2px 3px}
.mobile-landscape .sense-row>svg{width:16px;height:16px}
.mobile-landscape .quest .sense-row p,.mobile-landscape .sense-row strong{font-size:10px;line-height:1.6}
.mobile-landscape .bottom-hud{top:max(8px,env(safe-area-inset-top));bottom:auto;left:calc(50% - 104px);right:auto;width:208px;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:6px 8px;background:#182723dd}
.mobile-landscape .identity,.mobile-landscape .controls,.mobile-landscape .state-info{display:none}
.mobile-landscape .meter label,.mobile-landscape .meter label span{font-size:10px;margin-bottom:4px;gap:2px;white-space:nowrap}
.mobile-landscape .meter .track{height:10px}
.mobile-landscape .pause-btn{top:max(8px,env(safe-area-inset-top));right:calc(max(12px,env(safe-area-inset-right)) + 102px)}
.mobile-landscape .edit-parts-btn{top:58px;right:max(12px,env(safe-area-inset-right))}
.mobile-landscape .touch{bottom:max(14px,env(safe-area-inset-bottom));left:max(14px,env(safe-area-inset-left));right:max(14px,env(safe-area-inset-right))}
.mobile-landscape .move-stick{width:104px;height:104px;flex-basis:104px}
.mobile-landscape .touch .touch-actions button{width:72px;height:72px}
.mobile-landscape .hud .interact{bottom:max(16px,env(safe-area-inset-bottom));max-width:calc(100% - 380px);min-height:44px;padding:8px 14px;font-size:15px;white-space:normal}
.mobile-landscape #toast{top:64px;padding:8px 12px;max-width:calc(100% - 320px);font-size:12px}

/* The viewport already excludes physical notches and home-indicator insets. */
.mobile-wide:not(.playing) .topbar{padding:8px 16px}
.mobile-wide .selection,.mobile-wide .laboratory,.mobile-wide .hub{padding-left:16px;padding-right:16px}
.mobile-wide .selection-footer{flex-direction:row;align-items:center}
.mobile-wide .section-heading .palette{display:flex}
body.mobile-landscape .topbar{padding:8px 12px}
.mobile-landscape .quest{top:8px;left:12px}
.mobile-landscape .bottom-hud{top:8px}
.mobile-landscape .pause-btn{top:8px;right:114px}
.mobile-landscape .edit-parts-btn{right:12px}
.mobile-landscape .touch{bottom:14px;left:14px;right:14px}
.mobile-landscape .hud .interact{bottom:16px}

/* Prologue (SCENARIO.md): the fall, the dark stage and the first chapter card. The soul has no body yet, so the
   stage shows only a line of narration, a movement hint and its name and colours. */
.fall{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;padding:26vh 24px 0}
.fall::before{content:"";position:absolute;inset:0;background:#000;opacity:0;transition:opacity 1s steps(6);pointer-events:none}
.fall.dark::before{opacity:1}
.fall-caption,.story-caption{position:relative;margin:0;font-size:22px;line-height:1.4;color:#e4e8dc;text-align:center;text-shadow:2px 2px #000;opacity:0;transition:opacity .6s steps(4)}
.fall-caption.shown,.story-caption.shown{opacity:1}
.fall .skip{position:absolute;right:28px;bottom:28px;min-height:40px;font-size:15px}
.story-caption{position:absolute;left:50%;bottom:19%;transform:translateX(-50%);width:min(90%,720px)}
.story-action{position:fixed;transform:translateX(-50%);display:flex;flex-direction:column;align-items:center;gap:4px;padding:4px 10px 5px;font-size:12px;line-height:1.2;white-space:nowrap;color:#f1e8c8;border:1px solid #c9b77a;background:#0b0f15d9;text-shadow:1px 1px #07110f;pointer-events:none;z-index:3}
.story-action[hidden],.story-action .action-bar[hidden]{display:none}
.story-action .action-bar{width:96px;height:5px;border:1px solid #6b6040;background:#1a1c1a}
.story-action .action-bar i{display:block;height:100%;width:0;background:#e9cf7a}
.story-hint{position:absolute;left:50%;bottom:11%;transform:translateX(-50%);margin:0;padding:6px 14px;font-size:15px;color:#b8c2c9;border:2px solid #3b4652;background:#0b0f15d9;animation:story-hint 1.6s steps(2) infinite}
@keyframes story-hint{50%{color:#7d8894;border-color:#262e37}}
.story-chapter{position:absolute;left:28px;top:100px;padding:10px 16px;border-left:2px solid #9fe0d0;background:#0b1015d9}
.story-chapter .eyebrow{margin:0;color:#9fe0d0}
.story-chapter strong{font-size:20px;font-weight:400}
.bottom-hud.story-identity{right:auto;display:block;padding:10px 16px;background:#0b1015e6;border-color:#3b4652;box-shadow:inset 0 0 0 3px #1a222b,4px 4px var(--ui-ink)}
.chapter-card{position:absolute;left:50%;top:140px;transform:translateX(-50%);width:min(92%,600px);padding:18px 24px;text-align:center;pointer-events:auto;background:#0d141be8;border:2px solid #9fe0d0;box-shadow:inset 0 0 0 3px #1e2c33,4px 4px var(--ui-ink)}
.chapter-card .eyebrow{color:#9fe0d0;margin-bottom:6px}
.chapter-card h2{font-size:26px;margin-bottom:6px}
.chapter-card p{margin:6px 0;font-size:17px}
.chapter-card .actions{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin-top:12px}
.chapter-card .actions+.actions{margin-top:10px}
.chapter-card .button{font-size:15px;min-height:38px;padding:6px 14px}
.mobile-landscape .story-chapter{top:8px;left:12px}
.mobile-landscape .story-caption{bottom:20%;font-size:15px}
.mobile-landscape .story-hint{bottom:8%;font-size:12px}
.mobile-landscape .chapter-card{top:8px;padding:10px 14px}
.mobile-landscape .chapter-card h2{font-size:22px}
.mobile-landscape .chapter-card p{font-size:13px}
.mobile-landscape .bottom-hud.story-identity{display:none}
.mobile-landscape .chapter-card{width:min(58%,440px)}
.mobile-landscape .chapter-card .button{font-size:12px;min-height:32px;padding:4px 10px}
/* Prologue chapters 2-6: the quest box in the story's colours, the card a new DNA shows once, and the DNA list in
   the pause menu. */
.quest.story-quest{border-color:#9fe0d0;background:#0b1015e6;box-shadow:inset 0 0 0 3px #1e2c33,4px 4px var(--ui-ink)}
.quest.story-quest .eyebrow{color:#9fe0d0}
.dna-card{position:absolute;left:50%;top:104px;transform:translateX(-50%);min-width:260px;max-width:min(90%,520px);padding:12px 20px;text-align:center;background:#0d141bf0;border:2px solid #9fe0d0;box-shadow:inset 0 0 0 3px #1e2c33,4px 4px var(--ui-ink);animation:dna-card 7.5s steps(6) forwards}
.dna-card .eyebrow{margin:0 0 4px;color:#9fe0d0}
.dna-card strong{display:block;font-size:22px;font-weight:400;margin-bottom:4px}
.dna-card p:not(.eyebrow){margin:0;font-size:15px;color:#d4dfc8}
@keyframes dna-card{0%{opacity:0}6%{opacity:1}88%{opacity:1}100%{opacity:0}}
.dna-dex li span{font-size:13px}
.dna-dex li strong{font-weight:400}
.mobile-landscape .dna-card{top:8px;padding:6px 12px}
.mobile-landscape .dna-card strong{font-size:15px}
.mobile-landscape .dna-card p:not(.eyebrow){font-size:12px}
/* Swapping parts mid-story (regions.js): a row per slot, the owned parts as buttons, the worn one lit */
.swap-panel{width:480px}
.swap-row{display:flex;align-items:center;gap:12px;margin:10px 0}
.swap-row strong{min-width:44px;font-weight:400;font-size:17px;color:#e9cf7a}
.swap-options{display:flex;flex-wrap:wrap;gap:6px}
.pause-panel .swap-option{font-size:15px;padding:6px 10px;min-height:0;background:#1b2726;color:#d4dfc8;border:2px solid #506257}
.pause-panel .swap-option.on{background:#3b4f3e;color:#fff6d6;border-color:#e9cf7a}
.pause-panel .swap-option.new:not(.on){border-color:#9fe0d0;box-shadow:0 0 0 2px #9fe0d055}
/* The labelled parts button (a phone has no Q) and the one-button swap offer (regions.js): lower right above the
   status bar on a desktop (clear of the narration), bottom centre between the touch controls on a phone */
.swap-btn{display:flex;align-items:center;gap:6px;height:40px;padding:0 10px;background:#243d40;color:#edf0dc;border:2px solid var(--ui-ink);box-shadow:inset 2px 2px #73948d,inset -2px -2px #304f51,2px 2px var(--ui-ink);font:15px CreaturePixel,monospace}
.swap-btn svg{width:18px;height:18px}
.swap-prompt{position:absolute;right:32px;bottom:118px;display:flex;align-items:center;gap:12px;padding:8px 10px 8px 14px;background:#0d141bf0;border:2px solid #9fe0d0;z-index:6;pointer-events:auto}
.swap-prompt span{color:#9fe0d0;font-size:13px;white-space:nowrap}
.swap-prompt button{font-size:18px;padding:8px 14px;min-height:0;animation:swapPulse 1.1s ease-in-out infinite}
@keyframes swapPulse{50%{box-shadow:0 0 0 4px #9fe0d077}}
.mobile-landscape .swap-prompt{right:auto;left:50%;transform:translateX(-50%);bottom:max(10px,env(safe-area-inset-bottom))}
.mobile-landscape .swap-prompt button{font-size:15px;padding:6px 10px}

/* the lab: what a part changes (2026-11-05) — the stage lit as a part goes on, a part looked at worn for a moment,
   the creature before beside the one now, and the numbers that moved */
.specimen-stage{position:relative}
.specimen-stage.swapped{animation:lab-swap .9s ease-out}
@keyframes lab-swap{0%{box-shadow:inset 0 0 0 4px #e9cf7a,0 0 26px #e9cf7a88}100%{box-shadow:inset 0 0 0 0 #e9cf7a00,0 0 0 #e9cf7a00}}
.specimen-stage.swapped canvas{animation:lab-pop .5s ease-out}
@keyframes lab-pop{0%{transform:scale(1.08)}60%{transform:scale(.98)}100%{transform:scale(1)}}
.specimen-stage.previewing{outline:2px dashed #9fe0d0;outline-offset:-6px}
.lab-peek{position:absolute;left:10px;top:10px;padding:2px 8px;background:#0d1f1ccc;border:1px solid #9fe0d0;color:#9fe0d0;font-size:13px}
.lab-compare{display:grid;grid-template-columns:auto auto 1fr;align-items:center;gap:10px;margin-top:10px;padding:8px 10px;border:2px dashed #718974;background:#0f2220}
.lab-compare figure{margin:0;text-align:center}.lab-compare canvas{width:112px;height:112px;image-rendering:pixelated;opacity:.85;background:#182e2a}
.lab-compare figcaption{font-size:12px;color:#a9c0af}.lab-arrow{font-size:22px;color:#e9cf7a}
.lab-compare p{margin:0;display:flex;flex-direction:column;gap:2px;font-size:14px;color:#a9c0af}.lab-compare strong{color:#e2e8bf}.lab-compare .to{color:#e9cf7a}
.lab-stats .changed dd{color:#e9cf7a}.lab-delta{margin-left:6px;font-size:12px}.lab-delta.good{color:#8fe0a8}.lab-delta.bad{color:#f0a08a}.lab-delta.was{color:#7d8c86}
