/* Langerhans — the look of the world. Dark by nature: this is a night world, lit from within. */
:root {
  --ink: #ece4d4; --ink2: #b9ae9a; --ink3: #7d7466;
  --glass: rgba(14, 12, 18, 0.72); --glass2: rgba(20, 18, 26, 0.9);
  --line: rgba(236, 228, 212, 0.14);
  --accent: #e8d9b0;
  --serif: 'EB Garamond', 'Iowan Old Style', Georgia, serif;
  --display: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #08070b; color: var(--ink); font-family: var(--serif); }
body.nogl #sky { display: none; }
#sky, #motes { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#sky { image-rendering: auto; filter: saturate(1.05); }
#motes { pointer-events: none; z-index: 2; }
#world { position: fixed; inset: 0; z-index: 1; }
.stage { position: absolute; inset: 0; }
.scene { position: absolute; inset: 0; will-change: transform, opacity; }
.scene-svg { width: 100%; height: 100%; display: block; overflow: visible; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }

/* ---------- motion vocabulary (CSS only; cheap) ---------- */
@keyframes sway { 0%, 100% { transform: rotate(calc(var(--amp, 3deg) * -1)); } 50% { transform: rotate(var(--amp, 3deg)); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(var(--amp, -8px)); } }
@keyframes pulse { 0%, 100% { opacity: var(--lo, .45); } 50% { opacity: var(--hi, 1); } }
@keyframes flicker { 0%, 100% { opacity: 1; } 12% { opacity: .78; } 20% { opacity: .95; } 47% { opacity: .7; } 52% { opacity: 1; } 80% { opacity: .85; } }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(var(--dx, 100px)); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(var(--amp, 1.05)); } }
@keyframes flowdash { to { stroke-dashoffset: var(--dashlen, -240px); } }
@keyframes rise { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: var(--hi, .9); } 100% { transform: translateY(var(--amp, -160px)); opacity: 0; } }
@keyframes twinkle { 0%, 100% { opacity: .15; } 50% { opacity: .95; } }
.sway { animation: sway var(--dur, 6s) ease-in-out var(--delay, 0s) infinite; }
.bob { animation: bob var(--dur, 5s) ease-in-out var(--delay, 0s) infinite; }
.pulse { animation: pulse var(--dur, 4s) ease-in-out var(--delay, 0s) infinite; }
.flicker { animation: flicker var(--dur, 3s) linear var(--delay, 0s) infinite; }
.drift { animation: drift var(--dur, 9s) linear var(--delay, 0s) infinite; }
.spin { animation: spin var(--dur, 30s) linear var(--delay, 0s) infinite; }
.spin.rev { animation-direction: reverse; }
.breathe { animation: breathe var(--dur, 6s) ease-in-out var(--delay, 0s) infinite; }
.flowdash { animation: flowdash var(--dur, 6s) linear var(--delay, 0s) infinite; }
.rise { animation: rise var(--dur, 7s) ease-out var(--delay, 0s) infinite; }
.twinkle { animation: twinkle var(--dur, 4s) ease-in-out var(--delay, 0s) infinite; }
@media (prefers-reduced-motion: reduce) {
  .sway, .bob, .drift, .spin, .breathe, .flowdash, .rise { animation-duration: calc(var(--dur, 6s) * 4); }
}

/* ---------- interactive things in the scene ---------- */
.spot, .exit, .stone, .lens { cursor: pointer; outline: none; }
.spot-halo { opacity: .35; transition: opacity .4s; }
.spot-ring { fill: rgba(10, 8, 14, .55); stroke-width: 1.5; stroke-opacity: .9; }
.spot-wave { fill: none; stroke-width: 1.2; transform-box: fill-box; transform-origin: center; animation: spotwave 4s ease-out infinite; }
@keyframes spotwave { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(2.4); opacity: 0; } }
.spot-glyph { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.spot-label { font-family: var(--display); font-style: italic; font-size: 19px; fill: var(--ink); text-anchor: middle; opacity: 0; transition: opacity .3s; paint-order: stroke; stroke: rgba(8, 7, 11, .85); stroke-width: 4px; }
.spot:hover .spot-label, .spot:focus .spot-label, .spot.found .spot-label { opacity: .85; }
.spot:hover .spot-halo, .spot:focus .spot-halo { opacity: .9; }
.spot.found .spot-wave { animation: none; opacity: 0; }
.spot.found .spot-ring { stroke-dasharray: 3 3; }
.spot.found .spot-glyph { stroke: var(--accent); }
.spot:focus-visible .spot-ring, .exit:focus-visible .exit-line, .stone:focus-visible .stone-body, .lens:focus-visible .lens-ring { stroke: #fff; stroke-width: 3; }

.exit-line { fill: none; stroke-width: 2; stroke-opacity: .8; stroke-linecap: round; }
.exit-line.thin { stroke-width: 1; stroke-opacity: .4; }
.exit-fill { opacity: .55; transition: opacity .4s; }
.exit:hover .exit-fill, .exit:focus .exit-fill { opacity: 1; }
.exit-label { font-family: var(--display); font-style: italic; font-size: 20px; fill: var(--ink); text-anchor: middle; opacity: .55; transition: opacity .3s; paint-order: stroke; stroke: rgba(8, 7, 11, .8); stroke-width: 4px; }
.exit:hover .exit-label, .exit:focus .exit-label, .stone:hover .exit-label, .lens .exit-label { opacity: 1; }
.exit.sealed { opacity: .3; cursor: not-allowed; }
.chev { animation: pulse 1.6s ease-in-out infinite; }
.hole-swirl { transform-box: fill-box; transform-origin: center; animation: breathe 3s ease-in-out infinite; --amp: 1.25; }
.hole-core { animation: pulse 3s ease-in-out infinite; }

.stone-body { fill: #17151b; stroke: #6a6152; stroke-width: 1.5; }
.stone-rune { fill: none; stroke: #6a6152; stroke-width: 1.6; stroke-linecap: round; }
.stone-flame { fill: #ffd79a; opacity: 0; transform-box: fill-box; transform-origin: bottom center; }
.stone-glow { opacity: 0; transition: opacity 1s; }
.stone.lit .stone-flame { opacity: 1; animation: flicker 2.2s linear infinite; }
.stone.lit .stone-glow { opacity: .8; }
.stone.lit .stone-rune { stroke: #ffd79a; }
.stone:hover .stone-rune { stroke: #ffd79a; }

.lens-ring { fill: rgba(8, 7, 11, .4); stroke-width: 1.6; transform-box: fill-box; transform-origin: center; animation: breathe 5s ease-in-out infinite; --amp: 1.06; }
.lens-ring.dashed { fill: none; stroke-dasharray: 4 6; animation: spin 24s linear infinite; }
.lens-label { font-size: 22px; }

.inscr { pointer-events: none; }
.flow path { pointer-events: none; }

/* ---------- the page ---------- */
.page {
  position: fixed; z-index: 5; left: 22px; top: 22px; bottom: 22px; width: min(380px, 36vw);
  background: linear-gradient(180deg, rgba(14, 12, 18, .78), rgba(14, 12, 18, .62));
  border: 1px solid var(--line); border-radius: 4px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 26px 26px 18px; overflow-y: auto; opacity: 0; transform: translateX(-12px); transition: opacity .9s ease, transform .9s ease;
  scrollbar-width: thin; scrollbar-color: rgba(236, 228, 212, .2) transparent;
}
.page.show { opacity: 1; transform: none; }
.page.hidden { opacity: 0 !important; pointer-events: none; transform: translateX(-30px) !important; }
.page header small { font-family: var(--mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); opacity: .85; }
.page h1 { font-family: var(--display); font-weight: 500; font-size: 34px; line-height: 1.05; margin: 6px 0 8px; letter-spacing: .01em; }
.page .epi { display: block; font-family: var(--display); font-size: 18px; color: var(--ink2); margin-bottom: 14px; line-height: 1.35; }
.page-body p { font-size: 16.5px; line-height: 1.58; margin: 0 0 12px; color: #ddd4c2; }
.page-body h3 { font-family: var(--mono); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink3); font-weight: 500; margin: 20px 0 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.page ul { list-style: none; margin: 0; padding: 0; }
.page li { margin: 5px 0; font-size: 16px; }
.page li a { text-decoration: none; color: var(--ink); border-bottom: 1px dotted rgba(236, 228, 212, .25); }
.page li a:hover { color: var(--accent); }
.page li a.found { color: var(--accent); }
.page .xk { font-family: var(--mono); font-size: 10.5px; color: var(--ink3); margin-left: 4px; }
.page-btn, .ui-btn { background: rgba(236, 228, 212, .06); border: 1px solid var(--accent); color: var(--ink); border-radius: 3px; padding: 7px 14px; cursor: pointer; font-family: var(--display); font-size: 18px; font-style: italic; }
.page-btn:hover, .ui-btn:hover { background: rgba(236, 228, 212, .14); }
.ui-btn.ghost, .page-btn.ghost { border-color: var(--line); font-size: 15px; }
.page-btn { display: inline-block; text-decoration: none; }
.ui-btn[hidden], .page-btn[hidden] { display: none; }
.stone-note { font-style: italic; color: var(--ink2); }
.page-grip { display: none; }
.lore-link { color: var(--accent); text-decoration: none; border-bottom: 1px dotted var(--accent); }
.lore-link:not(.found) { opacity: .8; }

/* ---------- HUD ---------- */
.hud { position: fixed; z-index: 6; right: 18px; top: 18px; display: flex; gap: 8px; }
.hud-btn { position: relative; display: flex; align-items: center; gap: 6px; background: var(--glass); border: 1px solid var(--line); border-radius: 3px; padding: 7px 11px; cursor: pointer; color: var(--ink2); font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; backdrop-filter: blur(4px); }
.hud-btn:hover, .hud-btn.on { color: var(--ink); border-color: var(--accent); }
.hud-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.hud-btn b { font-weight: 500; color: var(--accent); }
.tidegauge { display: none; }

.veil { position: fixed; inset: 0; z-index: 4; background: #000; opacity: 0; pointer-events: none; transition: opacity .45s; }
.veil.on { opacity: .35; }
.toast { position: fixed; z-index: 9; left: 50%; bottom: 26px; transform: translate(-50%, 20px); background: var(--glass2); border: 1px solid var(--line); border-radius: 3px; padding: 10px 18px; font-family: var(--display); font-style: italic; font-size: 19px; color: var(--ink); opacity: 0; transition: all .5s; pointer-events: none; max-width: min(640px, 90vw); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.kcard { position: fixed; z-index: 7; left: 50%; top: 40%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; animation: kin 1.6s ease both; }
.kcard.out { animation: kout 1.4s ease both; }
.kcard small { font-family: var(--mono); letter-spacing: .4em; text-transform: uppercase; font-size: 11px; color: var(--ink2); }
.kcard h2 { font-family: var(--display); font-weight: 400; font-size: clamp(40px, 7vw, 86px); margin: 8px 0; letter-spacing: .04em; color: var(--ink); text-shadow: 0 0 40px var(--accent); }
.kcard em { font-family: var(--display); font-size: 22px; color: var(--ink2); }
@keyframes kin { from { opacity: 0; letter-spacing: .3em; filter: blur(6px); } to { opacity: 1; letter-spacing: .04em; filter: none; } }
@keyframes kout { to { opacity: 0; filter: blur(8px); } }

/* ---------- overlays ---------- */
.overlay[hidden] { display: none !important; }
.overlay { position: fixed; inset: 0; z-index: 8; display: flex; align-items: center; justify-content: flex-end; background: rgba(4, 3, 6, 0); transition: background .35s; }
.overlay.show { background: rgba(4, 3, 6, .45); }
.ov-panel { position: relative; margin: 18px; width: min(560px, 100%); max-height: calc(100% - 36px); overflow-y: auto; background: var(--glass2); border: 1px solid var(--line); border-radius: 4px; padding: 28px 30px; transform: translateX(30px); opacity: 0; transition: all .45s cubic-bezier(.2, .7, .2, 1); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); scrollbar-width: thin; scrollbar-color: rgba(236, 228, 212, .2) transparent; }
.overlay.show .ov-panel { transform: none; opacity: 1; }
.overlay.toy, .overlay.map, .overlay.journal { justify-content: center; }
.overlay.toy .ov-panel { width: min(1080px, 100%); }
.overlay.map .ov-panel { width: min(1100px, 100%); }
.overlay.journal .ov-panel { width: min(900px, 100%); }
.ov-close { position: absolute; right: 12px; top: 8px; background: none; border: none; font-size: 30px; color: var(--ink2); cursor: pointer; line-height: 1; z-index: 2; }
.ov-close:hover { color: var(--ink); }
.ov-panel header small, .toy-head small, .map-head small { font-family: var(--mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.ov-panel h2 { font-family: var(--display); font-weight: 500; font-size: 34px; margin: 6px 0 4px; line-height: 1.1; }
.lore-card .real { font-family: var(--mono); font-size: 12px; color: var(--ink2); }
.lore-card code { font-family: var(--mono); font-size: 11px; color: var(--accent); border: 1px solid var(--line); padding: 1px 5px; border-radius: 2px; }
.status { display: inline-block; margin-top: 10px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; padding: 3px 8px; border-radius: 2px; border: 1px solid var(--line); color: var(--ink2); }
.status::before { content: '● '; }
.st-on { color: #b9d9a8; } .st-off { color: #9fb2c8; } .st-scenario { color: #d6b6f0; } .st-rejected { color: #c9a090; } .st-concept { color: var(--accent); } .st-unmodelled { color: var(--ink3); }
.st-off::before { content: '○ '; } .st-scenario::before { content: '◇ '; } .st-rejected::before { content: '✕ '; } .st-concept::before { content: '✦ '; } .st-unmodelled::before { content: '· '; }
.lore-body h3 { font-family: var(--mono); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink3); font-weight: 500; margin: 22px 0 8px; }
.lore-body p, .lore-body .tale, .lore-body .model { font-size: 17px; line-height: 1.6; color: #ddd4c2; }
.lore-body .tale p:first-child::first-letter { font-family: var(--display); font-size: 2.6em; float: left; line-height: .85; padding: 4px 6px 0 0; color: var(--accent); }
.lore-body p { margin: 0 0 10px; }
.nums { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.nums th { text-align: left; font-weight: 400; color: var(--ink2); padding: 6px 12px 6px 0; vertical-align: top; width: 42%; border-top: 1px solid var(--line); }
.nums td { font-family: var(--mono); font-size: 12.5px; padding: 7px 0; color: var(--ink); border-top: 1px solid var(--line); line-height: 1.5; }
.basis b { color: var(--accent); font-weight: 500; }
.evidence { font-size: 14.5px !important; color: var(--ink2) !important; }
.links .chip { display: inline-block; margin: 0 4px 6px 0; padding: 3px 9px; border: 1px solid var(--line); border-radius: 20px; text-decoration: none; color: var(--ink2); font-size: 14px; }
.links .chip.found { color: var(--accent); border-color: var(--accent); }
.ref { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(232, 217, 176, .35); }
.ref:hover { border-bottom-color: var(--accent); }
.ref-paper::after { content: ' ↗'; font-size: .8em; opacity: .7; }
.repo-line { font-family: var(--mono); font-size: 11.5px !important; color: var(--ink3) !important; letter-spacing: .02em; margin-top: 14px !important; }
.repo-line .ref { color: var(--ink2); }
.status-note { font-style: italic; color: var(--ink3) !important; font-size: 14px !important; margin-top: 18px !important; }

/* journal */
.journal .jprog { font-family: var(--mono); font-size: 12px; color: var(--ink2); }
.journal .jprog b { color: var(--accent); font-weight: 500; }
.jbody { columns: 2 300px; column-gap: 34px; margin-top: 18px; }
.jbody section { break-inside: avoid; margin-bottom: 18px; }
.jbody h3 { font-family: var(--display); font-weight: 500; font-size: 22px; margin: 0 0 6px; color: var(--k); border-bottom: 1px solid var(--line); padding-bottom: 4px; display: flex; justify-content: space-between; }
.jbody h3 span { font-family: var(--mono); font-size: 11px; color: var(--ink3); align-self: flex-end; }
.jbody ul { list-style: none; padding: 0; margin: 0; }
.jbody li { margin: 4px 0; }
.jbody li a { text-decoration: none; color: var(--ink); display: block; }
.jbody li a b { font-weight: 400; font-family: var(--display); font-size: 18px; font-style: italic; }
.jbody li a span { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--ink3); }
.jbody li a:hover b { color: var(--accent); }
.jbody li.unseen { color: var(--ink3); font-size: 13px; font-style: italic; }
.jfoot { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 14px; }
.jfoot p { font-size: 14.5px; color: var(--ink2); line-height: 1.55; }

/* map */
.map-head p { color: var(--ink2); font-style: italic; margin: 4px 0 10px; }
.map-box { width: 100%; }
.map-svg { width: 100%; height: auto; display: block; background: radial-gradient(ellipse at 50% 50%, #12202a 0%, #0a0f15 70%); border: 1px solid var(--line); border-radius: 3px; }
.map-contour { fill: none; stroke: rgba(150, 190, 210, .07); stroke-width: 1; }
.isle-shape { stroke-width: 1.2; fill-opacity: .55; }
.map-isle:not(.seen) .isle-shape { fill-opacity: .4; stroke-dasharray: 3 4; }
.isle-reef { stroke-width: .8; stroke-dasharray: 2 5; opacity: .5; }
.map-kname { font-family: var(--display); font-size: 19px; font-style: italic; text-anchor: middle; fill: var(--ink); opacity: .9; }
.map-isle:not(.seen) .map-kname { fill: var(--ink3); font-size: 14px; letter-spacing: .2em; }
.map-path { fill: none; stroke: rgba(236, 228, 212, .18); stroke-width: 1; stroke-dasharray: 2 4; }
.map-path.walked { stroke: rgba(236, 228, 212, .5); stroke-dasharray: none; }
.map-rname { font-family: var(--mono); font-size: 9.5px; text-anchor: middle; fill: var(--ink2); paint-order: stroke; stroke: #0a0f15; stroke-width: 3px; }
.map-room.travel { cursor: pointer; }
.map-room.travel:hover .map-rname { fill: #ffd79a; }
.map-stone { animation: pulse 2.4s ease-in-out infinite; }
.here-ring { fill: none; stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: breathe 1.8s ease-in-out infinite; --amp: 1.5; }

/* toys */
.toy-head h2 { margin-bottom: 10px; }
.toy-body { display: block; }
.toy-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(240px, 1fr); gap: 22px; align-items: start; }
.toy-controls { display: flex; flex-direction: column; gap: 12px; }
.toy-text p, .ui-note { font-size: 15.5px; line-height: 1.55; color: #d7cebd; margin: 0 0 10px; }
.toy-text em, .ui-note em { color: var(--accent); font-style: italic; }
.ui-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ui-slider { display: flex; flex-direction: column; gap: 4px; }
.ui-label { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); }
.ui-val { font-weight: 500; color: var(--ink); letter-spacing: 0; text-transform: none; }
.ui-hint { font-size: 13px; color: var(--ink3); font-style: italic; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 2px; background: rgba(236, 228, 212, .25); }
input[type=range]::-moz-range-track { height: 2px; background: rgba(236, 228, 212, .25); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -7px; border-radius: 50%; background: var(--accent); border: 2px solid #15131b; box-shadow: 0 0 10px var(--accent); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 2px solid #15131b; }
.ui-toggle { display: inline-flex; align-items: center; gap: 8px; background: none; border: 1px solid var(--line); border-radius: 20px; padding: 4px 12px 4px 6px; cursor: pointer; color: var(--ink2); font-size: 14.5px; }
.ui-toggle i { width: 26px; height: 14px; border-radius: 8px; background: rgba(236, 228, 212, .15); position: relative; transition: background .25s; }
.ui-toggle i::after { content: ''; position: absolute; left: 2px; top: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--ink3); transition: all .25s; }
.ui-toggle.on { color: var(--ink); border-color: var(--accent); }
.ui-toggle.on i { background: rgba(236, 228, 212, .3); }
.ui-toggle.on i::after { left: 14px; background: var(--accent); }
.ui-choice { display: flex; flex-direction: column; gap: 5px; }
.ui-seg { display: flex; flex-wrap: wrap; gap: 4px; }
.ui-seg button { background: none; border: 1px solid var(--line); color: var(--ink2); padding: 4px 10px; border-radius: 2px; cursor: pointer; font-size: 14.5px; }
.ui-seg button.on { border-color: var(--accent); color: var(--ink); background: rgba(236, 228, 212, .08); }
.ui-readout { display: flex; flex-direction: column; padding: 6px 10px; border-left: 2px solid var(--accent); }
.ui-readout b { font-family: var(--mono); font-weight: 500; font-size: 19px; color: var(--ink); }
.ui-readout span { font-size: 12.5px; color: var(--ink3); }
.readouts { display: flex; flex-wrap: wrap; gap: 6px 14px; }

.plot { margin-bottom: 12px; }
.plot-title { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink2); margin-bottom: 4px; }
.plot-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13.5px; color: var(--ink2); margin-bottom: 4px; }
.lg-item { display: inline-flex; align-items: center; gap: 6px; }
.lg-item i { width: 14px; height: 2px; display: inline-block; }
.plot-box { position: relative; background: #15131b; border: 1px solid var(--line); border-radius: 3px; }
.plot-box canvas { width: 100%; height: 100%; display: block; }
.plot-tip { position: absolute; display: none; grid-template-columns: auto auto; gap: 2px 12px; min-width: 150px; background: rgba(8, 7, 11, .94); border: 1px solid var(--line); padding: 6px 9px; border-radius: 3px; font-size: 12.5px; color: var(--ink2); pointer-events: none; z-index: 3; }
.plot-tip .tip-h { grid-column: 1 / -1; font-family: var(--mono); color: var(--ink); font-size: 11.5px; }
.plot-tip span { display: flex; align-items: center; gap: 5px; }
.plot-tip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.plot-tip b { font-family: var(--mono); font-weight: 500; color: var(--ink); text-align: right; }
.toy-canvas { width: 100%; display: block; border-radius: 3px; border: 1px solid var(--line); background: #0d0c11; }

/* ---------- threshold title ---------- */
.title-block { text-align: left; }
.begin-row { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin: 2px 0 18px; }

/* ---------- narrow & portrait screens: the page becomes a sheet ---------- */
@media (max-width: 760px), (orientation: portrait) {
  .page { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 34vh; border-radius: 10px 10px 0 0; padding: 10px 16px 14px; transform: translateY(20px); transition: max-height .5s ease, opacity .6s, transform .6s; }
  .page.open { max-height: 82vh; }
  .page h1 { font-size: 26px; }
  .page .epi { font-size: 16px; margin-bottom: 8px; }
  .page-grip { display: block; width: 44px; height: 4px; border-radius: 2px; background: rgba(236, 228, 212, .3); margin: 0 auto 8px; cursor: pointer; }
  .hud { right: 10px; top: 10px; gap: 5px; }
  .hud-btn span { display: none; }
  .ov-panel { margin: 0; max-height: 100%; height: 100%; border-radius: 0; padding: 22px 16px; width: 100% !important; }
  .toy-grid { grid-template-columns: 1fr; }
  .jbody { columns: 1; }
  .spot-label, .exit-label { font-size: 26px; }
  .toast { top: 58px; bottom: auto; transform: translate(-50%, -10px); font-size: 16px; }
  .toast.on { transform: translate(-50%, 0); }
}
body.portrait .stage { bottom: 30vh; top: 40px; }
.map-isle:not(.visited) .isle-shape { fill-opacity: .28; }
.map-room:not(.visited) .map-rname { fill: var(--ink3); }
.map-stone.unvisited { animation: none; stroke-width: 1.2; }
.map-isle:not(.visited) .map-kname { fill: var(--ink2); }

/* visitors' notes and the message form */
.notes-quiet { color: var(--ink3); font-style: italic; }
.note { margin: 0 0 14px; padding: 2px 0 2px 14px; border-left: 2px solid var(--accent); }
.note p { margin: 0 0 6px; }
.note footer { font-family: var(--mono); font-size: 11px; color: var(--ink3); }
.note footer a { color: var(--ink2); }
.overlay.write .ov-panel h2 { font-family: var(--display); font-weight: 500; font-size: 32px; margin: 4px 0 14px; }
.overlay.write header small { font-family: var(--mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.write-form { display: flex; flex-direction: column; gap: 14px; }
.write-kind { border: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.write-kind legend { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink3); margin-bottom: 6px; }
.write-kind label { display: grid; grid-template-columns: 22px 1fr; column-gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 3px; cursor: pointer; }
.write-kind label:has(input:checked) { border-color: var(--accent); background: rgba(236, 228, 212, .05); }
.write-kind input { grid-row: span 2; margin: 4px 0 0; accent-color: var(--accent); }
.write-kind span { color: var(--ink2); font-size: 15px; }
.write-field { display: flex; flex-direction: column; gap: 6px; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink3); position: relative; }
.write-field i { text-transform: none; letter-spacing: 0; }
.write-field textarea, .write-field input { font-family: var(--serif); font-size: 17px; letter-spacing: 0; text-transform: none; color: var(--ink); background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 3px; padding: 9px 11px; resize: vertical; }
.write-field textarea:focus, .write-field input:focus { outline: none; border-color: var(--accent); }
.write-field[hidden] { display: none; }
.write-count { align-self: flex-end; letter-spacing: 0; }
.write-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.write-rules { font-size: 14px; color: var(--ink2); margin: 0; }
.write-actions { margin: 0; display: flex; align-items: center; gap: 12px; }
.write-status { color: var(--ink2); font-style: italic; }
.write-done { font-family: var(--display); font-size: 21px; font-style: italic; }
.nums .plain { display: block; margin-top: 3px; font-family: var(--serif); font-style: italic; font-size: 14px; line-height: 1.35; color: var(--ink2); }
.jbody h3 { background: linear-gradient(var(--k), var(--k)) no-repeat left bottom / calc(var(--p, 0) * 100%) 2px; }

/* touch screens have no hover, so the markers carry their names all the time */
@media (hover: none) {
  .spot-label { opacity: .85; font-size: 30px; }
}
@media (hover: none) { .spot-label.crowded { opacity: 0; } }
.page li ul { margin: 6px 0 4px 2px; }
.page li li { position: relative; padding-left: 16px; font-size: 15.5px; }
.page li li::before { content: ''; position: absolute; left: 3px; top: .7em; width: 6px; height: 1px; background: var(--accent); }
.page-body ul:not([class]) > li { margin: 11px 0; }

/* ---------- the look (js/core/style.js) ---------- */
.style-picker { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 20; display: flex; gap: 4px; align-items: center; padding: 6px 8px; background: rgba(10, 9, 14, .85); border: 1px solid var(--line); border-radius: 4px; font-family: var(--mono); font-size: 11px; color: var(--ink2); }
.style-picker span { letter-spacing: .14em; text-transform: uppercase; margin-right: 6px; }
.style-picker button { font: inherit; color: var(--ink); background: none; border: 1px solid var(--line); border-radius: 3px; padding: 4px 8px; cursor: pointer; }
.style-picker button.on { border-color: #e8c27a; color: #e8c27a; }

html:not([class*=style-]) #world::after, .style-plain #world::after { display: none; }

/* Ink & glow: softened shapes washed with pigment, paper grain over everything, colour kept so the lights read */
.style-soft #sky { filter: saturate(.9) sepia(.12); }
.style-soft #world::after {
  background:
    radial-gradient(ellipse at 50% 45%, transparent 45%, rgba(20, 12, 6, .55) 100%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.55  0 0 0 0 0.47  0 0 0 0 0.36  0 0 0 1.1 -0.25'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay; opacity: .5;
}
.style-soft .page, .style-soft .ov-panel {
  background: rgba(24, 19, 15, .9) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.6' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.9  0 0 0 0 0.8  0 0 0 0 0.65  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  border: none; border-radius: 2px; box-shadow: 0 0 0 1px rgba(236, 210, 170, .08), 0 18px 60px rgba(0, 0, 0, .55);
}
.style-soft .page h1, .style-soft .ov-panel h2 { font-style: italic; font-weight: 400; letter-spacing: 0; }
