:root{--bg: #f2f2f0;--surface: #ffffff;--ink: #1c1c1e;--muted: #66666c;--line: #d2d2d6;--tile: #e3e3e6;--tile-edge: #8a8a92;--good: #17703d;--bad: #cf3027;--gold: #c99700;--chip: #ebebee;--pulse-fill: #cbcbd3;color-scheme:light dark}@media(prefers-color-scheme:dark){:root:not([data-theme=light]){--bg: #141416;--surface: #212125;--ink: #f1f1f3;--muted: #a2a2aa;--line: #3a3a40;--tile: #35353b;--tile-edge: #6c6c76;--good: #3ecf80;--bad: #ff6b61;--gold: #f0bf2f;--chip: #2c2c31;--pulse-fill: #4d4d56}}*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}html,body{margin:0;background:var(--bg);color:var(--ink)}body{font:16px/1.35 -apple-system,BlinkMacSystemFont,SF Pro Text,system-ui,sans-serif;-webkit-text-size-adjust:100%}#app{max-width:480px;margin:0 auto;padding:max(12px,env(safe-area-inset-top)) 16px max(20px,env(safe-area-inset-bottom));min-height:100dvh}button{font:inherit;color:inherit;background:var(--surface);border:1px solid var(--line);border-radius:12px;min-height:44px;padding:0 16px;cursor:pointer}button.primary{background:var(--ink);color:var(--bg);border-color:var(--ink);font-weight:600}button:disabled{opacity:.4;cursor:default}button:focus-visible,summary:focus-visible{outline:3px solid var(--ink);outline-offset:2px}.muted{color:var(--muted)}.row{display:flex;gap:8px;align-items:center}.grow{flex:1}h1,h2,h3{margin:0}.top{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.target{display:flex;flex-direction:column;line-height:1}.target small{font-size:13px;color:var(--muted);margin-bottom:4px}.target b{font-size:56px;font-weight:700;letter-spacing:-1px}.meta{text-align:right;display:flex;flex-direction:column;gap:2px}.counter{font-size:18px;font-weight:600}.clock{font-size:28px;font-variant-numeric:tabular-nums;color:var(--muted)}.clock.red{color:var(--bad)}.leave{min-height:36px;padding:0 10px;font-size:14px;margin-top:4px}.caption{min-height:28px;margin:6px 0 2px;font-size:15px;font-weight:500;text-align:center}.caption:empty:before{content:" "}.caption button{margin-left:8px}.rules{margin:2px 0 6px;font-size:14px;color:var(--muted)}.rules summary{min-height:32px;display:flex;align-items:center;cursor:pointer}.rules ul{margin:2px 0 6px;padding-left:18px}.board{display:flex;justify-content:center;align-items:center;min-height:140px;margin:4px 0 10px}.board svg{touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;overflow:visible}.tile polygon{fill:var(--tile);stroke:var(--tile-edge);stroke-width:1;transition:fill .12s}.lbl{pointer-events:none;transform-box:fill-box;transform-origin:center}.lbl text{fill:var(--ink);font-weight:700;-webkit-user-select:none;user-select:none}.lbl .sign{fill:var(--ink);transition:opacity .2s}.lbl.dropped .sign{opacity:0}.tile.sel polygon{stroke:var(--ink);stroke-width:4}.tile.reach polygon{stroke:var(--ink);stroke-width:2.5;stroke-dasharray:5 4}.tile.pulse polygon{fill:var(--pulse-fill);stroke:var(--ink);stroke-width:4;stroke-dasharray:1 7;stroke-linecap:round;animation:beat 1.4s infinite}.trail{fill:none;stroke:var(--ink);stroke-opacity:.5;stroke-width:8;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}.tile{transform-box:fill-box;transform-origin:center}.tile.shake,.lbl.shake{animation:shake .28s}.tile.shake polygon{stroke:var(--bad);stroke-width:3}.tile.flash-ok polygon{animation:fok .28s}.tile.flash-bad polygon{animation:fbad .28s}.tile.flash-repeat polygon{animation:frep .28s}@keyframes shake{0%,to{transform:translate(0)}20%{transform:translate(-6px)}45%{transform:translate(6px)}70%{transform:translate(-4px)}}@keyframes fok{0%{fill:var(--good)}to{fill:var(--tile)}}@keyframes fbad{0%{fill:var(--bad)}to{fill:var(--tile)}}@keyframes frep{0%{fill:var(--muted)}to{fill:var(--tile)}}@keyframes beat{0%,22%,to{stroke-width:4}11%{stroke-width:9}}.tape{list-style:none;margin:0;padding:0;min-height:96px;max-height:210px;overflow:auto;border-top:1px solid var(--line)}.tape li{padding:6px 2px;border-bottom:1px solid var(--line);font-size:17px;font-variant-numeric:tabular-nums}.tape .bound{background:var(--chip);border-radius:6px;padding:0 5px;margin:0 -1px;box-shadow:inset 0 -2px 0 var(--tile-edge)}.tape .ok{color:var(--good);font-weight:700}.tape .no{color:var(--bad);font-weight:700;margin-left:6px}.tape .not{color:var(--muted)}.tape .chip{margin-left:8px;font-size:13px;background:var(--bad);color:var(--bg);border-radius:8px;padding:1px 7px}.tape .free{margin-left:8px;font-size:13px;color:var(--muted)}.tape li.msg{color:var(--muted);font-style:italic}.hintbar{margin-top:10px}.hintbar button{width:100%}button.hint.lit{background:var(--ink);color:var(--bg);border-color:var(--ink)}.result h2{font-size:28px}.stars{font-size:44px;letter-spacing:6px;color:var(--gold);line-height:1.1}.stars .off{color:var(--line)}.card{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:14px;margin:12px 0}.minis{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:8px}.mini{text-align:center;font-size:14px}.mini svg{max-width:100%;height:auto}.mini polygon{fill:var(--tile);stroke:var(--tile-edge);stroke-width:1}.mini text{fill:var(--ink);font-weight:700;paint-order:stroke;stroke:var(--tile);stroke-width:3px}.mini polyline{fill:none;stroke:var(--ink);stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:.45}.mini circle{fill:var(--ink)}.actions{display:flex;gap:10px;margin-top:14px}.actions button{flex:1}.title{font-size:26px;font-weight:700;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;touch-action:manipulation;padding:6px 0}.next{width:100%;text-align:left;padding:14px 16px;min-height:72px}.next b{display:block;font-size:20px}.chapter{margin:12px 0}.chapter h3{display:flex;justify-content:space-between;font-size:17px;margin-bottom:6px}.cells{display:grid;grid-template-columns:repeat(6,1fr);gap:6px}.cells button{min-height:44px;padding:0;font-size:14px;line-height:1.1}.cells button .st{color:var(--gold);font-size:11px;display:block;letter-spacing:1px;min-height:12px}.cells button.locked{opacity:.35}.shapeline{height:56px;width:auto;display:block;margin:6px 0}.shapeline polygon{fill:var(--tile);stroke:var(--tile-edge)}.gold{color:var(--gold)}.stline{color:var(--ink)}.stline .gold{letter-spacing:1px}.debug table{width:100%;border-collapse:collapse;font-size:13px;font-variant-numeric:tabular-nums}.debug th,.debug td{text-align:left;padding:4px;border-bottom:1px solid var(--line)}.debug .line{font-size:20px;font-weight:700;margin:8px 0}.debug pre{max-height:120px;overflow:auto;font-size:11px;background:var(--surface);padding:6px;border-radius:8px}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}.tile.shake,.lbl.shake{animation:none}}.home h3:not(.chapter h3){margin-top:14px}.next small{color:inherit;opacity:.75}.card .tape{max-height:none;min-height:0;margin-top:6px}.tile.faded,.lbl.faded{opacity:.35}.leftline{font-size:13px;color:var(--muted);margin-top:2px}.hintbar{display:flex;gap:10px;align-items:center}.hintbar button{flex:1;width:auto}.meter{display:flex;gap:4px}.meter i{width:14px;height:30px;border-radius:4px;border:2px solid var(--ink)}.meter i.on{background:var(--ink)}.timeup{text-align:right;font-size:14px;display:flex;flex-direction:column;gap:4px;align-items:flex-end}.timeup .row button{min-height:38px;padding:0 12px}.donebtn{min-height:36px;padding:0 10px;font-size:14px;margin-top:4px}.sub{font-weight:600;margin:10px 0 2px;font-size:14px;color:var(--muted)}.islandmap{overflow:auto;max-height:70dvh;border-radius:14px;border:1px solid var(--line);background:#2a85ad;-webkit-overflow-scrolling:touch}.islandmap svg{display:block}.plot.slide{animation:slidein .28s ease-out}@keyframes slidein{0%{transform:translateY(-40px);opacity:0}to{transform:none;opacity:1}}@media(prefers-reduced-motion:reduce){.plot.slide{animation:none}}.gap{height:10px}.switch{display:flex;gap:10px;align-items:center;min-height:44px;margin:8px 0}.switch input{width:24px;height:24px}.welcome p,.settings p{margin:12px 0}.goal textarea{font:inherit;padding:8px;border-radius:10px;border:1px solid var(--line);background:var(--bg);color:var(--ink)}
