:root {
  --ink: #303b36;
  --muted: #697068;
  --paper: #f9f6ee;
  --canvas: #eae7de;
  --line: #c9cbbd;
  --green: #415d50;
  --accent: #a74d38;
  --accent-soft: #f0e2d8;
  --hint-ink: #41677a;
  --hint-line: #91afbd;
  --hint-soft: #eaf1f4;
  --grid: #b7c1ae;
  --cell: 44px;
  --serif: 'Songti SC', 'STSong', 'Noto Serif CJK SC', serif;
  --sans: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --mono: 'SFMono-Regular', Consolas, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 14px/1.6 var(--sans); }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; transition: background .15s, color .15s, transform .15s; }
button:disabled { cursor: default; opacity: .45; }
button:active:not(:disabled) { transform: translateY(1px); }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
.rain { display: none; }
header { max-width: 1440px; margin: auto; padding: 22px 44px; display: flex; justify-content: space-between; align-items: center; gap: 16px; border-bottom: 1px solid #c4c7b8; }
.brand { --brand-ink: #243d32; --brand-clay: #a54c2d; display: flex; align-items: center; flex-shrink: 0; color: var(--brand-ink); text-decoration: none; font: 650 27px/1.6 'Avenir Next', Avenir, 'Trebuchet MS', sans-serif; letter-spacing: -1.2px; -webkit-font-smoothing: antialiased; }
.brand-name { white-space: nowrap; }
.brand-suffix { font-weight: 400; color: var(--brand-clay); }
.brand-mark { display: block; width: 25px; height: 25px; flex: none; margin-right: 12px; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; transform: none; color: var(--brand-ink); }
.brand-mark svg { display: block; width: 100%; height: 100%; }
.brand-accent { fill: var(--brand-clay); }
.night .brand { --brand-ink: #e4e9dd; --brand-clay: #e2a582; }
.site-navigation { display: flex; align-items: center; gap: 24px; margin-right: auto; margin-left: 24px; }
.site-navigation a { padding: 8px 0; color: var(--ink); text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; font-weight: 600; }
.site-navigation a[aria-current="page"] { border-bottom-color:var(--accent); }
.site-navigation a:hover { color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 9px; }
.header-actions .feedback-link { display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; width:40px; min-height:40px; padding:8px; border:1px solid transparent; border-radius:5px; color:#566154; text-decoration:none; }
.feedback-link svg { width:23px; height:23px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.header-actions .feedback-link:hover { border-color:#adb8a4; background:#f4f1e9; }
.header-actions .feedback-link[aria-current="page"] { color:var(--accent); background:var(--accent-soft); }
.night .header-actions .feedback-link { color:#b6c4ab; }
.night .header-actions .feedback-link:hover { background:#303c31; border-color:#52624a; }
.night .header-actions .feedback-link[aria-current="page"] { color:var(--accent); }
.header-actions button { padding: 6px 11px; min-height: 36px; background: transparent; border: 1px solid transparent; border-radius: 3px; color: #566154; font-size: 12px; }
.header-actions button:hover { border-color: #adb8a4; background: #f4f1e9; }
.header-actions button[aria-pressed=true]:where(:not(#night)) { color: var(--accent); background: var(--accent-soft); }
.weather { font-size: 11px; color: var(--muted); border-right: 1px solid #bfc4b4; padding-right: 18px; margin-right: 8px; }
main { max-width: 1440px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); align-items: start; gap: 36px; padding: 34px 44px 30px; }
.story-side, .workbench { min-width: 0; }
.story-side { position: sticky; top: 24px; }
body.community-session header, body.community-session .site-intro,
body.community-session #difficulty-picker, body.community-session #scene-expand,
body.community-session .story-side, body.community-session #thinking-tools { display:none; }
body.community-session { background:var(--paper); }
body.community-session main { display:block; max-width:940px; padding:0 12px 14px; }
body.community-session .workbench { padding:0 12px 12px; border:0; box-shadow:none; background:transparent; }
body.community-session .workbench-toolbar,
body.community-session #round-status, body.community-session #round-note,
body.community-session .paper-heading, body.community-session .puzzle-heading > div:first-child,
body.community-session #puzzle-note { display:none; }
body.community-session .puzzle-heading { justify-content:flex-end; margin:0; padding-top:5px; }
body.community-session .community-replay { width:auto; gap:7px; padding:8px 12px; border-color:var(--line); font-size:13px; }
body.community-session .community-next { min-height:40px; padding:8px 12px; border:1px solid var(--line); border-radius:4px; background:var(--paper); color:var(--ink); font-size:13px; }
body.community-session .board-wrap { margin-top:0; }
body.community-session .board-controls { margin-top:14px; }
body.community-session.puzzle-complete .story-side { display:block; position:static; margin:22px 0 0; }
body.community-session .story-side > :not(.room-heading):not(.dialogue),
body.community-session .story-side .eyebrow, body.community-session .story-actions,
body.community-session #chapter-ending { display:none; }
body.community-session .room-heading,body.community-session .dialogue-heading { display:none; }
body.community-session .story-side .dialogue { display:block; }
.puzzle-confetti { position:fixed; inset:0; overflow:hidden; pointer-events:none; z-index:1000; }
.puzzle-confetti i { position:absolute; left:var(--x); top:-18px; width:7px; height:12px; border-radius:1px; opacity:0; animation:puzzle-confetti-fall var(--duration) linear var(--delay) both; will-change:transform; }
.puzzle-confetti i.spark { width:7px; height:7px; border-radius:50%; }
@keyframes puzzle-confetti-fall {
  0% { opacity:0; transform:translate3d(0,-15px,0) rotate(0); }
  8%,75% { opacity:1; }
  100% { opacity:0; transform:translate3d(var(--drift),105dvh,0) rotate(var(--spin)); }
}
@media(prefers-reduced-motion:reduce) { .puzzle-confetti { display:none; } }
.room-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.eyebrow { margin: 0 0 4px; color: var(--muted); font: 11px/1.5 var(--sans); letter-spacing: 1px; }
h1, .room-heading h2 { font: 500 27px/1.35 var(--serif); margin: 0; letter-spacing: 1px; }
.site-intro { padding:22px 0 20px; border-bottom:1px solid var(--line); }
.site-intro h1 { font-size:23px; }
.site-intro p { margin:10px 0 0; color:var(--muted); font-size:13px; line-height:1.85; }
.site-intro a, .tutorial-content a { color:var(--green); text-underline-offset:4px; }
body.tutorial-page main { display:block; max-width:960px; }
.tutorial-content { padding:30px 0; }
.tutorial-content p { color:var(--muted); margin:18px 0; }
@media(max-width:1050px) {
  header { flex-wrap:wrap; }
  .site-navigation { order:3; width:100%; margin:0; gap:24px; }
  .site-intro { padding-bottom:16px; }
  .site-intro h1 { font-size:21px; }
  .site-intro p { font-size:13px; }
}
@media(max-width:430px) {
  header .brand { font-size:18px; }
  header .brand-mark { width:19px; height:19px; margin-right:7px; }
  .header-actions .feedback-link,.header-actions #language-toggle,.header-actions #night,.header-actions #settings-toggle { width:34px; min-height:36px; padding:6px; }
  .site-navigation { gap:18px; font-size:12px; }
}
#scene-expand { display: none; }
.scene { position: relative; overflow:hidden; background: #c6cdb7; border: 6px solid #f5f1e7; outline: 1px solid #b3baa8; box-shadow: 2px 4px 0 #c5c8b8; }
.scene > svg { display: block; width: 100%; height: auto; transform-origin:100% 50%; }
.live-dot { display: inline-block; width: 5px; height: 5px; background: #7a8c6b; border-radius: 50%; margin-right: 5px; }
.window-rain { animation: window-rain 7s ease-in-out infinite; }
.tea-steam { transform-origin: 315px 270px; animation: steam 5s ease-in-out infinite; }
.lamp-glow, .lamp-spill, .lamp-source { opacity:0; transition:opacity 1.2s ease-out; }
.lit .lamp-glow, .lit .lamp-spill, .lit .lamp-source { opacity:1; }
.lit .lamp-shade { filter: brightness(1.12) saturate(1.05); }
.shop-visitor { opacity:0; transform:translateX(6px); transition:opacity 1s ease-out, transform 1.2s ease-out; }
.letter-found .shop-visitor, .repaired .shop-visitor { opacity:1; transform:translateX(0); }
.visitor-head { transform-origin:589px 224px; }
.visitor-neck { transform-origin:585px 238px; }
.visitor-head { transform:rotate(0deg); }
.visitor-head-up { opacity:0; }
.bell-rings { opacity:0; }
.scene.bell-response .bell-object { animation:none; }
.scene-replay { min-height:44px; margin-top:4px; padding:8px 0; color:var(--green); background:none; border:0; font-size:12px; text-decoration:underline; text-underline-offset:4px; }
body:not(.scene-expanded) .scene-replay { display:none; }
.scene[data-settling="0"] .lamp-glow, .scene[data-settling="0"] .lamp-spill, .scene[data-settling="0"] .lamp-source { opacity:0; transition:none; }
.scene[data-settling="1"] .shop-visitor { opacity:0; transform:translateX(6px); transition:none; }
.scene[data-settling="2"] .visitor-head { transform:rotate(0deg); transition:none; }
.scene-response { margin:14px 0 0; padding-left:10px; border-left:2px solid var(--accent); color:var(--ink); font:13px/1.8 var(--serif); }
body:not(.scene-expanded) .scene-response { display:none; }
.letter-object { opacity: 0; transition: opacity .8s; }
.letter-found .letter-object { opacity: 1; }
.bell-object { opacity: .4; transform-origin: 526px 94px; }
.repaired .bell-object { opacity: 1; animation: sway 6.5s ease-in-out infinite; }
/* Preserve SVG geometry for the landing animation, but hide never-unlocked objects. */
.scene [data-tier="-1"] { visibility: hidden; }
.detail-medium, .detail-hard, .cloud-projection { display: none; }
[data-tier="1"] .detail-medium, [data-tier="2"] .detail-medium, [data-tier="2"] .detail-hard, .cloud-light .cloud-projection { display: inline; }
.dialogue { position: relative; padding: 22px 10px 20px 19px; margin: 24px 0 20px; border-left: 2px solid #98a48e; }
.speaker { display: block; font-size: 11px; color: var(--muted); }
.dialogue p { font: 17px/1.85 var(--serif); margin: 7px 0; color: #384a3c; }
.story-foot { display: block; font-size: 11px; line-height: 1.7; color: #757b70; }
.chapters { --chapter-accent:#956342; --chapter-tint:#f5eee1; --chapter-edge:#b99b75; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; border-top:1px solid var(--line); padding-top:16px; }
.chapter-card { position:relative; min-width:0; padding:12px 10px 8px; border:1px solid var(--line); border-radius:8px; background:color-mix(in srgb,var(--paper) 45%,transparent); transition:background .18s,border-color .18s; }
.chapter-card:has(.chapter-button:hover) { background:var(--paper); border-color:var(--chapter-edge); }
.chapter-card.active { background:var(--chapter-tint); border-color:var(--chapter-edge); box-shadow:inset 0 -2px 0 var(--chapter-edge); }
.chapters .chapter-button { display:flex; align-items:center; gap:8px; width:100%; min-height:36px; padding:0 0 8px; border:0; border-radius:6px; background:transparent; text-align:left; }
.chapters .chapter-button:active:not(:disabled) { transform:none; }
.chapter-button::before { content:''; position:absolute; inset:0; border-radius:inherit; }
.chapters .chapter-button > svg { width:30px; height:32px; fill:none; stroke:var(--muted); stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; flex-shrink:0; }
.chapters .chapter-button > span { font:500 15px/1.4 var(--serif); white-space:nowrap; }
.chapters b { position:absolute; top:10px; right:10px; font:9px var(--mono); color:var(--muted); opacity:.65; }
.chapter-card.active .chapter-button > svg { stroke:var(--chapter-accent); }
.chapter-progress { position:relative; display:flex; justify-content:center; gap:4px; width:max-content; margin:0 auto; }
.chapters .progress-dot { position:relative; display:grid; place-items:center; width:24px; height:24px; padding:0; border:0; border-radius:50%; background:transparent; color:var(--muted); }
.progress-dot-mark { width:5px; height:5px; border:1px solid currentColor; border-radius:50%; opacity:.65; }
.progress-dot.is-complete .progress-dot-mark { width:7px; height:4px; margin-top:-2px; border:0; border-left:1.5px solid currentColor; border-bottom:1.5px solid currentColor; border-radius:0; opacity:1; transform:rotate(-45deg); }
.chapters .progress-dot.is-current { color:var(--chapter-accent); }
.progress-dot.is-current::after { content:''; position:absolute; inset:4px; border:1px solid currentColor; border-radius:50%; opacity:.6; }
.chapters .progress-dot:hover:not(:disabled) { background:color-mix(in srgb,var(--chapter-accent) 12%,transparent); }
.chapters .progress-dot:focus-visible { outline-offset:0; }
.progress-tooltip { position:absolute; bottom:calc(100% + 6px); left:0; z-index:45; width:max-content; max-width:calc(100vw - 30px); padding:6px 9px; border:1px solid var(--line); border-radius:5px; background:var(--paper); color:var(--ink); box-shadow:0 3px 12px #0001; font:11px/1.5 var(--sans); pointer-events:none; }
.chapter-card:last-child .progress-tooltip { left:auto; right:0; }
.workbench { position: relative; padding: 0 26px 21px; background: var(--paper); border: 1px solid #bcc4b1; border-radius: 3px; box-shadow: 4px 5px 0 #d4d7c7; }
.workbench-toolbar { display:flex; justify-content:space-between; align-items:center; gap:16px; padding-top:12px; }
.difficulty-picker { position:relative; width:fit-content; }
.workbench-toolbar #scene-expand { flex-shrink:0; min-height:36px; }
.difficulty-picker summary { display:flex; align-items:center; gap:8px; width:fit-content; min-height:36px; cursor:pointer; list-style:none; color:var(--muted); font-size:12px; }
.difficulty-picker summary::-webkit-details-marker { display:none; }
.difficulty-change { display:inline-flex; align-items:center; gap:6px; }
.difficulty-change::after { content:""; width:5px; height:5px; border-right:1px solid currentColor; border-bottom:1px solid currentColor; transform:translateY(-2px) rotate(45deg); }
.difficulty-picker[open] .difficulty-change::after { transform:translateY(1px) rotate(225deg); }
.difficulty-options { position:absolute; top:100%; right:0; z-index:40; display:flex; flex-direction:column; gap:2px; min-width:160px; padding:5px; border:1px solid var(--line); border-radius:6px; background:var(--paper); box-shadow:0 6px 18px #263a251a; }
.difficulty-options button { display:flex; justify-content:space-between; align-items:center; gap:20px; min-height:40px; padding:8px 12px; border:0; border-radius:3px; background:transparent; color:var(--muted); font-size:12px; text-align:left; }
.difficulty-options button:hover:not(:disabled) { background:var(--hint-soft); }
.difficulty-options button[aria-pressed=true] { color:var(--green); background:var(--hint-soft); font-weight:600; }
.difficulty-options button[aria-pressed=true]::after { content:"✓"; }
.difficulty-picker summary:focus-visible { outline:2px solid var(--green); outline-offset:3px; }
.round-status { font: 11px/1.6 var(--sans); color: #7b8371; margin: 12px 0 0; }
.round-note, .paper-heading, .puzzle-heading .eyebrow { display: none; }
.puzzle-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin: 9px 0 0; }
h2 { font: 500 28px/1.35 var(--serif); color: var(--ink); margin: 0; letter-spacing: 1px; }
.size-label { border: 0; padding: 0; color: #62705a; font: 11px var(--mono); white-space: nowrap; }
.board-wrap { padding: 5px 0 17px; display: flex; justify-content: center; }
.board { width: max-content; display: grid; grid-template-columns: var(--row-clue-width, 43px) repeat(var(--n), var(--cell)); grid-template-rows: var(--clue-height, 60px) repeat(var(--n), var(--cell)); user-select: none; touch-action: none; }
.clue { display: flex; justify-content: flex-end; align-items: center; gap: 6px; padding-right: 10px; white-space: nowrap; min-width: 0; font: 500 var(--clue-font, 15px)/1.1 var(--mono); color: #45543e; transition: color .15s; }
.clue.col { flex-direction: column; justify-content: flex-end; gap: 4px; padding: 0 0 9px; }
.clue.matched { color: #94a08b; }
.clue.highlight:not(.line-error) { color: var(--hint-ink); background: var(--hint-soft); }
.fillable-clue { text-decoration: underline; text-decoration-thickness:1px; text-underline-offset: 4px; text-decoration-color: #91a282; }
.fillable-clue:not(:disabled):hover { color: var(--accent); background: var(--accent-soft); }
.fillable-clue:disabled { opacity: 1; cursor: default; text-decoration: none; }
.cell { display: grid; place-items: center; position: relative; padding: 0; background: #fffdf6; border: 0; border-right: 1px solid var(--grid); border-bottom: 1px solid var(--grid); color: #8a9580; font: var(--mark-font, 25px)/1 var(--sans); min-width: 0; min-height: 0; border-radius: 0; transition: background .1s; }
.cell.top-edge { border-top: 2px solid #7d8e70; }
.cell.left-edge { border-left: 2px solid #7d8e70; }
.cell.right-edge { border-right: 2px solid #7d8e70; }
.cell.bottom-edge { border-bottom: 2px solid #7d8e70; }
.cell.block-left { border-left: 2px solid #7d8e70; }
.cell.block-top { border-top: 2px solid #7d8e70; }
.cell.filled { background: #3c5748; box-shadow: inset 0 0 0 var(--fill-inset, 3px) #f9f6ee; animation: ink-set .15s ease-out; }
.cell:hover { outline: 2px solid #b27a53; outline-offset: -3px; z-index: 1; }
.cell:focus-visible { outline-offset: -4px; z-index: 2; }
.cell.crosshair::after { content: ''; position: absolute; inset: 0; background: #758c6a20; pointer-events: none; }
.cell.active-cell { outline: 2px solid #a06a45; outline-offset: -3px; z-index: 1; }
.drag-count { position: fixed; z-index: 30; pointer-events: none; border: 1px solid #bac7ac; border-radius: 4px; padding: 6px 10px; background: #fcfaf1; color: #3c5748; box-shadow: 0 3px 10px #263a2520; font: 500 12px/1.4 var(--sans); white-space: nowrap; }
.board.solved .cell.filled { background: #ab7647; transition: background .6s; }
.workbench[data-size="7"] { --cell: 40px; }
.workbench[data-size="10"], .workbench[data-size="15"] { --cell: 32px; }
.workbench[data-size="10"] .board-wrap, .workbench[data-size="15"] .board-wrap { display: flex; }
.workbench[data-size="10"] .board, .workbench[data-size="15"] .board { margin: 0 auto; }
.tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; padding: 13px 0; border-top: 1px solid #d4dacb; border-bottom: 1px solid #d4dacb; }
.tools button { background: #eeeede; color: #54674c; border: 1px solid #c3ceb6; border-radius: 3px; min-height: 39px; padding: 7px 10px; font-size: 12px; white-space: nowrap; box-shadow: 0 2px 0 #d2d9c5; }
.tools button:hover:not(:disabled) { background: #e5e9d9; }
.tools button[aria-pressed=true] { background: #425e4c; color: #fffaf0; border-color: #425e4c; box-shadow: 0 2px 0 #283f30; }
.tool-icon { font: 15px/1 var(--sans); margin-right: 4px; }
.tool-divider { width: 7px; }
#hint { color: var(--hint-ink); background: var(--hint-soft); border-color: var(--hint-line); box-shadow:none; }
.feedback { color: #68785c; font-size: 11px; line-height: 1.8; min-height: 34px; margin: 12px 0 8px; padding-left: 12px; position: relative; }
.feedback:before { content: ''; position: absolute; width: 4px; height: 4px; background: #8f9e80; top: 8px; left: 0; border-radius: 50%; }
.paper-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid #d3dac7; padding-top: 11px; color: #7b8570; font-size: 10px; }
.paper-footer { flex-wrap:wrap; }
.completion-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:10px; margin-left:auto; }
.completion-actions button { display:inline-flex; align-items:center; justify-content:center; min-height:44px; margin:0; padding:10px 16px; border-radius:6px; font-size:12px; font-weight:500; line-height:1.5; text-align:center; text-decoration:none; }
.completion-actions .text-button { color:#52664f; background:#f0f1e7; border:1px solid #bdc8b4; box-shadow:0 1px 2px #354d2c08; }
.completion-actions .text-button:hover:not(:disabled) { color:#344e3b; background:#e6ebdd; border-color:#8fa284; }
.completion-actions .primary { border-color:#3a5543; box-shadow:0 1px 2px #293d2f24; }
.completion-actions .primary:hover:not(:disabled) { background:#354f3f; }
.completion-actions button:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.text-button { border: 0; background: none; padding: 5px 0; color: inherit; font-size: 11px; text-decoration: underline; text-underline-offset: 4px; min-height: 30px; }
.text-button:hover { color: var(--accent); }
.primary { color: #fffaf0; background: #425e4c; border: 1px solid #314b3a; border-radius: 3px; min-height: 42px; padding: 10px 19px; margin: 11px 0 5px; font-size: 13px; box-shadow: 0 2px 0 #293d2f; }
.primary:hover { background: #314d3b; }
footer { max-width: 1440px; margin: 0 auto; padding: 0 44px 23px; display: flex; justify-content: space-between; align-items: center; gap: 20px; color: #747d69; font-size: 10px; }
footer > div { margin-left: auto; display: flex; align-items: center; gap: 22px; }
footer label { cursor: pointer; }
input[type=checkbox] { accent-color: #6c805c; vertical-align: -2px; }
/* Repair flight shares the root stacking context with the raised destination scene. */
.repair-overlay { display: contents; }
.repair-shade { position: fixed; inset: 0; z-index: 1000; background: #192b2a35; pointer-events: auto; animation: repair-shade-in .3s ease-out; }
@keyframes repair-shade-in { from { opacity: 0; } to { opacity: 1; } }
.repair-flyer { position: fixed; z-index: 1003; pointer-events: none; filter: drop-shadow(0 4px 8px #334b3828); transform-origin: center; }
.repair-pixels, .repair-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.repair-pixels { display: grid; grid-template-columns: repeat(var(--n), 1fr); grid-template-rows: repeat(var(--n), 1fr); gap: 3px; }
.repair-pixels i { display: block; }
.repair-pixels .ink { background:#ab7647; border-radius:1px; }
.night .repair-pixels .ink { background:#d0aa72; }
.repair-art { opacity: 0; overflow: visible; }
.repair-art .lamp-shade { filter: brightness(1.12) saturate(1.05); }
.repair-target { opacity: 0 !important; }
.board.releasing .cell.filled { opacity: .15; transition: opacity .45s; }
.repair-reduced > *, .repair-reduced:before { display: none; }
@keyframes sway { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } }
@keyframes steam { 0%, 100% { transform: translateY(0); opacity: .2; } 55% { transform: translateY(-7px); opacity: .55; } }
@keyframes window-rain { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
.glass-droplets { animation: glass-drip 10s ease-in-out infinite; }
@keyframes glass-drip { 0%, 100% { transform: translateY(0); opacity: .15; } 25% { opacity: .38; } 80% { transform: translateY(7px); opacity: .25; } }
@keyframes ink-set { from { box-shadow: inset 0 0 0 6px #f9f6ee; } to { box-shadow: inset 0 0 0 var(--fill-inset, 3px) #f9f6ee; } }
@media (min-width: 1400px) { .workbench { padding-inline: 36px; } .round-tabs { margin-inline: -36px; padding-inline: 36px; } }
@media (max-width: 1100px) { header { padding-inline: 26px; } main { gap: 30px; padding-inline: 26px; } .workbench { padding-inline: 19px; } .round-tabs { margin-inline: -19px; padding-inline: 19px; gap: 10px; } .chapters { gap: 4px; }  .chapters .chapter-button > svg { width: 25px; } footer { padding-inline: 26px; } }
@media (max-width: 1000px) {
  header { padding: 14px 23px; }
  .brand { font-size: 23px; }
  .brand-mark { width: 22px; height: 22px; margin-right: 8px; }
  .site-navigation { margin-left: 8px; }
  .weather { display: none; }
  .header-actions { gap: 0; }
  .header-actions button { font-size: 11px; padding-inline: 8px; }
  main { max-width: 650px; grid-template-columns: minmax(0, 1fr); gap: 23px; padding: 19px 23px 24px; }
  .story-side { position: static; display: grid; grid-template-columns: 150px minmax(0, 1fr); column-gap: 20px; align-items: center; }
  .room-heading { grid-column: 1 / -1; margin-bottom: 10px; }
  .room-heading > div { display: flex; align-items: baseline; gap: 13px; }
  .room-heading .eyebrow { font-size: 10px; margin: 0; }
  h1 { font-size: 16px; }
  #scene-expand { display: block; font-size: 10px; color: #65765a; }
  .scene { border-width: 3px; box-shadow: 1px 2px 0 #b9c2ac; }
  .dialogue { margin: 0; padding: 0 0 0 13px; }
  .speaker { font-size: 10px; }
  .dialogue p { font-size: 14px; line-height: 1.8; margin: 5px 0 0; }
  .story-foot { display: none; }
  .chapters { grid-column: 1 / -1; padding-top: 10px; margin-top: 12px; gap: 9px; }
  
  .chapters .chapter-button > svg { width: 26px; height: 33px; }
  .chapters .chapter-button > span { font-size: 12px; }
  .workbench { padding: 0 25px 17px; }
  .round-tabs { margin-inline: -25px; padding-inline: 25px; }
  .round-tabs button { padding-top: 14px; padding-bottom: 10px; }
  .round-status { margin-top: 10px; }
  .round-note { margin-bottom: 12px; }
  .paper-heading { padding-top: 12px; }
  .puzzle-heading { margin-top: 7px; }
  h2 { font-size: 25px; }
  .board-wrap { padding-top: 0; padding-bottom: 16px; }
  .scene-expanded .story-side { grid-template-columns: minmax(0, 1fr); }
  .scene-expanded .scene { grid-column: 1 / -1; }
  .scene-expanded .dialogue { margin-top: 16px; }
  .scene-expanded .story-foot { display: block; }
  footer { max-width: 650px; padding: 0 23px 22px; }
}
@media (max-width: 600px) {
  header { flex-wrap: wrap; gap: 6px 12px; }
  .header-actions { margin-left: auto; }
  .site-navigation { order: 1; flex-basis: 100%; margin: 0; font-size: 13px; }
}
@media (max-width: 430px) {
  header { padding: 12px 15px; }
  .brand { font-size: 21px; }
  .header-actions button { font-size: 10px; padding-inline: 6px; }
  main { padding: 14px 15px 20px; gap: 18px; }
  .story-side { column-gap: 12px; grid-template-columns: 118px minmax(0, 1fr); }
  .room-heading > div { gap: 9px; }
  h1 { font-size: 15px; }
  .dialogue { padding-left: 10px; }
  .dialogue p { font-size: 13px; line-height: 1.7; }
  .chapters { margin-top: 12px; padding-top: 10px; gap: 5px; }
  
  .chapters .chapter-button > svg { width: 23px; }
  .chapters .chapter-button > span { font-size: 11px; }
  .chapters b { font-size: 9px; }
  .workbench { padding-inline: 15px; }
  .round-tabs { margin-inline: -15px; padding-inline: 15px; gap: 8px; }
  .round-tabs button { font-size: 11px; }
  .workbench[data-size="7"] { --cell: 35px; }
  .clue { padding-right: 8px; }
  .board { grid-template-columns: var(--row-clue-width, 35px) repeat(var(--n), var(--cell)); }
  .tools { gap: 4px; }
  .tools button { padding-inline: 8px; font-size: 11px; }
  .tool-divider { width: 2px; }
  footer { padding-inline: 15px; gap: 10px; flex-wrap: wrap; }
  footer > div { gap: 15px; }
}
@media (prefers-reduced-motion: reduce) { *, *:before { animation: none !important; transition: none !important; } }

/* Keep the header quiet; preferences live in one anchored panel. */
.header-actions{position:relative}
#language-toggle>svg,#night>svg,#settings-toggle>svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
#night>.theme-sun{display:none}
.night #night>.theme-moon{display:none}
.night #night>.theme-sun{display:block}
.header-actions #language-toggle,.header-actions #night,.header-actions #settings-toggle{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:40px;min-height:40px;padding:8px;border-radius:5px}
#language-toggle { anchor-name: --language-toggle; }
.language-menu { position: absolute; position-anchor: --language-toggle; inset: auto; top: anchor(bottom); right: anchor(right); margin: 10px 0 0; width: 152px; padding: 6px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 8px 24px #26352420; }
.header-actions .language-menu a { display: block; width: 100%; padding: 10px 12px; min-height:44px; text-align: left; color: inherit; text-decoration:none; border-radius:3px; }
.header-actions .language-menu a:hover,.header-actions .language-menu a:focus-visible { background:var(--canvas); }
.header-actions .language-menu a[aria-current] { color:var(--green); font-weight:600; }
.header-actions #settings-toggle[aria-expanded=true]{color:var(--green);background:var(--hint-soft);border-color:var(--hint-line)}
.settings-panel{position:absolute;right:0;top:calc(100% + 10px);z-index:50;width:258px;max-width:calc(100vw - 30px);padding:14px 17px 12px;background:var(--paper);border:1px solid #bac4ad;border-radius:4px;box-shadow:0 8px 24px #26352420}
.header-actions .setting-toggle{width:100%;display:flex;align-items:center;justify-content:space-between;text-align:left;gap:10px;min-height:47px;padding:8px 0;color:var(--ink);font-size:13px;border:0;border-radius:0;background:none}
.header-actions .setting-toggle:hover,.header-actions .setting-toggle[aria-pressed=true]{background:none;color:var(--ink);border:0}
.setting-toggle:after{content:'';display:block;width:33px;height:19px;flex-shrink:0;border-radius:12px;background:radial-gradient(circle at 10px 50%,#faf8ef 6px,transparent 7px),#adb6a3;transition:background .15s}
.setting-toggle[aria-pressed=true]:after{background:radial-gradient(circle at 23px 50%,#faf8ef 6px,transparent 7px),#56734f}
.header-actions .setting-action{display:block;width:100%;min-height:44px;margin-top:4px;padding:10px 0;text-align:left;font-size:13px;color:var(--ink);border:0;border-top:1px solid #d4dacb;border-radius:0}
.header-actions .setting-action:hover{border-color:#d4dacb}
.night .header-actions .setting-action,.night .header-actions .setting-action:hover{border-color:#46563e}

body.night{color-scheme:dark;--ink:#e0e6d5;--muted:#a3ae99;--paper:#252e29;--canvas:#1c231f;--line:#4d5d47;--green:#9ab78c;--accent:#dfac86;--accent-soft:#3e332c;--grid:#52624d}
.night header,.night .chapters{border-color:#43513c}
.night .header-actions button{color:#b6c4ab}
.night .header-actions button:hover,.night #settings-toggle[aria-expanded=true]{background:#303c31;border-color:#52624a}
.night .settings-panel{border-color:#52624a;box-shadow:0 8px 24px #0005}
.night .scene{border-color:#3b4937;outline-color:#55634a;box-shadow:2px 4px 0 #111a12}
.night .scene>svg{filter:brightness(.8) saturate(.9)}
.night .dialogue{border-color:#627456}.night .dialogue p{color:#d1dcc3}.night .story-foot{color:#a1ae92}
.night .chapters { --chapter-accent:#e2bc8c; --chapter-tint:#35372d; --chapter-edge:#8f8060; }
.night .workbench{border-color:#4f5e45;box-shadow:4px 5px 0 #121d14}
.night .round-tabs,.night .tools,.night .paper-footer{border-color:#47583e}
.night .round-tabs button,.night .round-status,.night .size-label{color:#aabb96}
.night .clue{color:#c8d6b6}.night .clue.matched{color:#7f9270}
.night .cell{background:#1c261d;color:#99ab89}.night .cell.filled{background:#b6c79b;box-shadow:inset 0 0 0 var(--fill-inset, 3px) #252e29;animation:none}
.night .cell.top-edge,.night .cell.left-edge,.night .cell.right-edge,.night .cell.bottom-edge,.night .cell.block-top,.night .cell.block-left{border-color:#7c8f69}
.night .board.solved .cell.filled{background:#d0aa72}
.night .tools button{background:#33412e;color:#c3d2ae;border-color:#596d49;box-shadow:0 2px 0 #172318}
.night .tools button:hover:not(:disabled){background:#405236}.night .tools button[aria-pressed=true]{background:#a0b789;color:#1c2a1b;border-color:#b1c49c}
.night { --hint-ink:#b1cedc; --hint-line:#627f90; --hint-soft:#2b3a43; }
.night #hint{color:var(--hint-ink);background:var(--hint-soft);border-color:var(--hint-line);box-shadow:none}
.night .feedback,.night .paper-footer,.night .board-help,.night footer{color:#a6b895}

.night .completion .eyebrow{color:#c2af92}.night .completion p:not(.eyebrow){color:#bdcdaa}
.night .primary{background:#b0c49b;color:#23311e;border-color:#bbd1a3;box-shadow:0 2px 0 #152313}.night .primary:hover{background:#c1d2b0}
@media(max-width:430px){.settings-panel{right:0}}
.night .cell.crosshair::after{background:#b6c79b24}
.night .cell.active-cell{outline-color:#d0aa72}
.night .drag-count{color:#e2eacb;background:#27352c;border-color:#71855e}

/* The board fits its container and scrolls with the page. */
.board-heading-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; align-items:center; gap:8px; }
.board-heading-actions .debug-complete { width:40px; min-height:40px; padding:9px; border:1px dashed var(--line); border-radius:4px; background:var(--paper); color:var(--ink); }
.board-heading-actions .debug-complete svg { display:block; width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.board-heading-actions .debug-complete:hover { border-color:var(--green); }
.board-heading-actions .debug-complete:focus-visible { outline:2px solid var(--green); outline-offset:2px; }
.hint-budget { color:var(--hint-ink); font:10px/1.4 var(--sans); font-variant-numeric:tabular-nums; white-space:nowrap; opacity:.8; }
#scene-expand { display:inline-block; font-size:12px; }
body:not(.scene-expanded) main { grid-template-columns:minmax(0, 1fr); max-width:1100px; gap:20px; }
body:not(.scene-expanded) .story-side { position:static; display:block; }
body:not(.scene-expanded) .story-side .scene,
body:not(.scene-expanded) .story-side .dialogue { display:none; }
body:not(.scene-expanded) .room-heading { display:none; }
body:not(.scene-expanded) .chapters { margin-top:0; }
.board-wrap,
.workbench[data-size="10"] .board-wrap,
.workbench[data-size="15"] .board-wrap { display:block; overflow:visible; padding:0; margin:8px 0 16px; }
.board,
.workbench[data-size="10"] .board,
.workbench[data-size="15"] .board { margin:0 auto; isolation:isolate; }
.clue { position:sticky; left:0; z-index:5; background:var(--paper); gap:4px; padding-right:12px; }
.clue.col { top:0; left:auto; z-index:6; gap:4px; padding-bottom:8px; }
.clue-corner { position:sticky; top:0; left:0; z-index:8; background:var(--paper); display:grid; place-items:center; }
.clue-corner .size-label { position:absolute; right:0; bottom:20px; transform:rotate(-45deg); }
.clue-number { font:inherit; color:inherit; line-height:1.5; border:0; border-radius:2px; padding:0; min-width:1.35em; background:transparent; }
.clue.col .clue-number { text-align:center; }
.cell.highlight { outline:3px solid var(--hint-ink); outline-offset:-4px; background:var(--hint-soft); z-index:2; }
.cell.considering::before,.loupe-cell.considering::before { content:''; position:absolute; inset:12%; border:2px dashed #ae754b; border-radius:50%; pointer-events:none; z-index:3; }
.board.pan-mode { touch-action:pan-y; }
.board.pan-mode,.board.pan-mode .cell { cursor:auto; }
.thinking-tools { border-top:0; padding:10px 0; }
.tools button { min-height:44px; }
.cell-loupe { position:fixed; z-index:40; width:132px; padding:8px; pointer-events:none; color:var(--ink); background:var(--paper); border:1px solid var(--grid); border-radius:6px; box-shadow:0 5px 20px #263a2533; }
.loupe-grid { display:grid; grid-template-columns:repeat(3, 1fr); }
.loupe-cell { position:relative; aspect-ratio:1; display:grid; place-items:center; border:1px solid var(--grid); font:24px var(--sans); background:#fffdf6; }
.loupe-cell.filled { background:#3c5748; }
.loupe-cell.target { outline:3px solid var(--accent); outline-offset:-3px; z-index:1; }
.loupe-cell.outside { opacity:.15; }
.loupe-position { display:block; text-align:center; margin-top:6px; font-size:11px; }
.night .loupe-cell { background:#293629; }.night .loupe-cell.filled { background:#adc48b; }
[hidden] { display:none !important; }
@media(max-width:430px) {
  .board-heading-actions { gap:8px; }
  .clue { padding-right:12px; }
}

.night .completion-actions .text-button { color:#c2d0b0; background:#303d2c; border-color:#647657; box-shadow:none; }
.night .completion-actions .text-button:hover:not(:disabled) { color:#e1e9d5; background:#3c4b35; border-color:#8eaa76; }
.night .completion-actions .primary { box-shadow:0 1px 2px #101a1424; }
.night .completion-actions .primary:hover:not(:disabled) { background:#c1d2b0; }
@media(max-width:430px) {
  .completion-actions { width:100%; gap:8px; }
  .completion-actions button { flex:1 1 125px; padding-inline:12px; }
}

/* Keep the hint entry compact; reveal its context only when requested. */
.board { position:relative; }
.board-hint { max-width:100%; margin:10px 0 14px; padding:10px 12px; border:1px solid #d7d5c4; border-radius:5px; background:#f1f0e5; }
.board-hint:not(.active) { display:none; }
.board-hint-heading { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.board-hint-title { color:#5b6b51; font-size:12px; font-weight:600; }
.hint-navigation { display:inline-flex; gap:4px; margin-left:auto; }
.hint-navigation button { min-height:32px; padding:4px 7px; border:0; border-radius:3px; background:transparent; color:var(--hint-ink); font-size:11px; }
.hint-navigation button:hover:not(:disabled) { background:var(--paper); }
.hint-step { color:var(--hint-ink); font:11px/1.5 var(--sans); }
.board-heading-actions #hint { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:38px; padding:7px 12px; border:1px solid var(--hint-line); border-radius:4px; font-size:12px; white-space:nowrap; box-shadow:none; }
.board-hint.active { border-color:var(--hint-line); background:var(--hint-soft); }
.board-hint-text { margin:9px 0 1px; color:var(--hint-ink); font:13px/1.8 var(--sans); overflow-wrap:anywhere; }
.hint-line-frame { position:absolute; inset:0; z-index:9; border:2px solid var(--hint-line); border-radius:3px; box-shadow:0 0 0 1px var(--paper); background:transparent; pointer-events:none; }
.board-hint.active .board-hint-title { color:var(--hint-ink); }
.hint-icon { width:19px; height:19px; flex-shrink:0; fill:none; stroke:currentColor; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; }
#hint.is-exhausted .hint-icon { display:none; }
#hint:focus-visible { outline-color:var(--hint-ink); }
.board-heading-actions #hint.is-exhausted { flex-direction:column; gap:2px; padding:6px 10px; border-color:var(--line); background:transparent; color:var(--muted); opacity:1; cursor:default; }
#hint.is-exhausted #hint-label { font-size:11px; font-weight:400; }
#hint.is-exhausted .hint-budget { color:var(--muted); font-size:10px; opacity:1; }
@media(max-width:430px) {
  .board-hint { padding:9px 10px; }
  .board-hint-heading { gap:6px; }
  .board-hint-title { font-size:11px; }
  .hint-step { font-size:10px; }
  .board-heading-actions #hint { min-height:40px; padding-inline:10px; }
}

/* Line feedback stays on the board without intercepting strokes. */
.line-effect { position:absolute; inset:0; z-index:10; pointer-events:none; border:2px solid #6f9767; border-radius:3px; overflow:visible; color:#456b3d; background:#89ac6920; animation:line-confirm 1050ms ease-out both; }
.line-effect::before { content:''; position:absolute; inset:0; background:linear-gradient(90deg,transparent,#e7edc899,transparent); transform-origin:left; animation:line-sweep 850ms ease-out both; }
.line-effect.column::before { background:linear-gradient(0deg,transparent,#e7edc899,transparent); transform-origin:top; animation-name:line-sweep-column; }
.line-effect.error { color:#a44332; border-color:#b55b47; border-style:dashed; background:#bf59431a; animation:line-reject 750ms ease-out both; }
.line-effect.error::before { display:none; }
.clue.line-error { color:#a44332; background:#bf594312; }
.night .clue.line-error { color:#edaa90; background:#a24c3428; }
.night .line-effect.complete { color:#c2dcaa; border-color:#a3c68c; }
.night .line-effect.error { color:#f0b49e; border-color:#da967e; }
@keyframes line-confirm { 0% { opacity:0; } 18%,65% { opacity:1; } 100% { opacity:0; } }
@keyframes line-sweep { from { clip-path:inset(0 100% 0 0); } to { clip-path:inset(0 0 0 0); } }
@keyframes line-sweep-column { from { clip-path:inset(0 0 100% 0); } to { clip-path:inset(0 0 0 0); } }
@keyframes line-reject { 0%,70% { opacity:1; } 15%,45% { transform:translateX(-2px); } 30%,60% { transform:translateX(2px); } 80% { transform:translateX(0); } 100% { opacity:0; transform:translateX(0); } }
@media(prefers-reduced-motion:reduce) {
  .line-effect { animation:none; }
  .line-effect::before { animation:none; background:none; }
}

.feedback:empty { display:none; }

.scene-continue { display:block; width:100%; margin:14px 0 0; }

/* Keep scene expansion from shifting the page underneath the fixed flying object. */
body.repairing { overflow-anchor:none; }

/* Debug actions are mounted only for local development. */
.debug-menu { position:relative; }
.debug-menu summary { display:flex; align-items:center; justify-content:center; width:40px; min-height:40px; padding:8px; border:1px solid transparent; border-radius:5px; color:#566154; cursor:pointer; list-style:none; }
.debug-menu summary svg { width:23px; height:23px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.debug-menu summary:hover { border-color:var(--line); background:var(--paper); }
.debug-menu[open] summary { color:var(--green); border-color:var(--hint-line); background:var(--hint-soft); }
.night .debug-menu summary { color:#b6c4ab; }
.debug-menu summary::-webkit-details-marker { display:none; }
.debug-menu summary:focus-visible { outline:2px solid var(--green); outline-offset:2px; }
.debug-options { position:absolute; top:calc(100% + 8px); right:0; z-index:60; width:190px; padding:5px; border:1px solid var(--line); border-radius:5px; background:var(--paper); box-shadow:0 6px 20px #0002; }
.header-actions .debug-options button { display:block; width:100%; min-height:40px; padding:8px 10px; text-align:left; color:var(--ink); }
@media(max-width:430px) { .debug-options { left:0; right:auto; } }

/* Board tools share one surface and one set of interaction states. */
.board-controls { --mode-surface:#f0f1e8; --mode-line:#abb9a4; --mode-hover:#e3e9dc; --mode-selected:#526951; --mode-selected-ink:#fffaf0; margin:13px 0; padding:6px; border:1px solid var(--mode-line); border-radius:12px; background:var(--mode-surface); }
.board-controls .tools { justify-content:center; gap:4px; padding:0; border:0; }
.board-controls .thinking-tools { margin-top:4px; }
.paint-tools { display:inline-flex; align-items:stretch; justify-content:center; gap:4px; max-width:100%; }
.board-controls .tools button { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:44px; padding:10px 13px; border:0; border-radius:7px; background:transparent; color:var(--muted); font-size:13px; font-weight:500; box-shadow:none; }
.board-controls .paint-tools button { flex:1 1 0; min-width:76px; }
.board-controls #clear-consider { font-size:12px; font-weight:400; }
.board-controls .tools button:hover:not(:disabled) { background:var(--mode-hover); }
.board-controls .tools button[aria-pressed=true],.board-controls .tools button[aria-pressed=true]:hover:not(:disabled) { background:var(--mode-selected); color:var(--mode-selected-ink); box-shadow:none; }
.board-controls button svg { width:19px; height:19px; flex-shrink:0; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.board-controls button:active:not(:disabled) { transform:none; }
.board-controls button:focus-visible { outline-offset:1px; }
.night .board-controls { --mode-surface:#111f17; --mode-line:#43594a; --mode-hover:#293d2e; --mode-selected:#a0b789; --mode-selected-ink:#142317; }
@media(max-width:430px) {
  .paint-tools { flex:0 1 100%; }
  .board-controls .paint-tools button { min-width:0; }
  .board-controls .tools button { padding-inline:12px; }
}

.puzzle-heading > div:first-child { min-width:0; }
.puzzle-title-row { display:flex; align-items:center; gap:6px; }
.puzzle-title-row h2 { min-width:0; overflow-wrap:anywhere; }
.reset-puzzle { display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; width:44px; height:44px; padding:12px; border:1px solid transparent; border-radius:7px; background:transparent; color:var(--muted); }
.reset-puzzle svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.reset-puzzle:hover:not(:disabled) { color:var(--green); background:var(--canvas); border-color:var(--line); }

.reset-dialog { width:min(420px, calc(100% - 32px)); max-height:calc(100dvh - 32px); margin:auto; padding:28px; overflow:auto; color:var(--ink); background:var(--paper); border:1px solid var(--grid); border-radius:8px; box-shadow:0 16px 60px #15251d40; }
.reset-dialog::backdrop { background:#18271f80; }
.reset-dialog h2 { margin:6px 0 16px; font:600 24px/1.5 var(--serif); }
#reset-dialog-description { margin:0; line-height:1.9; }
.reset-dialog-warning { margin:10px 0 24px; color:var(--muted); font-size:12px; }
.reset-dialog-actions { display:flex; justify-content:flex-end; gap:12px; }
.reset-dialog-actions button { min-height:44px; margin:0; padding:10px 20px; border-radius:4px; }
#reset-cancel { background:transparent; color:var(--ink); border:1px solid var(--grid); }
#reset-cancel:hover { background:var(--canvas); }

/* A quiet invitation to start; the clock runs only during active play. */
.level-session { display:inline-flex; align-items:center; gap:7px; color:var(--muted); }
.elapsed-time { min-width:5ch; font:13px/1.3 var(--mono); font-variant-numeric:tabular-nums; white-space:nowrap; }
.session-toggle { width:44px; display:inline-flex; align-items:center; justify-content:center; gap:5px; min-height:44px; padding:8px; border:1px solid transparent; border-radius:7px; background:transparent; color:var(--green); font-size:12px; }
.session-toggle:hover:not(:disabled) { background:var(--canvas); border-color:var(--line); }
.session-toggle svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.session-toggle .session-pause,.session-toggle.is-running .session-play { display:none; }
.session-toggle.is-running .session-pause { display:block; }
.board-stage { position:relative; width:max-content; max-width:100%; margin:0 auto; }
.board-stage .board { margin:0; }
.board-stage.is-ready .board { opacity:.65; }
.board-stage.is-paused .board { opacity:.65; }
.board-start-overlay { position:absolute; inset:0; z-index:30; display:grid; place-items:center; border-radius:6px; background:transparent; pointer-events:none; }
.board-start { position:absolute; left:var(--start-center-x,50%); top:var(--start-center-y,50%); transform:translate(-50%,-50%); z-index:1; display:inline-flex; align-items:center; justify-content:center; width:44px; height:44px; padding:11px; border:1px solid var(--green); border-radius:50%; background:var(--green); color:var(--paper); box-shadow:0 3px 12px #1c32241a; pointer-events:auto; }
.board-start svg { width:18px; height:18px; fill:currentColor; }
.board-start::before,.board-start::after { content:''; position:absolute; inset:-1px; border:1px solid var(--green); border-radius:inherit; pointer-events:none; animation:start-ring 2.8s ease-out infinite; }
.board-start::after { animation-delay:1.4s; }
.board-start:hover { filter:brightness(1.08); }
.board-start:active:not(:disabled) { transform:translate(-50%,-50%); }
.start-glints { position:absolute; inset:0; overflow:hidden; border-radius:6px; pointer-events:none; }
.start-glints .cell.filled { position:absolute; opacity:0; animation:start-erase 3.4s steps(1,end) both; animation-delay:var(--glint-delay); }
.is-paused .start-glints { display:none; }
.session-locked #board-hint { display:none; }
body.page-away .board-start::before,body.page-away .board-start::after,body.page-away .start-glints i { animation-play-state:paused; }
@keyframes start-ring { 0% { opacity:.32; transform:scale(1); } 80%,100% { opacity:0; transform:scale(1.55); } }
@keyframes start-erase { 0%,5% { opacity:0; } 6%,65% { opacity:1; } 66%,100% { opacity:0; } }
@media(max-width:600px) {
  .puzzle-heading { flex-wrap:wrap; gap:4px 12px; }
  .board-heading-actions { margin-left:auto; }
  .level-session { gap:4px; }
}
@media(prefers-reduced-motion:reduce) {
  .board-start::before,.board-start::after,.start-glints { display:none; }
}
.board-stage:not(.is-ready):not(.is-paused) .board { animation:board-wake .2s ease-out; }
@keyframes board-wake { from { opacity:.65; } to { opacity:1; } }
@media(prefers-reduced-motion:reduce) { .board-stage .board { animation:none; } }

@media(max-width:430px) {
  .chapter-card { padding:10px 6px 6px; }
  .chapters .chapter-button { gap:5px; }
  .chapters .chapter-button > span { font-size:14px; }
  .chapters b { top:7px; right:7px; font-size:8px; }
  .chapter-progress { gap:2px; }
}

.chapter-ending{margin:20px 0;padding:20px 0;border-block:1px solid var(--line)}
.chapter-ending h2{font-size:23px}.chapter-ending p{line-height:1.9}.chapter-ending-next{color:var(--muted);margin-top:20px}.chapter-ending-next small{font-size:11px}
