:root{--ink:#253e43;--muted:#81908b;--paper:#f7f5ee;--line:#dfe3da;--teal:#337c72;--coral:#ee9988;--mint:#8bc5b5;--yellow:#eed17c}*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font-family:"DM Sans",Arial,"Noto Sans JP",sans-serif}:where(main, dialog) button{font:inherit;background:none;border:none;color:inherit;cursor:pointer;min-height:44px;border-radius:12px;-webkit-tap-highlight-color:transparent}:where(main, dialog) button:hover{background:#e7eade}:where(main, dialog) button:disabled{opacity:.35;cursor:default}:where(main, dialog) button:focus-visible,:where(main, dialog) a:focus-visible,:where(main, dialog) svg:focus-visible{outline:3px solid #55978b;outline-offset:3px}:where(main, dialog) header{max-width:1450px;margin:auto;height:90px;padding:0 5%;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line)}.brand{font-family:"Space Grotesk",sans-serif;font-weight:700;font-size:22px;letter-spacing:-.8px;text-decoration:none;color:var(--ink);display:flex;align-items:center;gap:11px}.brand-icon{display:grid;grid-template-columns:12px 12px;gap:2px;transform:rotate(-8deg)}.brand-icon i{width:12px;height:12px;background:var(--teal);border-radius:4px}.brand-icon i:last-child{grid-column:2;background:var(--coral)}.tag{font-size:8px;letter-spacing:1px;border:1px solid #cbd5cd;border-radius:5px;padding:5px 7px;margin-left:6px}.header-actions{display:flex;gap:8px;align-items:center}.header-actions button{min-width:44px;font-size:12px}.header-actions #sound{font-size:20px}.header-actions small{font-size:8px;margin-left:3px}#help{border:1px solid var(--line);border-radius:50%;width:44px;font-size:17px}main{max-width:1450px;margin:auto;padding:48px 5% 42px;display:grid;grid-template-columns:minmax(230px,1fr) minmax(330px,480px) 180px;gap:50px;align-items:start}.eyebrow{font-family:"Space Grotesk";font-size:9px;font-weight:500;letter-spacing:1.5px;color:#788e83;display:flex;gap:7px;align-items:center}.eyebrow>span{width:6px;height:6px;background:var(--coral);border-radius:50%}:where(main, dialog) h1{font-size:clamp(36px,3.9vw,56px);line-height:1.35;letter-spacing:-2.5px;font-weight:500;margin:30px 0 20px}:where(main, dialog) h1 em{font-style:normal;color:var(--teal)}#introText{font-size:13px;line-height:2;color:#82908a;margin:0 0 29px}.mode-tabs{display:flex;gap:4px;padding:5px;border:1px solid var(--line);border-radius:14px;max-width:300px}.mode-tabs button{flex:1;padding:10px;font-family:"Space Grotesk";font-size:11px;font-weight:600}.mode-tabs small{display:block;font-size:8px;letter-spacing:1px;margin-top:5px;color:#89988d}.mode-tabs .active{background:var(--teal);color:white}.mode-tabs .active small{color:#bbd9cb}.concept{margin-top:50px;padding-top:25px;border-top:1px solid var(--line);max-width:300px}.concept h3{font-size:14px;font-weight:500;margin:16px 0 10px}.concept p{font-size:12px;line-height:2;color:#859189}.mini-islands{display:flex;gap:4px;align-items:center;height:32px}.mini-islands i{display:block;width:24px;height:24px;border-radius:8px;background:var(--coral)}.mini-islands i:nth-child(2){margin-left:-8px}.mini-islands i:nth-child(3){background:var(--mint);margin-left:12px;width:43px}.mini-islands i:nth-child(4){background:var(--yellow);margin-left:12px}.mini-islands i:nth-child(5){background:var(--yellow);margin-left:-8px}.chapter-progress{margin-top:35px;max-width:240px}.chapter-progress>span{font-family:"Space Grotesk";font-size:22px;letter-spacing:-1px}.chapter-progress>div{height:3px;background:#e1e6db;margin:10px 0}.chapter-progress i{display:block;height:3px;background:var(--teal);width:0}.chapter-progress small{font-size:7px;letter-spacing:1.5px;color:#8c9a8c}.game-heading{display:flex;justify-content:space-between;align-items:center;gap:12px}.game-heading h2{font-size:20px;font-weight:500;margin:9px 0 0;letter-spacing:-.5px}#stages{font-size:21px;padding:0 10px;white-space:nowrap}#stages span{font-size:10px;margin-left:7px}.counters{display:flex;justify-content:space-between;align-items:center;margin:24px 0 14px;padding:0 5px}.counters>div{display:flex;align-items:center;gap:9px}.counters span{font-size:9px;letter-spacing:.6px;color:#8b978b}.counters b{font-family:"Space Grotesk";font-size:26px;font-weight:500;letter-spacing:-1px}.counters .distance{padding:5px 17px;border-radius:50px;background:#e8eddf}.distance b{color:var(--teal);font-size:25px}.target-counter{opacity:.8}.board-shell{padding:0;background:#e5ece5;border-radius:25px;overflow:hidden;border:1px solid #d8e2d7;box-shadow:0 15px 30px #35554c08}.board-row{display:grid;grid-template-columns:38px minmax(0,1fr) 38px;align-items:stretch}.row-controls{display:grid;grid-template-rows:repeat(4,1fr)}.col-controls{display:grid;grid-template-columns:repeat(4,1fr);margin:0 38px}.col-controls button{min-height:34px;height:34px;font-size:19px;color:#72948a;border-radius:8px}.row-controls button{min-height:44px;font-size:20px;color:#72948a;width:38px;border-radius:8px}#board{display:block;width:100%;aspect-ratio:1;touch-action:none;user-select:none;border-radius:16px;overflow:hidden;background:#dce6db}.island-counts{display:flex;gap:10px;margin:16px 0 0}.island-counts>div{flex:1;display:flex;gap:8px;justify-content:center;align-items:center;font-size:11px;padding:11px 5px;border:1px solid var(--line);border-radius:12px;transition:background .25s}.island-counts .done{background:#e7eddf;border-color:#cbdcc8}.island-counts i{height:16px;width:16px;border-radius:6px;display:grid;place-items:center;font-style:normal;font-size:10px;color:#344e46}.island-counts b{font-family:"Space Grotesk";font-size:12px;font-weight:500}.island-counts small{font-size:8px;color:#81917e}#message{font-size:12px;line-height:1.8;min-height:44px;margin:12px 0 6px;color:#7c8c7b}.actions{display:flex;gap:10px}.actions button{flex:1;min-height:49px;border:1px solid #d8dfd1;background:#efefe5;font-size:20px}.actions button span{font-size:11px;margin-left:7px}.actions .hint{background:#d8e8c4;border-color:#ccdcb6}.game-bottom{margin-top:15px;font-size:8px;letter-spacing:.6px;color:#8c9788;display:flex;justify-content:space-between;gap:8px}aside{padding-top:65px}.aside-top{font-family:"Space Grotesk";font-size:13px;letter-spacing:1.4px;line-height:1.8}.aside-top i{font-family:Georgia,serif;font-size:30px;display:block;letter-spacing:-.8px;color:#729580}.sun{display:block;font-size:65px;line-height:1.3;color:#dfb969;margin-top:20px}.rules{margin-top:65px}.rule{display:flex;gap:10px;align-items:start;padding:15px 0;border-top:1px solid var(--line)}.rule b{font-family:"Space Grotesk";font-size:9px;color:#a3ae99;line-height:2}.rule p{font-size:10px;line-height:1.8;margin:0;color:#81917b}.save-note{font-size:8px;color:#97a18f;margin-top:27px}footer{max-width:1305px;margin:auto;display:flex;justify-content:space-between;border-top:1px solid var(--line);padding:24px 0 28px;font-family:"Space Grotesk";font-size:8px;letter-spacing:1.2px;color:#92a08d}footer i{margin:0 8px}dialog{border:1px solid #d6dfcf;border-radius:25px;background:var(--paper);color:var(--ink);padding:35px;width:calc(100% - 32px);max-width:460px;max-height:85dvh;box-shadow:0 25px 90px #254b3933}dialog::backdrop{background:#284b4066;backdrop-filter:blur(5px)}.close{position:absolute;right:10px;top:8px;width:44px;font-size:26px;color:#7d8c79}dialog h2{font-family:"Space Grotesk";font-size:30px;letter-spacing:-1px;font-weight:500;margin:20px 0 10px}dialog p{font-size:13px;line-height:1.9;color:#7e8c79}.modal-kicker{font-family:"Space Grotesk";font-size:9px;letter-spacing:2px;color:#8e9c83}.modal-primary{display:block;width:100%;background:var(--teal);color:white;margin-top:24px;min-height:49px;font-size:13px}.modal-primary:hover{background:#2c6f65}.modal-secondary{display:block;width:100%;font-size:11px;margin-top:8px}.result-symbol{font-size:55px;color:#6f9b79;margin-top:18px}.result-stats{display:flex;border-top:1px solid var(--line);border-bottom:1px solid var(--line);margin:20px 0;padding:15px 0;gap:24px}.result-stats>div{flex:1;font-size:9px;color:#8e9b85}.result-stats b{display:block;font-family:"Space Grotesk";font-size:29px;margin-bottom:4px;font-weight:500;color:var(--ink)}.result-actions{display:flex;gap:10px;margin-top:12px}.result-actions button{flex:1;border:1px solid var(--line);font-size:12px}.level-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:9px;margin-top:23px}.level-grid button{height:66px;border:1px solid var(--line);font-family:"Space Grotesk";font-size:18px}.level-grid button.current{background:#dfebd7;border-color:#a4bfa5}.level-grid small{display:block;font-size:7px;margin-top:4px;letter-spacing:.5px;color:#849673}.help-step{display:flex;gap:15px;margin:20px 0}.help-step>b{font-family:"Space Grotesk";font-size:23px;color:#a7b79b}.help-step p{margin:0}.share-status{font-size:11px;margin-top:10px;overflow-wrap:anywhere}.share-status textarea{width:100%;height:80px;border:1px solid var(--line);background:white;padding:10px;font-size:13px;border-radius:8px}.pop{animation:pop .35s ease-out}@keyframes pop{50%{transform:scale(1.025)}}@media(max-width:1150px){main{grid-template-columns:minmax(240px,1fr) minmax(330px,480px);gap:45px}aside{display:none}footer{margin:0 5%}}@media(max-width:760px){:where(main, dialog) header{height:63px;padding:0 5%}.brand{font-size:18px;gap:8px}.tag{display:none}.header-actions{gap:2px}.header-actions button{min-width:40px}#help{width:40px;min-height:40px}main{display:block;max-width:510px;padding:20px max(16px,5%) 30px}.intro>.eyebrow,#introText,.concept,.chapter-progress{display:none}:where(main, dialog) h1{font-size:23px;letter-spacing:-.8px;line-height:1.35;margin:0 0 15px}:where(main, dialog) h1 br{display:none}:where(main, dialog) h1 em{margin-left:4px}.mode-tabs{max-width:none;margin-bottom:23px}.mode-tabs button{padding:7px;min-height:43px}.mode-tabs small{display:inline;margin-left:7px}.game-heading h2{font-size:18px;margin-top:7px}.counters{margin:16px 0 11px}.counters b{font-size:22px}.counters .distance{padding:4px 13px}.board-row{grid-template-columns:30px minmax(0,1fr) 30px}.row-controls button{width:30px;font-size:17px}.col-controls{margin:0 30px}.col-controls button{min-height:29px;height:29px;font-size:17px}.board-shell{border-radius:20px}.island-counts{gap:8px;margin-top:12px}.island-counts>div{gap:6px;font-size:10px;padding:10px 4px}#message{font-size:11px;min-height:42px;margin-top:10px}.actions{gap:8px}.actions button{min-height:47px}.actions button span{font-size:10px;margin-left:4px}.game-bottom{font-size:7px;letter-spacing:.3px}footer{font-size:6px;letter-spacing:.7px;padding-bottom:max(24px,env(safe-area-inset-bottom))}footer>span:last-child{display:none}dialog{padding:27px}.level-grid{gap:7px}.level-grid button{height:57px;font-size:16px}.level-grid small{font-size:6px}}@media(max-width:360px){.brand{font-size:16px}.header-actions button{min-width:36px}.brand-icon{transform:scale(.85)}:where(main, dialog) h1{font-size:22px}.row-controls button{min-height:44px}.level-grid{grid-template-columns:repeat(3,1fr)}}@media(prefers-reduced-motion:reduce){:where(main,dialog) *{animation:none!important;scroll-behavior:auto!important}}.board-row{grid-template-columns:44px minmax(0,1fr) 44px}.row-controls button{width:44px;min-width:44px}.col-controls{margin-left:44px;margin-right:44px}.col-controls button{height:44px;min-height:44px}.chapter-tabs{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin:20px 0}.chapter-tabs button{font-size:11px;border:1px solid var(--line);min-height:44px;padding:4px}.chapter-tabs .active{background:var(--teal);color:white}.chapter-title{font-size:17px;margin:24px 0 0}.chapter-navigation{display:flex;justify-content:space-between;gap:16px;margin-top:24px}.chapter-navigation button{font-size:12px;padding:8px}.level-grid button.cleared{border-color:#8ab49d}.difficulty-note{font-size:11px!important}.game-heading>div{min-width:0}.game-heading h2{overflow-wrap:anywhere}.modal-kicker{padding-right:24px}dialog h2{overflow-wrap:anywhere}@media(max-width:760px){.chapter-progress{display:block;margin:0 0 20px;max-width:none}.chapter-progress>span{font-size:16px}.chapter-progress small{display:none}.chapter-progress>div{margin:6px 0}.mode-tabs{margin-bottom:16px}}@media(max-width:360px){dialog{padding:24px 18px}.chapter-tabs{gap:5px}.chapter-tabs button{font-size:10px}.level-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:5px}.level-grid small{font-size:6px;letter-spacing:0}.header-actions button{min-width:44px}.brand{font-size:14px;gap:4px}.brand-icon{display:none}}
@media(max-width:360px){.level-grid,.chapter-tabs{grid-template-columns:repeat(4,minmax(0,1fr))}.level-grid small{font-size:8px}.chapter-tabs{gap:8px}}@media(min-width:361px) and (max-width:760px){.level-grid small{font-size:8px;letter-spacing:0}}/* Compact sequential journey */
.intro,aside,footer{display:none!important}:where(main, dialog) header{height:56px;padding:0 16px;max-width:500px}.brand{font-size:17px}.tag{display:none}.header-actions button,#help{min-width:44px;min-height:44px;width:44px}main{display:block;max-width:470px;padding:10px 16px 16px;margin:auto}.game{width:100%}.chapter-progress{display:block!important;max-width:none;margin:0 0 8px}.chapter-progress>span{font-size:12px;letter-spacing:0}.chapter-progress small{display:none}.chapter-progress>div{height:2px;margin:4px 0}.game-heading h2{font-size:16px;margin:3px 0 0}.eyebrow{font-size:8px;letter-spacing:.8px}.counters{margin:8px 0}.counters b{font-size:22px}.counters .distance{padding:3px 12px}.board-shell{width:min(100%,calc(100dvh - 275px));min-width:266px;margin:auto;border-radius:18px}.island-counts{display:none}#message{font-size:10px;line-height:1.4;min-height:28px;margin:8px 0 4px}.actions{gap:8px}.actions button{min-height:44px}.game-bottom{margin-top:8px;font-size:8px}.inline-result{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:10px;min-height:48px}.inline-result[hidden]{display:none}.inline-result strong{display:block;font-size:20px;color:var(--teal)}.inline-result small{display:block;font-size:10px;margin-top:3px}.inline-result .modal-primary{width:auto;min-width:132px;margin:0;padding:10px 14px;min-height:44px}.game:has(.inline-result:not([hidden])) #message{display:none}.game:has(.inline-result:not([hidden])) .actions{margin-top:8px}.game:has(.inline-result:not([hidden])) .board-shell{width:min(100%,calc(100dvh - 300px))}@media(max-width:360px){.brand{font-size:14px}.brand-icon{display:none}main{padding-left:12px;padding-right:12px}.inline-result strong{font-size:17px}}@media(max-height:600px){:where(main, dialog) header{height:48px}main{padding-top:6px}.game-bottom{display:none}.board-shell{min-width:266px}}.chapter-progress{display:none!important}.inline-result{justify-content:center;margin:6px 0;min-height:40px;text-align:center}.inline-result strong{font-size:30px;font-weight:700;letter-spacing:1px}.game-bottom{display:none}.header-actions #lang{width:auto;min-width:44px;white-space:nowrap;padding:0 7px}.actions .hint{background:var(--teal);color:#fff;border-color:var(--teal)}.actions .hint span{font-size:12px}.game:has(.inline-result:not([hidden])) .actions{margin-top:8px}.game:has(.inline-result:not([hidden])) .board-shell{width:min(100%,calc(100dvh - 280px))}@media(max-width:360px){.inline-result strong{font-size:27px}.actions .hint span{font-size:11px}}.actions .hint{white-space:nowrap;padding:0 4px;font-size:14px}.actions .hint span{margin-left:3px}/* Fixed-height stage/status row */
#message,#stageName{display:none!important}.game-heading{display:grid;grid-template-columns:85px minmax(0,1fr) 88px;gap:6px;height:44px;min-height:44px;align-items:center}.game-heading>div{min-width:0}#stageLabel{font-size:13px;letter-spacing:0;font-weight:600;white-space:nowrap}.game-heading .inline-result{display:flex;min-height:0;height:44px;margin:0;align-items:center;justify-content:center;overflow:hidden}.game-heading .inline-result[hidden]{display:flex;visibility:hidden}.game-heading .inline-result strong{font-size:clamp(15px,4vw,20px);line-height:1.2;letter-spacing:0;white-space:nowrap}#stages{padding:0 4px;font-size:19px}#stages span{font-size:10px;margin-left:3px}.actions,.game:has(.inline-result:not([hidden])) .actions{margin-top:10px}.board-shell,.game:has(.inline-result:not([hidden])) .board-shell{width:min(100%,calc(100dvh - 240px))}@media(max-width:360px){.game-heading{grid-template-columns:76px minmax(0,1fr) 76px;gap:4px}#stageLabel{font-size:12px}.game-heading .inline-result strong{font-size:15px}#stages span{font-size:9px}}/* Interaction restrictions apply only to the playable game section. */
.game{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;touch-action:pan-y}.game *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}.game #board{touch-action:none}.game button{touch-action:manipulation}/* Minimal English-only header; instructions and audio below play. */
:where(main, dialog) header{height:38px;min-height:38px;justify-content:center;border-bottom:0;padding:0 16px}.brand{font-size:13px!important;letter-spacing:1.7px;font-weight:600}.brand-icon,.header-actions,#lang{display:none!important}main{padding-top:4px;padding-bottom:12px}.game-info{max-width:438px;margin:0 auto;padding:16px 0 24px;border-top:1px solid var(--line);color:#78877e}.game-info h2{font-size:10px;letter-spacing:1.6px;font-weight:600;margin:0 0 10px}.game-info p{font-size:11px;line-height:1.65;margin:5px 0}.game-info small{font-size:9px}.bottom-settings{display:flex;align-items:center;gap:16px;margin:10px 0}.bottom-settings #sound{font-size:14px;min-height:44px;padding:0 12px;min-width:100px;border:1px solid var(--line)}.bottom-settings #sound:before{content:"SOUND ";font-size:10px;letter-spacing:1px}.bottom-settings #sound small{font-size:10px}.bottom-settings #help{width:44px;height:44px;min-height:44px}.board-shell,.game:has(.inline-result:not([hidden])) .board-shell{width:min(100%,calc(100dvh - 280px))}@media(max-width:470px){.game-info{margin:0 16px;padding-bottom:max(20px,env(safe-area-inset-bottom))}}/* Title ribbon and inline,initially collapsed instructions. */
:where(main, dialog) header{background:var(--teal,#327c75);height:38px;color:#fff}:where(main, dialog) header .brand{color:#fff}.game-info{padding-top:4px}.game-info summary{list-style:none;cursor:pointer;min-height:44px;display:flex;align-items:center;justify-content:space-between;font-size:10px;letter-spacing:1.6px;font-weight:600;color:#435d58}.game-info summary::-webkit-details-marker{display:none}.game-info summary::after{content:"+";font-size:18px;letter-spacing:0}.game-info details[open] summary::after{content:"−"}.game-info summary:focus-visible{outline:2px solid #327c75;outline-offset:2px}.instruction-content{padding:0 0 10px}.bottom-settings{margin-top:2px}#instructions #help{width:100%;height:auto;min-height:44px;border:0;border-radius:0;font-size:10px;white-space:nowrap;text-align:left}/* Completion colors persist independently of the selected stage. */
.level-grid button.cleared{background:#d3eade;border-color:#7eae94;color:#245b44}.level-grid button.perfect{background:#f5df9b;border-color:#c4a346;color:#65501b}.level-grid button.cleared small,.level-grid button.perfect small{color:inherit}.level-grid button.current{outline:2px solid #285d57;outline-offset:3px}#modal,#modal *{touch-action:pan-y}.copyright,footer.copyright{display:block!important;text-align:center;font-size:10px;letter-spacing:.6px;color:#718078;padding:16px 8px;margin:0 auto;border:0}#modal .copyright{padding-bottom:0;margin-top:12px}/* SVG focus outlines can leave clipped paint on iOS after disclosure reflow.
   The selected-cell marker already provides the board's keyboard focus cue. */
#board:focus,#board:focus-visible{outline:none;box-shadow:none}#instructions summary{-webkit-tap-highlight-color:transparent}

