:root{font-family:ui-rounded,"Avenir Next",Avenir,system-ui,sans-serif;color:#332447;background:#eee9f3;font-synthesis:none;--ink:#332447;--muted:#685979;--accent:#684395;--line:#d6c8e2;--paper:#faf7fc}*{box-sizing:border-box}body{margin:0;min-height:100vh;background:radial-gradient(ellipse at 50% 10%,#fffaf2 0,transparent 55%),#eee9f3}main{width:min(100% - 32px,540px);margin:24px auto 32px}header{margin-bottom:18px}.eyebrow{font-size:11px;font-weight:750;letter-spacing:.12em;margin:0 0 7px;color:#71617f}h1{font-size:clamp(31px,6vw,43px);line-height:1.07;letter-spacing:-.06em;margin:0;display:flex;align-items:center;gap:11px}h1 span{font-size:.78em;color:#a5682c;transform:rotate(15deg);font-weight:500}.lede{font-size:15px;line-height:1.45;margin:9px 0 0;color:var(--muted)}.game{background:var(--paper);border:1px solid var(--line);border-radius:22px;padding:12px;box-shadow:0 12px 40px #3e235310}.hud{display:grid;grid-template-columns:1fr 1fr .8fr 1.2fr;gap:5px;padding:1px 7px 12px}.hud div{display:flex;flex-direction:column;gap:3px}.hud span{color:var(--muted);font-size:12px}.hud strong{font-size:23px;line-height:1.1;font-variant-numeric:tabular-nums;letter-spacing:-.03em}#lives{font-size:17px;letter-spacing:0;line-height:1.5}.arena{position:relative;aspect-ratio:1;background:#eee4f2;border-radius:13px;overflow:hidden;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;outline-offset:3px}.arena:focus-visible{outline:3px solid #855ba8}canvas{display:block;width:100%;height:100%;pointer-events:none}.cargo{position:absolute;top:11px;left:11px;border-radius:50px;padding:6px 10px;background:#fff9edf0;color:#594064;font-size:12px;opacity:0;transition:opacity .15s;font-variant-numeric:tabular-nums;pointer-events:none}.cargo.visible{opacity:1}.cargo span{font-weight:750}.cargo b{display:inline-block;margin-left:6px;color:#68421a}.overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:18px;background:#f3eaf1d9;backdrop-filter:blur(3px)}.overlay[hidden]{display:none}.overlay-card{text-align:center;width:100%;max-width:340px}.kicker{font-size:10px;letter-spacing:.08em;font-weight:800;color:#775876;margin:0 0 10px}h2{font-size:clamp(25px,5vw,34px);line-height:1.1;letter-spacing:-.045em;margin:0 0 12px}.overlay-card>p:not(.kicker):not(.overlay-note){font-size:15px;line-height:1.55;margin:0 0 18px;color:#594966}.primary{border:0;border-radius:50px;background:var(--ink);color:#fff9ec;font:inherit;font-weight:750;min-height:49px;padding:12px 35px;box-shadow:0 4px 0 #ac93bf;cursor:pointer}.primary:hover{background:#4c3565}.primary:active{transform:translateY(2px);box-shadow:0 2px 0 #ac93bf}.overlay-note{font-size:11px;line-height:1.4;margin:16px 0 0;color:#71607b}.result-stats{display:flex;justify-content:center;gap:25px;margin:-1px 0 20px}.result-stats div{display:flex;flex-direction:column}.result-stats strong{font-size:30px;letter-spacing:-.04em}.result-stats span{font-size:12px;color:#71607b}.play-controls{display:flex;gap:9px;margin-top:12px}.hold{flex:1;min-height:61px;display:flex;align-items:center;justify-content:center;gap:9px;flex-direction:column;border:1px solid #c5b2d7;background:#e8dbf1;color:#432c5d;border-radius:13px;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;font:inherit;font-weight:750;cursor:pointer;transition:background .12s,border .12s}.hold span{font-size:15px;line-height:1.1}.hold small{font-size:11px;font-weight:500;line-height:1}.hold[data-held=true]{background:#684395;border-color:#684395;color:#fff9eb}.hold:disabled{cursor:default;opacity:.6}.icon-button{width:52px;min-height:52px;border:1px solid var(--line);border-radius:13px;background:#f4eef8;font-size:20px;color:#5c4076;cursor:pointer}.icon-button:disabled{opacity:.45;cursor:default}.status{font-size:12px;line-height:1.45;min-height:35px;text-align:center;color:#705b7b;margin:11px 4px 0}.below{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;column-gap:15px;margin:9px 0 0;color:#776780;font-size:11px}.text-button{font:inherit;font-size:12px;min-height:44px;border:0;background:none;color:#654877;padding:5px 2px;cursor:pointer;text-decoration:underline;text-underline-offset:3px}details{width:100%;font-size:13px;line-height:1.6}summary{cursor:pointer;min-height:44px;display:flex;align-items:center;gap:5px;color:#5d4c6c}summary:before{content:'+';font-size:18px}details[open] summary:before{content:'−'}details p{margin:4px 0 12px}kbd{background:#ded1e7;border-radius:4px;padding:1px 4px;font-size:.95em}button:focus-visible,summary:focus-visible{outline:3px solid #9470b7;outline-offset:3px}@media(max-width:360px){main{width:calc(100% - 20px);margin-top:17px}.game{padding:9px}.hud{padding-inline:4px}.hud strong{font-size:21px}.overlay{padding:12px}.overlay-card>p:not(.kicker):not(.overlay-note){font-size:13px;margin-bottom:13px}.overlay-note{font-size:10px;margin-top:12px}h2{font-size:25px}.kicker{font-size:9px}.primary{min-height:46px;padding:10px 29px}.lede{font-size:14px}.status{font-size:11px}}@media(min-width:700px){main{margin-top:28px}.game{padding:15px}header{text-align:center}h1{justify-content:center}.arena{max-height:520px}.hud{padding-bottom:15px}}@media(prefers-reduced-motion:reduce){*{transition:none!important}}
.result-stats[hidden]{display:none}
@media(min-width:600px){.arena{width:min(100%,calc(100svh - 350px));margin-inline:auto}}
/* Public type and controls stay readable at normal phone scale. */
.eyebrow{display:block;font-size:12px;line-height:1.5;letter-spacing:.08em;text-decoration:none}h1{font-size:clamp(31px,6vw,43px)}.lede{font-size:16px}.hud span{font-size:14px}.hud strong{font-size:25px}#lives{font-size:18px}.cargo{font-size:14px}.kicker{font-size:12px;line-height:1.45}.overlay-card>p:not(.kicker):not(.overlay-note){font-size:16px}.overlay-note{font-size:14px;line-height:1.4;margin-top:12px}.hold{min-height:70px;gap:7px}.hold span{font-size:17px}.hold small{font-size:14px;line-height:1.25}.status{font-size:14px;min-height:41px}.below,.text-button,details{font-size:14px}.text-button{min-height:44px}.below{display:block}.preferences{display:flex;flex-wrap:wrap;gap:7px 22px;justify-content:space-between}.below>p{font-size:14px;line-height:1.5;margin:4px 0 9px}summary{min-height:44px}.challenge-picker{margin:0 0 12px}.mode-buttons{display:flex;background:#ded2e9;border-radius:14px;padding:4px;gap:5px}.mode-buttons button{flex:1;border:0;border-radius:10px;min-height:44px;padding:8px 10px;font:inherit;font-size:15px;font-weight:700;color:#5c456e;background:none;cursor:pointer}.mode-buttons button[aria-pressed=true]{background:#fff9ee;color:#402f51;box-shadow:0 2px 4px #39294710}.mode-buttons button:disabled{cursor:default;opacity:.76}#challenge-label{font-size:14px;margin:8px 1px;color:#6e577b}.copy-score{display:block;margin:10px auto 0;padding:7px 14px;min-height:44px;border:1px solid #a88bbd;border-radius:10px;color:#4d3067;background:#faf4ff;font:inherit;font-size:14px;cursor:pointer}.copy-score[hidden],#share-panel[hidden],#reset-panel[hidden]{display:none}.share-panel{padding:12px 3px;font-size:14px}.share-panel label{display:block;margin-bottom:7px}.share-panel textarea{width:100%;font:inherit;padding:10px;border:1px solid #ba9dd0;border-radius:8px;background:#fffdf8;color:#3d294e}.result-stats{margin:0 0 13px}.result-stats span{font-size:14px}.result-stats strong{font-size:30px}.primary{font-size:16px;min-height:48px}#reset-panel{border:1px solid var(--line);padding:14px;border-radius:12px;line-height:1.5}#reset-panel button{font:inherit;font-weight:650;min-height:44px;padding:9px 14px;border:1px solid #c5b2d7;border-radius:9px;color:#4f3567;background:#f4ebf9;cursor:pointer}footer a{color:#654576;text-underline-offset:3px}footer{margin-top:22px;border-top:1px solid #d1c0dc;padding-top:12px;font-size:14px;line-height:1.7;color:#6c5979}footer nav{display:flex;flex-wrap:wrap;gap:8px 20px;align-items:center}footer nav a{display:inline-flex;align-items:center;min-height:44px}footer p{margin:9px 0}.portable-only{display:none}.document{font-size:17px;line-height:1.7;max-width:700px}.document h1{font-size:36px;line-height:1.15;display:block;margin:22px 0}.document h2{font-size:23px;line-height:1.3;margin:26px 0 10px}.document a{color:#66428b}.document p{margin:12px 0}.document details label{display:flex;align-items:center;gap:10px;min-height:44px;font-size:15px}.document details input{flex:none;width:22px;height:22px;margin:0;accent-color:#553c68}
@media(min-width:600px){.arena{width:min(100%,max(260px,calc(100svh - 400px)))}}
@media(max-width:599px) and (max-height:740px){.arena{width:min(100%,max(250px,calc(100svh - 240px)));margin-inline:auto}}
@media(max-width:360px){.overlay{padding:10px}.overlay-card>p:not(.kicker):not(.overlay-note){font-size:14px;margin-bottom:10px}.overlay-note{font-size:12px}.kicker{font-size:11px}h2{font-size:23px}.copy-score{margin-top:7px;min-height:42px;padding-block:6px}.result-stats{margin-bottom:9px}.result-stats strong{font-size:26px}.result-stats span{font-size:12px}.primary{padding:9px 19px}.status{font-size:14px}.hold span{font-size:16px}.hold small{font-size:14px}}

/* The result share action is below the arena so small displays keep the retry in view. */
.overlay{padding:12px;overflow-y:auto}.overlay-card{margin:auto}.overlay[data-kind=result] h2{font-size:28px}.overlay[data-kind=result] .overlay-card>p:not(.kicker):not(.overlay-note){margin-bottom:10px}.overlay[data-kind=result] .kicker{margin-bottom:7px}.overlay-card .kicker{font-size:14px;letter-spacing:0}.overlay-note,.result-stats span{font-size:14px}.overlay-card h2{font-size:28px}.overlay-card>p:not(.kicker):not(.overlay-note){font-size:16px;line-height:1.4;margin-bottom:13px}.overlay-note{margin-top:12px}.eyebrow{font-size:14px}.game>.copy-score{margin:10px auto 0}.document{width:min(100% - 32px,700px)}
@media(max-width:360px){.overlay-card h2,.overlay[data-kind=result] h2{font-size:25px}.overlay-card>p:not(.kicker):not(.overlay-note){font-size:14px}.overlay-card .kicker{font-size:14px}.overlay-note,.result-stats span{font-size:14px}.result-stats{gap:18px}.result-stats strong{font-size:27px}}
.hud{font-size:14px;grid-template-columns:repeat(auto-fit,minmax(min(4.5em,100%),1fr))}.hud>div{min-width:0}.mode-buttons button,.primary{max-width:100%;overflow-wrap:anywhere}.primary{padding-inline:24px}.hold{min-width:0;padding:10px 8px;overflow-wrap:anywhere}.hold span,.hold small{text-align:center}.icon-button{flex-shrink:0}.overlay-card{overflow-wrap:anywhere}.document h1,footer,details{overflow-wrap:anywhere}#lives{white-space:nowrap}
@media(min-width:700px) and (max-height:500px){main{width:min(100% - 32px,760px)}.game{display:grid;grid-template-columns:1fr 1fr;gap:8px 16px;padding:12px}.hud{grid-column:1/-1;padding-bottom:8px;grid-template-columns:repeat(4,minmax(0,1fr))}.arena{width:min(100%,260px);grid-column:1;grid-row:2/5}.play-controls{grid-column:2;grid-row:2;align-self:start;margin-top:0}.status{grid-column:2;grid-row:3;align-self:start}.game>.copy-score{grid-column:2;grid-row:4;align-self:start}.hud{grid-column:2;grid-row:1;padding-bottom:0}.arena{grid-row:1/5;min-width:0;width:min(100%,calc(100dvh - 132px),300px)}.play-controls{grid-row:2}.status{grid-row:3}.game>.copy-score{grid-row:4}.share-panel{grid-column:1/-1}.overlay-card>p:not(.kicker):not(.overlay-note){font-size:14px}.overlay-card h2{font-size:25px}.overlay-note{font-size:14px}.primary{padding-inline:16px}.overlay .kicker{font-size:14px}}
h1{display:block;overflow-wrap:anywhere}h1 span{display:inline-block;margin-left:10px}
.overlay{background:#f3eaf1bf;backdrop-filter:blur(1px)}
.arena:has(.overlay:not([hidden])){touch-action:pan-y}.overlay{touch-action:pan-y;overscroll-behavior:contain}
/* A single canvas color extends into Safari's safe area without a clipped gradient seam. */
html,body{background:#eee9f3}body{min-height:100svh}main{padding-bottom:env(safe-area-inset-bottom)}
h1{display:flex;align-items:center;gap:9px}.brand-spark{display:block;width:.85em;height:.85em;flex:none}h1 span{display:none}
#lives{display:flex;align-items:center;gap:5px;min-height:27px}.pane{width:17px;height:17px;display:inline-block;background:#513568;clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%)}.pane.spent{background:#bcaec6}
.icon-button{display:grid;place-items:center}.icon-button svg{fill:currentColor}
.cargo{border-radius:13px;line-height:1.25}.cargo small{display:block;margin-top:3px;font-size:12px;font-weight:700;color:#68421a}
.mode-buttons{flex-wrap:wrap}.mode-buttons button{flex:1 0 max-content;min-width:0;overflow-wrap:normal}
footer nav a,footer nav button{flex-shrink:0;overflow-wrap:normal}h1{flex-wrap:wrap;overflow-wrap:anywhere;word-break:normal}
@media(max-width:360px){h1{font-size:29px}}
/* RTG-030 app shell: compact on phones, spacious on desktop, and safe-area aware. */
*{box-sizing:border-box}.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
body{margin:0;color:#332447;background:#eee9f3;font:16px/1.5 system-ui,sans-serif}.app-shell{width:min(100%,1160px);min-height:100dvh;margin:auto;padding:max(12px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));display:flex;flex-direction:column;gap:14px}
.app-header{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:54px}.app-brand{display:flex;align-items:center;gap:10px;color:inherit;text-decoration:none;min-width:0}.app-brand img{width:36px;height:36px}.app-brand span{display:grid;line-height:1.2}.app-brand strong{font-size:17px}.app-brand small{font-size:13px;color:#655974}.header-actions{display:flex;align-items:center;gap:8px}.header-button,.settings-menu summary{display:flex;align-items:center;justify-content:center;min-height:44px;padding:8px 12px;border:1px solid #b8a8c4;border-radius:11px;background:#fff;color:#39294d;font:inherit;font-weight:700;cursor:pointer}.settings-menu{position:relative}.settings-menu summary{list-style:none;width:46px;padding:8px}.settings-menu summary::-webkit-details-marker{display:none}.settings-menu summary svg{width:23px;height:23px;fill:currentColor}.settings-panel{position:absolute;right:0;top:calc(100% + 8px);z-index:10;width:min(360px,calc(100vw - 28px));max-height:min(70dvh,620px);overflow:auto;padding:16px;border:1px solid #c8bbd1;border-radius:16px;background:#fff;box-shadow:0 14px 40px #38244830}.settings-heading{display:flex;justify-content:space-between;gap:10px;margin-bottom:12px}.settings-heading span,.storage-note{font-size:13px;color:#665a72}.setting-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 0;border-top:1px solid #eee9f1}.setting-toggle,.menu-action,.reset-panel button{min-height:44px;padding:8px 12px;border:1px solid #c9b9d5;border-radius:9px;background:#f8f4fa;color:#39294d;font:inherit;cursor:pointer}.menu-links{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}.menu-links a{display:inline-flex;align-items:center;min-height:44px;padding:0 8px;color:#5b3e70}.reset-panel{padding:10px;background:#f8f4fa;border-radius:10px}.reset-panel[hidden]{display:none}.reset-panel div{display:flex;gap:8px;flex-wrap:wrap}
.app-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;padding:4px;border:1px solid #c6b7d0;border-radius:14px;background:#e4dce9}.app-tabs button{min-height:44px;border:0;border-radius:10px;background:transparent;color:#4e3a5d;font:inherit;font-weight:750;cursor:pointer}.app-tabs button[aria-selected=true]{background:#fff;color:#382449;box-shadow:0 2px 7px #33244720}.app-view[hidden]{display:none}.challenge-picker{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 10px}.challenge-picker p{margin:0;color:#5e5269;font-size:14px;text-align:right}.mode-buttons{display:flex;gap:6px}.mode-buttons button{min-height:42px;padding:7px 12px;border:1px solid #b8a8c4;border-radius:10px;background:#fff;color:#39294d;font:inherit;font-weight:700}.mode-buttons button[aria-pressed=true]{background:#553c68;color:#fff;border-color:#553c68}
.game{width:100%;max-width:100%;margin:0 auto}.hud{max-width:760px;margin:0 auto 9px}.arena{width:min(100%,min(76vw,calc(100dvh - 330px),640px));min-width:min(100%,280px);aspect-ratio:1;margin:0 auto;border-radius:20px}.play-controls{max-width:760px;margin:10px auto 0}.hold{min-height:56px}.status{max-width:760px;margin:8px auto 0;min-height:24px}.copy-score,.share-panel{max-width:760px;margin:8px auto}.overlay{overflow:auto;overscroll-behavior:contain;padding:12px}.overlay-card{max-height:100%;overflow:auto}.quick-howto{max-width:390px;margin:9px auto 12px}.quick-howto[hidden]{display:none}.howto-art{display:block;width:100%;height:auto;max-height:66px}.quick-howto ol{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:6px 0 0;padding:0;list-style:none;text-align:left}.quick-howto li{display:grid;gap:1px;font-size:13px;line-height:1.3}.quick-howto li span{color:#665a72}.primary{min-height:48px}.overlay-copy,.overlay-note{margin:7px 0;font-size:14px}.app-footer{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-top:auto;padding:8px 0 2px;color:#655974;font-size:13px}.app-footer a{color:#553c68;text-underline-offset:3px}
.worlds-heading{max-width:700px;margin:4px auto 14px;text-align:center}.eyebrow,.world-count{margin:0;color:#684d7c;font-size:12px;font-weight:800;letter-spacing:.07em;text-transform:uppercase}.worlds-heading h1{display:block;margin:3px 0 5px;font-size:clamp(26px,4vw,38px)}.worlds-heading>p:last-child{margin:0;color:#5e5269}.world-mastery{margin:8px auto 0!important;padding:8px 12px;border-radius:10px;background:#f1e8f7;color:#39294d!important;font-size:14px;font-weight:700;line-height:1.4}.world-mastery:empty{display:none}.world-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.world-card{overflow:hidden;border:1px solid #cbbdd3;border-radius:18px;background:#fff;box-shadow:0 5px 18px #3324470c}.world-art{height:112px;display:grid;place-items:center}.world-art svg{width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:2}.world-garden{color:#658456;background:linear-gradient(140deg,#e6f0cf,#f6eed2)}.world-garden svg circle:first-child{fill:#f5d98e;stroke:#668253}.world-arcade{color:#397f86;background:linear-gradient(140deg,#d2f0ef,#e6ddfb)}.world-arcade svg circle{fill:#ffe18b}.world-orbit{color:#7558a5;background:linear-gradient(140deg,#e7dcfa,#d2e6f2)}.world-fall{color:#9a5a33;background:linear-gradient(140deg,#fbe4d2,#eddcf6)}.world-orbit svg circle{fill:#f6d88e}.world-copy{padding:12px 14px 14px}.world-copy h2{margin:1px 0 5px;font-size:21px}.world-copy>p:not(.world-count){margin:5px 0;color:#554a60;font-size:14px;line-height:1.45}.world-copy .world-best{color:#39294d!important}.world-select{width:100%;min-height:46px;margin-top:7px;padding:8px 12px;border:0;border-radius:10px;background:#513965;color:white;font:inherit;font-weight:750;cursor:pointer}.worlds-note{text-align:center;color:#655974;font-size:13px}.help-sheet{width:min(620px,calc(100vw - 28px));max-height:min(82dvh,760px);padding:20px;border:1px solid #b9a8c6;border-radius:20px;background:#fff;color:#39294d}.help-sheet::backdrop{background:#22192e88}.sheet-heading{display:flex;justify-content:space-between;align-items:start;gap:12px}.sheet-heading h2{margin:3px 0;font-size:25px}.sheet-close{min-height:44px;padding:8px 12px;border:1px solid #b8a8c4;border-radius:9px;background:#fff;color:inherit;font:inherit}.help-actions{display:flex;justify-content:flex-end;margin-top:14px}.help-sheet p{line-height:1.6}
button:focus-visible,a:focus-visible,summary:focus-visible,[role=tab]:focus-visible{outline:3px solid #a579c6;outline-offset:3px}button:disabled{opacity:.56;cursor:not-allowed}
@media(min-width:900px){.app-shell{gap:16px}.game{display:grid;grid-template-columns:minmax(0,1fr) minmax(230px,300px);grid-template-rows:auto 1fr auto auto;align-items:center;column-gap:18px}.hud{grid-column:1/3;width:min(100%,760px)}.arena{grid-column:1;grid-row:2/5;width:min(100%,min(58vw,calc(100dvh - 290px),650px));margin:0 auto}.play-controls{grid-column:2;grid-row:2;width:100%;display:grid;gap:10px}.status,.copy-score,.share-panel{grid-column:2;width:100%;align-self:start}.quick-howto ol{gap:12px}.overlay-card{width:min(92%,410px)}}
@media(max-width:680px){.world-grid{grid-template-columns:1fr;max-width:440px;margin:auto}.world-card{display:grid;grid-template-columns:34% 1fr;align-items:stretch}.world-art{height:100%;min-height:150px}.world-copy{padding:11px}.world-copy h2{font-size:19px}.world-copy>p:not(.world-count){font-size:13px}.world-count{font-size:10px}.world-select{min-height:44px}.challenge-picker{align-items:stretch;flex-direction:column}.challenge-picker p{text-align:left}.arena{width:min(100%,calc(100dvh - 350px),580px);min-width:260px}}
@media(max-width:390px){.app-shell{padding-left:max(10px,env(safe-area-inset-left));padding-right:max(10px,env(safe-area-inset-right));gap:10px}.app-brand small{font-size:11px}.header-button{padding:7px 9px;font-size:14px}.world-card{grid-template-columns:29% 1fr}.world-art{min-height:172px}.world-copy{padding:9px}.quick-howto ol{gap:5px}.quick-howto li{font-size:12px}}
/* The smallest phones: the name alone beside the header buttons, so the header stays two lines at most. */
@media(max-width:359px){.app-brand small{display:none}.app-brand img{width:30px;height:30px}.app-brand{gap:8px}}
@media(max-height:620px) and (orientation:landscape){.app-shell{gap:7px}.app-header{min-height:44px}.app-brand img{width:30px;height:30px}.challenge-picker{margin-bottom:4px}.arena{width:min(54vw,calc(100dvh - 230px),520px)}.quick-howto{margin:3px auto 5px}.quick-howto ol{gap:5px}.overlay{padding:6px}.app-footer{padding:2px 0}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}
@media(max-width:520px){.header-button{flex:0 0 auto;width:max-content}.overlay[data-kind=ready] #overlay-kicker,.overlay[data-kind=ready] #overlay-note{display:none}}
.header-button{white-space:nowrap;flex:0 0 auto;width:max-content}
@media(min-width:900px){.game{display:grid;grid-template-columns:minmax(0,1fr) minmax(250px,300px);grid-template-rows:auto auto auto auto auto;align-items:start;column-gap:18px;row-gap:8px}.hud{grid-column:1/3;grid-row:1}.arena{grid-column:1;grid-row:2/6}.play-controls{grid-column:2;grid-row:2;align-self:center}.status{grid-column:2;grid-row:3}.copy-score{grid-column:2;grid-row:4}.share-panel{grid-column:2;grid-row:5}.arena{margin-top:0}}
@media(min-width:900px){.play-controls{grid-template-columns:minmax(0,1fr) 52px;align-items:center;gap:8px}.play-controls .hold{min-width:0}}
@media(max-width:680px){.world-count{font-size:11px}}
.mode-buttons button{min-height:44px}
.worlds-heading h2{margin:3px 0 5px;font-size:clamp(26px,4vw,38px);line-height:1.2}
/* RTG-031 owner steering: subtle floating consent card (lib/consent-prompt.mjs sets
   position/size/z-index via CSSOM; this file only styles the look). Kept compact. */
.privacy-consent{padding:12px 13px;border-radius:14px;border:1px solid #c9bacf;background:#fffaf0;box-shadow:0 10px 26px #33244730;display:grid;gap:8px;opacity:0;transform:translateY(8px);animation:privacy-consent-in .18s ease-out forwards}
.privacy-consent p{margin:0;font-size:15px;line-height:1.35;color:#4a3a5c}
.privacy-consent a{color:#654576;text-underline-offset:3px}
.privacy-consent-actions{display:flex;gap:8px}
.privacy-consent-allow{flex:1;font:inherit;font-size:15px;font-weight:700;min-height:44px;padding:9px 14px;border:0;border-radius:9px;background:#553c68;color:#fff9ec;cursor:pointer}
.privacy-consent-allow:hover{background:#432c56}
.privacy-consent-decline{font:inherit;font-size:15px;font-weight:600;min-height:44px;padding:9px 12px;border:0;border-radius:9px;background:transparent;color:#6c5979;cursor:pointer}
.privacy-consent-decline:hover{color:#4a3a5c;background:#efe7f2}
.privacy-consent-allow:focus-visible,.privacy-consent-decline:focus-visible{outline:3px solid #9470b7;outline-offset:2px}
@keyframes privacy-consent-in{to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.privacy-consent{animation:none;opacity:1;transform:none}}
@media(max-width:360px){.privacy-consent{padding:11px}}
/* RTG-031 privacy-page analytics control (lib/privacy-choice.mjs mounts unstyled nodes). */
#analytics-choice{margin:14px 0}
#analytics-choice p{margin:0 0 10px}
#analytics-choice button{font:inherit;font-size:16px;font-weight:650;min-height:44px;padding:9px 16px;border:1px solid #c5b2d7;border-radius:9px;color:#4f3567;background:#f4ebf9;cursor:pointer}
#analytics-choice button:focus-visible{outline:3px solid #9470b7;outline-offset:3px}

/* RTG-031: keep the page end (footer links) reachable above the floating consent card. */
body:has(.privacy-consent-floating){padding-bottom:calc(150px + env(safe-area-inset-bottom))}
/* Header: brand text reads left to right, and the settings button shows only its gear. */
.app-header{text-align:left}
.settings-menu summary:before,.settings-menu[open] summary:before{content:none}
.settings-menu summary svg{flex:none}

/* Desktop: the page fits the window. The arena takes the left side at the largest square that
   fits; score, controls and status sit in a side column. */
.fullscreen-fit{display:contents}
.arena:focus:not(:focus-visible){outline:none}
@media(min-width:700px) and (min-height:540px) and (orientation:landscape){
.app-shell:has(#view-play:not([hidden])){height:100dvh;min-height:0}
.app-shell:has(#view-play:not([hidden]))>#view-play{flex:1 1 auto;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(250px,300px);grid-template-rows:auto auto auto auto auto minmax(0,1fr);column-gap:28px;row-gap:12px;align-items:start;padding:16px;background:var(--paper);border:1px solid var(--line);border-radius:22px;box-shadow:0 12px 40px #3e235310}
#view-play>.game:not(.is-fullscreen){display:contents}
#view-play>.challenge-picker{grid-column:2;grid-row:1;flex-direction:column;align-items:stretch;gap:8px;margin:0}
#view-play>.challenge-picker p{display:none}
#view-play>.game:not(.is-fullscreen) .fullscreen-fit{display:grid;place-items:center;container-type:size;grid-column:1;grid-row:1/7;align-self:stretch;min-width:0;min-height:0}
#view-play>.game:not(.is-fullscreen) .arena{grid-area:auto;width:min(100cqw,100cqh);max-height:none;min-width:0;margin:0}
#view-play>.game:not(.is-fullscreen) .hud{grid-column:2;grid-row:2;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;width:auto;max-width:none;margin:0;padding:0}
/* The side column is too narrow for the hold button beside three icons: it gets its own row, the icons share the next. */
#view-play>.game:not(.is-fullscreen) .play-controls{grid-column:2;grid-row:3;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:stretch;gap:8px;width:auto;max-width:none;margin:0}
#view-play>.game:not(.is-fullscreen) .play-controls .hold{grid-column:1/-1}
#view-play>.game:not(.is-fullscreen) .play-controls .icon-button{width:auto}
#view-play>.game:not(.is-fullscreen) .status{grid-column:2;grid-row:4;text-align:left;width:auto;max-width:none;min-height:0;margin:0}
#view-play>.game:not(.is-fullscreen) .copy-score{grid-column:2;grid-row:5;margin:0}
#view-play>.game:not(.is-fullscreen) .share-panel{grid-column:2;grid-row:6;align-self:start}
}
/* The start and result card scales with the arena, not the window, so it always fits. */
.arena{container:arena/size}
.arena #overlay-title{font-size:clamp(22px,10cqw,43px)}
@container arena (max-height:440px){.arena .quick-howto ol,.arena .overlay:not([data-kind=result]) .overlay-note,.arena .overlay[data-kind=result] .kicker{display:none}.arena .quick-howto{margin:2px auto 6px}}
@container arena (min-height:560px){.arena .overlay-card{width:min(92%,max(340px,56cqw));max-width:none}.arena .quick-howto{max-width:max(390px,52cqw)}.arena .overlay-card>p:not(.kicker):not(.overlay-note),.arena .overlay-card .kicker{font-size:clamp(14px,2.3cqw,19px)}.arena .overlay-card .primary{font-size:clamp(15px,2.4cqw,20px)}.arena .quick-howto li{font-size:clamp(12px,1.9cqw,16px)}}
@container arena (max-height:380px){.arena .quick-howto{display:none}.arena .overlay-card>p:not(.kicker):not(.overlay-note){font-size:13px;margin-bottom:8px}}

/* Full screen: the whole game inside one screen, with the arena as large as it can be. */
html.game-fullscreen-lock{overflow:hidden;overscroll-behavior:none}
.fullscreen-toggle svg{fill:none;flex:none}
.play-controls .fullscreen-label{display:none}
.overlay-fullscreen{display:flex;width:max-content;max-width:100%;align-items:center;justify-content:center;gap:7px;min-height:44px;margin:8px auto 0;padding:0 16px;border:1.5px solid #b8a8c4;border-radius:999px;background:#fff9ee;color:#402f51;font:inherit;font-size:15px;font-weight:700;cursor:pointer}
.overlay-fullscreen:hover{background:#fff;border-color:#855ba8}
.overlay-fullscreen svg{flex:none}
.game.is-fullscreen .overlay-fullscreen{display:none}
.game.is-fullscreen{position:fixed;inset:0;z-index:2147483001;width:auto;max-width:none;margin:0;border:0;border-radius:0;box-shadow:none;background:var(--paper);overflow:auto;overscroll-behavior:none;padding:max(10px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));display:grid;gap:10px;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(min(35dvh,70vw),1fr) auto auto;grid-template-areas:"hud" "board" "controls" "status"}
.game.is-fullscreen .fullscreen-fit{grid-area:board;display:grid;place-items:center;container-type:size;align-self:stretch;justify-self:stretch;min-width:0;min-height:0}
.game.is-fullscreen .arena{grid-area:auto;width:min(100cqw,100cqh);max-height:none;min-width:0;margin:0}
.game.is-fullscreen .hud{grid-area:hud;width:auto;max-width:none;margin:0;padding:0 4px}
.game.is-fullscreen .play-controls{grid-area:controls;display:grid;grid-template-columns:minmax(0,1fr) auto auto auto;align-items:stretch;gap:8px;width:auto;max-width:none;margin:0}
.game.is-fullscreen .status{grid-area:status;width:auto;max-width:none;min-height:0;margin:0}
.game.is-fullscreen .copy-score,.game.is-fullscreen .share-panel{display:none}

@media(orientation:landscape){
.game.is-fullscreen{column-gap:22px;grid-template-columns:minmax(0,1fr) clamp(240px,28vw,300px);grid-template-rows:auto auto auto minmax(0,1fr);grid-template-areas:"board hud" "board controls" "board status" "board ."}
.game.is-fullscreen .hud{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:0}
.game.is-fullscreen .status{text-align:left}
.game.is-fullscreen .play-controls{grid-template-columns:repeat(3,1fr)}
.game.is-fullscreen .play-controls .hold{grid-column:1/-1}
}
@media(orientation:landscape) and (max-height:520px){.game.is-fullscreen{gap:8px 16px}.game.is-fullscreen .hud strong{font-size:20px}}
.fullscreen-tip{position:absolute;z-index:3;top:calc(max(10px,env(safe-area-inset-top)) + 60px);left:50%;transform:translateX(-50%);width:min(92%,420px);display:flex;align-items:center;gap:8px;padding:10px 8px 10px 14px;border-radius:14px;background:#402f51;color:#fff9ee;box-shadow:0 8px 24px #3e235340}
.fullscreen-tip p{margin:0;font-size:14px;line-height:1.4}
.fullscreen-tip button{flex:none;display:grid;place-items:center;width:44px;height:44px;padding:0;border:0;border-radius:10px;background:transparent;color:inherit}
.try-another{margin:10px 0 0;font-size:14px;text-align:center}.try-another a{color:var(--muted)}
/* RTG-065: state-specific controls and one coherent result composition. The general h1 flex rule left the centered card heading sitting left of its buttons. */
.overlay-card h1{display:block}
.overlay[data-kind=result] .quick-howto,.overlay[data-kind=pause] .quick-howto{display:none}
.overlay[data-kind=result] .overlay-note{margin-top:10px;color:#5e5269}
.game[data-mode=ended] #hold,.game[data-mode=ended] #pause{display:none}
.game[data-mode=ended] .play-controls{display:flex;justify-content:center;grid-template-columns:none}
.game[data-mode=ended] .play-controls .fullscreen-toggle{width:auto;min-height:48px;display:flex;align-items:center;gap:8px;padding:0 18px;font-size:15px;font-weight:700}
.game[data-mode=ended] .play-controls .fullscreen-label{display:inline}
/* RTG-065 review: on a phone (portrait or landscape) the board fills the lower viewport, so the shared consent card can only use a top corner, where it covered the brand, How to play and Settings. When the card is in a top corner (inline top set, bottom auto) it now sits just below the header, over the tabs and mode row, which are secondary before a first run; --halo-header-bottom is kept current by app.mjs. */
@media(max-width:520px),(max-height:520px){.privacy-consent-floating:not([style*="top: auto"]){top:calc(var(--halo-header-bottom,66px) + 8px)!important}}
/* RTG-065: a card taller than the board (enlarged text, short board) leads with its action and drops decoration; the card still scrolls for the rest. */
.overlay-card.is-overflowing{display:flex;flex-direction:column;align-items:center}
.overlay-card.is-overflowing>*{order:0;width:100%}
.overlay-card.is-overflowing #overlay-title{order:-2;margin:0 0 6px}
.overlay-card.is-overflowing #primary{order:-1;width:auto;margin:0 auto 10px}
.overlay-card.is-overflowing .kicker,.overlay-card.is-overflowing .quick-howto,.overlay-card.is-overflowing .overlay-fullscreen{display:none}
.overlay-card.is-overflowing .result-stats{flex-direction:column;gap:2px;margin-bottom:8px}
.overlay-card.is-overflowing[data-more=true]{-webkit-mask-image:linear-gradient(#000 calc(100% - 36px),transparent);mask-image:linear-gradient(#000 calc(100% - 36px),transparent)}

/* First play, sound and streak (Glimmer player-experience slice). New players get one Play button; the run choices open after their first finished run. */
.app-shell[data-first-run=true] .app-tabs,.app-shell[data-first-run=true] .mode-buttons{display:none}.app-shell[data-first-run=true] #challenge-label{margin-top:0}
.app-shell[data-first-run=true] .overlay[data-kind=ready] .primary{font-size:20px;min-height:58px;padding-inline:52px}
.sound-toggle svg{display:block}.sound-toggle .sound-mute{display:none}.sound-toggle[data-on=false] .sound-wave{display:none}.sound-toggle[data-on=false] .sound-mute{display:block}.sound-toggle[data-on=false]{color:#8a7a95}
#challenge-label .streak-chip{display:inline-block;margin-left:2px;padding:1px 9px;border-radius:999px;background:#fff3d6;color:#7a5220;font-size:13px;font-weight:750;white-space:nowrap;vertical-align:1px}
#overlay-streak{margin:0 0 10px;font-size:14px;line-height:1.4;font-weight:700;color:#7a5220}.overlay[data-kind=ready] #overlay-streak{margin-top:-4px}

/* On the smallest boards (about 320px phones, or landscape full screen) the card has no spare line, so the streak line steps aside there; the picker chip still shows it. */
@container arena (max-height:340px){.arena #overlay-streak,.arena #overlay-goal{display:none}}

/* Goals (depth piece two): a line on the result card and a list on the Goals tab. */
#overlay-goal{margin:0 0 10px;font-size:14px;line-height:1.4;color:#5e5269}
.goal-list{list-style:none;max-width:560px;margin:0 auto;padding:0;display:grid;gap:8px}.goal{display:grid;grid-template-columns:34px 1fr;align-items:center;gap:10px;padding:10px 12px;border:1px solid #cbbdd3;border-radius:14px;background:#fff}.goal.is-done{background:#fff7e4;border-color:#e2c78f}
.goal-mark{width:34px;height:34px;display:grid;place-items:center;border-radius:50%;border:1.5px solid #cbbdd3;color:#7a5220}.goal.is-done .goal-mark{background:#f6dc9a;border-color:#d9b25f}
.goal-copy{display:grid;gap:2px}.goal-copy strong{font-size:16px;color:#332447}.goal-copy span{font-size:14px;line-height:1.4;color:#5e5269}.goal.is-done .goal-copy span{color:#7a5220}


/* Publisher attribution: small, separate from the game's own mark (owner rule Sep 29: the game leads, Dayplay Games is the publisher). */
.app-footer .publisher{display:inline-flex;align-items:center;gap:6px;min-height:44px;color:#655974;text-decoration:none}.app-footer .publisher:hover{text-decoration:underline}.app-footer .publisher img{width:18px;height:18px;border-radius:4px;flex:none}
/* The hold button's text and hint change on every press and release; the button keeps one size so the arena above never moves. */
.hold{height:auto;min-height:0;max-height:none;padding:6px 8px;gap:4px;overflow:hidden}.hold span,.hold small{display:flex;align-items:center;justify-content:center;width:100%;text-align:center;white-space:normal;overflow:hidden}.hold span{height:2.2em}.hold small{height:2.5em}

/* QA: the status line keeps a two-line box so a longer message never moves the arena or the controls */
.status,#view-play>.game:not(.is-fullscreen) .status,.game.is-fullscreen .status{min-height:2.9em}
.app-brand{min-height:44px}.try-another a,.app-footer a{display:inline-flex;align-items:center;min-height:44px}
@media(max-width:360px){#view-play .icon-button{width:44px}#view-play .hold span{font-size:14px}#view-play .hold small{font-size:12px}}

/* Landscape phones: the arena is capped by the short height (later rules set a 280px floor and a tighter cap). */
@media(min-width:700px) and (max-height:500px){#view-play .arena{min-width:0;width:min(100%,calc(100dvh - 132px),300px)}#view-play .status,#view-play .play-controls{width:100%;justify-self:stretch;margin-inline:0}}

/* First-visit tutorial (lib/game-tutorial.mjs) in Glimmer's colours; the look and layout are shared. */
:root{--dpt-bg:var(--paper);--dpt-ink:var(--ink);--dpt-muted:var(--muted);--dpt-line:var(--line);--dpt-tint:#e4d8ee;--dpt-accent:var(--accent);--dpt-accent-ink:#fff}
.sheet-tutorial{margin:0 0 14px}
