/* Disable double-tap zoom; preserve scrolling, pinch zoom and game-specific gestures. */
:where(*) { touch-action: manipulation; }

:root {
  color-scheme:dark; --bg:#101b2b; --panel:#1b2b3a; --line:#ffffff16;
  --ink:#f6f4e9; --muted:#a9bec8; --mint:#b4efbf; --gold:#f9d17d;
  font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-size:14px;line-height:1.45}
button,input,select{font:inherit}button,a,input,select{-webkit-tap-highlight-color:transparent}
button{cursor:pointer;border:0;color:inherit}button:disabled{cursor:default;opacity:.45}
a{color:inherit;text-decoration:none}button,a{touch-action:manipulation}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid var(--gold);outline-offset:3px}
h1,h2,h3,p{margin:0}.muted,.small{color:var(--muted)}.small{font-size:12px}
.ambient{position:fixed;inset:0;pointer-events:none;z-index:-1;background:radial-gradient(ellipse at 50% 48%,#29524466,transparent 65%)}
.app-shell{width:100%;max-width:454px;margin:auto;padding:8px 8px max(10px,env(safe-area-inset-bottom))}
.site-header{height:50px;display:flex;align-items:center;justify-content:space-between;gap:10px}
.site-header h1{font-size:24px;letter-spacing:-1px;font-weight:750}.site-header h1 span{font-size:24px;color:var(--gold);margin-right:3px}
.playsible{display:flex;align-items:center;gap:4px;color:var(--muted);font-size:22px;min-height:44px}.playsible span{font-size:11px;font-weight:600;letter-spacing:-.3px}
.icon-button{display:grid;place-items:center;border-radius:50%;background:#ffffff09;width:44px;height:44px;font-size:20px;flex-shrink:0}
.icon-button:hover{background:#ffffff19}.town-vista{height:100px;border-radius:20px 20px 6px 6px;overflow:hidden;margin-top:4px}
.town-vista canvas{width:100%;height:100%;display:block;object-fit:cover}
.mission-heading{display:flex;justify-content:space-between;align-items:baseline;gap:10px;padding:12px 8px 10px}
.mission-heading h2{font-size:17px;font-weight:650;letter-spacing:-.35px}
#missionEyebrow{font-size:12px;color:var(--muted);white-space:nowrap}
.board-shell{border:1px solid #9dccb831;border-radius:21px;padding:8px;background:linear-gradient(140deg,#29423f,#20313b 55%,#253d38);box-shadow:0 14px 70px #050c1844,inset 0 1px #ffffff08}
.play-hud{display:flex;gap:10px;align-items:center;padding:3px 4px 10px;min-height:72px}
.moves-counter{display:flex;flex-direction:column;justify-content:center;align-items:center;min-width:61px;padding-right:12px;border-right:1px solid #abc7b624;color:var(--mint)}
.moves-counter strong{font-size:31px;line-height:1.05;font-weight:760;letter-spacing:-1px;font-variant-numeric:tabular-nums}.moves-counter span{font-size:11px;color:#c6d4cc;line-height:1.5}
.moves-counter.low strong{color:var(--gold)}
.goals{display:flex;gap:6px;justify-content:space-evenly;align-items:center;flex:1;min-width:0}
.goal-chip{position:relative;background:transparent;display:flex;align-items:center;justify-content:center;gap:7px;padding:2px 5px;min-height:49px;border-radius:11px;flex:1;min-width:0}
.goal-chip:hover{background:#ffffff09}.goal-chip .goal-count{font-size:15px;font-weight:750;letter-spacing:-.35px;font-variant-numeric:tabular-nums;white-space:nowrap}
.goal-chip .goal-count span{font-size:11px;font-weight:500;color:#bbc8c6}.goal-chip.done .goal-count{color:var(--mint)}
.goal-check{position:absolute;right:2px;top:-2px;background:var(--mint);color:#1d3329;border-radius:50%;font-size:10px;width:15px;height:15px;font-weight:900}
.goal-chip.pulse .piece-icon{animation:goal-pop .38s ease-out}
.piece-icon{width:31px;height:31px;display:inline-grid;place-items:center;flex-shrink:0;border-radius:9px;background:linear-gradient(145deg,var(--tile-light),var(--tile-base) 55%,var(--tile-dark));box-shadow:inset 0 1px #ffffff8a,inset 0 -2px #0003,0 1px 3px #0004;vertical-align:middle;border:1px solid #ffffff26}
.piece-icon .tile-symbol{width:68%;height:68%}.piece-icon.rainbow{background:conic-gradient(from 25deg,#78cbb2,#6fbde0,#b4a1e7,#ee9a83,#edd480,#78cbb2);border-radius:50%}
.piece-icon.rainbow svg{width:80%;height:80%;filter:drop-shadow(0 1px 1px #0003)}.piece-icon.rainbow circle{fill:#213845;stroke:#fffcde;stroke-width:2}.piece-icon.rainbow path{fill:#fffcde}
.piece-icon.repair{background:linear-gradient(145deg,#96adb8,#526b7c);border:3px double #e8f0ee;position:relative}
.piece-icon.repair svg{width:78%;height:78%}.piece-icon.repair path{fill:none;stroke:#fff;stroke-width:2.5;stroke-linecap:round}
.piece-icon[data-special="core"]{background:radial-gradient(circle,#d3efd2 3%,#325447 10%,#172832 37%,#88baa4 40%,#293c46 48%,#172832 63%)}
.piece-icon[data-special="core"] circle{fill:none;stroke:#fff3b9;stroke-width:2}.piece-icon[data-special="core"] .spark{fill:#fff3b9;stroke:none}
.board-stage{position:relative}.board{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:5px;padding:6px;border-radius:13px;background:#10212b;box-shadow:inset 0 2px 7px #0007;touch-action:none;user-select:none;outline:none}
.tile{position:relative;width:100%;padding:0;aspect-ratio:1;border-radius:11px;background:linear-gradient(155deg,var(--tile-light),var(--tile-base) 55%,var(--tile-dark));box-shadow:inset 0 2px 1px #ffffff6b,inset 0 -4px 1px #0003,0 2px 3px #0005;display:grid;place-items:center;isolation:isolate;border:1px solid #ffffff20;transition:filter .12s;overflow:visible}.tile::before{content:'';position:absolute;inset:5px;border:1px solid #ffffff19;border-radius:8px;pointer-events:none}.tile:hover{filter:brightness(1.12)}.tile.selected{outline:3px solid #fff7c6;outline-offset:1px;z-index:3;filter:brightness(1.2)}.tile.hint{animation:hint 1s ease infinite}.tile-symbol{width:60%;height:60%;filter:drop-shadow(0 2px 1px #0003);opacity:.92;pointer-events:none}.tile-symbol path,.tile-symbol circle,.tile-symbol polygon,.tile-symbol ellipse{fill:#fffbef}.tile[data-special="beam-h"] .tile-symbol,.tile[data-special="beam-v"] .tile-symbol,.tile[data-special="burst"] .tile-symbol{width:69%;height:69%}.c0{--tile-light:#f2c46d;--tile-base:#d3993e;--tile-dark:#936d2e}.c1{--tile-light:#81d8e4;--tile-base:#47a6c2;--tile-dark:#2d6f92}.c2{--tile-light:#bce993;--tile-base:#73b46c;--tile-dark:#3f7856}.c3{--tile-light:#f5a189;--tile-base:#d26f67;--tile-dark:#98454a}.c4{--tile-light:#cdb2f1;--tile-base:#9b86d3;--tile-dark:#655396}.tile[data-special="core"]{background:radial-gradient(circle,#e8f8d8 2%,#83cfc0 8%,#293349 13%,#172332 47%,#6f9698 50%,#344951 60%,#152532 63%);box-shadow:inset 0 0 12px #e7dfa94d,0 0 12px #c1e9d029}.tile[data-special="core"] .tile-symbol{width:75%;height:75%}.tile[data-special="core"] .tile-symbol circle{fill:none;stroke:#fff3b9;stroke-width:2}.tile[data-special="core"] .tile-symbol .spark{fill:#fff3b9;stroke:none}.special-tag{position:absolute;right:2px;top:1px;font-size:10px;color:white;line-height:1;pointer-events:none}.plate{position:absolute;inset:-2px;border:3px solid #abb4bc;border-radius:11px;pointer-events:none;z-index:2;box-shadow:0 0 0 1px #283440}.plate::before,.plate::after{content:'';width:5px;height:5px;position:absolute;top:-2px;background:#e2e6eb;border:1px solid #697780;border-radius:50%}.plate::before{left:-2px}.plate::after{right:-2px}.plate.two{border-style:double;border-width:5px}.plate-bolts{position:absolute;bottom:0;right:3px;font-size:8px;color:#fff;text-shadow:0 1px #000;pointer-events:none;z-index:3}.tile.clearing{animation:pop .2s ease forwards;z-index:4}.combo-label{position:absolute;left:0;right:0;top:40%;text-align:center;color:#fffde9;font-weight:900;font-size:25px;letter-spacing:-.5px;filter:drop-shadow(0 3px 8px #102230);pointer-events:none;z-index:10;opacity:0;transform:scale(.8)}.combo-label.show{animation:combo .75s ease forwards}
.board-tools{min-height:57px;display:flex;align-items:center;gap:10px;padding:7px 3px 0}
.tool-button{background:transparent;display:flex;gap:6px;align-items:center;font-size:12px;min-height:44px;padding:0 6px;color:#d2e1d7}.tool-button>span{font-size:24px;color:var(--gold)}
.score-mini{margin-left:auto;font-size:10px;color:var(--muted);white-space:nowrap}.score-mini strong{font-size:12px;font-weight:600;color:#d5e2da}
.wild-button{position:relative;min-width:114px;border-radius:12px;padding:6px 10px;min-height:44px;background:#91c5a112;display:flex;gap:8px;align-items:center;overflow:hidden;border:1px solid #b0e7c026}
.wild-button:disabled{opacity:.65}.wild-symbol{font-size:25px;color:var(--mint);line-height:1}.wild-button strong{font-size:12px;display:block;line-height:1.2;font-weight:650}.wild-button small{display:block;font-size:10px;color:var(--muted)}
.wild-button.ready{background:var(--mint);color:#183428;border-color:#cfffcb;box-shadow:0 0 18px #bcf4b828}.wild-button.ready .wild-symbol,.wild-button.ready small{color:#254334}
.wild-button[aria-pressed="true"]{outline:2px solid var(--gold);outline-offset:2px}.charge-track{position:absolute;left:0;bottom:0;width:100%;height:3px;background:#0d211b30}.charge-track>span{display:block;height:100%;width:0;background:var(--mint);transition:width .3s}.ready .charge-track{display:none}
.game-status{font-size:12px;min-height:20px;text-align:center;margin:8px 2px 0;color:var(--muted)}
.run-line{display:flex;justify-content:center;align-items:center;gap:12px;min-height:0;font-size:11px;color:var(--muted)}.run-line:has([hidden]):not(:has(:not([hidden]))){display:none}
#runBadge:empty{display:none}#paceBadge{font-variant-numeric:tabular-nums}.run-line .text-button{padding:4px;font-size:11px}
.mode-tabs{display:flex;gap:5px;justify-content:center;border-top:1px solid var(--line);margin-top:10px;padding-top:5px}
.mode-tabs button{background:transparent;flex:1;min-height:44px;display:flex;align-items:center;justify-content:center;gap:7px;color:var(--muted);border-radius:12px;font-size:12px}
.mode-tabs button span{font-size:21px;line-height:1}.mode-tabs button.active{color:var(--mint);background:#a7eec10b}.mode-tabs button:hover{background:#ffffff09}
.preview-label{display:block;text-align:center;font-size:10px;color:#91a7b0;padding-top:5px}.connection-notice{font-size:12px;padding:10px;border:1px solid #f9d17d44;border-radius:10px;color:var(--gold);margin:5px 0;background:#f9d17d0b}
.refill-bar{position:relative;margin:4px 6px 8px;padding-top:10px}.refill-caption{position:absolute;top:-4px;left:0;font-size:8px;color:var(--muted);letter-spacing:.7px}
#refillPreview{display:grid;grid-template-columns:repeat(6,1fr);gap:5px}.preview-column{display:flex;gap:3px;justify-content:center}.preview-dot{background:var(--tile-base);border-radius:3px;width:9px;height:9px}.preview-dot+span{width:6px;height:6px;opacity:.5;margin-top:2px}
/* A small, skippable lesson lives on the board, not in front of the whole game. */
.coach-card{position:absolute;z-index:15;top:8px;left:8px;right:8px;max-width:340px;margin:auto;display:flex;align-items:flex-start;gap:10px;padding:13px 14px 7px;background:#f7f1d9;color:#233e37;border:1px solid #fff4cd;border-radius:15px;box-shadow:0 7px 24px #071e2e88}
.coach-card.at-bottom{top:auto;bottom:9px}.coach-picture{display:flex;gap:3px;padding-top:2px;flex-shrink:0}.coach-picture .piece-icon{width:25px;height:29px;border-radius:6px}
.coach-copy{flex:1;min-width:0}.coach-copy>strong{font-size:14px;line-height:1.2;display:block;margin-bottom:4px;letter-spacing:-.2px}.coach-copy p{font-size:12px;line-height:1.4;max-width:260px}
.coach-actions{display:flex;gap:15px;align-items:center;justify-content:flex-end}.coach-actions .text-button{min-height:34px;font-size:11px;color:#4d6257;padding:6px 0}.coach-actions #coachNext{font-weight:800;color:#1c5144}
.coach-arrow{position:absolute;inset:0;width:100%;height:100%;z-index:12;pointer-events:none;overflow:visible}.coach-arrow>path{stroke:#fff6bd;stroke-width:3;fill:none;stroke-linecap:round;filter:drop-shadow(0 2px 3px #061c28)}
.board.teaching .tile{filter:brightness(.55)}.board.teaching .tile.lesson-focus{filter:brightness(1.15);outline:2px solid #fff6bd;outline-offset:1px;z-index:6}.board.teaching .tile.lesson-focus.selected{outline:3px solid #fff;outline-offset:2px}
.goals.lesson-focus{outline:2px solid var(--gold);outline-offset:2px;border-radius:9px}.wild-button.lesson-focus{outline:2px solid var(--gold);outline-offset:3px}
/* Only a menu or a result has a second layer of detail. */
dialog{position:fixed;margin:auto;background:linear-gradient(145deg,#263d46,#182936);color:var(--ink);border:1px solid #aac4b82e;border-radius:24px;padding:30px 24px 24px;max-width:440px;width:calc(100% - 24px);max-height:88dvh;overflow-y:auto;box-shadow:0 30px 120px #0008}
dialog::backdrop{background:#07141dcc;backdrop-filter:blur(5px)}.modal-close{position:absolute;top:7px;right:7px;background:transparent}
.modal-eyebrow{font-size:10px;letter-spacing:1.2px;color:var(--mint);margin-bottom:8px}.modal-title{font-size:27px;letter-spacing:-.8px;line-height:1.18;margin:5px 18px 12px 0}.modal-copy{font-size:13px;line-height:1.6;color:var(--muted);margin:12px 0 18px}.modal-subhead{font-size:16px;margin:18px 0 8px}
.button{min-height:44px;border-radius:11px;padding:11px 16px;font-weight:650;font-size:13px;display:inline-flex;align-items:center;justify-content:center;text-align:center}.primary{background:var(--mint);color:#19392c}.secondary{background:#ffffff0c;border:1px solid #bdd8c327;color:#e1e8df}.wide{width:100%}.button-row{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.text-button{background:transparent;color:var(--muted);min-height:44px;padding:10px 0;font-size:12px}
.settings-list{display:flex;flex-direction:column;margin:20px 0 16px}.settings-list>button,.settings-list>label{display:flex;align-items:center;text-align:left;gap:12px;background:transparent;min-height:50px;padding:6px 0;border-bottom:1px solid var(--line);font-size:14px}.settings-list>button>span:first-child,.settings-list>label>span{font-size:21px;width:25px;text-align:center;color:var(--mint)}.settings-list>button>span:last-child{margin-left:auto;color:var(--muted);font-size:12px}.settings-list input{margin-left:auto;accent-color:var(--mint);width:21px;height:21px}.settings-list button:hover{color:var(--mint)}
.account-details{font-size:11px;color:var(--muted);display:flex;gap:15px;justify-content:space-between;margin:13px 0 20px}.account-details a{color:var(--mint);padding:8px;margin-top:-8px}
.map-vista{width:100%;border-radius:15px;margin-bottom:15px;display:block}.map-status{display:flex;justify-content:space-between;font-size:12px;color:var(--muted);margin:10px 0}
.level-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.level-item{background:#ffffff05;border:1px solid var(--line);border-radius:14px;min-height:98px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;padding:8px}.level-item.active{background:#b4efbf13;border-color:#b4efbf77}.level-item:disabled{opacity:.4}.level-number{font-size:23px;font-weight:750;color:var(--mint)}.level-name{font-size:10px;line-height:1.2;text-align:center}.level-stars{font-size:11px;color:var(--gold);letter-spacing:2px}.level-item:hover:not(:disabled){background:#c9f3bb20}
.help-examples{display:flex;justify-content:center;align-items:center;gap:7px;margin:14px 0 20px}.help-examples .piece-icon{width:43px;height:43px;border-radius:11px}.help-details{margin:14px 0;border-top:1px solid var(--line);padding-top:14px}.help-details summary{cursor:pointer;font-size:13px;min-height:35px;color:var(--mint)}.guide-row{padding:10px 0;border-top:1px solid var(--line);display:flex;gap:13px;align-items:center;font-size:12px;color:var(--muted)}.guide-row strong{display:block;color:var(--ink);margin-bottom:3px}.guide-row .piece-icon{width:38px;height:38px}
.result-stars{font-size:36px;color:var(--gold);letter-spacing:8px;margin:15px 0}.result-stats{display:flex;gap:24px;margin:18px 0}.result-stats strong{display:block;font-size:25px;letter-spacing:-.7px}.result-stats small{display:block;color:var(--muted);font-size:11px}.result-goals{display:flex;gap:12px;justify-content:center;margin:18px 0}.result-goals .goal-chip{flex:0 1 auto;background:#ffffff07;padding:8px 10px}
.scoreboard{width:100%;border-collapse:collapse;font-size:12px;margin:18px 0}.scoreboard th{text-align:left;font-size:9px;color:var(--muted);padding-bottom:9px}.scoreboard td{border-top:1px solid var(--line);padding:11px 2px}.scoreboard tr.me td{color:var(--mint)}.scoreboard td:last-child{text-align:right}
dialog.rankings-dialog{max-width:1020px}.ranking-boards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-top:20px}.ranking-board{padding:16px;border:1px solid var(--line);border-radius:16px;background:#101b2b66;min-width:0}.ranking-board h3{margin-bottom:6px}.ranking-board>div{margin-top:14px}.ranking-board a{text-decoration:underline;text-underline-offset:3px}.ranking-board td:nth-child(2){overflow-wrap:anywhere}.ranking-mine{line-height:1.9}.ranking-mine strong{font-size:26px;color:var(--mint)}
@media(max-width:720px){.ranking-boards{grid-template-columns:1fr}.mode-tabs button{gap:4px;font-size:11px}.mode-tabs button span{font-size:18px}}
.friends-screen{padding:20px 8px 0}.lobby-hero{text-align:center;padding:15px 5px 24px}.lobby-hero h2{font-size:26px;line-height:1.2;letter-spacing:-.7px}.lobby-hero p{font-size:12px;color:var(--muted);margin-top:12px}.lobby-symbol{display:block;font-size:42px;color:var(--mint);margin-bottom:15px}
.lobby-box{border:1px solid var(--line);border-radius:18px;padding:20px;background:var(--panel)}.lobby-box h3{font-size:18px}.lobby-box>p{font-size:12px;color:var(--muted);margin:12px 0}.field-label{display:flex;justify-content:space-between;align-items:center;font-size:13px}.field-label select,input{background:#122431;border:1px solid #ffffff24;color:var(--ink);border-radius:8px;padding:10px;font-size:14px}.check-label{font-size:12px;display:flex;align-items:center;gap:8px;margin:13px 0 20px;min-height:34px}.check-label input{accent-color:var(--mint)}.join-form{display:flex;gap:8px;margin:16px 0}.join-form input{min-width:0;flex:1}
.room-row,.player-row{display:flex;gap:8px;align-items:center;padding:11px 0;border-top:1px solid var(--line);font-size:12px}.room-row strong,.player-row strong{flex:1}.room-row small,.player-row small{font-size:10px;color:var(--muted)}.player-avatar{height:30px;width:30px;flex-shrink:0;border-radius:50%;display:grid;place-items:center;background:#b4efbf15;color:var(--mint)}.player-row.ready .player-avatar{background:var(--mint);color:#19382a}.player-row .text-button{font-size:10px}
.opponents{display:flex;gap:8px;flex-wrap:wrap;margin:8px 0}.opponent{flex:1;min-width:110px;border:1px solid var(--line);border-radius:10px;padding:9px;background:#182c38}.opponent strong{font-size:11px}.opponent small{font-size:10px;color:var(--muted);display:block}.thin-track{height:3px;background:#0b202b;border-radius:5px;margin-top:6px}.thin-track>div{height:100%;background:var(--mint);border-radius:5px}
.toast{position:fixed;bottom:22px;left:50%;transform:translateX(-50%);background:#e1efc9;color:#20382e;padding:12px 18px;border-radius:12px;box-shadow:0 5px 30px #0004;font-size:12px;z-index:1000;max-width:90%;text-align:center;pointer-events:none}.share-field{width:100%;font-size:12px;padding:10px;margin:9px 0}
.skip-link{position:absolute;top:-80px;left:15px;z-index:100;padding:12px;background:var(--gold);color:#223}.skip-link:focus{top:8px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}[hidden]{display:none!important}
@keyframes pop{to{transform:scale(.2);opacity:0;filter:brightness(1.4)}}@keyframes combo{15%,60%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(1.04) translateY(-12px)}}@keyframes hint{50%{filter:brightness(1.3);outline:2px solid #fff4b5;outline-offset:1px}}@keyframes goal-pop{50%{transform:scale(1.2)}}
@media(min-width:760px){.app-shell{padding-top:22px}.town-vista{height:112px}.board-shell{box-shadow:0 20px 100px #020e1c66}.site-header{margin-bottom:8px}.mode-tabs{margin-top:15px}}
@media(max-width:400px){.app-shell{padding:5px 7px 8px}.town-vista{height:82px}.site-header{height:46px}.site-header h1{font-size:22px}.play-hud{gap:6px}.goal-chip{gap:4px;padding:2px}.piece-icon{width:27px;height:29px}.goal-chip .goal-count{font-size:14px}.goal-chip .goal-count span{font-size:10px}.moves-counter{min-width:50px;padding-right:8px}.mission-heading h2{font-size:16px}.coach-card{padding:11px 10px 5px;gap:8px}.coach-picture .piece-icon{width:21px;height:25px}.coach-copy>strong{font-size:13px}}
@media(max-width:350px){.app-shell{padding-left:4px;padding-right:4px}.board-shell{padding:5px}.board{gap:3px;padding:4px}.tile{border-radius:9px}.tile::before{inset:4px;border-radius:6px}.site-header h1{font-size:21px}.playsible span{font-size:10px}.mission-heading{padding:8px 5px}.goal-chip .piece-icon{width:23px;height:25px}.goal-chip .goal-count{font-size:12px}.goals{gap:3px}.play-hud{min-height:65px}.coach-picture{display:none}.coach-card{left:7px;right:7px}.board-tools{gap:6px}.wild-button{min-width:105px;padding:5px 8px}.score-mini{font-size:9px}}
@media(max-height:720px) and (max-width:600px){.town-vista{height:46px;margin-top:0}.app-shell{padding-top:0}.mission-heading{padding-top:7px;padding-bottom:7px}.game-status{margin-top:5px}.mode-tabs{margin-top:5px}.preview-label{padding-top:0}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
/* Targets stay legible even when three fit beside the move counter. */
.goal-chip{flex-direction:column;gap:4px;min-height:55px}.goal-chip .piece-icon{width:30px;height:30px}.goal-chip .goal-count{font-size:16px;line-height:1}.goal-chip .goal-count span{font-size:12px}
.goal-chip:only-child{flex-direction:row;gap:10px}.goal-chip:only-child .piece-icon{width:36px;height:36px}.goal-chip:only-child .goal-count{font-size:20px}.goal-chip:only-child .goal-count span{font-size:14px}
.game-status:empty{display:none}
@media(max-width:350px){.goal-chip{min-height:51px}.goal-chip .piece-icon{width:27px;height:27px}.goal-chip .goal-count{font-size:14px}.goal-chip .goal-count span{font-size:11px}.goal-chip:only-child .piece-icon{width:32px;height:32px}}
@media(max-height:720px) and (max-width:600px){.town-vista{height:32px}.site-header{height:44px}.mission-heading{padding:5px}.play-hud{min-height:60px;padding-bottom:7px}.board-tools{min-height:49px;padding-top:3px}.preview-label{display:none}.mode-tabs{padding-top:2px;margin-top:4px}}
.coach-actions .text-button{min-height:44px}
@media(min-width:760px) and (max-height:850px){.app-shell{max-width:386px;padding-top:2px}.site-header{height:44px;margin-bottom:0}.town-vista{height:48px}.mission-heading{padding:8px 6px}.mode-tabs{margin-top:7px}.board-tools{min-height:50px;padding-top:4px}}

/* Glowtown 2 · mastery, restoration and readable game objects */
.goal-check{display:grid;place-items:center;padding:0;line-height:1;right:0;top:-1px;width:17px;height:17px}
.goal-check svg{width:14px;height:14px;display:block;fill:none;stroke:currentColor;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round}
.town-vista{position:relative}.vista-button{position:absolute;inset:auto 0 0;display:flex;justify-content:space-between;align-items:center;background:linear-gradient(transparent,#0a233a99);padding:16px 11px 6px;color:#e3edcd;font-size:10px;text-align:left;min-height:38px;text-shadow:0 1px 3px #102333}
#vistaNotice.shine{animation:vista-notice 2.3s ease}.mission-heading{gap:7px}.mission-heading h2{margin-right:auto}.star-targets{background:transparent;color:var(--gold);padding:0 5px;min-height:32px;letter-spacing:1px;white-space:nowrap;font-size:12px}.star-targets .missed{color:#748785;opacity:.6}
.tile[data-special="beam-h"],.tile[data-special="beam-v"],.tile[data-special="burst"]{border:2px solid #fff3bc;box-shadow:inset 0 0 0 3px #152d4680,inset 0 2px 1px #fff9,0 0 9px #ffe8b837,0 3px 4px #0006}
.tile[data-special="beam-h"]::after,.tile[data-special="beam-v"]::after{content:'';position:absolute;inset:8px 0;z-index:-1;background:repeating-linear-gradient(0deg,transparent 0 5px,#fff4 5px 9px);border-radius:8px;pointer-events:none}
.tile[data-special="beam-v"]::after{background:repeating-linear-gradient(90deg,transparent 0 5px,#fff4 5px 9px)}
.tile[data-special="burst"]::before{inset:5px;border:2px dashed #fff8;border-radius:50%}
.tile[data-special]:not([data-special=""]) .tile-symbol{opacity:1;filter:drop-shadow(0 1px 2px #092736);z-index:1}
.tile[data-special="burst"] .tile-symbol path,.tile[data-special^="beam-"] .tile-symbol path{fill:#fffde3;stroke:#233b4c;stroke-width:2;stroke-linejoin:round}
.special-glint{position:absolute;top:-7px;right:-5px;color:#fffbe6;font-size:15px;text-shadow:0 0 7px #ffdb85;z-index:4;pointer-events:none}
.tile[data-special="core"]{border:2px solid #fff4ca;background:radial-gradient(circle,#e7faff 0 5%,#263a51 7% 42%,transparent 45%),conic-gradient(#f3bc71,#e998aa,#be9fec,#85cdda,#a9d793,#f3bc71);box-shadow:inset 0 0 0 3px #20314c,0 0 10px #c4ecb85c}
.tile[data-special="core"] .tile-symbol{width:80%;height:80%}.tile[data-special="core"] .spark{fill:#fff!important}
.plate{inset:1px;border-color:#d5e3d6;box-shadow:inset 0 0 0 1px #10253b,0 0 0 2px #425761}.plate.two{border-width:6px}.health-pips{position:absolute;bottom:0;left:0;right:0;color:#fffbe8;font-size:12px;line-height:1.1;text-align:center;text-shadow:0 1px 2px #000;pointer-events:none;z-index:5;letter-spacing:2px}
.wire-frame,.ice-frame,.relay-frame{position:absolute;inset:0;border-radius:10px;pointer-events:none;z-index:2}.wire-frame{inset:1px}.wire-frame svg{width:100%;height:100%;fill:none;stroke:#203e4c;stroke-width:5;filter:drop-shadow(0 0 1px #edee8c)}.wire-frame svg .wire-break{stroke:#fff2a1;stroke-width:2.5}
.ice-frame{background:linear-gradient(130deg,#e0fbff66,transparent 35%,#b8e5ff38);border:3px solid #c9f4ff;box-shadow:inset 0 0 8px #efffff95;backdrop-filter:saturate(.65)}.ice-badge{position:absolute;right:1px;top:0;color:#fff;font-size:14px;text-shadow:0 1px #1d5062;z-index:3;pointer-events:none}
.relay-frame{border:3px solid #f3db99;box-shadow:inset 0 0 0 2px #364b52}.relay-badge{position:absolute;top:-3px;right:-3px;width:20px;height:20px;background:var(--tile-base);border:2px solid #fff6d7;border-radius:50%;display:grid;place-items:center;z-index:4;pointer-events:none}.relay-badge .tile-symbol{width:13px;height:13px}
.tile.steel-box{background:linear-gradient(140deg,#b3c2c6,#6b8994 48%,#3f596b);border:2px solid #d5dfe0;box-shadow:inset 0 2px #fff6,inset 0 -4px #1d394966;cursor:help}.steel-art{width:100%;height:100%;fill:none;stroke:#304c5c;stroke-width:5;pointer-events:none}.steel-art rect{fill:#57798744;stroke:#dee5d6;stroke-width:1}.steel-art circle{fill:#edf1e4;stroke:#526971;stroke-width:1}
.tile.void-cell{opacity:1;background:#091a25;box-shadow:inset 0 2px 8px #030f18;outline:0;border:1px solid #47636b33;cursor:default}.tile.void-cell::before{border:none}.tile.void-cell:hover{filter:none}
.obstacle-icon{background:linear-gradient(145deg,#c4d3d0,#668c94);font-size:26px;line-height:1;color:#253c4b;font-weight:800}.obstacle-icon.wire{background:#edf0ac;color:#3a6467}.obstacle-icon.ice{background:#bdeafa;color:#517b91}.obstacle-icon.relay{background:#f8dfa2}.obstacle-icon.steel{border:2px solid #e5efe7}
.effect-layer{position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:7;border-radius:13px}.blast-effect{position:absolute;pointer-events:none}.beam-horizontal{left:0;right:0;top:var(--y);height:7px;background:#fff9d4;box-shadow:0 0 15px 5px #f6e7a3aa;animation:beam-flash .4s ease-out forwards}.beam-vertical{top:0;bottom:0;left:var(--x);width:7px;background:#fff9d4;box-shadow:0 0 15px 5px #f6e7a3aa;animation:beam-flash .4s ease-out forwards}
.burst-ripple,.core-ripple,.repair-spark{left:var(--x);top:var(--y);border:5px solid #fff4ba;border-radius:50%;width:120px;height:120px;margin:-60px;box-shadow:0 0 30px #fff2c2,inset 0 0 20px #ffed8b88;animation:blast-ring .5s ease-out forwards}.core-ripple{width:320px;height:320px;margin:-160px;border-color:#c5f4e8}.repair-spark{width:55px;height:55px;margin:-27.5px;border:2px dashed #c4f5bf;box-shadow:0 0 12px #c2f7be}
.tile.taking-hit{animation:terrain-hit .25s ease}.map-vista{width:100%;height:auto;aspect-ratio:7/4;object-fit:contain;border-radius:18px}.map-status{margin-top:12px}.map-status strong{color:var(--gold)}.chapter-track{height:5px;background:#0e273a;border-radius:5px;overflow:hidden;margin:8px 0}.chapter-track span{display:block;height:100%;background:var(--mint);transition:width .7s}.gate-copy{font-size:12px;color:var(--muted);margin:8px 0 10px;max-width:52ch}
.chapter-navigation{display:flex;align-items:center;gap:9px;margin:12px 0}.chapter-navigation select{min-width:0;flex:1;background:#1b3443;color:var(--ink);padding:10px;border:1px solid #b8dbc130;border-radius:10px}.level-item.recommended{border:1px solid #c7ecba80;background:#81ad9622}.level-name small{display:block;font-size:10px;color:var(--mint);margin-top:2px}
.chapter-unlock{background:linear-gradient(90deg,#eec67d22,#aadca925);border:1px solid #e9d49055;border-radius:15px;padding:12px;display:flex;gap:12px;align-items:center;margin:12px 0;color:#f6e6b1;animation:chapter-open 1.5s ease-out}.unlock-emblem{display:grid;place-items:center;width:40px;height:40px;border:1px solid #fff3be80;border-radius:50%;font-size:29px;color:var(--gold);animation:unlock-turn 1.6s ease-out}
.result-vista{width:100%;height:auto;aspect-ratio:21/8;border-radius:14px;margin-top:12px}.mastery-hint{font-size:12px;color:var(--gold);text-align:center;margin:4px 0 14px}.result-stars{animation:stars-in .7s cubic-bezier(.2,1.4,.4,1)}
@keyframes blast-ring{from{transform:scale(.2);opacity:.9}to{transform:scale(1.6);opacity:0}}
@keyframes beam-flash{from{transform:scale(.4);opacity:1}to{transform:scale(1.15);opacity:0}}
@keyframes terrain-hit{0%,100%{filter:brightness(1)}50%{filter:brightness(1.8)}}
@keyframes chapter-open{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
@keyframes unlock-turn{from{transform:rotate(-110deg) scale(.3)}to{transform:none}}
@keyframes stars-in{from{transform:scale(.65);opacity:.4}to{transform:scale(1);opacity:1}}
@keyframes vista-notice{0%,100%{color:#e3edcd}20%,70%{color:#fff2a1;text-shadow:0 0 14px #d7ef92}}
@media(max-width:400px){.mission-heading h2{font-size:15px}.star-targets{font-size:11px;padding:0;letter-spacing:0}.goals:has(>.goal-chip:nth-child(4)){gap:1px}.goals:has(>.goal-chip:nth-child(4)) .goal-chip{flex-direction:column;gap:1px;padding:0}.goals:has(>.goal-chip:nth-child(4)) .piece-icon{width:24px;height:24px}.goals:has(>.goal-chip:nth-child(4)) .goal-count{font-size:12px}.goals:has(>.goal-chip:nth-child(4)) .goal-count span{font-size:10px}.vista-button{font-size:9px}.chapter-navigation select{font-size:12px}}
@media(prefers-reduced-motion:reduce){.blast-effect,.special-glint{animation:none}.chapter-unlock,.unlock-emblem,.result-stars,#vistaNotice.shine,.tile.taking-hit{animation:none}.chapter-track span{transition:none}}
/* Keep the board and navigation inside small portrait viewports. */
.mission-heading h2{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}
.star-targets{flex-shrink:0}
@media(max-height:720px) and (max-width:600px){.mode-tabs{margin-top:0;padding-top:0}.board-tools{min-height:46px}}
@media(min-width:760px) and (min-height:851px) and (max-height:950px){.app-shell{max-width:414px;padding-top:8px}.town-vista{height:88px}.site-header{margin-bottom:4px}}

.chapter-receipt{font-size:12px;color:var(--gold);margin:-4px 0 14px;line-height:1.5}

/* 2.1: legible, bounded effects. Each combination draws its actual footprint. */
.vista-button{gap:7px;padding:10px 10px 5px;min-height:32px;background:linear-gradient(transparent,#0a233abd);font-size:10px}
.vista-label{display:flex;align-items:center;gap:5px;min-width:0;flex:1}.vista-bulb{color:#ffe3a0;font-size:14px}.vista-count{flex-shrink:0;font-variant-numeric:tabular-nums;background:#10272d80;color:#f4e6b5;border:1px solid #e4d59738;border-radius:12px;padding:1px 7px;font-size:9px}
.coach-plus{align-self:center;font-size:14px;font-weight:800;color:#446152}
.effect-layer{contain:layout paint}.fx{margin:0;opacity:0;animation-fill-mode:both;will-change:transform,opacity}
.fx.beam-horizontal{height:4px;background:linear-gradient(0deg,#f3d180,#fffbe9,#f3d180);box-shadow:0 0 9px 3px #ffe6a477;transform-origin:var(--origin,50%) 50%;animation:fx-beam-h .49s cubic-bezier(.18,.8,.35,1) both}
.fx.beam-vertical{width:4px;background:linear-gradient(90deg,#f3d180,#fffbe9,#f3d180);box-shadow:0 0 9px 3px #ffe6a477;transform-origin:50% var(--origin,50%);animation:fx-beam-v .49s cubic-bezier(.18,.8,.35,1) both}
.fx.burst-ripple,.fx.core-ripple,.fx.repair-spark,.fx.fx-charge,.fx.fx-convert{left:var(--x);top:var(--y);margin:0;border:2px solid #ffe9b9;border-radius:50%;box-shadow:0 0 13px #ffe4ac88,inset 0 0 15px #ffeda32e;animation:fx-ring .68s ease-out both}
.fx.core-ripple{border-color:#cbf9eb;box-shadow:0 0 15px #9ae9d866,inset 0 0 20px #b1ebe824}
.fx.fx-mega{border:3px solid #ffe9b9;background:radial-gradient(ellipse,#ffdfa52e,transparent 65%)}
.fx.fx-citywide{border-width:5px;background:radial-gradient(ellipse,#b1edd124,transparent 55%);animation-duration:.76s}
.fx.fx-charge{border-color:#fff6d5;animation:fx-charge .46s ease-out both;box-shadow:0 0 13px #ffdfa677}
.fx.fx-convert{border-color:var(--tile-light);box-shadow:0 0 15px var(--tile-base);animation:fx-convert .58s ease-out both}
.fx.fx-link{left:var(--x);top:var(--y);height:2px;background:linear-gradient(90deg,#fff4c2,var(--tile-light,#e3f3ca));box-shadow:0 0 6px 1px #d5f4cd66;transform-origin:0 50%;animation:fx-link .46s ease-out both}
.fx.fx-link::after{content:'';position:absolute;right:-3px;top:-2px;width:6px;height:6px;border-radius:50%;background:#fff5d5;box-shadow:0 0 8px #fff2ca}
.fx.fx-chip{left:var(--x);top:var(--y);width:5px;height:5px;border-radius:2px;background:var(--tile-light,#fff2c1);box-shadow:0 0 6px var(--tile-base,#ecd797);animation:fx-chip .42s ease-out both}
.tile.special-born .tile-symbol{animation:special-born .54s cubic-bezier(.2,.7,.3,1) both}.tile.special-born .special-glint{animation:glint-born .54s ease-out both}
.tile.clearing{animation:clear-soft .22s ease-in both}.tile.taking-hit{animation:terrain-dent .3s ease-out}
.combo-label{top:34%;font-size:clamp(19px,5.3vw,26px);line-height:1.1;padding:0 12px;text-shadow:0 2px 0 #193344,0 0 16px #162b35;filter:none;letter-spacing:.3px}
.combo-label.show{animation:combo-readable .85s ease-out both}
@keyframes fx-beam-h{0%{opacity:0;transform:translateY(-50%) scaleX(.04)}18%{opacity:.9}50%{opacity:.8;transform:translateY(-50%) scaleX(1)}100%{opacity:0;transform:translateY(-50%) scaleX(1)}}
@keyframes fx-beam-v{0%{opacity:0;transform:translateX(-50%) scaleY(.04)}18%{opacity:.9}50%{opacity:.8;transform:translateX(-50%) scaleY(1)}100%{opacity:0;transform:translateX(-50%) scaleY(1)}}
@keyframes fx-ring{0%{opacity:0;transform:translate(-50%,-50%) scale(.15)}16%{opacity:.85}70%{opacity:.4}100%{opacity:0;transform:translate(-50%,-50%) scale(1.05)}}
@keyframes fx-charge{0%{opacity:0;transform:translate(-50%,-50%) scale(1.4)}25%{opacity:.65}70%{opacity:.9;transform:translate(-50%,-50%) scale(.35)}100%{opacity:0;transform:translate(-50%,-50%) scale(.6)}}
@keyframes fx-convert{0%{opacity:0;transform:translate(-50%,-50%) scale(.5)}25%{opacity:.9;transform:translate(-50%,-50%) scale(1.02)}100%{opacity:0;transform:translate(-50%,-50%) scale(1.3)}}
@keyframes fx-link{0%{opacity:0;transform:rotate(var(--angle)) scaleX(.02)}35%{opacity:.85;transform:rotate(var(--angle)) scaleX(1)}100%{opacity:0;transform:rotate(var(--angle)) scaleX(1)}}
@keyframes fx-chip{0%{opacity:.85;transform:translate(-50%,-50%) scale(1)}100%{opacity:0;transform:translate(calc(-50% + var(--dx)),calc(-50% + var(--dy))) rotate(75deg) scale(.2)}}
@keyframes clear-soft{0%{opacity:1;transform:scale(1)}35%{opacity:.85;transform:scale(1.04)}100%{opacity:0;transform:scale(.58)}}
@keyframes special-born{0%{transform:scale(.65);opacity:.3}65%{transform:scale(1.18);opacity:1}100%{transform:scale(1);opacity:1}}
@keyframes glint-born{0%{transform:rotate(-55deg) scale(.2)}65%{transform:rotate(20deg) scale(1.5)}100%{transform:rotate(0) scale(1)}}
@keyframes terrain-dent{0%,100%{filter:brightness(1)}35%{filter:brightness(1.3)}}
@keyframes combo-readable{0%{opacity:0;transform:translateY(6px) scale(.94)}20%,65%{opacity:1;transform:translateY(0) scale(1)}100%{opacity:0;transform:translateY(-8px) scale(1)}}
@media(max-height:720px) and (max-width:600px){.vista-button{padding:2px 8px;min-height:25px}.vista-label{font-size:8px}.vista-count{font-size:8px}}
@media(prefers-reduced-motion:reduce){.fx{display:none!important}.tile.clearing,.tile.taking-hit,.tile.special-born .tile-symbol,.tile.special-born .special-glint,.combo-label.show{animation:none}.tile.clearing{opacity:.55}.combo-label.show{opacity:0}}
