@font-face{font-family:Montserrat;src:url("./assets/Montserrat-Regular.ttf") format("truetype");font-weight:400;font-display:swap}
@font-face{font-family:Montserrat;src:url("./assets/Montserrat-Medium.ttf") format("truetype");font-weight:600;font-display:swap}
@font-face{font-family:Oranienbaum;src:url("./assets/Oranienbaum-Regular.ttf") format("truetype");font-weight:400;font-display:swap}
@font-face{font-family:Yeseva;src:url("./assets/YesevaOne-Regular.ttf") format("truetype");font-weight:400;font-display:swap}
@font-face{font-family:Tenor;src:url("./assets/TenorSans-Regular.ttf") format("truetype");font-weight:400;font-display:swap}

:root {
  --body: Montserrat, Arial, sans-serif;
  --display: Oranienbaum, Georgia, serif;
  --accent: #b3eedf;
  --bright: #faf5e7;
  --ink: #eaf5f3;
  --base: #091923;
  --panel: #102630;
  --dark: #112822;
  --line: #7b9992;
}

body[data-world="needle"] { --accent:#f5cea1; --base:#1a2b24; --panel:#21362a; --dark:#392721; --line:#9f927a; }
body[data-world="lantern"] { --display:Yeseva, Georgia, serif; --accent:#f1ba77; --base:#26131d; --panel:#3c212b; --dark:#3d2430; --line:#8e695a; }
body[data-world="folio"] { --accent:#f0d7a6; --base:#372d25; --panel:#493a2c; --dark:#352e28; --line:#b39b7c; }
body[data-world="clock"] { --display:Tenor, Georgia, serif; --accent:#f5c780; --base:#09201f; --panel:#1c3631; --dark:#2d2621; --line:#a48862; }
body[data-world="glass"] { --accent:#d5ffad; --base:#071b23; --panel:#142e3a; --dark:#132535; --line:#74a9a2; }
body[data-world="post"] { --display:Tenor, Georgia, serif; --accent:#f9c2a3; --base:#1c303c; --panel:#284557; --dark:#321e22; --line:#8ca1a7; }

*, *::before, *::after { box-sizing:border-box; }
html, body { width:100%; height:100%; margin:0; overflow:hidden; }
body { display:grid; place-items:center; background:#0b1519; color:var(--ink); font:400 1rem/1.5 var(--body); }
h1, h2, h3, p { margin:0; }
h1, h2 { font-family:var(--display); font-weight:400; line-height:1.03; text-wrap:balance; }
button, select, input { font:inherit; }
button { color:inherit; cursor:pointer; }
button:disabled { cursor:default; }
img { display:block; }
a { color:inherit; text-underline-offset:.22em; }
[hidden] { display:none!important; }
:focus-visible { outline:2px solid var(--accent); outline-offset:4px; }
[tabindex="-1"]:focus { outline:none; }
::selection { background:var(--accent); color:var(--dark); }
.visually-hidden, .skip-link:not(:focus) { position:absolute; inline-size:1px; block-size:1px; white-space:nowrap; overflow:hidden; clip-path:inset(50%); }
.skip-link:focus { position:fixed; z-index:25; left:12px; top:12px; background:var(--panel); padding:12px 15px; }
.icon { display:inline-block; width:22px; height:22px; flex:none; }

.game-frame {
  --device-width:100vw;
  --device-height:100dvh;
  width:min(100vw,var(--device-width));
  height:min(100dvh,var(--device-height));
  position:relative;
  background:var(--base);
}
.game-frame[data-device="tablet"] { --device-width:820px; --device-height:1024px; }
.game-frame[data-device="phone"] { --device-width:390px; --device-height:844px; }
.game-frame:not([data-device="desktop"]) { box-shadow:0 0 0 1px #4e6264,0 14px 60px #0008; }
.game { height:100%; width:100%; position:relative; overflow:hidden; isolation:isolate; container:game / size; }
.stage { position:absolute; inset:0; overflow:hidden; }

.toolbar {
  position:absolute;
  z-index:7;
  inset:0 0 auto;
  min-height:72px;
  padding:12px clamp(12px,3.5cqw,55px);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  color:#fffaf0;
  background:linear-gradient(180deg,#07141cf5,#07141cbb 70%,#07141c38);
}
.tools-start, .tools-end { display:flex; align-items:center; gap:8px; min-width:0; }
.brand { color:#f9f2df; white-space:nowrap; font:400 1.48rem/1 Oranienbaum, Georgia, serif; padding-left:9px; }
.tool {
  min-width:42px; min-height:42px; padding:7px 9px;
  display:inline-flex; justify-content:center; align-items:center; gap:6px;
  border:1px solid #d5e0d044; border-radius:6px;
  background:#101a20b8; color:#fff6e9;
  font-size:.82rem; font-variant-numeric:tabular-nums; white-space:nowrap;
}
.tool:hover, .tool[aria-expanded="true"] { background:#263a40; border-color:#d5e0d099; }
.tool .icon { color:var(--accent); }
.tool small { color:#f0e7d7; font-size:.83em; }
.tool-word { padding-inline:11px; }
.device-panel {
  position:absolute; z-index:9; right:clamp(12px,3.5cqw,55px); top:66px; width:min(270px,calc(100% - 24px));
  padding:6px; border:1px solid var(--line); background:var(--panel); color:var(--ink);
  border-radius:9px; box-shadow:0 18px 36px #0007;
}
.device-panel button {
  display:flex; width:100%; min-height:52px; align-items:center; gap:12px;
  text-align:left; border:0; border-radius:5px; padding:8px 10px; background:none;
}
.device-panel button:hover, .device-panel button[aria-pressed="true"] { background:#ffffff18; }
.device-panel small { display:block; color:var(--accent); font-size:.74rem; }

.map-scroll { position:absolute; z-index:1; inset:0; overflow:hidden auto; overscroll-behavior:contain; scrollbar-width:none; scroll-snap-type:y mandatory; }
.map-scroll::-webkit-scrollbar { display:none; }
.map-scroll[data-flow="across"] { display:flex; overflow:auto hidden; scroll-snap-type:x mandatory; }
.region { position:relative; flex:0 0 100%; width:100%; height:100%; scroll-snap-align:start; scroll-snap-stop:always; isolation:isolate; overflow:clip; }
.chapter-art {
  position:absolute; inset:0; width:100%; height:100%; object-fit:cover; object-position:var(--art-x,50%) center;
}
.region-heading {
  position:absolute; z-index:4; top:clamp(78px,11%,106px); left:clamp(18px,6cqw,104px);
  max-width:86%; color:#fff8e8; text-shadow:0 2px 3px #05161bce,0 6px 26px #05161bb8; pointer-events:none;
}
.region-heading h1 { font-size:clamp(2.45rem,6.5cqw,6rem); letter-spacing:-.032em; text-wrap:initial; }
.region-heading p { color:#fff4dc; font-size:clamp(.8rem,1.45cqw,1.05rem); margin-top:.46em; }
.region-heading p span, .day-meta span { padding-inline:3px; opacity:.7; }
.board { position:absolute; inset:18% 5% max(16%,var(--dock-safe,0px)); pointer-events:none; }
.route { position:absolute; z-index:1; inset:0; width:100%; height:100%; overflow:visible; stroke-linecap:round; stroke-linejoin:round; fill:none; }
.route-shadow { stroke:#07151bc2; stroke-width:6; }
.route-line { stroke:#fff0c8; stroke-width:2.5; }
.waypoint {
  position:absolute; z-index:3; left:var(--x); top:var(--y);
  display:grid; place-items:center; transform:translate(-50%,-50%); pointer-events:auto;
}
.waypoint:has(.marker[aria-pressed="true"]), .waypoint:focus-within { z-index:4; }
.marker {
  width:clamp(43px,4.05cqw,56px); height:clamp(43px,4.05cqw,56px);
  position:relative; z-index:1; display:grid; place-items:center; padding:0;
  border-radius:50%; border:2px solid #fff1ce; background:#122635; color:#fff7e6;
  box-shadow:0 3px 9px #040a12ac; font-size:clamp(.95rem,1.55cqw,1.2rem); font-weight:700;
  transition:scale .16s ease;
}
.marker:hover { scale:1.06; }
.marker-sign {
  position:absolute; z-index:1; left:calc(100% - 10px); top:calc(100% - 10px);
  width:19px; height:19px; border-radius:50%; display:grid; place-items:center;
  border:1px solid currentColor; color:inherit; background:inherit;
}
.marker-sign .icon { width:13px; height:13px; stroke-width:2; }
.marker-today-label {
  position:absolute; bottom:calc(100% + 7px); left:50%; translate:-50% 0;
  border:1px solid #f9dfa880; border-radius:4px; background:#1c1b1c; color:#fff0ce;
  font:600 11px/1.08 var(--body); white-space:nowrap; padding:4px 6px; box-shadow:0 2px 8px #09071484;
}
.marker-locked { border-color:#85979f; background:#16272e; color:#e1e9ec; }
.marker-locked .marker-sign { border-color:#85979f; }
.marker-missed { border-style:dashed; border-color:#e8a490; background:#582b31; color:#ffe4d8; }
.marker-open { background:#eee0ad; color:#332517; border-color:#806036; }
.marker-done { background:#254e41; color:#e6ffec; border-color:#6db899; }
.marker-today { background:#ffd771; color:#2c1d07; border-color:#fff6dd; }
.marker[aria-pressed="true"] { outline:2px solid #fff6dc; outline-offset:4px; }
.marker:focus-visible { outline:2px solid white; outline-offset:5px; }
.actor-tether { position:absolute; z-index:2; inset:0; width:100%; height:100%; pointer-events:none; fill:none; stroke:#fff0c3; stroke-width:2; filter:drop-shadow(0 1px 2px #0e151a); }
.actor-tether path { stroke-width:2; stroke-dasharray:3 3; }
.region:has(.actor:is([hidden],[data-moving])) .actor-tether { visibility:hidden; }
.actor {
  position:absolute; z-index:2; top:0; left:0; width:clamp(50px,6.2cqw,94px); height:clamp(69px,8.2cqw,127px);
  object-fit:contain; object-position:center bottom; pointer-events:none; transform-origin:55% 84%;
  filter:drop-shadow(0 6px 6px #040b15a6);
}
.actor[data-moving][data-arrival="north"] { filter:drop-shadow(-8px 3px 6px #a9efdfab); }
.actor[data-moving][data-arrival="glass"] { filter:drop-shadow(-4px 2px 7px #edbaa6ba) drop-shadow(2px 0 5px #76f8d0aa); }

[data-map="needle"] .route-line { stroke:#ef8b72; stroke-dasharray:5 7; stroke-width:3.6; }
[data-map="needle"] .marker { border-radius:10px; }
[data-map="lantern"] .region-heading { left:50%; width:min(95%,850px); transform:translateX(-50%); text-align:center; }
[data-map="lantern"] .region-heading h1 { font-size:clamp(2.6rem,6.7cqw,6.1rem); }
[data-map="lantern"] .route-line { stroke-dasharray:1 10; stroke-width:3.5; stroke:#f6c884; }
[data-map="lantern"] .marker { border-radius:49% 49% 15% 15%; }
[data-map="north"] .route-line { stroke:#a8f1ec; filter:drop-shadow(0 0 4px #9eeade); }
[data-map="north"] .marker { border-radius:39% 50% 39% 50%; }
[data-map="folio"] .route-line { stroke:#f8d1a2; stroke-dasharray:2 7; }
[data-map="folio"] .marker { border-radius:4px 18px 18px 4px; }
[data-map="clock"] .region-heading { right:7%; left:auto; text-align:right; }
[data-map="clock"] .region-heading h1 { font-size:clamp(2.42rem,6.9cqw,6.3rem); }
[data-map="clock"] .route-line { stroke:#f0c276; stroke-width:3; }
[data-map="clock"] .marker { box-shadow:inset 0 0 0 3px #eda75b5e,0 3px 10px #050e14; }
[data-map="glass"] .region-heading h1 { letter-spacing:-.008em; }
[data-map="glass"] .route-line { stroke:#b4f4bc; stroke-width:3; }
[data-map="glass"] .marker { border-radius:18% 43% 23% 43%; }
[data-map="post"] .region-heading h1 { font-size:clamp(2.5rem,7.4cqw,6.3rem); letter-spacing:-.034em; text-transform:uppercase; }
[data-map="post"] .route-line { stroke:#ffa08a; stroke-dasharray:12 5; }
[data-map="post"] .marker { border-radius:7px; }

.day-dock {
  z-index:4; position:absolute; inset:auto clamp(12px,3.5cqw,55px) 65px;
  display:flex; align-items:end; justify-content:space-between; gap:13px;
  color:#fff7e9; text-shadow:0 2px 10px #07141b;
  pointer-events:none;
}
.day-dock button { pointer-events:auto; }
.day-dock::before {
  content:""; position:absolute; z-index:-1; pointer-events:none;
  inset:-24px calc(-1 * clamp(12px,3.5cqw,55px)) -66px;
  background:linear-gradient(0deg,#08131e 3%,#08131ee0 54%,#08131e99 80%,transparent 100%);
}
.day-caption { min-width:0; max-width:min(69ch,70%); }
.day-meta { color:#fff1c8; font-size:.79rem; font-weight:600; }
.day-meta .icon { display:inline-block; width:14px; height:14px; vertical-align:-2px; margin-right:3px; }
.day-meta[data-status="today"] { color:#ffdb86; }
.day-meta[data-status="done"] { color:#a7ead0; }
.day-meta[data-status="missed"] { color:#fbc5b5; }
.day-meta[data-status="locked"] { color:#c2d7e0; }
.day-caption h2 { margin-top:4px; font-size:clamp(1.65rem,3.6cqw,3.5rem); text-wrap:initial; }
.day-brief { color:#fff0db; font-size:.85rem; margin-top:3px; }
.day-controls { display:flex; align-items:center; gap:8px; flex:none; }
.primary, .quiet {
  display:inline-flex; align-items:center; justify-content:center; gap:7px; padding:9px 14px;
  min-height:45px; border-radius:6px; border:1px solid transparent; text-shadow:none;
  font-weight:600; font-size:.84rem; line-height:1.28;
}
.primary { background:var(--accent); color:var(--dark); }
.primary:hover { filter:brightness(1.08); }
.quiet { border-color:#e4ecdb52; background:#ffffff14; color:inherit; }
.quiet:hover { background:#ffffff22; }
.day-lock { font-size:.85rem; white-space:nowrap; }
.region-nav {
  position:absolute; z-index:5; inset:auto clamp(12px,3.5cqw,55px) 12px;
  display:grid; grid-template-columns:44px repeat(4,minmax(0,1fr)) 44px;
  gap:4px; padding-top:6px; border-top:1px solid #fff0cf56;
}
.region-tab, .route-arrow {
  min-height:42px; display:grid; place-items:center; align-content:center; gap:1px; border:1px solid transparent;
  border-radius:5px; padding:4px 6px; background:#101923b5; color:#fffaec; line-height:1.13;
}
.region-tab span { font-weight:600; font-size:.78rem; }
.region-tab small { font-size:.66rem; color:#ddd5c7; }
.region-tab:hover, .route-arrow:hover:not(:disabled) { border-color:#fff5ce88; background:#203440; }
.region-tab[aria-current="true"] { color:var(--accent); border-color:#fff5ce76; }
.route-arrow:disabled { opacity:.43; }
.day-tip {
  position:absolute; z-index:8; pointer-events:none; width:min(258px,calc(100% - 16px));
  padding:11px 12px; border:1px solid var(--line); border-radius:8px; color:var(--ink); background:var(--panel);
  box-shadow:0 8px 20px #0008; font-size:.81rem; line-height:1.4;
}
.day-tip strong, .day-tip span { display:block; }
.day-tip strong { color:var(--accent); margin-bottom:5px; }

.chapter { position:absolute; inset:0; isolation:isolate; overflow:hidden; }
.chapter-shade {
  position:absolute; inset:0;
  background:linear-gradient(90deg,#0a1822f5 0%,#0a1822db 27%,#0a182282 47%,#0a18221a 70%),
    linear-gradient(180deg,#08151a8c,transparent 22%,transparent 69%,#08131c7d);
}
.chapter-scroll { position:absolute; inset:72px 0 0; overflow:auto; overscroll-behavior:contain; display:flex; align-items:safe center; scrollbar-width:thin; scrollbar-color:var(--line) transparent; }
.chapter-copy { padding:clamp(19px,4.4cqw,66px); margin:0; width:min(58cqw,760px); }
.chapter-copy h1 { font-size:clamp(2.75rem,6.5cqw,6.4rem); letter-spacing:-.038em; color:#fff7e7; margin:.11em 0 .32em; }
.chapter-copy .story { color:#fff1dd; max-width:54ch; font-size:clamp(.9rem,1.5cqw,1.1rem); }
.chapter-copy .story + .story, .chapter-body .primary { margin-top:12px; }
.answers { margin:22px 0 0; padding:0; border:0; min-width:0; }
.answers legend { font-size:.92rem; margin-bottom:8px; font-weight:600; line-height:1.4; color:#fff3d8; }
.answer {
  min-height:44px; display:flex; align-items:center; gap:10px; text-align:left; color:#fff7e7;
  width:100%; padding:7px 10px; margin-bottom:5px; border:1px solid #fff1d765; background:#09141cc2; border-radius:6px;
}
.answer:hover, .answer.tried { background:#314b50; }
.answer span { flex:none; height:26px; width:26px; display:grid; place-items:center; font:400 1.08rem var(--display); border-radius:50%; border:1px solid #f9efd093; }
.answer-note { min-height:1.3em; color:var(--accent); font-size:.81rem; margin-top:6px; }
.reward { font:400 clamp(1.7rem,4.4cqw,3.2rem) var(--display); color:var(--accent); margin-top:10px; animation:reward-rise .4s ease both; }
@keyframes reward-rise { from { opacity:.4; transform:translateY(6px); } to { opacity:1; transform:none; } }
.chapter-nav { display:grid; grid-template-columns:1fr 1fr 1fr; gap:6px; margin-top:18px; }
.chapter-nav .quiet { padding-inline:8px; white-space:nowrap; }
.chapter-nav .icon { width:17px; }

body[data-world="needle"] .chapter::after { content:""; position:absolute; inset:76px 15px 15px; border:1px dashed #fbebbd99; pointer-events:none; }
body[data-world="needle"] .chapter-shade { background:linear-gradient(90deg,#13271ff8,#1b332ce5 28%,#1c382e3a 68%),linear-gradient(0deg,#1a2d2344,transparent 45%); }
body[data-world="lantern"] .chapter-shade { background:radial-gradient(ellipse at 66% 50%,transparent 29%,#200a1cbd 78%),linear-gradient(90deg,#281119ed,#351827b5 40%,transparent 71%); }
body[data-world="lantern"] .chapter-copy h1 { font-size:clamp(2.45rem,5.7cqw,5.3rem); }
body[data-world="folio"] .chapter-art { width:59%; }
body[data-world="folio"] .chapter-shade { background:linear-gradient(90deg,transparent 46%,#ae94796e 55%,#4b3126 59%,#221c1c 61%,#362927); }
body[data-world="folio"] .chapter-scroll { justify-content:end; }
body[data-world="folio"] .chapter-copy { width:min(44cqw,710px); padding-inline:clamp(12px,3.3cqw,49px); }
body[data-world="folio"] .chapter-copy h1 { font-size:clamp(2.45rem,5.2cqw,5.1rem); }
body[data-world="clock"] .chapter-shade { background:linear-gradient(270deg,#0d2323fa,#172c2add 22%,#17302a69 48%,transparent 77%); }
body[data-world="clock"] .chapter-scroll { justify-content:end; }
body[data-world="clock"] .chapter-copy h1 { font-size:clamp(2.55rem,5.8cqw,5.8rem); }
body[data-world="glass"] .chapter-shade {
  background:linear-gradient(113deg,#0b1d2cee 16%,#152a3bda 38%,#305c5780 54%,transparent 62%),
    radial-gradient(ellipse at 74% 28%,#cdf8a135,transparent 56%);
}
body[data-world="post"] .chapter-shade { background:linear-gradient(90deg,#263746fd,#263746df 34%,#5a3a3d45 65%,transparent 84%); }
body[data-world="post"] .chapter-copy h1 { font-size:clamp(2.6rem,5.8cqw,5.7rem); }
body[data-world="post"] .chapter::after { content:""; position:absolute; top:70px; left:0; right:0; height:4px; background:repeating-linear-gradient(126deg,#d2716c 0 14px,#f1e2bd 14px 27px,#83b8ba 27px 40px,#f1e2bd 40px 54px); }

@container game (min-width: 621px) {
  body[data-world="needle"] .chapter-copy { width:min(52cqw,700px); }
  body[data-world="needle"] .answer { border-style:dashed; background:#172c24d9; }
  body[data-world="lantern"] .chapter-scroll { align-items:safe end; }
  body[data-world="lantern"] .chapter-copy {
    width:100%; max-width:1380px; margin-inline:auto;
    display:grid; grid-template-columns:minmax(0,.95fr) minmax(0,1.05fr);
    column-gap:clamp(25px,5cqw,75px); align-items:start;
  }
  body[data-world="lantern"] .chapter-copy h1 { grid-column:1; grid-row:2; }
  body[data-world="lantern"] .chapter-body { grid-column:2; grid-row:1 / 3; }
  body[data-world="lantern"] .chapter-nav { grid-column:2; margin-top:8px; }
  body[data-world="lantern"] .chapter-shade {
    background:radial-gradient(ellipse at 49% 24%,transparent 28%,#200a1c84 76%),
      linear-gradient(180deg,#240d1a29,transparent 35%,#220e19dc 64%,#230d18fa 100%);
  }
  body[data-world="north"] .chapter-art { object-position:var(--art-x) 62%; }
  body[data-world="folio"] .chapter-shade {
    background:linear-gradient(90deg,transparent 47%,#b5987566 55%,#b29b7b 58%,#f6e8c5 60%,#f8edcf 100%);
  }
  body[data-world="folio"] .chapter-copy { color:#332a21; }
  body[data-world="folio"] .chapter-copy :is(h1,.story,.answers legend) { color:#2b211e; }
  body[data-world="folio"] .chapter-copy :is(.day-meta,.answer-note,.reward) { color:#6f382b; }
  body[data-world="folio"] .chapter-copy :is(.answer,.quiet) { border-color:#64473577; background:#fdf3da; color:#321f1f; }
  body[data-world="folio"] .chapter-copy :is(.answer:hover,.quiet:hover) { background:#eedab2; }
  body[data-world="folio"] .chapter-copy .answer span { border-color:#816852; }
  body[data-world="clock"] .chapter { background:radial-gradient(ellipse at 28% 57%,#324b43,#0d2323 67%); }
  body[data-world="clock"] .chapter-art { clip-path:ellipse(36% 51% at 28% 56%); object-position:23% 51%; }
  body[data-world="clock"] .chapter-shade { background:linear-gradient(270deg,#0d2323 0%,#172e2dec 29%,#17302a30 54%,transparent 68%); }
  body[data-world="glass"] .chapter-art { clip-path:polygon(28% 0,100% 0,100% 100%,44% 100%,31% 56%); }
  body[data-world="glass"] .chapter { background:radial-gradient(ellipse at 74% 57%,#36514f,#0e202e); }
  body[data-world="glass"] .answer { border-radius:2px 10px 2px 10px; }
  body[data-world="post"] .chapter { background:radial-gradient(ellipse at 81% 53%,#62727c,#1b303f 63%); }
  body[data-world="post"] .chapter-art {
    left:auto; right:4.6%; top:15%; width:51%; height:76%;
    transform:rotate(3deg); border:clamp(7px,1.05cqw,16px) solid #e9d7b7; box-shadow:0 12px 40px #06162092;
  }
  body[data-world="post"] .chapter-shade { background:linear-gradient(90deg,#192a38 4%,#263746ed 34%,#26374624 59%,transparent 83%); }
  body[data-world="post"] .chapter-copy { width:min(49cqw,720px); }
}

.game-dialog {
  position:fixed; inset:50% auto auto 50%; transform:translate(-50%,-50%);
  max-width:none; width:min(710px,calc(var(--device-width) - 20px),calc(100vw - 20px));
  max-height:min(calc(var(--device-height) - 26px),calc(100dvh - 26px));
  margin:0; padding:0; overflow:auto;
  border:1px solid var(--line); border-radius:13px;
  background:var(--panel); color:var(--ink); box-shadow:0 20px 90px #000a;
}
.game-dialog::backdrop { background:#050e16ae; }
.game-dialog[open] { display:flex; flex-direction:column; overflow:hidden; }
.dialog-header { display:flex; flex:none; align-items:center; justify-content:space-between; gap:12px; padding:17px 20px 10px; }
.dialog-header h2 { font-size:clamp(1.85rem,4vw,2.9rem); }
.studio-tabs { display:flex; flex:none; flex-wrap:wrap; gap:7px; padding:0 20px 10px; border-bottom:1px solid #fff3d340; }
.studio-tabs button {
  padding:6px 10px; min-height:38px; border:1px solid transparent; border-radius:5px; color:var(--ink); background:transparent; font-size:.85rem;
}
.studio-tabs button:hover, .studio-tabs button[aria-pressed="true"] { border-color:#ffefd060; color:var(--accent); background:#09161e6e; }
.dialog-scroll { min-height:0; overflow:auto; padding:15px 20px 20px; scrollbar-width:thin; scrollbar-color:var(--line) transparent; }
.dialog-footer { display:flex; flex:none; justify-content:end; padding:10px 20px 12px; border-top:1px solid #fff3d340; }
.mix-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 15px; }
.mix-fields label { display:grid; align-content:end; gap:5px; font-weight:600; font-size:.79rem; }
.mix-fields select, .share-address { width:100%; min-height:44px; padding:8px 12px; border:1px solid var(--line); border-radius:5px; background:var(--base); color:var(--ink); font-size:.86rem; }
.studio-note { font-size:.83rem; color:var(--accent); margin-top:13px; }
.studio-actions { display:flex; flex-wrap:wrap; gap:6px; justify-content:end; margin-top:14px; }
.studio-actions .icon { width:17px; height:17px; }
.share-address { margin-top:12px; }
.world-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.world-card { display:flex; gap:10px; align-items:center; min-width:0; min-height:76px; padding:0 7px 0 0; text-align:left; overflow:hidden; border-radius:6px; border:1px solid #fff5d443; background:var(--base); }
.world-card[aria-pressed="true"], .world-card:hover { border-color:var(--accent); }
.world-card img { width:38%; align-self:stretch; object-fit:cover; }
.world-card strong, .world-card small { display:block; line-height:1.24; }
.world-card strong { font-size:.92rem; }
.world-card small { color:var(--accent); font-size:.71rem; margin-top:3px; }
.studio-docs p, .studio-docs li { font-size:.88rem; }
.studio-docs p + p, .studio-docs li + li { margin-top:9px; }
.studio-docs ul { padding-inline-start:20px; }
.studio-docs a { color:var(--accent); }
.progress-dialog { width:min(450px,calc(var(--device-width) - 20px)); }
.progress-content p { font-size:.91rem; }
.progress-content .progress-figure { display:flex; align-items:center; gap:10px; font:400 1.8rem var(--display); color:var(--accent); margin-bottom:13px; }

@container game (max-width: 620px) {
  .toolbar { min-height:56px; padding:6px 9px; gap:3px; }
  .tools-start, .tools-end { gap:4px; }
  .brand { display:none; }
  .tool { min-width:40px; min-height:44px; padding:6px; font-size:.73rem; }
  .tool .icon { width:19px; height:19px; }
  .tool-fullscreen { display:none; }
  .device-panel { top:54px; right:9px; }
  .region-heading { top:clamp(68px,11%,105px); left:15px; max-width:93%; }
  [data-map="clock"] .region-heading { right:16px; }
  .region-heading h1 { font-size:clamp(2.25rem,10cqw,3.7rem); }
  .region-heading p { margin-top:.46em; }
  .board { inset:17% 5% max(21%,var(--dock-safe,0px)); }
  .day-dock { inset:auto 11px 59px; display:block; }
  .day-dock::before { inset-inline:-11px; }
  .day-caption { max-width:100%; }
  .day-caption h2 { font-size:clamp(1.45rem,6.4cqw,2.42rem); }
  .day-meta { font-size:.73rem; }
  .day-brief { font-size:.74rem; line-height:1.35; }
  .day-controls { margin-top:6px; gap:6px; }
  .day-controls .primary { min-height:42px; padding-inline:12px; }
  .route-arrow, .region-tab { min-height:42px; padding:3px; }
  .region-nav { grid-template-columns:35px repeat(4,minmax(0,1fr)) 35px; gap:2px; inset:auto 8px 8px; padding-top:4px; }
  .region-tab span { font-size:.59rem; }
  .region-tab small { font-size:.59rem; }
  .actor { width:46px; height:65px; }
  .tool-score small, .count-word { display:none; }
  .marker-sign { width:17px; height:17px; }
  .marker-sign .icon { width:11px; height:11px; }
  .chapter-art, body[data-world="folio"] .chapter-art { width:100%; height:52%; object-position:var(--art-x,50%) 52%; }
  .chapter .chapter-shade { background:linear-gradient(180deg,#08152257 0%,transparent 22%,var(--base) 48%); }
  body[data-world] .chapter .chapter-shade { background:linear-gradient(180deg,#08152257 0%,transparent 22%,var(--base) 48%); }
  .chapter-scroll { inset:56px 0 0; display:block; }
  body[data-world] .chapter-copy { width:100%; padding:0 13px 18px; margin-top:clamp(140px,54cqw,270px); }
  body[data-world] .chapter-copy h1 { font-size:clamp(2.32rem,10cqw,4.2rem); margin-bottom:.26em; }
  .chapter-copy .story { line-height:1.45; font-size:.89rem; }
  .answers { margin-top:14px; }
  .answers legend { font-size:.88rem; margin-bottom:6px; }
  .answer { font-size:.84rem; line-height:1.35; }
  .chapter-nav { margin-top:10px; }
  .chapter-nav .quiet { font-size:.74rem; padding-inline:4px; gap:2px; }
  body[data-world="needle"] .chapter::after { inset:57px 6px 7px; }
  body[data-world="post"] .chapter::after { top:56px; }
}

@container game (max-width: 355px) {
  .marker { width:38px; height:38px; }
  .marker-sign { width:15px; height:15px; }
  .marker-today-label { font-size:10px; padding:3px 4px; }
  .actor { width:40px; height:58px; }
  .day-dock { inset-block-end:55px; }
  .day-controls { margin-top:4px; }
  .region-nav { grid-template-columns:28px repeat(4,minmax(0,1fr)) 28px; }
}

@container game (max-height: 690px) {
  .region-heading h1 { font-size:clamp(2.15rem,7cqw,4.1rem); }
  .day-brief { max-width:58ch; }
  .board { inset-block-end:max(22%,var(--dock-safe,0px)); }
}
@container game (min-width: 621px) and (max-height: 675px) {
  body[data-world] .chapter .chapter-copy { padding-block:14px 18px; }
  body[data-world] .chapter .chapter-copy h1 { font-size:clamp(2rem,7.1cqh,3.85rem); margin-bottom:.18em; }
  .chapter-copy .story { font-size:.88rem; line-height:1.39; }
  .answers { margin-top:11px; }
  .answer { min-height:40px; padding-block:4px; }
  .chapter-nav { margin-top:9px; }
  .chapter-nav .quiet { min-height:39px; }
}
@container game (max-width: 620px) and (max-height: 715px) {
  body[data-world] .chapter .chapter-copy { margin-top:clamp(110px,24cqh,176px); }
  body[data-world] .chapter .chapter-copy h1 { font-size:clamp(1.95rem,8.8cqw,3.05rem); }
}
@container game (max-width: 620px) and (max-height: 600px) {
  body[data-world] .chapter .chapter-copy { margin-top:clamp(78px,15cqh,110px); }
  body[data-world] .chapter .chapter-copy h1 { font-size:clamp(1.85rem,8cqw,2.5rem); text-shadow:0 2px 12px #101e25; }
  body[data-world] .chapter .chapter-shade { background:linear-gradient(180deg,#08152270 0%,transparent 15%,var(--base) 41%); }
  body[data-world] .chapter .chapter-art { height:43%; }
  .chapter-copy .story { font-size:.82rem; line-height:1.35; }
  .answers { margin-top:9px; }
  .answer { margin-bottom:3px; }
  .answer-note:empty { min-height:0; margin-top:0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::after, *::before { scroll-behavior:auto!important; animation-duration:.001ms!important; transition-duration:.001ms!important; }
}
