:root {
  color-scheme: light;
  --ink:#34372d; --muted:#686b5d; --line:#d5d3c4; --paper:#fffdf4; --orange:#efb852;
  --board-size:clamp(470px,calc(var(--toy-height,100svh) - 243px),660px);
  font-family:"DM Sans","PingFang SC","Microsoft YaHei","Noto Sans CJK SC",system-ui,sans-serif;
  color:var(--ink); background:#f5f3e9; font-synthesis:none;
}
* { box-sizing:border-box; }
body { margin:0; min-height:100svh; background-image:radial-gradient(#b8b49966 .7px,transparent .8px); background-size:8px 8px; }
button,input { font:inherit; color:inherit; }
button { cursor:pointer; touch-action:manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, #board:focus-visible { outline:3px solid #547a73; outline-offset:2px; }
button:disabled { cursor:default; opacity:.48; }
button:active:not(:disabled) { transform:translateY(1px); }
[hidden] { display:none!important; }
.wrap { width:min(calc(100% - 56px),calc(var(--board-size) + 354px)); margin:0 auto; }
.masthead { background:#faf8ef; border-bottom:1px solid #d8d5c7; }
.top { height:66px; display:flex; align-items:center; justify-content:space-between; }
.wordmark { display:flex; align-items:center; gap:12px; }
#mark { display:block; width:39px; height:39px; background:#efbd60; image-rendering:pixelated; border:1px solid #685941; border-radius:7px; box-shadow:0 2px #c7ba9c; }
.wordmark h1 { display:block; margin:0; font-size:26px; font-weight:780; letter-spacing:.045em; line-height:1.16; }
.wordmark small { display:block; font:600 11px/1.4 ui-monospace,"SFMono-Regular",monospace; color:#726b55; }
nav,.board-controls,.section-line,.dialog-head,.board-top,.page-heading,.panel-title { display:flex; align-items:center; justify-content:space-between; }
nav { gap:9px; }
button { display:inline-flex; align-items:center; justify-content:center; gap:7px; border:1px solid transparent; border-radius:6px; background:transparent; line-height:1.2; }
button canvas,.dimensions canvas { flex-shrink:0; pointer-events:none; }
.nav-button { padding:9px 12px; font-size:14px; font-weight:580; }
.nav-button:hover { background:#edeade; }
.page-heading { margin:25px 0 19px; gap:16px; }
h1,h2,h3,p { margin:0; }
.page-heading p { margin:0; font-size:13px; color:var(--muted); }
.primary { background:var(--orange); border:1px solid #857049; box-shadow:0 2px #c5ae7a; min-height:39px; padding:8px 16px; font-size:14px; font-weight:680; color:#44371f; }
.primary:hover { background:#f9c668; }
.workbench { display:grid; grid-template-columns:minmax(0,1fr) 334px; align-items:start; gap:20px; }
.board-card,.panel { background:var(--paper); border:1px solid #c9c7b8; border-radius:10px; box-shadow:0 3px 0 #7b785c20; overflow:hidden; }
.board-top { padding:0 14px; height:39px; }
.scene-name,.sim-status,.current-icon,.section-line span,.dimensions,.footer-key,.card-title { display:inline-flex; align-items:center; }
.scene-name { gap:9px; font-size:13px; }
.scene-dot { display:inline-block; width:13px; height:12px; position:relative; background:linear-gradient(to bottom,#deb568 30%,transparent 30%) 0 0/3px 100% no-repeat; }
.scene-dot:after { content:""; position:absolute; inset:0; background:#977a4e; clip-path:polygon(0 83%,30% 45%,49% 62%,70% 24%,100% 83%,100% 100%,0 100%); }
.sim-status { font-size:11px; font-weight:600; color:#547058; gap:6px; }
.sim-status i { width:6px; height:6px; border-radius:50%; background:#6a9061; }
.sim-status.paused { color:#9a6a32; }.sim-status.paused i {background:#c98f43;}
#board-wrap { position:relative; aspect-ratio:1; overflow:hidden; background:#f4e4dd; border-block:1px solid #c9c7b8; }
#board { display:block; width:100%; height:100%; image-rendering:pixelated; touch-action:none; cursor:crosshair; }
#cursor { position:absolute; pointer-events:none; border:1px solid #fff9ee; outline:1px solid #4a4944bb; border-radius:50%; transform:translate(-50%,-50%); }
#cursor.stamp-outline {border-radius:2px;}
#cursor.gravity-outline {border:1px dashed #826785;outline:1px dotted #fff1cfab;box-shadow:inset 0 0 0 1px #fff1cf55;}
#cursor.gravity-outline::after {content:"";position:absolute;left:50%;top:50%;width:3px;height:3px;background:#462f4c;box-shadow:0 0 0 1px #ffe5b4;transform:translate(-50%,-50%);}
.page-heading .primary {flex-shrink:0;}
@media (pointer:fine) { #board:hover { cursor:none; } }
.board-controls { min-height:49px; gap:4px; padding:7px 10px; justify-content:flex-start; }
.board-controls button { border-radius:5px; font-size:13px; padding:6px 8px; min-height:32px; }
.board-controls button:hover:not(:disabled),.icon-only:hover { background:#eeecdf; }
.icon-only { padding:5px; width:33px; height:33px; }
#expand { margin-left:auto; }
.board-controls {flex-wrap:wrap;}
.board-controls .audio-toggle {gap:4px;white-space:nowrap;}
.audio-toggle small {font-size:10px;color:var(--muted);}
.audio-toggle[aria-pressed=true] {background:#e8eddd;}
#mute[aria-pressed=true] {background:#f1dbcc;}
@media(max-width:460px) {
  .music-prefix {display:none;}
  .board-controls .audio-toggle {padding-inline:4px;gap:3px;}
}
.panel { padding:18px 17px 15px; }
.panel-title { margin-bottom:14px; }
h2 { font-size:20px; letter-spacing:-.025em; font-weight:750; }
.panel-title>span,.section-line span { font:500 11px/1.4 ui-monospace,"PingFang SC",monospace; color:var(--muted); }
.group { margin:0 0 11px; }
.group h3,.section-line h3 { font-size:11px; color:#676953; font-weight:650; letter-spacing:.05em; }
.group h3 { margin-bottom:5px; }
.swatches { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; }
.wonder-group .swatches {grid-template-columns:repeat(3,minmax(0,1fr));}
.swatch { padding:5px 1px 4px; min-height:41px; flex-direction:column; gap:2px; border:1px solid color-mix(in srgb,var(--tint) 23%,#e2dfd0); background:color-mix(in srgb,var(--tint) 9%,#fffdf3); border-radius:5px; position:relative; line-height:1.06; font-size:11px; font-weight:600; }
.swatch:hover,.tool:hover { background:color-mix(in srgb,var(--tint) 19%,#fffdf3); }
.swatch[aria-pressed=true],.tool[aria-pressed=true] { border-color:color-mix(in srgb,var(--tint) 66%,#273626); background:color-mix(in srgb,var(--tint) 25%,#fffdf3); box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--tint) 60%,#41483d); }
.swatch[aria-pressed=true]:after { content:""; position:absolute; top:3px;right:3px; width:4px;height:4px;background:color-mix(in srgb,var(--tint) 68%,#273626); }
.stamp { image-rendering:pixelated; }
.brush-block { border-top:1px solid var(--line); padding:12px 0; margin-top:13px; }
#brushes { display:grid; grid-template-columns:repeat(5,1fr); gap:5px; margin:7px 0; }
#stamp-tip {display:flex;align-items:center;min-height:28px;margin:7px 0;font-size:12px;line-height:1.5;color:var(--muted);}
.brush,.tool { background:#f5f3e7; border:1px solid #d8d5c4; border-radius:5px; min-height:28px; }
.brush i { display:block; border-radius:50%; background:#686856; }
.brush[aria-pressed=true] { border-color:#a28a55; background:#f2ddb0; box-shadow:inset 0 0 0 1px #b7a06c; }
.brush:hover { background:#ebe6d4; }
#tools { display:flex; gap:5px; }
/* Earthquake tools: a magnitude selector, not a material. */
.quake-group .swatches { grid-template-columns:repeat(4,minmax(0,1fr)); }
.quake { gap:4px; justify-content:center; font-weight:600; }
.quake .quake-mark { width:9px; height:9px; flex:0 0 auto; border-radius:50%; background:
  radial-gradient(circle at 50% 50%,color-mix(in srgb,var(--tint) 92%,#2b1c12) 0 35%,transparent 38%),
  conic-gradient(from 0deg,var(--tint),color-mix(in srgb,var(--tint) 40%,#fff8ea),var(--tint)); }
.quake[aria-pressed=true] { box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--tint) 70%,#41483d),0 0 0 1px color-mix(in srgb,var(--tint) 45%,#fffdf3); }
.tool { flex:1; font-size:12px; font-weight:580; gap:5px; min-height:28px; }
#current { background:#edeedc; padding:10px; display:flex; align-items:center; gap:10px; border-radius:6px; border:1px solid #d4d9be; min-height:53px; }
.current-icon { width:32px; height:32px; flex-shrink:0; justify-content:center; border:1px solid #fff9; border-radius:5px; background:#fff8; }
#current h3 { font-size:13px; margin-bottom:2px; } #current p {font-size:11px; line-height:1.55; color:#565b4a; }
footer { display:flex; align-items:center; justify-content:space-between; margin:15px 1px 24px; color:#686a5c; font-size:11px; }
.footer-key { gap:6px; } footer b {font-weight:400;color:#a5a48f;} kbd { padding:1px 4px;border:1px solid #d1cfbf;border-radius:3px;background:#f8f6ed;font:500 10px/1.25 ui-monospace,"PingFang SC",monospace; }
.dimensions { gap:5px;font:11px ui-monospace,monospace; }.footer-touch{display:none;}
dialog { color:var(--ink); width:min(540px,calc(100% - 26px)); padding:0; border:1px solid #afa995; border-radius:12px; background:#fffdf4; box-shadow:0 12px 60px #38322236; max-height:85svh; }
dialog::backdrop { background:#393b325c; }
.dialog-head { position:sticky;top:0;z-index:1;padding:13px 18px;background:var(--paper);border-bottom:1px solid var(--line); }
#dialog-content { padding:18px; } .dialog-copy,.help-list {font-size:14px;line-height:1.75;color:#56584a;}
.dialog-actions { display:flex; flex-wrap:wrap; justify-content:flex-end;gap:8px;margin-top:18px; }
.secondary,.danger { border:1px solid #c6c4b1;background:#f4f1e4; padding:8px 12px; min-height:36px; font-size:13px;font-weight:600; }
.secondary:hover {background:#e9e6d7;} .danger {background:#f5dbcc;border-color:#c19881;}
.field { display:grid;gap:5px;font-size:13px;font-weight:600; } input[type=text] { border:1px solid #bdbba9;border-radius:5px;background:white;padding:9px 10px;width:100%; }
.save-preview { width:108px; height:108px; border:1px solid var(--line);image-rendering:pixelated;border-radius:5px; }
.save-row {display:grid; grid-template-columns:108px 1fr; align-items:center;gap:15px;}
.shelf-header { display:flex;align-items:center;justify-content:space-between;margin:0 0 9px; } .shelf-header h3 {font-size:15px;}
.shelf { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:18px; }
.entry { position:relative;min-width:0; }
.scene-card {display:flex; flex-direction:column; align-items:stretch; padding:0; gap:0; text-align:left; width:100%; border:1px solid #cdc8b5; background:#f7f4e8;overflow:hidden;}
.scene-card:hover {border-color:#8e9675;} .scene-card img {width:100%;aspect-ratio:1.45;object-fit:cover;object-position:50% 68%; image-rendering:pixelated;}
.card-title { display:block; padding:7px 8px; font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.remove-entry {position:absolute;right:3px;top:3px;background:#fffdf3e6;width:24px;height:24px;align-items:center;}
.help-list {padding-left:21px;margin:0;}.help-list li+li{margin-top:6px;}
.note {font-size:12px;color:var(--muted);line-height:1.6;margin:6px 0 12px;}
#toast {position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:#383d32;color:#fffdf1;padding:9px 16px;border-radius:6px;z-index:9;max-width:88vw;font-size:13px;box-shadow:0 3px 14px #26251c26;}
body.focus-mode {overflow:hidden;}
.focus-mode .quest-strip {display:none;}
.toy-container body.focus-mode {overflow:hidden;}
.focus-mode .quest-strip {display:none;}
.toy-container #toast {
  bottom:calc(var(--toy-bottom) + 16px);
  left:calc(var(--toy-safe-left) + var(--toy-width) / 2);
  max-width:calc(var(--toy-width) - 24px);
}
.toy-container .discovery {
  bottom:calc(var(--toy-bottom) + 70px);
  left:calc(var(--toy-safe-left) + var(--toy-width) / 2);
  max-width:calc(var(--toy-width) - 24px);
}
.toy-container .focus-mode .board-card {
  inset:var(--toy-insets);
  container-type:inline-size;
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  width:min(var(--toy-width), max(360px, calc(var(--toy-height) - 90px)));
  height:min(var(--toy-height), calc(var(--toy-width) + 90px));
  max-height:var(--toy-height);
}
.toy-container .focus-mode #board-wrap {
  place-self:center;
  height:min(100%,100cqw);
  width:auto;
  max-width:100%;
}
.focus-mode .board-card {position:fixed;z-index:3;inset:0; margin:auto; width:min(calc(var(--toy-height,100svh) - 97px),100vw); height:fit-content; max-height:100svh; box-shadow:0 0 0 100vmax #393b32cf; }
@media(min-width:850px) and (min-height:840px) { .panel {padding:22px 19px 18px;} .group {margin-bottom:14px;}.swatch{min-height:47px;}.brush-block{padding:15px 0;}.board-top{height:42px;} }
@media(max-width:880px) and (min-width:701px) { .wrap{width:calc(100% - 28px);} .workbench{grid-template-columns:minmax(0,1fr) 284px;gap:12px;}.panel{padding:14px 11px;} }
@media(max-width:700px) {
  .wrap {width:min(calc(100% - 24px),540px);} .top {height:54px;}.wordmark{gap:8px;}#mark{width:32px;height:32px;}.wordmark h1{font-size:21px;}
  nav{gap:2px;}.nav-button{gap:4px;padding:8px 6px;font-size:12px;}
  .page-heading{margin:16px 0 12px;}.page-heading p{font-size:11px;margin:0;}.primary{padding:7px 11px;font-size:12px;min-height:34px;}
  .workbench{display:flex;flex-direction:column;gap:12px;}.panel,.board-card{width:100%;}.board-top{height:31px;}.board-controls{min-height:42px;padding:4px 7px;}.board-controls button{font-size:12px;}
  .panel{padding:13px;}.panel-title{margin-bottom:9px;}h2{font-size:18px;}.swatches{grid-template-columns:repeat(4,minmax(0,1fr));}.swatch{flex-direction:row;gap:5px;min-height:34px;}.group{margin-bottom:9px;}.group h3{margin-bottom:4px;}
  .footer-key{display:none;}.footer-touch{display:inline;}.card-title{font-size:11px;}
}
@media(max-width:355px) {
  .board-controls{gap:0;}.board-controls button{padding:5px;}.swatch{gap:2px;}
  .wordmark{gap:6px;flex-shrink:0;}.wordmark h1{font-size:18px;letter-spacing:.01em;white-space:nowrap;}#mark{width:28px;height:28px;}
  nav{gap:0;}.nav-button{padding:7px 4px;font-size:11px;gap:3px;}
}
@media (min-width:701px) {
  :root { --board-size:clamp(410px,calc(var(--toy-height,100svh) - 286px),660px); }
  .page-heading {margin:19px 0 14px;}
  .page-heading p {line-height:1.45;}
  .top {height:59px;}
  footer {margin:12px 1px 14px;}
}
@media(min-width:701px) and (max-height:799px) {
  .group {margin-bottom:7px;}.swatch{min-height:36px;padding:3px 0;}
  .panel {padding:13px 14px 12px;}.panel-title{margin-bottom:8px;}
  .brush-block{padding:9px 0;margin-top:9px;}.board-top{height:34px;}
  #current{padding:7px;min-height:45px;}.top{height:53px;}
  .page-heading{margin:14px 0 12px;}
}
@media(max-width:700px) {
  #elements {display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:4px;}
  #elements .group,#elements .swatches {display:contents;}#elements .group h3{display:none;}
  .swatch {flex-direction:column;min-height:39px;gap:1px;padding:2px 0;font-size:10px;}
  .brush-block{display:grid;grid-template-columns:1.2fr 1fr;gap:5px 9px;margin-top:8px;padding:8px 0;}
  .section-line{grid-column:1/-1;} #brushes{margin:0;} #current{min-height:36px;padding:5px 8px;}
  #current .current-icon{width:24px;height:24px;} #current h3{display:none;} #current p{line-height:1.4;}
  .panel-title {margin-bottom:7px;} .panel-title h2{font-size:17px;}
}
.scene-name {min-width:0;margin-right:8px;} .scene-name strong {white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}.scene-dot,.sim-status {flex-shrink:0;}
.scene-display {display:flex;align-items:center;gap:12px;flex-shrink:0;}
#choose-map {min-height:26px;padding:3px 8px;border:1px solid var(--line);background:#f5f2e7;font-size:12px;}
#choose-map::after { content:"";width:5px;height:5px;border:solid currentColor;border-width:0 1px 1px 0;transform:translateY(-1px) rotate(45deg); }
#choose-map:hover { background:#ece8d8; }
.map-shelf .scene-card img {aspect-ratio:1.3;object-fit:contain;background:#f5e7df;}
.map-shelf .card-title {padding-bottom:2px;}
.map-hint {padding:0 8px 7px;color:var(--muted);font-size:11px;line-height:1.4;text-align:left;}
.scene-card img:not([src]) {background:#f5e7df;}
@media(max-width:460px) {.map-shelf{grid-template-columns:repeat(2,minmax(0,1fr));}.scene-display{gap:7px;}}
@media(min-width:850px) and (min-height:840px) {
  .panel {padding:18px 17px 15px;}.group{margin-bottom:11px;}.swatch{min-height:41px;}
}
@media(max-width:700px) {
  #elements .wonder-group {display:block;grid-column:1/-1;margin:4px 0 0;}
  #elements .wonder-group h3 {display:block;}
  #elements .wonder-group .swatches {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));}
  #stamp-tip {margin:0;font-size:11px;}
}

/* Field notebook: a quiet layer above the sandbox that records what the
   materials have already shown the player. */
.nav-count {min-width:17px;padding:1px 4px;border-radius:9px;background:#e7e2ce;color:#6f6850;font:600 9px/1.5 ui-monospace,"SFMono-Regular",monospace;text-align:center;}
.journal-nav[aria-label] {white-space:nowrap;}
.quest-strip {width:100%;min-height:33px;padding:4px 12px;border:0;border-bottom:1px solid #d3d0bf;border-radius:0;background:linear-gradient(90deg,#f6f2df,#fbf9ee 55%,#f3efe0);gap:8px;text-align:left;justify-content:flex-start;color:#5d5c4b;}
.quest-strip:hover {background:linear-gradient(90deg,#f1edda,#f8f5e8 55%,#eee9d7);}
.quest-seal {width:23px;height:23px;flex:0 0 auto;display:flex;align-items:center;justify-content:center;border:1px solid #ad986a;border-radius:50%;background:#f6e3ac;box-shadow:inset 0 0 0 2px #fff7db;}
.quest-seal .frog-face {display:block;}
.quest-copy {display:flex;align-items:baseline;gap:7px;min-width:0;flex:1;}
.quest-copy small {flex:0 0 auto;font-size:9px;font-weight:700;letter-spacing:.08em;color:#8b7b55;}
.quest-copy strong {min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:680;color:#4c5a45;}
.quest-progress {flex:0 0 auto;padding:2px 6px;border-radius:9px;background:#e6ebd6;color:#657251;font:600 10px/1.3 ui-monospace,"SFMono-Regular",monospace;}
.quest-arrow {flex:0 0 auto;color:#958d73;font-size:16px;line-height:1;}
.quest-strip.complete {background:linear-gradient(90deg,#e9efdc,#f7f6e8);}
.quest-strip.complete .quest-copy strong {color:#4e6b4a;}
.discovery {position:fixed;left:50%;bottom:74px;z-index:12;max-width:min(430px,calc(100vw - 28px));display:flex;align-items:center;gap:11px;padding:10px 13px 10px 11px;border:1px solid #b49d67;border-radius:8px;background:#fff9e7;box-shadow:0 7px 24px #3a34234a,inset 0 0 0 2px #fffdf5;opacity:0;transform:translate(-50%,12px);transition:opacity .18s ease,transform .22s cubic-bezier(.2,.8,.25,1);pointer-events:none;}
.discovery.show {opacity:1;transform:translate(-50%,0);}
.discovery-seal {width:42px;height:42px;flex:0 0 auto;display:flex;align-items:center;justify-content:center;border:1px solid #ac9560;border-radius:50%;background:#f4e2ad;box-shadow:inset 0 0 0 2px #fff9e8;transform:rotate(-7deg);}
.discovery-copy {display:flex;flex-direction:column;min-width:0;gap:1px;}
.discovery-copy small {font:600 9px/1.4 ui-monospace,"SFMono-Regular",monospace;letter-spacing:.08em;color:#8c7c57;}
.discovery-copy small b {font-weight:700;color:#75613f;}
.discovery-copy strong {font-size:14px;line-height:1.35;color:#3f4d3a;}
.discovery-copy>span {font-size:11px;line-height:1.45;color:#6b6d5a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.discovery-spark {margin-left:auto;flex:0 0 auto;color:#c4923f;font-size:18px;animation:discovery-spark 1.1s ease-in-out infinite alternate;}
@keyframes discovery-spark {from {transform:scale(.8) rotate(-8deg);opacity:.5;} to {transform:scale(1.12) rotate(7deg);opacity:1;}}
.journal-hero {display:grid;grid-template-columns:56px minmax(0,1fr) auto;align-items:center;gap:12px;padding:13px 14px;border:1px solid #d3c8a9;border-radius:8px;background:linear-gradient(135deg,#f5eacb,#fbf8eb 65%);}
.journal-frog {width:52px;height:48px;display:flex;align-items:center;justify-content:center;border:1px solid #b59e69;border-radius:7px;background:#efd995;box-shadow:inset 0 0 0 3px #faf2d5;}
.journal-kicker {display:block;font:600 9px/1.4 ui-monospace,"SFMono-Regular",monospace;letter-spacing:.1em;color:#8b7b55;margin-bottom:2px;}
.journal-rank {font-size:19px;line-height:1.25;font-weight:760;color:#3e4b38;}
.journal-rank-note {margin-top:2px;font-size:11px;line-height:1.5;color:#6f705d;}
.journal-total {min-width:58px;text-align:right;color:#6e7359;}
.journal-total strong {display:block;font:700 25px/1 ui-monospace,"SFMono-Regular",monospace;color:#4d6548;}
.journal-total span {font:600 10px/1.5 ui-monospace,"SFMono-Regular",monospace;color:#92917a;}
.journal-total small {display:block;font-size:9px;color:#8b896f;letter-spacing:.06em;}
.journal-progress {height:5px;margin:9px 1px 17px;border-radius:4px;background:#e4e2d2;overflow:hidden;}
.journal-progress i {display:block;height:100%;border-radius:4px;background:linear-gradient(90deg,#9bae7d,#d3aa5b);transition:width .35s ease;}
.journal-next {padding:10px 12px;margin:0 0 16px;border-left:3px solid #d1ae62;background:#f8f5e8;}
.journal-next-label {display:block;margin-bottom:4px;font:650 9px/1.4 ui-monospace,"SFMono-Regular",monospace;letter-spacing:.09em;color:#927d51;}
.journal-next-row {display:flex;align-items:center;gap:9px;}
.journal-next-row .note-seal {width:33px;height:33px;flex-basis:33px;transform:none;}
.journal-next-copy {min-width:0;}
.journal-next-copy h4 {font-size:13px;line-height:1.3;color:#46533f;}
.journal-next-copy p {margin-top:1px;font-size:11px;line-height:1.5;color:#72735f;}
.journal-group {margin:0 0 16px;}
.journal-group-head {display:flex;align-items:center;justify-content:space-between;margin-bottom:6px;}
.journal-group-head h3 {font-size:11px;font-weight:700;letter-spacing:.08em;color:#756e56;}
.journal-group-head span {font:600 9px/1.3 ui-monospace,"SFMono-Regular",monospace;color:#97917b;}
.note-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;}
.note-tile {min-width:0;display:grid;grid-template-columns:35px minmax(0,1fr);gap:7px;align-items:start;padding:8px 7px;border:1px solid #dfdccc;border-radius:6px;background:#fbf9ef;}
.note-tile.found {border-color:#c9c8a9;background:#f7f3df;box-shadow:inset 0 0 0 1px #fffdf5;}
.note-tile.locked {background:#f7f5ec;border-style:dashed;}
.note-seal {position:relative;width:35px;height:35px;display:flex;align-items:center;justify-content:center;border:1px solid #d5cdb7;border-radius:50%;background:#eee9d8;flex:0 0 auto;}
.note-tile.found .note-seal {border-color:#b8a36a;background:#f2e0ad;transform:rotate(-4deg);}
.note-tile.locked .note-seal {filter:grayscale(1);opacity:.38;}
.note-tile.locked .note-letter {filter:grayscale(1);}
.note-check {position:absolute;right:-2px;bottom:-2px;width:13px;height:13px;display:flex;align-items:center;justify-content:center;border-radius:50%;background:#66815c;color:#fffdf3;font:700 9px/1 sans-serif;border:1px solid #fffdf3;}
.note-mark {position:absolute;left:-3px;bottom:-3px;width:14px;height:14px;display:flex;align-items:center;justify-content:center;border-radius:50%;background:#fff8df;border:1px solid #b69c64;color:#8b6332;font:700 8px/1 sans-serif;}
.note-letter {font:700 18px/1 "PingFang SC","Microsoft YaHei",serif;color:#7a704d;}
.note-copy {min-width:0;padding-top:1px;}
.note-copy h4 {display:flex;align-items:baseline;flex-wrap:wrap;gap:4px;font-size:11px;line-height:1.35;color:#4f5545;}
.note-status {font:500 8px/1.2 ui-monospace,"SFMono-Regular",monospace;letter-spacing:.03em;color:#8e8a76;}
.note-tile.found .note-status {color:#6c805c;}
.note-copy p {margin-top:3px;font-size:10px;line-height:1.5;color:#777864;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;}
.note-tile.locked .note-copy p {color:#92917d;}
.journal-foot {margin-top:2px;padding-top:10px;border-top:1px solid #e1ddcc;font-size:10px;line-height:1.6;color:#8b8976;}
@media(max-width:700px) {
  .nav-count {display:none;}
  .quest-strip {min-height:31px;padding:3px 8px;gap:6px;}
  .quest-copy {gap:5px;}
  .quest-copy small {font-size:8px;letter-spacing:.03em;}
  .quest-copy strong {font-size:11px;}
  .quest-progress {font-size:9px;padding:2px 5px;}
  .quest-seal {width:21px;height:21px;}
  .discovery {bottom:76px;padding:9px 10px;gap:8px;}
  .discovery-seal {width:35px;height:35px;}
  .discovery-copy strong {font-size:13px;}
  .discovery-copy>span {font-size:10px;}
  .journal-hero {grid-template-columns:42px minmax(0,1fr) auto;gap:8px;padding:10px;}
  .journal-frog {width:40px;height:38px;}
  .journal-frog canvas {max-width:30px;height:auto;}
  .journal-rank {font-size:17px;}
  .journal-total strong {font-size:21px;}
  .note-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(max-width:380px) {
  .journal-nav {padding-inline:4px;}
  .nav-button {gap:3px;}
  .quest-copy small {display:none;}
  .note-tile {grid-template-columns:31px minmax(0,1fr);padding:7px 6px;gap:5px;}
  .note-seal {width:31px;height:31px;}
}
@media(prefers-reduced-motion:reduce) {
  .discovery,.discovery-spark,.journal-progress i {transition:none;animation:none;}
}

/* A small visitor walks the top of the terrain. It is an overlay, never a
   simulation cell, so it can be petted without disturbing the sand. */
.visitor {
  position:absolute; z-index:2; width:7%; min-width:24px; max-width:34px; aspect-ratio:1;
  padding:0; border:0; background:transparent; transform:translate(-50%,-100%);
  transition:left .22s linear, top .22s linear; filter:drop-shadow(0 2px 1px #29251b42);
}
.visitor canvas {display:block;width:100%;height:100%;image-rendering:pixelated;pointer-events:none;}
.visitor::before,.visitor::after {content:"";position:absolute;pointer-events:none;opacity:0;transition:opacity .15s;}
.visitor::before {left:8%;top:-5px;width:84%;height:7px;border:1px solid #46613d;border-radius:50% 50% 45% 45%;background:linear-gradient(#b9d48c,#6f975d 62%,#557a4c);transform:rotate(-4deg);box-shadow:0 1px #2e472f66;}
.visitor::after {left:50%;top:-1px;width:1px;height:7px;background:#5a422f;box-shadow:1px 0 #5a422f55;}
.visitor.umbrella::before,.visitor.umbrella::after {opacity:1;}
.visitor.glow {filter:drop-shadow(0 0 5px #ffe29a) drop-shadow(0 2px 1px #29251b42);}
.visitor:hover {filter:drop-shadow(0 0 5px #f5d479aa) drop-shadow(0 2px 1px #29251b42);}
.visitor:focus-visible {outline:2px solid #547a73;outline-offset:3px;border-radius:5px;}
.visitor-bubble {
  position:absolute;z-index:4;transform:translate(-50%,-105%);max-width:min(210px,76%);
  padding:7px 9px;border:1px solid #b49d67;border-radius:7px;background:#fff9e8;
  box-shadow:0 4px 14px #29251b26,inset 0 0 0 1px #fffdf4;color:#525343;
  font-size:11px;line-height:1.55;text-align:center;pointer-events:none;
}
.visitor-bubble::after {content:"";position:absolute;left:50%;bottom:-6px;width:8px;height:8px;background:#fff9e8;border-right:1px solid #b49d67;border-bottom:1px solid #b49d67;transform:translateX(-50%) rotate(45deg);}
.visitor-bubble strong {display:block;margin-bottom:1px;font:700 9px/1.4 ui-monospace,"SFMono-Regular",monospace;letter-spacing:.08em;color:#8d7b54;}
@media(max-width:700px) {
  .visitor {min-width:22px;}
  .visitor-bubble {font-size:10px;padding:6px 8px;max-width:min(185px,82%);}
}
@media(prefers-reduced-motion:reduce) {
  .visitor {transition:none;}
}

.postcard-preview {width:100%;padding:8px;border:1px solid #d4c9b0;border-radius:7px;background:#eee7d4;}
.postcard-canvas {display:block;width:100%;height:auto;border-radius:4px;box-shadow:0 3px 12px #574b3226;}
#postcard {margin-left:auto;}
#expand {margin-left:0;}
.visitor.hide {animation:visitor-tremble .16s linear infinite;filter:drop-shadow(0 1px 1px #29251b42);}
.visitor.awe {filter:drop-shadow(0 0 7px #ffe3a0) drop-shadow(0 2px 1px #29251b42);}
.visitor.listen {filter:drop-shadow(0 0 4px #e6cf8a) drop-shadow(0 2px 1px #29251b42);}
@keyframes visitor-tremble {0%,100% {transform:translate(-50%,-100%) rotate(-2deg);} 50% {transform:translate(-50%,-100%) translateX(1px) rotate(2deg);}}
@media(prefers-reduced-motion:reduce) {.visitor.hide {animation:none;}}

/* Workshop daylight: a paper-thin light layer above the sand, below the
   visitor and the cursor. It is purely visual and never changes cells. */
.light-button {min-height:26px;padding:3px 8px;border:1px solid var(--line);background:#f5f2e7;font-size:12px;white-space:nowrap;}
.light-button:hover {background:#ece8d8;}
.lighting {position:absolute;inset:0;z-index:1;pointer-events:none;opacity:0;transition:opacity .35s ease,background .35s ease;}
#board-wrap.light-dusk .lighting {opacity:1;background:linear-gradient(180deg,rgba(255,174,103,.20),rgba(84,52,88,.26));}
#board-wrap.light-night .lighting {
  opacity:1;
  background:
    radial-gradient(circle at 18% 22%,#fff5c9 0 1px,transparent 1.7px),
    radial-gradient(circle at 41% 12%,#fff5c9 0 1px,transparent 1.6px),
    radial-gradient(circle at 73% 17%,#fff5c9 0 1px,transparent 1.7px),
    radial-gradient(circle at 87% 31%,#fff5c9 0 1px,transparent 1.4px),
    radial-gradient(circle at 62% 8%,#fff5c9 0 1px,transparent 1.5px),
    radial-gradient(circle at 29% 39%,#fff5c9 0 1px,transparent 1.4px),
    radial-gradient(circle at 78% 45%,#fff5c9 0 1px,transparent 1.3px),
    radial-gradient(circle at 91% 58%,#fff5c9 0 1px,transparent 1.2px),
    radial-gradient(circle at 8% 62%,#fff5c9 0 1px,transparent 1.2px),
    linear-gradient(180deg,rgba(24,31,64,.42),rgba(19,21,43,.56));
}
@media(max-width:700px) {.light-button{font-size:11px;padding:3px 6px;}}
@media(prefers-reduced-motion:reduce) {.lighting {transition:none;}}

/* The full-book reward appears only after all twenty-two notes are found. */
.journal-complete {display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;margin:0 0 16px;padding:12px 13px;border:1px solid #b99b5e;border-radius:8px;background:linear-gradient(135deg,#1b2941,#3b2b45 68%,#5b3b48);box-shadow:inset 0 0 0 2px #f1d99b1f;}
.journal-complete small {display:block;margin-bottom:3px;font:600 9px/1.4 ui-monospace,"SFMono-Regular",monospace;letter-spacing:.12em;color:#d7bd7e;}
.journal-complete h3 {font:700 20px/1.35 "Songti SC","Noto Serif CJK SC",serif;color:#f7e8bd;}
.journal-complete p {max-width:280px;margin-top:3px;font-size:11px;line-height:1.55;color:#d8c9a8;}
.journal-complete .primary {flex:0 0 auto;background:#dcb76b;border-color:#8e7138;color:#342a18;}
.certificate-preview {width:100%;padding:8px;border:1px solid #bda66c;border-radius:7px;background:#1b2435;}
.certificate-canvas {display:block;width:100%;height:auto;border-radius:4px;box-shadow:0 4px 18px #151b2b66;}
@media(max-width:700px) {.journal-complete {align-items:flex-start;} .journal-complete .primary {margin-left:auto;}}

/* The generated-map shelf: three seeds at a glance, one button to reroll. */
.wild-batch {margin:0 0 17px;padding:10px 10px 11px;border:1px solid #d3c7ab;border-radius:8px;background:linear-gradient(135deg,#f5eedb,#fbf8ec);}
.wild-head {display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:7px;}
.wild-copy h3 {font-size:14px;line-height:1.35;color:#4b5542;}
.wild-copy p {margin-top:2px;font-size:10px;line-height:1.4;color:#85816d;}
.wild-head .secondary {flex:0 0 auto;min-height:29px;padding:5px 8px;font-size:11px;}
.wild-batch .shelf {grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:0;}
.wild-batch .scene-card img {aspect-ratio:1.15;}
.wild-batch .card-title {padding:6px 6px 1px;font-size:11px;}
.wild-batch .map-hint {padding:0 6px 6px;font-size:9px;}
@media(max-width:460px) {.wild-batch{padding:8px 7px 9px;} .wild-head{gap:5px;} .wild-head .secondary{font-size:10px;padding:4px 6px;} .wild-copy p{max-width:170px;}}

/* A material-derived soundscape card. The bars are decoration; the actual
   music is synthesized from echo.js in the audio engine. */
.echo-card {position:relative;overflow:hidden;padding:16px 16px 13px;border:1px solid #b9a36e;border-radius:9px;background:linear-gradient(145deg,#26352f,#4e4b3b 58%,#6e5a3e);box-shadow:inset 0 0 0 2px #f1dfae1a;}
.echo-kicker {display:block;margin-bottom:4px;font:600 9px/1.4 ui-monospace,"SFMono-Regular",monospace;letter-spacing:.16em;color:#d4bd84;}
.echo-copy h3 {font:700 26px/1.25 "Songti SC","Noto Serif CJK SC",serif;color:#f5e6ba;}
.echo-copy p {max-width:440px;margin-top:4px;font-size:12px;line-height:1.65;color:#d4c7a8;}
.echo-chips {display:flex;flex-wrap:wrap;gap:4px;margin-top:10px;}
.echo-chip {padding:3px 7px;border:1px solid #c8b47e66;border-radius:12px;background:#f8e9b51a;color:#e8d7aa;font:500 10px/1.4 ui-monospace,"SFMono-Regular",monospace;}
.echo-bars {height:67px;display:flex;align-items:flex-end;gap:4px;margin-top:12px;padding:0 1px;opacity:.72;}
.echo-bars i {display:block;flex:1 1 0;min-height:8px;border-radius:2px 2px 0 0;background:linear-gradient(180deg,#f6d98e,#9fbb86 58%,#5b8a80);transform:scaleY(.36);transform-origin:bottom;transition:transform .3s ease;}
.echo-card.playing .echo-bars i {animation:echo-pulse 1.25s ease-in-out infinite alternate;}
@keyframes echo-pulse {from {transform:scaleY(.28);opacity:.55;} to {transform:scaleY(1);opacity:1;}}
.echo-status {min-height:20px;margin:9px 1px 0;font-size:11px;line-height:1.5;color:#6f705d;}
@media(max-width:700px) {.echo-card{padding:13px 12px 11px;} .echo-copy h3{font-size:23px;} .echo-bars{height:52px;gap:3px;}}
@media(prefers-reduced-motion:reduce) {.echo-card.playing .echo-bars i {animation:none;transform:scaleY(.7);}}

/* Growth rings: a scrub-through memory of what the sandbox has been. */
.control-icons {display:flex;align-items:center;gap:4px;margin-left:auto;flex:0 0 auto;}
#strata[data-count="0"] {opacity:.6;}
#postcard,#strata,#expand {margin-left:0;}
.strata-grid {display:grid;grid-template-columns:minmax(0,1fr);gap:7px;margin:2px 0 4px;}
.strata-card {display:flex;align-items:center;gap:9px;padding:6px;border:1px solid #d3cdb9;border-radius:7px;background:#fbf9ef;text-align:left;min-width:0;transition:border-color .15s ease,background .15s ease;}
.strata-card:hover {border-color:#a9a179;background:#f6f3e4;}
.strata-card:focus-visible {outline:3px solid #547a73;outline-offset:2px;}
.strata-card img {width:52px;height:52px;flex:0 0 auto;border:1px solid #cfc7ac;border-radius:4px;image-rendering:pixelated;object-fit:cover;}
.strata-copy {display:flex;flex-direction:column;gap:2px;min-width:0;}
.strata-copy b {font-size:12px;line-height:1.35;font-weight:680;color:#47513f;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.strata-copy small {font:500 9px/1.4 ui-monospace,"SFMono-Regular",monospace;color:#8b8873;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
@media(min-width:560px) {.strata-grid {grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:355px) {.strata-card {gap:6px;padding:5px;} .strata-card img {width:44px;height:44px;} .strata-copy b {font-size:11px;}}
@media(prefers-reduced-motion:reduce) {.strata-card {transition:none;}}
