@font-face{font-family:Montserrat;src:url('assets/brand/Montserrat-Regular.ttf') format('truetype');font-weight:400;font-display:swap}
@font-face{font-family:Montserrat;src:url('assets/brand/Montserrat-Bold.ttf') format('truetype');font-weight:600 800;font-display:swap}
:root{font-family:Montserrat,'Segoe UI',sans-serif;font-synthesis:none}
body{--ink:var(--site-ink);--muted:var(--site-muted);--paper:var(--site-paper);color:var(--ink);background:var(--paper);margin:0;font-size:16px;line-height:1.7}
*{box-sizing:border-box}
button,input{font:inherit}
button,.file-button{display:inline-flex;align-items:center;justify-content:center;min-height:44px;cursor:pointer;border:1px solid var(--site-action);background:white;color:var(--site-action);padding:8px 14px;border-radius:3px;font-size:13px;font-weight:700;line-height:1.5}
button:hover,.file-button:hover{background:var(--site-ground)}
button:disabled{opacity:.45;cursor:default}
:focus-visible{outline:3px solid var(--site-ink);outline-offset:3px}
a{color:var(--site-action)}
header{max-width:1200px;margin:auto;display:flex;align-items:center;gap:24px;padding:12px 32px;border-bottom:1px solid var(--site-rule)}
.brand{display:flex;align-items:center;gap:12px;color:var(--ink);font-size:24px;font-weight:700;text-decoration:none;letter-spacing:.02em}
.brand img{display:block;width:48px;height:48px;margin:12px;object-fit:contain}
.project{font-size:13px;color:var(--muted)}
.quiet{border-color:transparent;margin-left:auto}
main{max-width:1200px;margin:auto;padding:32px}
.intro{display:flex;justify-content:space-between;align-items:center;gap:24px;margin-bottom:32px}
h1{font-size:clamp(34px,3.3vw,48px);line-height:1.14;font-weight:700;letter-spacing:-1.2px;margin:0 0 16px}
p{line-height:1.7;margin:8px 0;color:var(--muted)}
.intro p{max-width:65ch;font-size:16px}
.runtime{font-size:13px;color:var(--muted);max-width:120px}
.workspace{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(320px,1fr);gap:40px;align-items:start}
.habitat{background:var(--site-ground);border:1px solid var(--site-rule);border-radius:3px;overflow:hidden}
.world-toolbar{display:flex;align-items:center;justify-content:space-between;padding:16px;gap:8px;border-bottom:1px solid var(--site-rule);background:white}
.live-controls{display:flex;align-items:center;gap:12px}
.live-label{font-size:13px;font-weight:700}
.live-label:before{content:'';display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--site-orange);margin-right:8px}
#phase{font-size:13px;color:var(--muted);white-space:nowrap}
.world-wrap{position:relative}
#world{aspect-ratio:1;position:relative}
#world>svg{width:100%;height:100%;display:block;overflow:hidden}
#world svg text{font-family:Montserrat,'Segoe UI',sans-serif;font-size:1.1px;font-weight:600;paint-order:stroke;stroke:#f6f8fa;stroke-width:.32px;stroke-linejoin:round}
.noul{cursor:pointer;outline:none}
.noul .selection-marker{opacity:0;transition:opacity .18s}
.noul.selected .selection-marker,.noul:hover .selection-marker,.noul:focus-visible .selection-marker{opacity:1}
.noul:focus-visible .selection-marker{stroke-width:.3}
#world .noul-sprite{overflow:hidden;pointer-events:none}
.noul-hit{pointer-events:all}.sprite-b{opacity:0}
#world .noul-label{display:block;fill:var(--creature);font-size:1.2px;stroke:white;stroke-width:.5px;pointer-events:none}
#world .thought text{font-size:1.4px;stroke:none;font-weight:600}
.world-caption{display:flex;justify-content:space-between;gap:12px;pointer-events:none;padding:8px 16px;font-size:13px;color:var(--muted);border-top:1px solid var(--site-rule)}
.transport{padding:12px 16px;display:flex;align-items:center;gap:8px;background:white;border-top:1px solid var(--site-rule)}
.primary{background:var(--site-action);color:white;border-color:var(--site-action)}
.primary:hover{background:#97260e}
.transport>span{margin-left:auto;font-size:13px;color:var(--muted);max-width:200px;text-align:right}
#artifact-form{border-top:1px solid var(--site-rule);padding:20px 16px;background:white}
.habitat label{font-size:14px;font-weight:700}
.input-row{display:flex;gap:8px;margin-top:12px}
input{width:100%;min-width:0;min-height:44px;border:1px solid var(--muted);border-radius:3px;padding:10px 12px;color:var(--ink);background:white;font-size:14px}
input::placeholder{color:var(--muted)}
.input-row button{white-space:nowrap}
#placement-note,#image-note{font-size:13px;line-height:1.5;margin-top:12px}
.image-upload{display:flex;align-items:center;gap:12px;margin-top:16px;font-size:13px!important}
.image-upload input{width:auto;max-width:235px;font-size:13px;padding:4px;border:0}
.observation{min-width:0}
.aside-title{display:flex;justify-content:space-between;gap:8px;color:var(--muted);font-size:13px}
#source-badge{font-size:13px}
.creature-tabs{display:flex;gap:6px;margin:20px 0}
.creature-tabs button{flex:1;font-size:13px;padding:8px 4px;border-color:var(--muted);color:var(--ink)}
.creature-tabs button[aria-pressed=true]{background:var(--site-slate);border-color:var(--site-slate);color:white}
.creature-heading{display:flex;gap:8px;align-items:center;margin:8px 0 16px}
.creature-heading h2{font-size:27px;line-height:1.22;font-weight:700;margin:0}
.creature-heading p{font-size:13px;margin-top:8px}
.portrait{width:88px;height:96px;flex-shrink:0;background:transparent url('assets/bold.webp?v=ailang-brand-10') center/contain no-repeat}
.portrait.wary{background-image:url('assets/wary.webp?v=ailang-brand-10')}.portrait.paranoid{background-image:url('assets/paranoid.webp?v=ailang-brand-10')}.portrait.curious{background-image:url('assets/curious.webp?v=ailang-brand-10')}
.current-thought{font-size:14px;margin-bottom:16px}
.vitals{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:16px 0 28px}
.vitals>div:last-child{grid-column:1/-1}
.vital-label{display:flex;justify-content:space-between;font-size:13px;color:var(--muted);margin-bottom:8px}
.vital-track{height:4px;background:var(--site-rule)}
.vital-track i{display:block;background:var(--site-slate);height:100%}
.urgent .vital-track i{background:var(--site-action)}
.decision-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;border-top:1px solid var(--site-rule);padding-top:20px}
h3{font-size:22px;line-height:1.35;font-weight:700;margin:0}
#verified{font-size:13px;color:var(--muted)}
#decision-context,#decision-stage{font-size:14px;margin:16px 0}
.bar-row{display:grid;grid-template-columns:80px 1fr 44px;gap:10px;align-items:center;font-size:13px;margin:12px 0}
.bar-track{height:8px;background:var(--site-rule);overflow:hidden}
.bar-fill{height:100%;background:var(--site-action)}
.vital-track i,.bar-fill{transition:width .3s ease-out}
.bar-p{text-align:right;color:var(--muted);font-variant-numeric:tabular-nums}
.roll-track{position:relative;display:flex;height:22px;margin-top:28px;background:var(--site-rule)}
.prob-segment{display:block;border-right:2px solid white;background:var(--site-slate)}
.prob-segment:nth-child(even){background:var(--site-muted)}
.prob-segment:nth-child(3n){background:repeating-linear-gradient(45deg,#526677 0 3px,#a0aeb9 3px 5px)}
.roll-marker{position:absolute;top:21px;transform:translateX(-50%);font-size:14px;color:var(--site-action)}
.roll-note{font-size:13px;color:var(--muted);line-height:1.5;margin:24px 0 16px}
.outcome{padding:12px 16px;background:var(--site-ground);border-left:3px solid var(--site-orange);font-size:14px;line-height:1.7;margin:20px 0}
.outcome strong{display:block;font-size:16px;margin-bottom:4px}
details{margin-top:24px;border-top:1px solid var(--site-rule);padding-top:16px}
summary{cursor:pointer;font-size:14px;font-weight:700;min-height:44px}
.evidence-tabs{display:flex;gap:6px;margin:12px 0}
.evidence-tabs button{padding:8px;font-size:13px}
pre{font:13px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace;background:var(--site-ground);padding:12px;white-space:pre-wrap;overflow-wrap:anywhere;max-height:280px;overflow:auto}
.ledger{margin-top:40px}
.ledger-heading{display:flex;justify-content:space-between;align-items:center;gap:16px}
.ledger h2{font-size:27px;line-height:1.22;font-weight:700;margin:0}
.ledger p{font-size:14px}
.bank-actions{display:flex;gap:8px;flex-shrink:0}
.timeline{display:flex;gap:12px;overflow:auto;padding:16px 0}
.timeline button{min-width:205px;text-align:left;display:block;color:var(--ink);background:var(--site-ground);border-color:var(--muted);padding:12px 16px}
.timeline button.active{border-color:var(--site-action);border-left-width:3px}
.timeline strong{display:block;font-size:14px;margin:4px 0}
.timeline small{color:var(--muted);font-size:13px}
.ledger-footer{display:flex;justify-content:space-between;gap:16px;color:var(--muted);font-size:13px}
.ledger-empty{padding:16px 0;font-size:14px;color:var(--muted)}
#status{font-size:14px;color:var(--site-action);padding:12px 16px;margin:0;border-top:1px solid var(--site-rule)}
#status:empty{display:none}
footer{display:flex;justify-content:space-between;gap:24px;border-top:1px solid var(--site-rule);margin-top:32px;padding-top:20px;color:var(--muted);font-size:13px}
dialog{max-width:520px;width:calc(100% - 40px);border:1px solid var(--muted);border-radius:3px;padding:32px;background:white;color:var(--ink)}
dialog::backdrop{background:#314352bf}
dialog h2{font-weight:700;font-size:27px;line-height:1.22;margin:16px 0}
dialog p{font-size:14px}
.close{position:absolute;right:4px;top:4px;border:0;font-size:24px}
dialog label{display:block;font-size:14px;margin:20px 0 8px}
dialog .primary{margin-top:12px}
.loading{display:grid;height:100%;place-items:center;padding:24px;background:#f1f5ed;color:var(--muted);text-align:center}
.loading-content{width:min(100%,340px)}
.loading-nouls{display:flex;align-items:end;justify-content:center;gap:6px;margin-bottom:16px}
.loading-nouls img{width:20%;max-width:65px;aspect-ratio:1;object-fit:contain}
.loading h2{font-size:clamp(20px,2vw,27px);line-height:1.25;margin:0 0 10px;color:var(--ink)}
#loading-stage{font-size:14px;margin:0 0 16px}
#loading-progress{display:block;width:100%;height:14px;border:1px solid #aac2a5;border-radius:10px;overflow:hidden;appearance:none;background:#dce7d6;accent-color:#427853}
#loading-progress::-webkit-progress-bar{background:#dce7d6;border-radius:10px}
#loading-progress::-webkit-progress-value{background:#427853;border-radius:10px;transition:width .25s ease}
#loading-progress::-moz-progress-bar{background:#427853;border-radius:10px}
.loading-hint{font-size:13px;line-height:1.5;margin:14px 0 8px}
#loading-count{display:block;font-size:12px;font-variant-numeric:tabular-nums}
#loading-retry{margin-top:14px;background:white}
#loading-retry[hidden]{display:none}
.loading.failed #loading-progress{accent-color:var(--site-action)}
.loading.failed #loading-stage{color:var(--site-action)}
.placing{cursor:crosshair}
[data-object]{cursor:pointer;outline:none;-webkit-tap-highlight-color:transparent}
[data-object]:focus-visible{outline:2px solid var(--site-action)}
#object-description{position:absolute;left:12px;right:12px;bottom:44px;z-index:3;padding:16px 48px 16px 16px;border:1px solid var(--muted);border-radius:3px;background:white;max-height:180px;overflow:auto}
#object-description strong{font-size:13px;color:var(--muted)}
#object-description p{margin:4px 0 0;color:var(--ink);font-size:14px;line-height:1.5}
#close-description{position:absolute;right:0;top:0;font-size:22px;border:0;padding:8px 14px}
#object-description.hover-popup{right:auto;bottom:auto;pointer-events:auto}
.noul.dead .noul-sprite{filter:grayscale(1);opacity:.4}.noul.dead .noul-shadow{opacity:.12}
@media(max-width:1000px){.workspace{gap:28px;grid-template-columns:minmax(0,1.3fr) minmax(300px,1fr)}.intro .runtime{display:none}.world-toolbar{flex-wrap:wrap}#phase{display:none}.transport{flex-wrap:wrap}.image-upload{flex-wrap:wrap}.ledger-heading{align-items:start;flex-direction:column}.input-row{flex-wrap:wrap}.input-row input{flex:1 1 200px}}
@media(max-width:740px){header{padding:8px 20px;gap:8px}.brand{font-size:20px;gap:0}.brand img{width:32px;height:32px;margin:8px}.project{display:none}.quiet{font-size:13px;max-width:160px}main{padding:24px 20px}h1{font-size:34px}.intro{margin-bottom:24px}.workspace{grid-template-columns:1fr}.observation{padding:0}.world-toolbar{padding:12px}.world-caption{font-size:13px;line-height:1.5;align-items:end}.world-caption span:first-child{max-width:65%}.transport{padding:12px}.transport>span{max-width:140px}.image-upload input{max-width:100%}.bank-actions{flex-wrap:wrap}.ledger-footer{flex-wrap:wrap}footer span:last-child{display:none}#world .thought text{font-size:1.65px}.creature-tabs{flex-wrap:wrap}.creature-tabs button{min-width:64px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

.create-noul{margin-top:16px}textarea{font:inherit;font-size:14px;width:100%;resize:vertical;padding:12px;border:1px solid var(--muted);border-radius:3px;color:var(--ink);background:white;min-height:120px}.trait-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px 16px;margin:16px 0;padding:12px;background:var(--site-ground);font-size:13px;line-height:1.5}.trait-grid span{display:block;color:var(--muted)}.trait-grid strong{display:block}#character-status{font-size:14px;color:var(--site-action)}.creature-tabs{flex-wrap:wrap}.creature-tabs button{overflow-wrap:anywhere;min-width:70px}.trait-grid[hidden]{display:none}.creature-heading p{overflow-wrap:anywhere}#character-traits{margin-top:0}

/* Keep the brand on the page; use colour in the habitat to distinguish evidence. */
#habitat-ground rect{fill:#f1f5ed}
#world .noul .selection-marker{opacity:.65;stroke:var(--creature);stroke-width:.22;fill:var(--creature);fill-opacity:.10}
#world .noul.selected .selection-marker,#world .noul:hover .selection-marker,#world .noul:focus-visible .selection-marker{opacity:1;stroke-width:.4;fill-opacity:.2}
#world .deliberating{stroke:#bd3012;stroke-width:.3}
#world .thought rect{stroke:var(--creature);stroke-width:.12}
#world [data-kind="tree"] path{fill:#427853}
#world [data-kind="tree"] path:first-of-type{fill:#866743}
#world [data-kind="tree"] path:last-of-type{fill:#8cb777}
#world [data-kind="water"] ellipse{fill:#2686ae}
#world [data-kind="water"] ellipse:first-of-type{fill:#376677}
#world [data-kind="water"] ellipse:last-of-type{fill:#8ed0dc}
#world [data-kind="path"] path:first-of-type{fill:#c3ad85}
#world [data-kind="toilet"] path{fill:#8a7255}
#world #mushroom stop:first-child{stop-color:#ebd5b6}
#world #mushroom stop:nth-child(2){stop-color:#ba8860}
#world #mushroom stop:last-child{stop-color:#886448}
#world #thorn stop:first-child{stop-color:#8f9b62}
#world #thorn stop:last-child{stop-color:#50623c}
.creature-tabs button{border-top:4px solid var(--creature);min-height:48px}
.creature-tabs button[aria-pressed=true]{background:var(--creature);border-color:var(--creature)}
.creature-heading{border-left:4px solid var(--creature);padding-left:10px}
.current-thought{color:var(--ink);background:var(--site-ground);padding:10px 12px;border-left:3px solid var(--creature)}
.vital-track{height:7px;border-radius:2px;overflow:hidden}
.vitals>div:nth-child(1) .vital-track i{background:#7953a4}
.vitals>div:nth-child(2) .vital-track i{background:#ad7626}
.vitals>div:nth-child(3) .vital-track i{background:#2474a8}
.vitals>div:nth-child(4) .vital-track i{background:#886448}
.vitals>div:nth-child(5) .vital-track i{background:#287a63}
.vitals>div.urgent .vital-track i{background:#bd3012}
.urgent .vital-label{color:#bd3012;font-weight:700}
.bar-track{height:10px}
.bar-row:nth-child(4n+1) .bar-fill,.prob-segment:nth-child(4n+1){background:#287a63}
.bar-row:nth-child(4n+2) .bar-fill,.prob-segment:nth-child(4n+2){background:#2474a8}
.bar-row:nth-child(4n+3) .bar-fill,.prob-segment:nth-child(4n+3){background:#7953a4}
.bar-row:nth-child(4n+4) .bar-fill,.prob-segment:nth-child(4n+4){background:#ad7626}

.social-observation{margin:20px 0 24px;padding-top:18px;border-top:1px solid var(--site-rule)}
.social-observation h3{font-size:18px}.social-observation p{font-size:13px;line-height:1.6}
#social-encounter{color:var(--ink);font-weight:700}
.social-distribution{margin-top:16px;font-size:13px}
.social-distribution .bar-row{grid-template-columns:minmax(100px,1fr) 1fr 40px;font-size:12px;margin:8px 0}
.social-distribution .bar-row>span:first-child{overflow-wrap:anywhere}

/* Item creation keeps the habitat in place and gives thumbs room to work. */
#item-dialog{border:1px solid #aac2a5;border-top:5px solid #427853;border-radius:16px;padding:28px;max-height:90dvh;overflow:auto;overscroll-behavior:contain}
.item-eyebrow{font-size:12px;font-weight:700;color:#427853}
#item-dialog h2{margin:8px 24px 8px 0}
#item-pause-note{font-size:13px;margin-bottom:20px}
#artifact-form{border:0;padding:0;background:transparent}
#artifact-form label{margin:12px 0 8px;font-weight:700}
#artifact{font-size:16px;min-height:52px}
.item-suggestions{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px}
.item-suggestions button{font-size:12px;padding:8px 10px;border-color:#c6d6bf;color:#365e40;background:#f1f5ed;border-radius:24px}
#item-picture{margin-top:20px;padding-top:12px}
#item-picture summary span{font-weight:400;color:var(--muted)}
#item-picture input{font-size:16px}
.item-actions{display:flex;gap:10px;justify-content:space-between;margin-top:20px}
.item-actions button{min-height:48px;margin:0}
.item-actions .primary{flex:1}
#placement-controls{padding:12px 16px;background:#e7f0e0;border-top:1px solid #aac2a5}
#placement-controls[hidden]{display:none}
#placement-note{margin:0 0 10px;color:#365e40;font-weight:700}
#placement-controls>div{display:flex;gap:8px;flex-wrap:wrap}
#world.placing{outline:3px solid #427853;outline-offset:-3px}
#world.placing *{cursor:crosshair}
.transport{flex-wrap:wrap}.transport>span{flex-basis:100%;max-width:none;text-align:left;margin:0}
@media(max-width:740px){#item-dialog{margin:0;inset:auto 0 0;width:100%;max-width:none;max-height:88dvh;padding:24px 20px max(20px,env(safe-area-inset-bottom));border-radius:18px 18px 0 0}.item-suggestions{gap:5px}.transport #add-item{flex:1}#item-dialog h2{font-size:25px}}

.item-placing .transport,.item-placing #status{display:none}

#artifact-form .draw-item{display:flex;align-items:center;gap:10px;margin:18px 0 0;font-size:14px;cursor:pointer}
.draw-item input{width:20px;min-height:20px;flex:0 0 20px;accent-color:#427853}
.draw-item small{display:block;color:var(--muted);font-weight:400;font-size:12px}
#art-option-note{font-size:12px;margin:4px 0 0;line-height:1.5}
#art-option-note:empty{display:none}
#artwork-status{padding:10px 16px;margin:0;background:#e7f0e0;color:#365e40;font-size:13px;border-top:1px solid #aac2a5}
#artwork-status[hidden],.item-placing #artwork-status{display:none}

/* A tap is acknowledged immediately, then blooms once the item is placed. */
.placement-ping{position:absolute;z-index:2;width:34px;height:34px;border:2px solid #427853;border-radius:50%;background:#e7f0e055;box-shadow:0 0 0 3px #ffffffb3;transform:translate(-50%,-50%);pointer-events:none}
.placement-ping:after{content:'';position:absolute;width:6px;height:6px;left:50%;top:50%;transform:translate(-50%,-50%);border-radius:50%;background:#427853}
.placement-ping.confirmed{animation:placement-bloom 1.4s ease-out forwards}
.placement-ping.confirmed:after{opacity:0}
@keyframes placement-bloom{0%{transform:translate(-50%,-50%) scale(.7);opacity:1}45%{opacity:.9}100%{transform:translate(-50%,-50%) scale(2.4);opacity:0}}
#object-description[data-placement]{border-color:#427853;box-shadow:0 3px 14px #2847341a}
#object-description[data-placement] strong{color:#365e40}
@media(prefers-reduced-motion:reduce){.placement-ping.confirmed{animation:none;opacity:1}}

.carried-marker{fill:#fff7db;stroke:#ad7626;stroke-width:.16}
.carrying-note{font-size:13px;color:#6c5127;background:#faf3df;padding:8px 12px;border-radius:3px;line-height:1.5}
#item-activity{font-size:13px;padding:10px 16px;margin:0;color:#6c5127;background:#faf3df;border-top:1px solid #ddd0ad}
#item-activity[hidden],.item-placing #item-activity{display:none}

/* The habitat is the page. Keep its square coordinate system intact at every size. */
html,body{height:100%;overflow:hidden;background:#f1f5ed}
body{height:100dvh;display:flex;flex-direction:column;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
body>header{flex:none;width:100%;max-width:none;padding:6px 16px;gap:10px;background:#f9fbf6;border-color:#d8e2d1;min-height:56px}
header .brand img{width:32px;height:32px;margin:0}
header h1{font-size:18px;letter-spacing:-.4px;line-height:1.2;margin:0}
.header-actions{display:flex;gap:4px;margin-left:auto;flex-shrink:0}
.header-actions button{background:transparent;border-color:transparent;padding:8px 10px}
#fullscreen{gap:6px}
#fullscreen[hidden]{display:none}
main{flex:1;min-height:0;width:100%;max-width:none;padding:0;margin:0}
.workspace{display:block;height:100%}
.habitat{position:relative;display:flex;flex-direction:column;height:100%;border:0;border-radius:0;background:#f1f5ed;overflow:hidden}
.world-toolbar{flex:none;padding:4px 20px;border:0;background:transparent;min-height:52px;flex-wrap:nowrap}
.live-controls{gap:12px;min-width:0}.runtime{max-width:none;font-size:11px}
#connect-live{background:#ffffffc9;border-color:#b8cbb0;color:#365e40}
.world-wrap{flex:1;min-height:0;display:grid;place-items:center;container-type:size}
#world{width:min(100cqw,100cqh);height:min(100cqw,100cqh);flex:none;aspect-ratio:1}
.world-caption{position:absolute;bottom:8px;left:20px;right:20px;padding:0;border:0;font-size:11px;align-items:end;z-index:1}
.world-caption span{background:#f1f5edd9;padding:2px 6px;border-radius:4px}
.transport{flex:none;align-self:center;border:1px solid #d8e2d1;border-radius:16px;background:#ffffffed;padding:8px;gap:6px;margin:8px 12px 12px;box-shadow:0 3px 14px #2847340d;flex-wrap:nowrap}
.transport button{border-radius:9px;white-space:nowrap}
.transport>span{display:none}
.transport #add-item{min-width:120px;background:#365e40;border-color:#365e40}
.transport #add-item:hover{background:#274b30}
#observe,#history,#play,#reset{color:#365e40;border-color:transparent;background:transparent}
#observe:hover,#history:hover,#play:hover,#reset:hover{background:#edf3e8}
.habitat>#status,.habitat>#item-activity,.habitat>#artwork-status{position:absolute;left:50%;transform:translateX(-50%);bottom:82px;z-index:4;width:max-content;max-width:min(540px,calc(100% - 24px));border:1px solid #d8e2d1;border-radius:10px;padding:8px 14px;background:#fffffff2;font-size:12px;line-height:1.5;box-shadow:0 3px 14px #2847340d;pointer-events:none}
.habitat>#item-activity{bottom:126px;background:#faf3dff5}
.habitat>#artwork-status{bottom:170px;background:#e7f0e0f5}
#placement-controls{position:fixed;bottom:max(12px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);z-index:5;border:1px solid #aac2a5;border-radius:14px;width:max-content;max-width:calc(100% - 24px);box-shadow:0 3px 14px #2847341a}
#placement-controls>div{flex-wrap:nowrap}
#placement-controls button{font-size:12px;padding:8px 12px}
.item-placing .world-wrap{margin-bottom:112px}
.item-placing .world-caption{display:none}
#object-description{z-index:6;max-width:440px;left:50%;right:auto;transform:translateX(-50%);width:calc(100% - 24px);bottom:20px;border-radius:10px}
#object-description.hover-popup{transform:none}
.game-panel{position:fixed;inset:12px 12px 12px auto;margin:0;width:min(440px,calc(100% - 24px));max-width:none;max-height:none;height:calc(100% - 24px);padding:0 24px 24px;border:1px solid #c6d6bf;border-radius:16px;overflow:auto;overscroll-behavior:contain;box-shadow:0 12px 50px #28473430}
.game-panel::backdrop{background:#233d293d}
.panel-top{position:sticky;top:0;z-index:2;display:flex;justify-content:space-between;align-items:center;gap:12px;background:white;padding:10px 0;border-bottom:1px solid #d8e2d1;margin-bottom:18px;font-size:13px;font-weight:700;color:#365e40}
.panel-top button{border:0;font-size:24px;color:#365e40}
.ledger-heading{flex-direction:column;align-items:start}
.ledger .timeline{flex-direction:column;overflow:visible}
.ledger .timeline button{width:100%;min-width:0}
.ledger h2{font-size:24px}
.game-panel .ledger-footer{flex-wrap:wrap}
@media(max-width:740px){
 body>header{padding:4px 10px;gap:8px;min-height:52px}
 header h1{font-size:15px;max-width:155px}
 header .brand img{width:28px;height:28px}
 .header-actions button{padding:8px;font-size:12px;min-width:44px}
 #fullscreen span{display:none}#fullscreen{font-size:23px}
 .world-toolbar{padding:4px 12px}.live-label{font-size:12px}.runtime{display:none}#phase{display:block;font-size:11px}
 .transport{width:calc(100% - 20px);padding:6px;gap:2px;margin:8px 10px 10px;border-radius:14px}
 .transport button{font-size:12px;padding:8px;min-width:44px}
 .transport #add-item{min-width:100px;flex:1}
 .world-caption{left:8px;right:8px}
 .game-panel{inset:auto 0 0;height:85dvh;max-height:100dvh;width:100%;padding:0 20px max(24px,env(safe-area-inset-bottom));border-radius:18px 18px 0 0}
}
@media(max-height:500px) and (min-width:600px){
 body>header{min-height:44px;padding:0 12px}header h1{font-size:15px}
 .world-toolbar{position:absolute;left:8px;top:0;z-index:2;align-items:start;padding:8px;flex-direction:column;gap:4px}
 .live-controls{flex-direction:column;align-items:start;gap:4px}.runtime{display:none}
 .transport{position:absolute;right:8px;bottom:8px;flex-direction:column;margin:0;padding:6px;width:auto}
 .transport button{width:100%}.transport #add-item{min-width:100px}
 .world-wrap{margin:0 136px}.world-caption{left:0;right:0}
 .game-panel{inset:8px 8px 8px auto;height:calc(100% - 16px);width:400px;border-radius:14px}
 .habitat>#status,.habitat>#item-activity,.habitat>#artwork-status{bottom:8px;max-width:45%;font-size:11px}
 .item-placing .world-wrap{margin:0 136px 0 0}.item-placing #placement-controls{left:auto;right:8px;bottom:8px;transform:none;max-width:180px;padding:10px}.item-placing #placement-controls>div{flex-direction:column}
}

/* The character's self-image is part of their story, with evidence one tap away. */
.self-image{margin:1rem 0;padding:1rem;border:1px solid var(--border, #b7c8cd);border-radius:16px;background:rgba(255,255,255,.045);overflow-wrap:anywhere}
.self-image-heading{display:flex;align-items:baseline;justify-content:space-between;gap:.75rem;flex-wrap:wrap}
.self-image-heading h3{margin:0;font-size:1rem}
#identity-count,.identity-progress,.identity-label{font-size:.75rem;opacity:.75}
#self-description{font-size:1rem;line-height:1.6;margin:.75rem 0}
.self-image summary{cursor:pointer;font-size:.85rem;padding:.5rem 0}
.identity-change{border-top:1px solid rgba(140,166,177,.3);margin-top:1rem;padding-top:1rem}
.identity-change strong{font-size:.8rem}
.identity-change p,.identity-change li{font-size:.85rem;line-height:1.5}
.identity-before{opacity:.65}
.identity-change ul{padding-left:1.2rem}
.identity-activity{display:block;max-width:100%;margin:.5rem 0;text-align:left;white-space:normal;font-size:.85rem}
.identity-activity[hidden]{display:none}

/* Visible feedback separates model judgments from their physical consequences. */
.habitat-story{flex:none;margin:0 20px;height:150px;max-height:150px;padding:8px 12px;border:1px solid var(--site-rule);border-radius:12px;background:#ffffffed;overflow:hidden}
.story-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:11px;font-weight:700;color:var(--site-green,#365e40)}
.story-heading button{border:0;background:transparent;padding:4px 0;font-size:12px;color:inherit}
#story-peek{display:flex;gap:16px}
.story-event{display:flex;flex-direction:column;gap:5px;text-align:left;min-width:0;overflow-wrap:anywhere;border:0;border-left:3px solid #2474a8;border-radius:0;padding:8px 12px;background:transparent;font:inherit;color:var(--ink)}
#story-peek .story-event{flex:1;padding:4px 10px}
.story-label{font-size:10px;font-weight:700;color:var(--muted)}
.story-event strong{font-size:13px;line-height:1.4}
.story-detail,.story-event p,.story-event li{font-size:12px;line-height:1.5}
#story-peek .story-event strong,#story-peek .story-detail{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.story-outcome{border-color:#287a63}.story-identity{border-color:#7953a4}
.story-empty,.story-intro{font-size:12px;line-height:1.5;margin:4px 0}
#story-events .story-event,#noul-story-events .story-event{margin:12px 0 18px;background:var(--site-ground);padding:12px}
.story-event ul{padding-left:16px;margin:4px 0}.story-event p{margin:4px 0}
.noul-inner-nav{display:flex;gap:4px;position:sticky;top:54px;background:white;z-index:2;padding:6px 0;border-bottom:1px solid var(--site-rule)}
.noul-inner-nav button{flex:1;min-width:0;padding:8px 4px;font-size:12px}
.mind-now{margin:12px 0;padding:12px;background:var(--site-ground);border-left:3px solid var(--creature)}
.mind-now h3{font-size:16px;line-height:1.4;margin:5px 0;overflow-wrap:anywhere}
.mind-now p{font-size:12px;line-height:1.5;margin:6px 0}#mind-wait{color:var(--muted)}
#mind-now,#self-image-title,#noul-story,#decision-title{scroll-margin-top:110px}
.item-placing .habitat-story{display:none}
@media(max-width:740px){.habitat-story{margin:0 10px;height:145px;max-height:145px;padding:6px 10px}#story-peek .story-event:nth-child(n+2){display:none}.story-event strong{font-size:12px}#story-peek .story-detail{font-size:11px;-webkit-line-clamp:2}.story-label{font-size:9px}.story-heading{font-size:10px}.noul-inner-nav{top:54px}}
@media(max-height:500px) and (min-width:600px){.habitat-story{position:absolute;left:10px;bottom:10px;width:240px;max-width:240px;height:120px;max-height:120px;margin:0;z-index:2}#story-peek .story-event:nth-child(n+2){display:none}.story-detail{display:none}}

/* Object names stay quiet; the full semantic description opens on hover/tap. */
.world-entity > text { display:none; }
#world #object-labels text {font-size:1.35px;font-weight:600;fill:var(--sunholo-slate,#384656);stroke:#f1f5ed;stroke-width:.45px;paint-order:stroke;stroke-linejoin:round;cursor:pointer;pointer-events:all}
#object-description strong {display:block;padding-right:22px;overflow-wrap:anywhere}
#artifact-title {margin-bottom:12px}
#session-stop {flex:none;margin:8px 20px;padding:14px 16px;border:1px solid #e5b98a;border-radius:14px;background:#fff8ef;color:#384656}
#session-stop[hidden] {display:none}
#session-stop p {font-size:13px;line-height:1.5;margin:5px 0 10px}
#session-stop small {display:block;font-size:11px;line-height:1.4;margin-top:8px}
.session-actions {display:flex;flex-wrap:wrap;gap:8px}
.session-actions button {white-space:normal}
@media(max-width:600px){#session-stop{margin:6px 10px;padding:12px}.session-actions{display:grid;grid-template-columns:1fr}.session-actions button{width:100%;font-size:12px}#world #object-labels text{font-size:1.35px}}
.habitat:has(#session-stop:not([hidden])) .habitat-story {display:none}
#session-stop {max-height:50dvh;overflow:auto}
@media(max-height:500px) and (min-width:600px){#session-stop{position:absolute;right:140px;bottom:8px;width:310px;z-index:5;max-height:75dvh}}

.bank-actions {flex-wrap:wrap;max-width:100%}
/* Preview text fits its reserved space; the Story panel keeps the full account. */
#story-peek .story-event strong {-webkit-line-clamp:1}
#story-peek .story-label {white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
