.swarm-control{width:270px;padding:10px 13px;background:#fffdf6;border:1px solid #e0e5d6;border-radius:15px}.swarm-head,.swarm-row,.swarm-foot{display:flex;align-items:center;justify-content:space-between;gap:8px}.swarm-head label{font-size:12px;font-weight:650}.swarm-number{display:flex;align-items:center;gap:4px;font-size:11px;color:#74816f}.swarm-number input{width:62px;border:1px solid #d7dfcc;border-radius:6px;padding:3px 4px;font:inherit;font-size:12px;font-weight:600;color:#47755b;background:#f5f7ed;text-align:center}.swarm-row{margin-top:3px;font-size:10px;color:#8d967f}.swarm-row input{appearance:none;background:transparent;min-width:0;flex:1;accent-color:#77945e;height:22px;cursor:pointer}.swarm-row input::-webkit-slider-runnable-track{height:6px;border-radius:6px;background:linear-gradient(to right,#8ba66e 0 var(--swarm-fill,2%),#e7ecdd var(--swarm-fill,2%) 100%)}.swarm-row input::-webkit-slider-thumb{appearance:none;width:15px;height:15px;border-radius:50%;background:#77945e;margin-top:-4.5px;box-shadow:0 0 0 3px #77945e18}.swarm-row input::-moz-range-track{height:6px;border-radius:6px;background:#e7ecdd}.swarm-row input::-moz-range-progress{height:6px;background:#8ba66e}.swarm-row input::-moz-range-thumb{width:15px;height:15px;border:0;border-radius:50%;background:#77945e}.swarm-foot{font-size:10px;color:#839078;margin-top:1px}.swarm-foot button{border:0;padding:3px 0;background:none;color:#527655;font-size:10px;text-decoration:underline;text-underline-offset:3px}.swarm-control input:focus-visible{outline:2px solid #edac63;outline-offset:2px}.levelsection{padding-right:3px}.controls{order:0}.sidebar .levelsection{order:1}.sidebar .controls{order:0}
@media(max-width:740px){.topbar{flex-wrap:wrap;gap:13px}.toptools{display:contents}.swarm-control{order:2;width:100%;padding:9px 12px}.topbar>.brand{margin-right:auto}.swarm-head label{font-size:12px}.swarm-row input{height:25px}.swarm-foot{font-size:11px}.swarm-foot button{font-size:11px}.levelsection{max-height:none;overflow:visible}.sidebar .controls{order:1}.sidebar .levelsection{order:0}}

.depthlabel{position:absolute;left:50%;transform:translate(-50%,-100%);margin-top:-5px;padding:4px 7px;font-size:11px;line-height:1.2;color:#a67858;background:#fff4dce8;border:1px solid #d9bd9b99;border-radius:7px;pointer-events:none;white-space:nowrap}.depthlabel.at-limit{color:#aa583c;border-color:#cb8f66;background:#fff1dd}@media(max-width:740px){.depthlabel{font-size:10px;padding:3px 5px;margin-top:-3px}}

.version{font-size:10px;letter-spacing:1px;padding:4px 6px;border:1px solid #cbd6bf;color:#6f8862;border-radius:6px;margin-left:1px}.ruleline{min-height:34px;padding:9px 19px;font-size:11px;line-height:1.5;background:#f2f2e5;color:#788166;display:flex;gap:8px;align-items:center;border-bottom:1px solid #e8e9d9}.ruledot{width:5px;height:5px;flex:none;border-radius:50%;background:#94a576}.ruleline.moving-now{color:#9a6b35;background:#f7edcf}.ruleline.moving-now .ruledot{background:#d9a15c}.inknumbers{display:flex;align-items:center;gap:3px;font-size:12px;white-space:nowrap;color:var(--muted);font-variant-numeric:tabular-nums}.inknumbers .inkvalue{width:auto}.inknumbers small{font-size:10px;color:#9da18f}.inkvalue{width:34px}@media(max-width:740px){.ruleline{font-size:10px;padding:7px 13px;min-height:32px}.version{font-size:9px}.inkcaption small{font-size:9px}}

:root{color-scheme:light;--paper:#f7f5ed;--ink:#293e36;--muted:#778079;--line:#e2e5d9;--orange:#ee8755;--green:#47755b;--light:#edf1e4;--white:#fffef8;--radius:24px}
*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font-family:ui-rounded,"PingFang SC","Microsoft YaHei",system-ui,sans-serif;-webkit-font-smoothing:antialiased}button{font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}button:focus-visible,a:focus-visible,canvas:focus-visible{outline:3px solid #edac63;outline-offset:4px}button:disabled{cursor:default;opacity:.5}[hidden]{display:none!important}svg{display:block}.wrap{max-width:1240px;margin:auto;padding:28px 36px 20px}.topbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:30px}.brand{display:flex;align-items:center;gap:11px;font-weight:750;letter-spacing:1px;font-size:19px}.brandmark{width:40px;height:40px;border-radius:14px;background:var(--green);color:#faf6e4;display:grid;place-items:center;transform:rotate(-7deg)}.brandmark svg{transform:rotate(7deg)}.toptools{display:flex;align-items:center;gap:10px}.topnote{font-size:12px;color:var(--muted);margin-right:12px;letter-spacing:1px}.iconbtn{border:1px solid var(--line);background:transparent;color:var(--ink);width:39px;height:39px;border-radius:50%;display:grid;place-items:center;transition:background .15s}.iconbtn:hover{background:#eaece1}.iconbtn[aria-pressed=true]{background:#e5edde;border-color:#c0cdb8}.hero{margin-bottom:25px;display:flex;justify-content:space-between;align-items:end}.eyebrow{font-size:10px;font-weight:700;letter-spacing:3px;color:var(--green);margin:0 0 10px}.hero h1{font-size:35px;line-height:1.3;letter-spacing:-1px;margin:0;font-weight:760}.hero h1 span{color:var(--orange)}.hero p{font-size:13px;color:var(--muted);margin:0 0 3px}.layout{display:grid;grid-template-columns:minmax(0,1fr) 268px;gap:23px;align-items:start}.playbox{background:var(--white);border:1px solid #e1e4d6;border-radius:var(--radius);overflow:hidden;box-shadow:0 7px 0 #e6e9dd55}.gamebar{display:flex;align-items:center;gap:12px;padding:17px 22px 15px;border-bottom:1px solid #eaece2}.levelmark{width:35px;height:35px;border-radius:11px;background:#eaf0df;display:grid;place-items:center;color:#4d7256;font-size:12px;font-weight:750}.levelmeta{flex:1}.levelmeta strong{font-size:14px;display:block}.levelmeta span{font-size:11px;color:var(--muted);display:block;margin-top:4px}.pausebtn{width:32px;height:32px}.clock{display:flex;align-items:center;gap:7px;font-variant-numeric:tabular-nums;font-size:22px;font-weight:750}.clock small{font-size:11px;color:var(--muted);font-weight:500}.clock svg{width:22px;height:22px;color:var(--green)}.clock.urgent{color:#cf6244}.board{position:relative;background:#f5edcc;isolation:isolate}.board canvas{display:block;width:100%;height:auto;aspect-ratio:900/650;touch-action:none;cursor:crosshair}.board.playing canvas{cursor:default}.boardhint{position:absolute;left:50%;top:18px;transform:translateX(-50%);white-space:nowrap;font-size:12px;pointer-events:none;background:#fffdf2e6;border:1px solid #e8dec0;border-radius:20px;padding:8px 15px;color:#766e52;box-shadow:0 2px 5px #75604408}.boardhint b{font-weight:650;color:#4b614a}.inkbar{padding:15px 22px 17px;display:flex;gap:15px;align-items:center}.inkcaption{font-size:12px;display:flex;gap:7px;align-items:center;white-space:nowrap}.inkcaption svg{color:var(--green)}.inktrack{height:6px;background:#eaece2;border-radius:10px;flex:1;overflow:hidden}.inkfill{height:100%;background:#91aa7f;border-radius:10px;transition:width .08s}.inkvalue{font-size:12px;font-variant-numeric:tabular-nums;width:39px;text-align:right;color:var(--muted)}.caption{margin:15px 0 0;display:flex;justify-content:space-between;gap:10px;color:#818579;font-size:11px}.caption span{display:flex;gap:6px;align-items:center}.sidebar{display:flex;flex-direction:column;gap:19px}.mission{padding:23px 21px 21px;border-radius:var(--radius);background:#eaf0e0;position:relative;overflow:hidden}.mission:after{content:"";position:absolute;width:90px;height:90px;border:1px dashed #bac9aa;border-radius:50%;right:-28px;top:-28px;pointer-events:none}.mission .overline{font-size:11px;letter-spacing:1px;color:#6b8666;display:flex;align-items:center;gap:6px}.mission h2{font-size:22px;line-height:1.5;margin:13px 0 9px;font-weight:750;letter-spacing:-.5px}.mission p{font-size:12px;line-height:1.9;color:#6a7b66;margin:0}.mission footer{border-top:1px solid #d5dfc8;margin-top:17px;padding-top:14px;display:flex;gap:8px;align-items:center;font-size:11px;color:#648057}.mission footer i{width:6px;height:6px;border-radius:50%;background:#7d9c6b}.levelsection .sectiontitle{display:flex;justify-content:space-between;align-items:center;margin:0 1px 10px}.sectiontitle h2{font-size:12px;margin:0;letter-spacing:.5px}.sectiontitle span{font-size:10px;color:var(--muted);font-variant-numeric:tabular-nums}.levels{display:flex;flex-direction:column;gap:7px}.levelbutton{width:100%;border:1px solid transparent;background:transparent;border-radius:14px;color:var(--ink);padding:12px 13px;display:flex;align-items:center;gap:12px;text-align:left;transition:background .15s,border-color .15s}.levelbutton:hover{background:#eceee4}.levelbutton[aria-pressed=true]{background:var(--white);border-color:#d4dbc9;box-shadow:0 3px 5px #3e533105}.levelnum{font-size:12px;color:#a3aa9d;font-variant-numeric:tabular-nums}.levelbutton[aria-pressed=true] .levelnum{color:var(--green)}.levelcopy{flex:1}.levelcopy b{display:block;font-size:12px;font-weight:650}.levelcopy small{display:block;font-size:10px;color:#929887;margin-top:4px}.levelstatus{color:#729063;font-size:15px;min-width:16px}.controls{display:flex;flex-direction:column;gap:9px}.retry{width:100%;border:0;background:var(--green);color:#fffef4;border-radius:14px;padding:14px 16px;font-size:13px;font-weight:650;display:flex;gap:9px;justify-content:center;align-items:center;box-shadow:0 3px 0 #315a44;transition:transform .15s,background .15s}.retry:hover{background:#3c694f}.retry:active{transform:translateY(2px);box-shadow:0 1px 0 #315a44}.retry kbd{font:10px inherit;color:#cad8c6;border:1px solid #ffffff35;padding:1px 4px;border-radius:4px;margin-left:7px}.sitefoot{display:flex;justify-content:center;gap:8px;color:#a0a596;font-size:10px;letter-spacing:.4px;margin:28px 0 0}.overlay{position:absolute;inset:0;display:grid;place-items:center;background:#f5efd55c;backdrop-filter:blur(3px);z-index:2;padding:16px}.result{width:290px;max-width:100%;padding:23px 26px 25px;text-align:center;background:#fffdf3;border:1px solid #e2ddc3;border-radius:23px;box-shadow:0 14px 55px #53462726;animation:pop .3s ease-out}.result .stamp{font-size:38px;margin-bottom:4px}.result .resulttag{font-size:9px;letter-spacing:3px;color:#a1a487;margin:8px 0}.result h2{font-size:23px;margin:8px 0 10px}.result p{font-size:12px;line-height:1.8;color:#8a8c76;margin:0 0 17px}.result .retry{margin-top:9px;padding:12px}.result .secondary{background:transparent;border:0;color:#7d866f;font-size:11px;margin-top:16px;text-decoration:underline;text-underline-offset:4px}.toast{position:absolute;left:50%;bottom:17px;transform:translateX(-50%);max-width:90%;text-align:center;white-space:normal;background:#394b3bea;color:#fffdf3;border-radius:12px;padding:9px 15px;font-size:12px;z-index:3;pointer-events:none}.pausepanel h2{margin-top:5px}.modal{border:1px solid #dce1cf;border-radius:24px;background:#fffdf5;color:var(--ink);padding:28px;max-width:360px;width:calc(100% - 32px);box-shadow:0 25px 100px #2c382338}.modal::backdrop{background:#25372655;backdrop-filter:blur(4px)}.modal header{display:flex;justify-content:space-between;align-items:center}.modal h2{font-size:21px;margin:0}.modal ol{padding-left:22px;color:#77836e;font-size:13px;line-height:2;margin:22px 0}.modal p{font-size:11px;color:#89927e;line-height:1.9}.noscript{padding:24px;color:#a54328}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@keyframes pop{from{transform:translateY(10px) scale(.96);opacity:0}to{transform:none;opacity:1}}@media(min-width:1450px){.wrap{padding-top:40px}.topbar{margin-bottom:38px}}@media(max-width:920px){.wrap{padding:23px 22px}.layout{grid-template-columns:minmax(0,1fr) 235px;gap:17px}.hero h1{font-size:29px}.hero p{font-size:12px}.mission{padding:19px}.gamebar{padding:13px 17px}.inkbar{padding:13px 17px}.boardhint{font-size:11px;top:13px}.caption{font-size:10px}}@media(max-width:740px){.wrap{max-width:600px;padding:18px 15px 22px}.topbar{margin-bottom:25px}.topnote{display:none}.brand{font-size:17px}.brandmark{width:34px;height:34px;border-radius:11px}.iconbtn{width:36px;height:36px}.hero{display:block;margin-bottom:18px}.hero h1{font-size:29px}.hero p{margin:9px 0 0;font-size:12px}.eyebrow{font-size:9px;margin-bottom:8px}.layout{display:flex;flex-direction:column;gap:23px}.gamecol,.sidebar{width:100%}.playbox{border-radius:19px}.gamebar{padding:11px 14px}.levelmark{height:31px;width:31px}.levelmeta strong{font-size:12px}.levelmeta span{font-size:10px}.clock{font-size:19px}.clock svg{width:18px}.boardhint{font-size:10px;padding:6px 10px;top:10px}.inkbar{padding:12px 14px}.inkcaption{font-size:11px}.caption{margin-top:11px;flex-wrap:wrap}.mission{display:none}.sidebar{gap:16px}.levels{display:grid;grid-template-columns:1fr 1fr;gap:7px}.levelbutton{padding:12px 10px;gap:9px;border-color:#e1e4d7}.levelcopy b{font-size:11px}.levelcopy small{font-size:9px}.controls{display:grid;grid-template-columns:1.4fr 1fr;align-items:start}.retry{padding:13px 8px;font-size:12px}.retry kbd{display:none}.sitefoot{margin-top:24px;font-size:9px}.result{width:255px;padding:16px 22px}.result .stamp{font-size:28px}.result h2{font-size:21px;margin:5px 0 8px}.result p{font-size:11px;margin-bottom:10px}.result .resulttag{margin:5px 0}.result .secondary{margin-top:11px}.toast{font-size:10px;padding:7px 10px;bottom:9px}}
@media(min-width:741px) and (max-height:900px){.wrap{max-width:1100px;padding-top:20px}.topbar{margin-bottom:20px}.hero{margin-bottom:19px}.hero h1{font-size:31px}.layout{grid-template-columns:minmax(0,1fr) 250px;gap:20px}.gamebar{padding:13px 18px}}
@media(min-width:741px) and (max-height:780px){.wrap{max-width:1010px;padding-top:16px}.topbar{margin-bottom:14px}.hero{margin-bottom:15px}.hero h1{font-size:28px}.hero p{font-size:11px}.gamebar{padding:10px 16px}.mission{padding:18px}.mission h2{font-size:20px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}
@media(max-width:740px){.topbar>.toptools{display:contents}.topbar .swarm-control{width:100%;order:2}.topbar{flex-wrap:wrap;gap:13px}.topbar .iconbtn{flex:none}.topbar .brand{margin-right:auto}}

/* A shared right rail: only the level list scrolls; the canvas keeps its size. */
.gamecol{position:sticky;top:16px;align-self:start}
.sidebar{position:sticky;top:16px;height:var(--playbox-height,740px);max-height:calc(100dvh - 32px);display:grid;grid-template-rows:auto auto minmax(0,1fr);gap:16px;min-height:0}
.sidebar .mission,.sidebar .controls,.sidebar .levelsection{order:initial;min-width:0}
.mission{padding:21px}.mission h2{font-size:21px;line-height:1.45;margin:12px 0 9px}
.mission-swarm{border-top:1px solid #d3dec6;margin-top:17px;padding-top:15px}
.sidebar .swarm-control{width:100%;padding:0;border:0;border-radius:0;background:transparent}
.swarm-head label{font-size:12px;color:#466347}.swarm-number input{background:#fffef8;border-color:#ccd9bf;border-radius:8px;width:63px;padding:5px}
.swarm-row{margin-top:7px}.swarm-foot{flex-wrap:wrap;row-gap:2px}.swarm-foot button{margin-left:auto;white-space:nowrap}
.sidebar .controls{display:block}.sidebar .levelsection{display:flex;flex-direction:column;min-height:0;overflow:hidden;padding:2px 0 0}
.levelsection .sectiontitle{flex:none;margin:0 1px 10px}.sidebar .levels{flex:1;min-height:0;overflow-y:auto;overscroll-behavior-y:contain;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:#bdccb0 transparent;padding:3px 5px 5px 1px}
.levels::-webkit-scrollbar{width:6px}.levels::-webkit-scrollbar-thumb{background:#bdccb0;border-radius:6px}.levels:focus-visible{outline:2px solid #cfb57e;outline-offset:-2px;border-radius:12px}
.levelbutton{flex:none}
@media(min-width:741px) and (max-width:1000px){.mission{padding:16px}.mission h2{font-size:18px;margin:9px 0}.mission p{font-size:11px;line-height:1.75}.mission-swarm{margin-top:12px;padding-top:12px}.sidebar{gap:12px}}
@media(max-width:740px){.gamecol{position:static}.sidebar{position:static;height:auto;max-height:none;grid-template-rows:auto auto auto;gap:15px}.sidebar .mission{display:block;padding:17px 18px;border-radius:19px}.sidebar .mission>.overline,.sidebar .mission>h2,.sidebar .mission>p{display:none}.mission-swarm{border:0;padding:0;margin:0}.sidebar .swarm-control{order:initial}.sidebar .levelsection{height:265px}.sidebar .levels{display:grid;grid-template-columns:1fr 1fr;grid-auto-rows:min-content;align-content:start}.topbar>.toptools{display:flex}}
@media(min-width:741px) and (max-height:700px){.sidebar .mission{padding:14px 17px}.sidebar .mission h2{display:none}.sidebar .mission p{font-size:11px;line-height:1.65;margin-top:9px}.sidebar .mission-swarm{margin-top:12px;padding-top:10px}.sidebar{gap:12px}}

/* Compact app header: the level itself is the page headline. */
.wrap{padding-top:20px}.topbar{margin-bottom:10px}.brand{font-size:17px}.brandmark{width:36px;height:36px;border-radius:12px}.hero{display:none}.tagline{margin:0 0 18px;padding:0 1px 14px;border-bottom:1px solid #e5e7dc;font-size:24px;line-height:1.25;font-weight:760;letter-spacing:-.6px}.tagline span{color:var(--orange)}.mission:after{display:none}
@media(min-width:1450px){.wrap{padding-top:24px}.topbar{margin-bottom:20px}}
@media(max-width:740px){.wrap{padding:12px 12px 20px}.topbar{margin-bottom:8px;padding:0 1px;gap:8px}.tagline{font-size:21px;margin-bottom:14px;padding:0 1px 11px}.brand{font-size:16px;gap:9px}.brandmark{width:32px;height:32px;border-radius:10px}.brandmark svg{width:21px;height:21px}.toptools{gap:7px}.iconbtn{width:34px;height:34px}.mission{background:#edf2e6}}

.share-action{width:100%;border:1px solid #cbd7c2;background:#f4f7ed;color:#456c53;border-radius:12px;padding:10px 14px;margin-top:10px;font-size:12px;font-weight:650}.share-action:hover{background:#eaf0df}.share-action:disabled{opacity:.65}.result .share-action+.secondary{margin-top:11px}
.share-dialog{width:min(460px,calc(100% - 24px));max-width:none;border:0;padding:0;background:transparent;color:var(--ink)}.share-dialog::backdrop{background:#26382c91;backdrop-filter:blur(6px)}.share-sheet{position:relative;background:#fffdf6;border:1px solid #dfe4d6;border-radius:24px;padding:54px 16px 16px;box-shadow:0 24px 90px #1f30233d}.share-close{position:absolute;right:16px;top:12px;z-index:2;background:#fffdf6e8;box-shadow:0 2px 8px #344b3920}.share-preview{overflow:hidden;border-radius:16px;background:#edf1e7;border:1px solid #dfe5d7;box-shadow:0 5px 18px #344b3920}.share-preview img{display:block;width:100%;height:auto;-webkit-touch-callout:default;user-select:auto}.share-sheet>p{text-align:center;color:#788176;font-size:11px;line-height:1.6;margin:11px 4px}.share-actions{display:block}.share-actions .retry{padding:12px;text-decoration:none}
@media(max-width:740px){.result .share-action{padding:8px 10px;margin-top:8px;font-size:11px}.result .share-action+.secondary{margin-top:8px}.share-dialog{width:calc(100% - 18px)}.share-sheet{padding:44px 10px 10px;border-radius:18px}.share-close{right:10px;top:8px;width:31px;height:31px}.share-sheet>p{font-size:10px;margin:8px 3px}.share-actions .retry{font-size:11px;padding:10px}}

/* Keep compact header icons optically centered on narrow mobile screens. */
.toptools .iconbtn{padding:0;-webkit-appearance:none;appearance:none;display:flex;align-items:center;justify-content:center;line-height:1}
.toptools .headericon{display:block;width:18px;height:18px;flex:none;overflow:visible}
.toptools .soundicon{transform:translateX(.5px)}
.toptools .helpicon{transform:translateY(-.25px)}
@media(max-width:740px){.toptools .iconbtn{width:36px;height:36px;min-width:36px;min-height:36px}.toptools .headericon{width:18px;height:18px}}

/* Platform controls share the same compact visual language as the game. */
.toptools { flex-shrink: 0; }
#language { max-width: 120px; min-height: 40px; padding: 7px 9px; border: 1px solid #d9e0cf; border-radius: 12px; background: #fffdf6; color: #47755b; font: inherit; font-size: 12px; }
#language:focus-visible, .save-row button:focus-visible { outline: 2px solid #47755b; outline-offset: 3px; }
.levelbutton.locked { opacity: .58; cursor: not-allowed; }
.levelbutton.locked:hover { transform: none; background: transparent; }
.save-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #7b857a; font-size: 11px; padding: 0 3px 10px; flex-shrink: 0; }
.save-row button { border: 0; background: none; color: #47755b; font: inherit; text-decoration: underline; cursor: pointer; padding: 5px 0; }
.swarm-control input:disabled, #swarmReset:disabled { opacity: .65; cursor: default; }
.share-actions { flex-direction: column; }
#shareFeedback:empty { display: none; }
#shareFeedback { font-size: 13px; line-height: 1.6; }
:lang(en) .brand { font-size: clamp(16px, 2vw, 23px); }
:lang(en) .tagline { letter-spacing: -.035em; }
:lang(en) .ruleline { line-height: 1.5; }
:lang(en) .levelcopy b { line-height: 1.35; }
:lang(en) .result h2 { font-size: clamp(23px, 3vw, 32px); }
:lang(en) .boardhint { font-size: clamp(10px, 1.3vw, 13px); max-width: 92%; white-space: normal; text-align: center; }
:lang(en) .swarm-number { gap: 5px; }
@media (max-width: 480px) {
 .topbar { gap: 8px; flex-wrap: wrap; }
 .toptools { gap: 6px; margin-left: auto; }
 .brand { gap: 7px; }
 #language { max-width: 91px; min-height: 36px; font-size: 11px; padding: 6px; }
 :lang(en) .brandmark { width: 34px; height: 34px; border-radius: 12px; }
 :lang(en) .tagline { font-size: clamp(25px, 6.8vw, 34px); }
 :lang(en) .levelmeta strong { font-size: 13px; }
 :lang(en) .levelmeta span { font-size: 10px; }
 :lang(en) .clock { gap: 4px; }
 :lang(en) .inkcaption { font-size: 11px; white-space: nowrap; }
}
#shareDisclosure { font-size: 12px; line-height: 1.5; margin: 12px 0 0; }

/* Y8 owns the viewport: fit the complete board without changing world geometry. */
.y8-embed,.y8-embed body{width:100%;height:100%;margin:0;overflow:hidden}
/* Keep offscreen announcements inside the viewport, not after the full-height app. */
.y8-embed .sr-only{top:0;left:0}
.y8-embed .wrap{position:absolute;inset:0;width:100%;max-width:none;height:100%;overflow:hidden;padding:10px;display:flex;flex-direction:column;gap:6px}
.y8-embed .topbar{flex:none;min-height:40px;margin:0;flex-wrap:nowrap;gap:8px}
.y8-embed .brand{font-size:17px;white-space:nowrap}
.y8-embed .tagline{flex:none;font-size:19px;margin:0;padding:0 0 5px;line-height:1.25}
.y8-embed .tagline span{margin-left:.15em}
.y8-embed .layout{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) 235px;grid-template-rows:minmax(0,1fr);gap:12px;align-items:stretch}
.y8-embed .gamecol{position:relative;top:auto;align-self:stretch;min-width:0;min-height:0;display:flex;justify-content:center;align-items:center}
.y8-embed .playbox{flex:none;width:var(--fitted-board-width,100%);max-width:100%;border-radius:16px;box-shadow:none}
.y8-embed .gamebar{height:52px;padding:6px 12px;gap:8px}
.y8-embed .levelmeta{min-width:0}
.y8-embed .levelmeta strong,.y8-embed .levelmeta span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.y8-embed .levelmeta strong{font-size:12px}
.y8-embed .levelmeta span{font-size:10px;margin-top:2px}
.y8-embed .ruleline{height:42px;min-height:0;padding:4px 10px;font-size:10px;line-height:1.4;overflow-y:auto}
.y8-embed .inkbar{height:36px;padding:6px 10px;gap:8px}
.y8-embed .board canvas{width:100%;height:auto;aspect-ratio:900/650}
.y8-embed .caption,.y8-embed .sitefoot{display:none}
.y8-embed .sidebar{position:static;top:auto;height:100%;max-height:none;min-height:0;gap:10px;grid-template-rows:auto auto minmax(0,1fr)}
.y8-embed .mission{padding:12px;border-radius:16px}
.y8-embed .mission>.overline,.y8-embed .mission>h2,.y8-embed .mission>p{display:none}
.y8-embed .mission-swarm{margin:0;padding:0;border:0}
.y8-embed .sidebar .levelsection{height:auto;min-height:0}
.y8-embed .sidebar .levels{display:flex;flex-direction:column}
.y8-embed .board{isolation:auto}
.y8-embed .overlay{position:fixed;inset:0;overflow:auto;align-items:safe center;border-radius:16px;z-index:10}
.y8-embed .result{margin:auto;padding:14px 18px;width:290px}
.y8-embed .result .stamp{font-size:26px}
.y8-embed .result h2{font-size:24px;margin:5px 0}
.y8-embed .result p{margin-bottom:8px;line-height:1.5}
.y8-embed .result .resulttag{margin:4px 0;letter-spacing:2px}
.y8-embed .result .secondary{margin-top:8px}
@media(max-width:600px){
 .y8-embed .wrap{padding:6px;gap:4px}
 .y8-embed .brand{font-size:14px;gap:5px}
 .y8-embed .brandmark{width:28px;height:28px}
 .y8-embed .toptools{gap:4px}
 .y8-embed #language{max-width:80px}
 .y8-embed .tagline{font-size:17px}
 .y8-embed .layout{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) 140px;gap:6px}
 .y8-embed .sidebar{grid-template-columns:110px minmax(0,1fr);grid-template-rows:36px minmax(0,1fr);gap:6px}
 .y8-embed .sidebar .mission{grid-column:1;grid-row:2;overflow-y:auto;padding:6px}
 .y8-embed .sidebar .controls{grid-column:1;grid-row:1}
 .y8-embed .sidebar .levelsection{grid-column:2;grid-row:1 / 3}
 .y8-embed .sidebar .levels{grid-template-columns:1fr}
 .y8-embed .swarm-head{flex-wrap:wrap;gap:2px}
 .y8-embed .swarm-foot{font-size:9px}
 .y8-embed .save-row{font-size:10px;padding-bottom:3px}
 .y8-embed .retry{padding:8px;font-size:11px}
}
@media(max-height:460px) and (min-width:601px){
 .y8-embed .tagline{display:none}
 .y8-embed .layout{grid-template-columns:minmax(0,1fr) 210px}
 .y8-embed .mission{max-height:110px;overflow-y:auto}
}

/* Short landscape frames still need a usable board and a separate level rail. */
@media(max-height:460px){
 .y8-embed .tagline{display:none}
 .y8-embed .gamebar{height:42px;padding:4px 8px}
 .y8-embed .ruleline{height:32px;padding:3px 8px;font-size:9px}
 .y8-embed .inkbar{height:28px;padding:4px 8px;gap:6px}
 .y8-embed .levelmark{width:26px;height:26px;flex:none}
 .y8-embed .clock{font-size:18px;gap:4px}
 .y8-embed .boardhint{top:6px;font-size:10px;padding:5px 8px}
}
@media(max-width:600px) and (max-height:460px){
 .y8-embed .layout{grid-template-columns:minmax(0,1fr) 180px;grid-template-rows:minmax(0,1fr)}
 .y8-embed .sidebar{grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr)}
 .y8-embed .sidebar .mission,.y8-embed .sidebar .controls,.y8-embed .sidebar .levelsection{grid-column:auto;grid-row:auto}
 .y8-embed .sidebar .mission{max-height:92px;overflow-y:auto}
}
