/* そろばんクエスト。前半は ゆびそろばん（Artifact）の スタイルを そのまま 引き継いだ もの */
:root{
  --bg:#EAF3F7; --surface:#FFFFFF; --ink:#1D2B3A; --muted:#5A6D7E; --line:#C8D7E1;
  --thumb:#0B9384; --thumb-soft:#CDEFEA; --index:#D12F76; --index-soft:#FAD8E6;
  --sun:#FFB81F; --sun-soft:#FFF1CC; --good:#23914A;
  --wood:#6A3E21; --wood-hi:#8C5532; --tray:#F6E9CF; --rod:#CDB88F; --beam:#3B2415; --dot:#F6E4BF;
  --b1a:#F4BB63; --b1b:#B06C1C; --b5a:#5A78D6; --b5b:#26377A;
  --hand:#FFE2C4; --skin:#F7C9A0; --sleeve:#3FA2DB;
  --f-display:"Mochiy Pop One","Hiragino Maru Gothic ProN","Zen Maru Gothic",sans-serif;
  --f-body:"Zen Maru Gothic","Hiragino Maru Gothic ProN","Hiragino Sans",sans-serif;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#0F1C27; --surface:#182A38; --ink:#E8F0F5; --muted:#9DB1C1; --line:#2B4254;
    --thumb:#2FC6B4; --thumb-soft:#123C38; --index:#FF5E9F; --index-soft:#47182E;
    --sun:#FFC845; --sun-soft:#3D3212; --good:#4CC474;
    --tray:#2C2219; --dot:#F6E4BF; --hand:#F0CDAA; --skin:#E8B98F; --sleeve:#2E7FB0;
    color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --bg:#0F1C27; --surface:#182A38; --ink:#E8F0F5; --muted:#9DB1C1; --line:#2B4254;
  --thumb:#2FC6B4; --thumb-soft:#123C38; --index:#FF5E9F; --index-soft:#47182E;
  --sun:#FFC845; --sun-soft:#3D3212; --good:#4CC474;
  --tray:#2C2219; --dot:#F6E4BF; --hand:#F0CDAA; --skin:#E8B98F; --sleeve:#2E7FB0;
  color-scheme:dark;
}
*,*::before,*::after{box-sizing:border-box}
[hidden]{display:none!important}
html,body{height:100%}
body{background:var(--bg);color:var(--ink);font-family:var(--f-body);font-weight:500;font-size:16px;line-height:1.6;
  padding-inline:16px;-webkit-tap-highlight-color:transparent}
button{font:inherit;color:inherit;cursor:pointer}
button:focus-visible,.bead:focus-visible{outline:3px solid var(--sun);outline-offset:2px}
.app{max-width:560px;margin-inline:auto;padding-block:14px 24px}
h1,h2,h3{font-family:var(--f-display);font-weight:400;text-wrap:balance;margin:0}

/* ---------- home ---------- */
.hero{display:flex;align-items:center;gap:14px;padding-block:6px 14px}
.hero .mascot{width:92px;flex:none}
.hero h1{font-size:clamp(34px,9vw,48px);line-height:1.1;letter-spacing:.02em}
.hero p{margin:4px 0 0;color:var(--muted);font-weight:700}
.rules{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:8px;margin-block:4px 18px}
.rule{background:var(--surface);border-radius:14px;padding:10px 6px 8px;text-align:center;font-size:13px;font-weight:700;line-height:1.35;
  display:flex;flex-direction:column;align-items:center;gap:4px;border:2px solid transparent}
.rule.t{border-color:var(--thumb)} .rule.i{border-color:var(--index)}
.rule svg{width:40px;height:44px}
.rule b{font-size:14px}
.rule.t b{color:var(--thumb)} .rule.i b{color:var(--index)}
.rule.b{border-color:var(--sun)}
.sec-h{font-size:18px;margin-block:4px 10px;display:flex;justify-content:space-between;align-items:baseline}
.sec-h small{font-family:var(--f-body);font-size:13px;color:var(--muted);font-weight:700}
.stages{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.tile{background:var(--surface);border:2px solid var(--line);border-radius:16px;padding:10px 6px 8px;display:flex;flex-direction:column;align-items:center;gap:4px;
  min-width:0;transition:transform .12s}
.tile:hover{transform:translateY(-2px)}
.tile:active{transform:scale(.97)}
.tile.next{border-color:var(--sun);box-shadow:0 0 0 3px var(--sun-soft)}
.tile .num{width:54px;height:34px}
.tile .nm{font-size:12.5px;font-weight:700;line-height:1.3;text-align:center;min-height:2.6em}
.tile .st{display:flex;gap:1px}
.tile .st svg{width:15px;height:15px}
.modes{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:16px}
.mode{border:none;border-radius:18px;padding:14px 12px;text-align:left;display:flex;flex-direction:column;gap:2px;min-width:0}
.mode.speed{background:var(--ink);color:var(--bg)}
.mode.free{background:var(--surface);border:2px solid var(--line)}
.mode b{font-family:var(--f-display);font-weight:400;font-size:17px}
.mode span{font-size:13px;opacity:.8;font-weight:700}
.foot{margin-top:18px;color:var(--muted);font-size:12.5px;text-align:center}

/* ---------- play ---------- */
.bar{display:flex;align-items:center;gap:10px;padding-bottom:8px}
.icon-btn{width:40px;height:40px;border-radius:12px;border:2px solid var(--line);background:var(--surface);display:grid;place-items:center;flex:none}
.icon-btn svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.bar .ttl{flex:1;min-width:0}
.bar .ttl b{display:block;font-family:var(--f-display);font-weight:400;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dots{display:flex;gap:5px;margin-top:3px}
.dots i{width:18px;height:6px;border-radius:3px;background:var(--line)}
.dots i.done{background:var(--good)} .dots i.now{background:var(--sun)}
.talk{display:flex;align-items:center;gap:8px;min-height:62px}
.talk .mascot{width:62px;flex:none}
.bubble{position:relative;background:var(--surface);border-radius:14px;padding:8px 12px;font-weight:700;font-size:15px;line-height:1.45;flex:1;min-width:0}
.bubble::before{content:"";position:absolute;left:-8px;top:50%;margin-top:-8px;border:8px solid transparent;border-right-color:var(--surface);border-left:0}
.bubble .ft{color:var(--thumb)} .bubble .fi{color:var(--index)}
.q{display:flex;align-items:baseline;justify-content:center;gap:10px;padding-block:6px 4px;min-height:64px;flex-wrap:wrap}
.q-num{font-family:var(--f-display);font-size:44px;line-height:1.1;font-variant-numeric:tabular-nums}
.q-ans{font-family:var(--f-display);font-size:44px;line-height:1.1;color:var(--good)}
.q-lab{font-weight:900;color:var(--muted);font-size:15px}
.q .hud{display:flex;gap:14px;font-weight:900;font-size:15px;color:var(--muted);width:100%;justify-content:center}
.q .hud b{font-family:var(--f-display);font-weight:400;color:var(--ink);font-size:20px;font-variant-numeric:tabular-nums}
.board{display:flex;justify-content:center}
#soro{width:100%;max-width:420px;max-height:44vh;touch-action:manipulation;user-select:none;-webkit-user-select:none}
.bead{cursor:pointer;transition:transform .16s cubic-bezier(.3,1.5,.55,1)}
.bead .bp{stroke:rgba(0,0,0,.35);stroke-width:1.5}
.bead.off{opacity:.38;cursor:default}
.bead .bi.shake{animation:shake .38s}
@keyframes shake{20%{transform:translateX(-7px)}40%{transform:translateX(6px)}60%{transform:translateX(-4px)}80%{transform:translateX(2px)}}
#ring,#ring2{pointer-events:none;transition:transform .16s}
#ring path,#ring2 path{fill:none;stroke-width:5;animation:pulse 1s ease-in-out infinite}
#ring.t path,#ring2.t path{stroke:var(--thumb)} #ring.i path,#ring2.i path{stroke:var(--index)}
@keyframes pulse{50%{stroke-opacity:.35}}
.rodlab{font-family:var(--f-display);font-size:17px;fill:var(--muted)}
.rodlab.on{fill:var(--ink)}
.fingers{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px;margin-top:10px}
.finger{border:3px solid var(--line);background:var(--surface);border-radius:18px;padding:8px 8px 6px;display:flex;align-items:center;justify-content:center;gap:8px;
  transition:transform .1s, background .15s}
.finger svg{width:44px;height:50px;flex:none}
.finger .fl{display:flex;flex-direction:column;align-items:flex-start;line-height:1.2}
.finger .fl b{font-family:var(--f-display);font-weight:400;font-size:17px}
.finger .fl small{font-size:12px;color:var(--muted);font-weight:700}
.finger.thumb[aria-pressed="true"]{background:var(--thumb-soft);border-color:var(--thumb)}
.finger.index[aria-pressed="true"]{background:var(--index-soft);border-color:var(--index)}
.finger.thumb[aria-pressed="true"] b{color:var(--thumb)}
.finger.index[aria-pressed="true"] b{color:var(--index)}
.finger.both[aria-pressed="true"]{background:linear-gradient(90deg,var(--thumb-soft),var(--index-soft));border-color:var(--sun)}
.finger.both .fl b{font-size:15px}
.finger.nudge{animation:nudge .5s 2}
@keyframes nudge{30%{transform:translateY(-8px) scale(1.04)}60%{transform:translateY(0)}}
kbd{font-family:var(--f-body);font-size:11px;border:1px solid var(--line);border-radius:4px;padding:0 4px;color:var(--muted)}
.tools{display:flex;justify-content:center;gap:10px;margin-top:10px}
.pill{border:2px solid var(--line);background:var(--surface);border-radius:999px;padding:6px 16px;font-weight:900;font-size:14px;display:inline-flex;align-items:center;gap:6px}
.pill svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.pill[aria-pressed="true"]{border-color:var(--sun);background:var(--sun-soft)}
.readout{font-family:var(--f-display);font-size:52px;line-height:1.1;font-variant-numeric:tabular-nums}

/* hand drawing */
.h{fill:var(--hand);stroke:var(--ink);stroke-width:2.6;stroke-linejoin:round}
.h.t-on{fill:var(--thumb)} .h.i-on{fill:var(--index)}

/* mascot */
.mascot .eye-h,.mascot .mouth-o{display:none}
.mascot.happy .eye-n{display:none} .mascot.happy .eye-h{display:inline}
.mascot.oops .mouth-n{display:none} .mascot.oops .mouth-o{display:inline}
.mascot.hop{animation:hop .45s}
@keyframes hop{40%{transform:translateY(-10px)}}

/* card / modal */
.veil{position:fixed;inset:0;background:rgba(10,20,30,.55);display:grid;place-items:center;padding:16px;z-index:10}
.card{background:var(--surface);border-radius:24px;padding:22px 20px 18px;width:100%;max-width:420px;text-align:center;display:flex;flex-direction:column;gap:12px;align-items:center;
  animation:pop .25s cubic-bezier(.3,1.5,.55,1)}
@keyframes pop{from{transform:scale(.85);opacity:0}}
.card h2{font-size:22px;line-height:1.35}
.card p{margin:0;font-weight:700;line-height:1.7;max-width:34ch}
.card .hands{display:flex;gap:14px;justify-content:center}
.card .hands svg{width:74px;height:84px}
.card .big-stars{display:flex;gap:6px}
.card .big-stars svg{width:48px;height:48px}
.card .score{font-family:var(--f-display);font-size:52px;line-height:1}
.card .btns{display:flex;gap:10px;flex-wrap:wrap;justify-content:center;margin-top:4px}
.btn{border:none;border-radius:14px;padding:11px 20px;font-weight:900;font-size:16px;background:var(--ink);color:var(--bg)}
.btn.sub{background:transparent;border:2px solid var(--line);color:var(--ink)}
.star-on{fill:var(--sun);stroke:var(--sun)} .star-off{fill:none;stroke:var(--line)}
.star-on,.star-off{stroke-width:2;stroke-linejoin:round}
/* ---------- flash ---------- */
.mode.flash{grid-column:1/-1;background:var(--sun-soft);border:2px solid var(--sun);flex-direction:row;align-items:center;gap:12px}
.mode.flash .fl-ico{width:48px;height:48px;flex:none;border-radius:12px;background:var(--ink);color:var(--sun);display:grid;place-items:center;font-family:var(--f-display);font-size:24px}
.mode.flash div{display:flex;flex-direction:column;min-width:0}
.lvs{display:flex;gap:6px;overflow-x:auto;padding-block:4px 8px;scrollbar-width:none}
.lv{flex:none;width:44px;height:44px;border-radius:12px;border:2px solid var(--line);background:var(--surface);font-family:var(--f-display);font-size:17px;position:relative}
.lv[aria-pressed="true"]{border-color:var(--ink);background:var(--ink);color:var(--bg)}
.lv.clear::after{content:"✓";position:absolute;right:-4px;top:-6px;font-size:11px;font-family:var(--f-body);font-weight:900;background:var(--good);color:#fff;border-radius:50%;width:16px;height:16px;display:grid;place-items:center}
.fl-meta{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;font-weight:900;font-size:14px}
.fl-meta .spec{font-family:var(--f-display);font-weight:400;font-size:16px}
.screen{position:relative;margin-top:8px;background:var(--ink);color:var(--bg);border-radius:20px;min-height:min(46vh,340px);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;overflow:hidden;padding:12px}
.screen .big{font-family:var(--f-display);font-size:clamp(72px,24vw,150px);line-height:1;font-variant-numeric:tabular-nums;letter-spacing:.02em}
.screen .cap{font-weight:900;font-size:15px;opacity:.75}
.screen svg.mini{width:min(60%,240px);height:auto;transition:opacity .2s}
.screen .res{display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center}
.screen .res .verdict{font-family:var(--f-display);font-size:30px}
.screen .res .verdict.ok{color:var(--good)} .screen .res .verdict.ng{color:var(--index)}
.screen .res .nums{font-weight:700;font-size:15px;opacity:.85;max-width:32ch;line-height:1.6;font-variant-numeric:tabular-nums}
.screen .res .btns{display:flex;gap:8px;flex-wrap:wrap;justify-content:center;margin-top:4px}
.screen .btn{background:var(--bg);color:var(--ink)}
.screen .btn.sub{background:transparent;border:2px solid var(--bg);color:var(--bg)}
.answer{display:flex;flex-direction:column;gap:8px;margin-top:10px}
.ans-box{background:var(--surface);border:3px solid var(--line);border-radius:16px;min-height:60px;display:flex;align-items:center;justify-content:flex-end;padding:4px 16px;font-family:var(--f-display);font-size:36px;font-variant-numeric:tabular-nums}
.ans-box.wait{color:var(--muted);font-family:var(--f-body);font-weight:900;font-size:15px;justify-content:center}
.pad{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.pad button{border:2px solid var(--line);background:var(--surface);border-radius:14px;padding:10px 0;font-family:var(--f-display);font-size:24px}
.pad button:active{transform:scale(.96)}
.pad button.go{background:var(--ink);color:var(--bg);border-color:var(--ink);font-family:var(--f-body);font-weight:900;font-size:17px}
.pad button.del{font-family:var(--f-body);font-weight:900;font-size:15px}
.pad button:disabled{opacity:.4}
.streak{display:flex;gap:6px;align-items:center;font-weight:900;font-size:13px;color:var(--muted)}
.streak i{width:22px;height:8px;border-radius:4px;background:var(--line)} .streak i.on{background:var(--good)}

/* ---------- simulation ---------- */
.mode.demo{grid-column:1/-1;background:var(--thumb-soft);border:2px solid var(--thumb);flex-direction:row;align-items:center;gap:12px}
.mode.demo svg{width:48px;height:54px;flex:none}
.mode.demo div{display:flex;flex-direction:column;min-width:0}
.bar .ttl small{font-size:12px;color:var(--muted);font-weight:700}
.sim-form{display:flex;gap:8px}
.sim-form input{flex:1;min-width:0;font-family:var(--f-display);font-size:20px;padding:6px 12px;border-radius:12px;border:2px solid var(--line);background:var(--surface);color:var(--ink)}
.sim-form input:focus-visible{outline:3px solid var(--sun);outline-offset:1px}
.chips{display:flex;gap:6px;overflow-x:auto;padding-block:8px;scrollbar-width:none}
.chip{flex:none;border:2px solid var(--line);background:var(--surface);border-radius:999px;padding:2px 12px;font-weight:900;font-size:14px;font-variant-numeric:tabular-nums}
.expr{display:flex;justify-content:center;align-items:baseline;gap:4px;flex-wrap:wrap;font-family:var(--f-display);font-size:30px;line-height:1.3;min-height:46px;font-variant-numeric:tabular-nums}
.expr .t{color:var(--muted);padding:0 5px;border-radius:10px}
.expr .t.cur{color:var(--ink);background:var(--sun-soft)}
.expr .ans{color:var(--good)}
#simSoro{width:100%;max-width:540px;max-height:50vh}
.sim-bead{transition:transform var(--press,300ms) ease-in-out}
.sim-bead .bp{stroke:rgba(0,0,0,.35);stroke-width:1.5}
.fo,.ff{fill:none;stroke-linecap:round;stroke-linejoin:round}
.fo{stroke:var(--ink)} .ff{stroke:var(--skin)}
.fo.i{stroke-width:27} .ff.i{stroke-width:21}
.fo.t{stroke-width:31} .ff.t{stroke-width:25}
.fo.c{stroke-width:25} .ff.c{stroke-width:19}
.palm{fill:var(--skin);stroke:var(--ink);stroke-width:3}
.crease{fill:none;stroke:var(--ink);stroke-opacity:.35;stroke-width:2;stroke-linecap:round}
.sleeve{fill:var(--sleeve);stroke:var(--ink);stroke-width:3;stroke-linejoin:round}
.cuff{fill:none;stroke:var(--ink);stroke-opacity:.35;stroke-width:3}
.nail{fill:#fff;fill-opacity:.55;stroke:var(--ink);stroke-opacity:.25;stroke-width:1.2}
#hand{opacity:.93;filter:drop-shadow(5px 8px 5px rgba(0,0,0,.22))}
.glow{fill:none;stroke-width:4;animation:pulse .8s ease-in-out infinite}
.glow.t{stroke:var(--thumb)} .glow.i{stroke:var(--index)}
.rodlab.cur{fill:var(--index)}
.ctrls{display:flex;justify-content:center;align-items:center;gap:8px;flex-wrap:wrap;margin-top:8px}
.pill.main{background:var(--ink);color:var(--bg);border-color:var(--ink);padding-inline:20px}
.pill:disabled{opacity:.45;cursor:default}
.seg{display:inline-flex;border:2px solid var(--line);border-radius:999px;overflow:hidden}
.seg button{border:0;background:var(--surface);padding:6px 11px;font-weight:900;font-size:13px}
.seg button[aria-pressed="true"]{background:var(--sun-soft)}
.steps{position:relative;list-style:none;margin:12px 0 0;padding:6px;max-height:230px;overflow-y:auto;background:var(--surface);border-radius:16px}
.steps li{display:flex;gap:8px;align-items:flex-start;padding:5px 8px;border-radius:10px;font-size:14px;font-weight:700;line-height:1.45;color:var(--muted)}
.steps li.done{color:var(--ink)}
.steps li.cur{background:var(--sun-soft);color:var(--ink)}
.steps li.say{font-weight:900}
.fc{flex:none;width:12px;height:12px;border-radius:50%;margin-top:5px;background:var(--line)}
.fc.thumb{background:var(--thumb)} .fc.index{background:var(--index)}
.fc.pinch,.fc.scissor{background:linear-gradient(90deg,var(--thumb) 50%,var(--index) 50%)}
.legend{display:flex;justify-content:center;gap:14px;font-size:12.5px;font-weight:700;color:var(--muted);margin-top:6px;flex-wrap:wrap}
.legend span{display:inline-flex;align-items:center;gap:5px}
.legend .fc{margin:0}
#fx{position:fixed;inset:0;pointer-events:none;z-index:20;width:100%;height:100%}
@media (prefers-reduced-motion: reduce){ *{animation:none!important;transition:none!important} }
@media (max-width:540px){ .finger{flex-direction:column;gap:2px;padding:6px 4px} .finger .fl{align-items:center} .finger .fl small{display:none} .finger svg{width:38px;height:42px} }
@media (max-width:380px){ .q-num,.q-ans{font-size:38px} .finger .fl b,.finger.both .fl b{font-size:14px} }

/* ================= そろばんクエスト で 足した もの ================= */
.app{max-width:620px}
a{color:inherit}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;text-decoration:none;cursor:pointer}
.btn.big{font-size:18px;padding:15px 22px;border-radius:18px;width:100%}
.btn.small-btn{font-size:14px;padding:8px 14px}
.page{max-width:560px;margin-inline:auto;padding-block:28px 40px}
.page.center{text-align:center;display:flex;flex-direction:column;align-items:center;gap:14px}
.hero-c{text-align:center;display:flex;flex-direction:column;align-items:center;gap:4px;margin-bottom:22px}
.mascot.big{width:132px}
.eyebrow{margin:6px 0 0;font-weight:900;color:var(--thumb);font-size:14px;letter-spacing:.06em}
.logo{font-family:var(--f-display);font-weight:400;font-size:clamp(44px,13vw,64px);line-height:1.05;margin:4px 0}
.lead{font-weight:900;font-size:17px;margin:4px 0 0}
.stack{display:flex;flex-direction:column;gap:10px;margin-block:8px 16px}
.small{font-size:13px;color:var(--muted);font-weight:700;line-height:1.7}
.notice{background:var(--sun-soft);border:2px solid var(--sun);border-radius:14px;padding:10px 14px;font-weight:700;font-size:14px}
.foot-link{text-align:center;margin-top:26px;font-size:13px;font-weight:700;color:var(--muted)}
.h1{font-family:var(--f-display);font-weight:400;font-size:28px;margin:0 0 14px}
.h2{font-family:var(--f-display);font-weight:400;font-size:19px;margin:0 0 8px}
.kids{display:flex;flex-direction:column;gap:10px;margin-bottom:24px}
.kid{width:100%;display:flex;align-items:center;gap:12px;background:var(--surface);border:2px solid var(--line);border-radius:20px;padding:12px 14px;text-align:left}
.kid:hover{border-color:var(--sun)}
.kid-av{width:52px;height:52px;flex:none;border-radius:16px;display:grid;place-items:center;font-family:var(--f-display);font-size:24px;color:#fff;background:hsl(var(--h) 55% 50%)}
.kid-nm{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.35}
.kid-nm b{font-family:var(--f-display);font-weight:400;font-size:20px}
.kid-nm small{color:var(--muted);font-weight:700;font-size:13px}
.kid-go{background:var(--ink);color:var(--bg);font-weight:900;border-radius:12px;padding:8px 14px;font-size:15px}
.box{background:var(--surface);border-radius:20px;padding:16px 18px;font-size:14px;font-weight:700;line-height:1.7}
.box p{margin:0 0 12px}
.mt{margin-top:10px}
.qr{background:#fff;border-radius:20px;padding:14px;width:min(78vw,300px)}
.qr svg{width:100%;height:auto;display:block}
.url{font-size:12px;word-break:break-all;color:var(--muted);max-width:100%}

/* ---- home ---- */
.topbar{display:flex;align-items:center;gap:10px;padding-block:4px 10px}
.topbar .who{display:flex;align-items:center;gap:10px;flex:1;min-width:0}
.topbar .av{width:42px;height:42px;border-radius:13px;display:grid;place-items:center;font-family:var(--f-display);font-size:20px;color:#fff;background:hsl(var(--h,200) 55% 50%);flex:none}
.topbar .nm{font-family:var(--f-display);font-size:19px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tag-guest{font-size:12px;font-weight:900;background:var(--sun-soft);border:2px solid var(--sun);border-radius:999px;padding:1px 10px;white-space:nowrap}
.lvcard{background:var(--ink);color:var(--bg);border-radius:22px;padding:14px 16px 12px;display:grid;grid-template-columns:auto 1fr;gap:4px 14px;align-items:center}
.lvcard .lvn{grid-row:span 2;font-family:var(--f-display);font-size:16px;line-height:1;text-align:center}
.lvcard .lvn b{display:block;font-size:44px;font-weight:400;line-height:1}
.lvcard .ttl{font-family:var(--f-display);font-size:18px;line-height:1.2}
.expbar{height:12px;border-radius:6px;background:rgba(255,255,255,.18);overflow:hidden;position:relative}
.expbar i{position:absolute;inset:0 auto 0 0;background:var(--sun);border-radius:6px;transition:width .6s ease}
.lvcard .sub{grid-column:1/-1;font-size:13px;font-weight:700;opacity:.85;display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap}
.wall{display:inline-flex;align-items:center;gap:4px;color:var(--sun)}
.wall svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}
.today{display:flex;align-items:center;gap:12px;background:var(--surface);border-radius:18px;padding:10px 12px;margin-top:10px}
.today .meter{flex:1;min-width:0}
.today .meter b{font-size:14px}
.today .meter small{display:block;color:var(--muted);font-weight:700;font-size:12px}
.meterbar{height:10px;border-radius:5px;background:var(--line);overflow:hidden;margin-top:4px;position:relative}
.meterbar i{position:absolute;inset:0 auto 0 0;background:var(--good);border-radius:5px}
.meterbar em{position:absolute;top:-2px;bottom:-2px;width:3px;background:var(--ink);border-radius:2px}
.stamp-btn{flex:none;border:2px solid var(--line);background:var(--surface);border-radius:14px;padding:4px 8px;display:flex;flex-direction:column;align-items:center;font-size:11px;font-weight:900;gap:0}
.stamp-btn svg{width:38px;height:38px}
.hw{display:flex;align-items:center;gap:10px;background:var(--thumb-soft);border:2px solid var(--thumb);border-radius:18px;padding:10px 12px;margin-top:10px}
.hw.done{background:var(--surface);border-color:var(--line)}
.hw .hw-t{flex:1;min-width:0;font-weight:700;font-size:14px;line-height:1.45}
.hw .hw-t b{display:block;font-size:12px;color:var(--thumb);font-weight:900}
.hw.done .hw-t b{color:var(--good)}
.hw .btn{padding:8px 14px;font-size:14px}
.area{margin-top:22px}
.area-h{display:flex;align-items:baseline;gap:4px 8px;margin-bottom:6px;flex-wrap:wrap}
.area-h h2{white-space:nowrap}
.area-h h2{font-size:20px}
.area-h small{font-size:12.5px;color:var(--muted);font-weight:700}
.area-h .st{margin-left:auto;font-size:12px;font-weight:900;background:var(--surface);border-radius:999px;padding:1px 10px;color:var(--muted)}
.path{position:relative;padding-block:6px}
.path::before{content:"";position:absolute;left:50%;top:18px;bottom:18px;border-left:4px dashed var(--line);transform:translateX(-2px)}
.node{position:relative;display:flex;align-items:center;gap:10px;width:min(78%,330px);margin-block:8px;background:var(--surface);border:3px solid var(--line);border-radius:20px;padding:8px 12px 8px 8px;text-align:left}
.node:nth-child(4n+1){margin-left:0} .node:nth-child(4n+2){margin-left:11%} .node:nth-child(4n+3){margin-left:22%} .node:nth-child(4n+4){margin-left:11%}
.node .no{width:44px;height:44px;flex:none;display:grid;place-items:center;font-family:var(--f-display);font-size:19px;border-radius:14px;background:var(--line);color:var(--ink)}
.node .nn{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.3}
.node .nn b{font-size:14.5px}
.node .nn small{font-size:11.5px;color:var(--muted);font-weight:700}
.node .mk{flex:none;width:26px;height:26px}
.node .mk svg{width:26px;height:26px}
.node.cleared{border-color:var(--sun)}
.node.cleared .no{background:var(--sun);color:#3a2a00}
.node.current{border-color:var(--thumb);box-shadow:0 0 0 4px var(--thumb-soft);animation:bob 1.8s ease-in-out infinite}
.node.current .no{background:var(--thumb);color:#fff}
.node.locked{opacity:.55;border-style:dashed;cursor:default}
.node.hw::after{content:"しゅくだい";position:absolute;right:10px;top:-11px;font-size:11px;font-weight:900;background:var(--index);color:#fff;border-radius:999px;padding:0 8px}
.node.soon{opacity:.5;border-style:dashed;cursor:default}
@keyframes bob{50%{transform:translateY(-3px)}}
.here{position:absolute;left:-6px;top:-12px;font-size:11px;font-weight:900;background:var(--thumb);color:#fff;border-radius:999px;padding:0 8px}
.side{display:grid;grid-template-columns:1fr;gap:10px;margin-top:24px}
.tower{display:flex;align-items:center;gap:12px;border:2px solid var(--sun);background:var(--sun-soft);border-radius:20px;padding:12px 14px;text-align:left;width:100%}
.tower .ico{width:50px;height:50px;flex:none;border-radius:14px;background:var(--ink);color:var(--sun);display:grid;place-items:center;font-family:var(--f-display);font-size:24px}
.tower div{display:flex;flex-direction:column;min-width:0}
.tower b{font-family:var(--f-display);font-weight:400;font-size:18px}
.tower span{font-size:13px;font-weight:700;opacity:.85}
.play3{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.play3 button{border:2px solid var(--line);background:var(--surface);border-radius:16px;padding:10px 6px;display:flex;flex-direction:column;align-items:center;gap:4px;font-weight:900;font-size:13px;line-height:1.3;min-width:0}
.play3 svg{width:34px;height:34px}
.sec-t{font-family:var(--f-display);font-size:17px;margin:20px 0 8px}

/* ---- gate ---- */
.gate-head{display:flex;flex-direction:column;gap:2px;margin-bottom:10px}
.gate-head .area-n{font-size:13px;font-weight:900;color:var(--muted)}
.gate-head h2{font-size:24px;line-height:1.3}
.gate-st{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}
.chipx{font-size:12px;font-weight:900;border-radius:999px;padding:2px 10px;background:var(--surface);border:2px solid var(--line)}
.chipx.ok{border-color:var(--sun);background:var(--sun-soft)}
.chipx.hw{border-color:var(--index);color:var(--index)}
.rulebox{background:var(--surface);border-radius:20px;padding:14px;display:flex;gap:12px;align-items:flex-start}
.rulebox .hands{display:flex;gap:4px;flex:none}
.rulebox .hands svg{width:46px;height:52px}
.rulebox h3{font-size:17px;line-height:1.4;margin-bottom:4px}
.rulebox p{margin:0;font-size:14.5px;font-weight:700;line-height:1.75}
.acts{display:grid;gap:10px;margin-top:14px}
.act{display:flex;align-items:center;gap:12px;border-radius:20px;padding:14px;text-align:left;border:2px solid var(--line);background:var(--surface);width:100%}
.act .ai{width:46px;height:46px;flex:none;border-radius:14px;display:grid;place-items:center}
.act .ai svg{width:26px;height:26px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.act div{display:flex;flex-direction:column;min-width:0}
.act b{font-family:var(--f-display);font-weight:400;font-size:19px}
.act span{font-size:13px;font-weight:700;color:var(--muted)}
.act.see .ai{background:var(--thumb-soft);color:var(--thumb)}
.act.prac .ai{background:var(--sun-soft);color:#9a6a00}
.act.chal{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.act.chal span{color:inherit;opacity:.8}
.act.chal .ai{background:var(--sun);color:var(--ink)}

/* ---- board の 問題表示 ---- */
.mit{display:flex;flex-wrap:wrap;justify-content:center;gap:6px;width:100%}
.mit span{font-family:var(--f-display);font-size:26px;line-height:1.3;padding:0 8px;border-radius:10px;color:var(--muted);font-variant-numeric:tabular-nums}
.mit span.cur{color:var(--ink);background:var(--sun-soft)}
.mit span.done{color:var(--ink);opacity:.45}
.mit .eq{color:var(--good)}
.mulq{display:flex;flex-direction:column;align-items:center;gap:2px;width:100%}
.mulq .big{font-family:var(--f-display);font-size:36px;line-height:1.2}
.mulq .stp{font-weight:900;font-size:15px;background:var(--sun-soft);border-radius:10px;padding:2px 10px}
.mode-tag{font-size:11px;font-weight:900;border-radius:999px;padding:1px 8px;background:var(--sun);color:var(--ink);margin-left:6px;vertical-align:2px}

/* ---- pad ---- */
.prompt{margin-top:8px;background:var(--surface);border-radius:20px;min-height:min(36vh,260px);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:14px;text-align:center}
.prompt .pq{font-family:var(--f-display);font-size:clamp(36px,11vw,58px);line-height:1.2;font-variant-numeric:tabular-nums}
.prompt .pq .box2{display:inline-block;min-width:1.2em;border:4px dashed var(--line);border-radius:12px;padding:0 6px;color:var(--good)}
.prompt .cap{font-weight:900;color:var(--muted);font-size:15px}
.prompt svg.mini{width:min(56%,200px);height:auto}
.prompt .fb{font-family:var(--f-display);font-size:24px}
.prompt .fb.ok{color:var(--good)} .prompt .fb.ng{color:var(--index)}
.paper{font-family:var(--f-display);font-size:26px;line-height:1.35;text-align:right;font-variant-numeric:tabular-nums;border-right:3px solid var(--ink);padding-right:10px;display:inline-block}
.paper .ln{border-top:3px solid var(--ink);margin-top:4px;padding-top:2px;color:var(--good);min-height:1.3em}
.realhint{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:900;color:var(--muted)}

/* ---- result / stamp ---- */
.card .gain{font-family:var(--f-display);font-size:34px;color:var(--good);line-height:1.1}
.card .gain small{font-size:16px;color:var(--ink)}
.card .stats{display:flex;gap:16px;justify-content:center;font-weight:900;font-size:14px;color:var(--muted)}
.card .stats b{display:block;font-family:var(--f-display);font-weight:400;font-size:24px;color:var(--ink)}
.card .lvbig{font-family:var(--f-display);font-size:64px;line-height:1}
.card .hanko{width:150px;height:150px;animation:hanko .5s cubic-bezier(.3,1.6,.5,1)}
@keyframes hanko{0%{transform:scale(2.2) rotate(-18deg);opacity:0}60%{transform:scale(.92) rotate(-8deg);opacity:1}100%{transform:scale(1) rotate(-8deg)}}
.stamps-top{display:flex;align-items:center;justify-content:space-between;gap:10px}
.cal{display:grid;grid-template-columns:repeat(7,1fr);gap:6px;margin-top:8px}
.cal .dw{text-align:center;font-size:12px;font-weight:900;color:var(--muted)}
.cal .d{aspect-ratio:1;background:var(--surface);border-radius:12px;position:relative;display:flex;align-items:flex-start;justify-content:flex-start;padding:3px 5px;font-size:11px;font-weight:900;color:var(--muted);min-width:0}
.cal .d.today{outline:3px solid var(--sun)}
.cal .d.blank{background:transparent}
.cal .d svg{position:absolute;inset:12% 8% 4% 8%;width:84%;height:84%}
.legend2{display:flex;gap:14px;justify-content:center;font-size:12.5px;font-weight:700;color:var(--muted);margin-top:10px;flex-wrap:wrap}
.legend2 span{display:inline-flex;align-items:center;gap:4px}
.legend2 svg{width:22px;height:22px}
.toast{position:fixed;left:50%;top:14px;transform:translateX(-50%);background:var(--ink);color:var(--bg);font-weight:900;border-radius:999px;padding:6px 16px;z-index:30;font-size:15px;animation:toast 1.6s ease forwards;pointer-events:none}
@keyframes toast{0%{opacity:0;transform:translate(-50%,-8px)}15%,75%{opacity:1;transform:translate(-50%,0)}100%{opacity:0}}
.lock-svg{fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
@media (max-width:420px){ .node{width:84%} .node:nth-child(4n+3){margin-left:16%} .node:nth-child(4n+2),.node:nth-child(4n+4){margin-left:8%} }
