/* KAMIHIRAKI styles (kept out of index.html so the Content-Security-Policy can forbid inline code) */
:root{
  --bg:#ebe6db; --bgr:235,230,219; --panel:rgba(250,248,243,.94); --ink:#1f2629; --sub:#5d6468; --line:rgba(31,38,41,.14);
  --accent:#d9483b; --gold:#d79b1f; --blue:#2f6fd6;
  --safe-t:env(safe-area-inset-top,0px); --safe-b:env(safe-area-inset-bottom,0px);
  --safe-l:env(safe-area-inset-left,0px); --safe-r:env(safe-area-inset-right,0px);
  --vw:100vw; --vh:100vh; /* the screen size as seen inside zoomed UI (larger text) */
}
*{box-sizing:border-box}
html,body{margin:0;height:100%;overflow:hidden;background:var(--bg);color:var(--ink);overscroll-behavior:none;touch-action:manipulation;
  font-family:system-ui,-apple-system,"Segoe UI","Hiragino Sans","Hiragino Kaku Gothic ProN","Noto Sans JP","Yu Gothic UI",Meiryo,sans-serif;
  -webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-font-smoothing:antialiased;
  -webkit-text-size-adjust:100%;text-size-adjust:100%}
:lang(ja) body{word-break:keep-all;overflow-wrap:anywhere;line-break:strict}
#c{position:fixed;inset:0;width:100%;height:100%;display:block;touch-action:none;outline:none}
button{font:inherit;color:inherit;cursor:pointer;border:0;background:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
button:focus-visible,a:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
.hidden{display:none!important}
svg{display:block}

/* ---- play HUD ---- */
.bar{position:fixed;left:0;right:0;display:flex;align-items:center;pointer-events:none;z-index:5}
.bar>*{pointer-events:auto}
#top{top:0;padding:calc(10px + var(--safe-t)) calc(12px + var(--safe-r)) 8px calc(12px + var(--safe-l));justify-content:space-between;gap:8px}
.grp{display:flex;gap:8px}
.ic{width:46px;height:46px;flex:none;border-radius:50%;background:var(--panel);border:1px solid var(--line);display:grid;place-items:center;
  box-shadow:0 2px 10px rgba(30,30,25,.10);transition:transform .12s,opacity .2s}
.ic:active{transform:scale(.93)}
.ic:disabled{opacity:.38;cursor:default}
.ic svg{width:22px;height:22px}
.ttl{flex:1;min-width:0;text-align:center;background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:6px 12px;
  box-shadow:0 2px 10px rgba(30,30,25,.08);max-width:340px}
button.ttl{display:block;font:inherit;color:inherit;cursor:pointer}
button.ttl.histable #lvFolds::after{content:"";display:inline-block;width:.62em;height:.62em;margin-left:.35em;vertical-align:.02em;
  border:1.6px solid currentColor;border-radius:50%;opacity:.7;box-sizing:border-box;
  background:linear-gradient(currentColor,currentColor) 50% 18%/1.4px 38% no-repeat,linear-gradient(currentColor,currentColor) 62% 50%/30% 1.4px no-repeat}
/* the fold history: a strip of small pictures under the top bar */
#histStrip{position:fixed;left:50%;transform:translateX(-50%);top:calc(64px + var(--safe-t));z-index:7;width:min(calc(var(--vw) - 16px),720px);
  background:var(--panel);border:1px solid var(--line);border-radius:18px;box-shadow:0 8px 28px rgba(30,30,25,.18);padding:8px 44px 8px 8px}
#histStrip .hhead{font-size:12px;color:var(--sub);padding:0 4px 6px;font-weight:650}
#histStrip .hlist{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;padding-bottom:2px}
#histStrip .hlist::-webkit-scrollbar{display:none}
#histStrip .hitem{flex:none;width:76px;display:flex;flex-direction:column;align-items:center;gap:3px;padding:5px 3px 6px;border-radius:12px;border:1.5px solid transparent}
#histStrip .hitem img{width:64px;height:64px;border-radius:8px;background:rgba(var(--bgr),.55)}
#histStrip .hitem span{font-size:11px;line-height:1.2;color:var(--sub);white-space:nowrap;max-width:72px;overflow:hidden;text-overflow:ellipsis;font-variant-numeric:tabular-nums}
#histStrip .hitem.on{border-color:var(--ink);background:rgba(31,38,41,.06)}
#histStrip .hitem.on span{color:var(--ink);font-weight:750}
#histStrip .hitem.later{opacity:.5}
#histStrip .hitem.later img{outline:1.5px dashed rgba(31,38,41,.35);outline-offset:-1.5px}
#histStrip .hclose{position:absolute;right:6px;top:6px;width:34px;height:34px;border-radius:50%;display:grid;place-items:center;color:var(--sub)}
#histStrip .hclose svg{width:18px;height:18px}
/* the gallery viewer's tools for handling the work (right side) */
#vwTools{position:fixed;right:calc(10px + var(--safe-r));top:50%;transform:translateY(-50%);display:flex;flex-direction:column;gap:6px;
  background:var(--panel);border:1px solid var(--line);border-radius:18px;padding:6px;box-shadow:0 4px 18px rgba(30,30,25,.14);pointer-events:auto}
#vwTools .tool{width:64px;min-height:54px;border-radius:13px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
  font-size:11px;font-weight:700;color:var(--sub);padding:4px 2px}
#vwTools .tool svg{width:22px;height:22px}
#vwTools .tool.on{background:var(--ink);color:#fff}
#vwTools .tool span{line-height:1.15;text-align:center}
@media (max-width:560px){#vwTools{top:calc(70px + var(--safe-t));transform:none}#vwTools .tool{width:56px;min-height:48px;font-size:10px}#vwTools .tool svg{width:20px;height:20px}}
/* Create: turning the work held up or standing */
#objPad{position:fixed;right:calc(10px + var(--safe-r));top:50%;transform:translateY(-50%);z-index:6;display:flex;flex-direction:column;gap:6px;
  background:var(--panel);border:1px solid var(--line);border-radius:18px;padding:6px;box-shadow:0 4px 18px rgba(30,30,25,.14)}
#objPad .tool{width:64px;min-height:52px;border-radius:13px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
  font-size:11px;font-weight:700;color:var(--sub);padding:4px 2px}
#objPad .tool svg{width:22px;height:22px}
#objPad .tool.on{background:var(--ink);color:#fff}
#objPad .tool span{line-height:1.15;text-align:center}
@media (max-width:560px){#objPad{top:calc(70px + var(--safe-t));transform:none}#objPad .tool{width:56px;min-height:46px;font-size:10px}}
/* ---- paper planes ---- */
#plane{pointer-events:none}
#plane>*{pointer-events:auto}
#plBack{position:absolute;left:calc(12px + var(--safe-l));top:calc(10px + var(--safe-t))}
.pltop{position:absolute;left:calc(66px + var(--safe-l));right:calc(12px + var(--safe-r));top:calc(10px + var(--safe-t));display:flex;gap:8px;align-items:stretch;pointer-events:none}
.plcard{flex:1;min-width:0;background:var(--panel);border:1.5px solid var(--line);border-radius:14px;padding:6px 10px;display:flex;flex-direction:column;gap:1px;box-shadow:0 2px 10px rgba(30,30,25,.08)}
.plcard .nm{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.plcard.p1 .nm{color:#b8392d}.plcard.p2 .nm{color:#2f4f8f}
.plcard .pn{font-size:11.5px;color:var(--sub);font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.plcard .pts{font-size:13px;letter-spacing:2px;color:var(--ink)}
.plcard .last{font-size:12px;color:var(--sub);font-variant-numeric:tabular-nums;min-height:1.2em}
.plcard.turn{border-color:var(--ink);box-shadow:0 0 0 2px rgba(31,38,41,.14)}
.plmid{flex:none;width:clamp(112px,26vw,170px);background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:6px 8px;text-align:center;box-shadow:0 2px 10px rgba(30,30,25,.08)}
#plRound{font-size:12.5px;font-weight:750;line-height:1.25}
#plWind{display:flex;align-items:center;justify-content:center;gap:6px;margin-top:3px;font-size:12px;color:var(--sub);font-variant-numeric:tabular-nums}
#plWind i{display:block;width:16px;height:16px;flex:none;background:no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f2629' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20V4M6 10l6-6 6 6'/%3E%3C/svg%3E")}
#plCall{position:absolute;left:50%;top:38%;transform:translate(-50%,-50%);pointer-events:none;text-align:center;white-space:pre-line;font-weight:850;
  font-size:clamp(22px,5.4vw,36px);color:#fff;text-shadow:0 2px 12px rgba(0,0,0,.45);font-variant-numeric:tabular-nums}
#plCall.ready{font-size:clamp(18px,4.4vw,26px)}
#plCall.land,#plCall.end{animation:pop .5s cubic-bezier(.2,1.6,.4,1)}
#plCall.live{top:22%;font-size:clamp(20px,5vw,30px)}
.plaim{position:absolute;left:50%;transform:translateX(-50%);bottom:calc(12px + var(--safe-b));width:min(460px,calc(var(--vw) - 20px));background:var(--panel);
  border:1px solid var(--line);border-radius:20px;padding:10px 10px 8px;box-shadow:0 4px 18px rgba(30,30,25,.14);display:grid;grid-template-columns:1fr 1fr auto;gap:4px 8px;align-items:center}
.plgauge{display:flex;flex-direction:column;align-items:center;gap:1px;min-width:0;font-size:12px;font-weight:700;color:var(--sub)}
.plgauge b{color:var(--ink);font-variant-numeric:tabular-nums}
.plgauge svg{width:100%;max-width:150px;aspect-ratio:4/3;touch-action:none;cursor:grab;background:rgba(31,38,41,.04);border-radius:12px}
.plgauge svg path,.plgauge svg circle{fill:none;stroke-linecap:round;stroke-linejoin:round}
.plgauge .gnd{stroke:rgba(31,38,41,.35);stroke-width:2}
.plgauge .arc{stroke:rgba(31,38,41,.2);stroke-width:7}
.plgauge .tk path{stroke:rgba(31,38,41,.4);stroke-width:1.5}
.plgauge .hall{stroke:rgba(31,38,41,.18);stroke-width:2}
.plgauge .mid{stroke:rgba(31,38,41,.18);stroke-width:1.5;stroke-dasharray:3 4}
.plgauge .ndl{stroke:var(--ink);stroke-width:3}
.plgauge .pl{fill:#d9483b;stroke:var(--ink);stroke-width:1}
.plgauge .knob{fill:#d9483b;stroke:var(--ink);stroke-width:1.5}
.plthrow{position:relative;width:104px;height:104px;border-radius:50%;background:var(--ink);color:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;
  touch-action:none;-webkit-user-select:none;user-select:none;box-shadow:0 4px 14px rgba(30,30,25,.25)}
.plthrow svg{position:absolute;inset:0;width:100%;height:100%}
.plthrow .bg{fill:none;stroke:rgba(255,255,255,.18);stroke-width:7}
.plthrow .ring{fill:none;stroke:#e9b54a;stroke-width:7;stroke-linecap:round}
.plthrow b{position:relative;font-size:16px;font-weight:850}
.plthrow small{position:relative;font-size:11px;opacity:.85;font-variant-numeric:tabular-nums}
.plthrow.charging{transform:scale(1.04)}
.plthrow:focus-visible{outline:3px solid var(--blue);outline-offset:3px}
.plhelp{grid-column:1/-1;margin:0;font-size:11.5px;color:var(--sub);text-align:center}
#plEnd{position:absolute;left:50%;transform:translateX(-50%);bottom:calc(16px + var(--safe-b));width:min(380px,calc(var(--vw) - 32px));background:var(--panel);
  border:1px solid var(--line);border-radius:18px;padding:12px;box-shadow:0 4px 18px rgba(30,30,25,.14)}
#plRes{white-space:pre-line;font-size:13px;margin:0 0 8px;text-align:center}
#plRes:empty{display:none}
@media (max-width:560px){.plthrow{width:88px;height:88px}.plaim{gap:3px 6px;padding:8px 8px 6px}.pltop{left:calc(64px + var(--safe-l));gap:5px}.plmid{width:96px;padding:5px 4px}#plRound{font-size:11px}#plWind{font-size:10.5px;gap:3px}.plcard{padding:5px 7px}.plcard .nm{font-size:12px}}
/* the versus setup: the games as cards */
.segopt.games{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;background:none;padding:0}
.segopt.games button{display:flex;flex-direction:column;align-items:center;gap:3px;padding:9px 4px 8px;border-radius:14px;border:1.5px solid var(--line);background:#fff;height:auto;min-height:84px;white-space:normal}
.segopt.games button svg{width:30px;height:30px}
.segopt.games button b{font-size:13.5px}
.segopt.games button small{font-size:11px;color:var(--sub);font-weight:600;line-height:1.25}
.segopt.games button.on{border-color:var(--ink);background:var(--ink);color:#fff}
.segopt.games button.on small{color:rgba(255,255,255,.8)}
#lvName{font-weight:750;font-size:15px;letter-spacing:.02em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#lvFolds{font-size:12.5px;color:var(--sub);font-variant-numeric:tabular-nums;margin-top:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#bottom{bottom:0;justify-content:center;padding:8px calc(12px + var(--safe-r)) calc(14px + var(--safe-b)) calc(12px + var(--safe-l))}
.seg{display:inline-flex;background:var(--panel);border:1px solid var(--line);border-radius:999px;padding:5px;gap:4px;
  box-shadow:0 4px 18px rgba(30,30,25,.14)}
.seg button{height:52px;min-width:124px;padding:0 22px;border-radius:999px;font-weight:700;font-size:16px;display:flex;align-items:center;
  justify-content:center;gap:9px;color:var(--sub);transition:background .18s,color .18s}
.seg button svg{width:24px;height:24px;flex:none}
.seg button.on{background:var(--ink);color:#fff}
#mCut.on{background:var(--accent)}
.pulse{animation:pulse 1.1s ease-in-out infinite}
@keyframes pulse{0%,100%{box-shadow:0 0 0 0 rgba(217,72,59,.0)}50%{box-shadow:0 0 0 7px rgba(217,72,59,.28)}}
#mCut.pulse:not(.on){color:var(--accent)}
.nudge{animation:nudge .5s ease-in-out}
@keyframes nudge{0%,100%{transform:translateX(0)}25%{transform:translateX(-4px)}75%{transform:translateX(4px)}}
#gesture{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(92px + var(--safe-b));z-index:4;pointer-events:none;
  color:#fff;font-size:14px;font-weight:600;letter-spacing:.02em;text-align:center;width:max-content;max-width:min(90vw,520px);line-height:1.45;
  text-shadow:0 1px 3px rgba(0,0,0,.55),0 0 12px rgba(0,0,0,.25)}
#toast{position:fixed;left:50%;top:calc(84px + var(--safe-t));transform:translate(-50%,-6px);z-index:20;pointer-events:none;
  background:rgba(31,38,41,.9);color:#fff;padding:9px 16px;border-radius:999px;font-size:14px;font-weight:600;max-width:88vw;text-align:center;
  opacity:0;transition:opacity .2s,transform .2s}
#toast.show{opacity:1;transform:translate(-50%,0)}

/* create mode toolbar */
#createBar{bottom:0;justify-content:center;padding:6px calc(8px + var(--safe-r)) calc(10px + var(--safe-b)) calc(8px + var(--safe-l))}
.tools{display:flex;gap:4px;max-width:100%;overflow-x:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-x;
  background:var(--panel);border:1px solid var(--line);border-radius:22px;padding:5px;box-shadow:0 4px 18px rgba(30,30,25,.14);scrollbar-width:none}
.tools::-webkit-scrollbar{display:none}
.tool{flex:none;width:min(60px,calc((var(--vw) - 84px) / 12));height:58px;border-radius:16px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
  font-size:10.5px;font-weight:700;color:var(--sub);line-height:1.1;text-align:center;padding:0 2px}
.tool svg{width:22px;height:22px}
.tool.on{background:var(--ink);color:#fff}
.tool.warn{background:var(--accent);color:#fff}
.tool .swatch{width:22px;height:22px;border-radius:6px;display:block;box-shadow:inset 0 0 0 1.5px rgba(0,0,0,.18)}
/* fold | cut: one switch, always in view */
.tool.segl,.tool.segr{background:rgba(31,38,41,.07)}
.tool.segl{border-radius:16px 6px 6px 16px}
.tool.segr{border-radius:6px 16px 16px 6px}
.tool.segl.on{background:var(--ink);color:#fff}
.tool.segr.warn{background:var(--accent);color:#fff}
.tool.dim{opacity:.42}
.tool.open{box-shadow:inset 0 0 0 2px var(--ink);color:var(--ink)}
/* panels over the toolbar: how to fold, the fold angle, guides */
#cPopScrim{position:fixed;inset:0;z-index:4}
body.popopen #gesture,body.altopen #gesture{visibility:hidden}
#cPop{position:fixed;z-index:7;width:min(330px,calc(var(--vw) - 16px));background:#faf8f3;border:1px solid var(--line);border-radius:20px;
  padding:12px 12px 10px;box-shadow:0 10px 30px rgba(30,30,25,.22);animation:fade .16s ease-out;max-height:calc(var(--vh) - 16px);overflow-y:auto;overscroll-behavior:contain}
#cPop .ptitle{display:block;font-size:13px;font-weight:800;color:var(--sub);margin:0 2px 8px}
#cPop .kinds{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
#cPop .kinds+.ptitle{margin-top:11px}
#cPop .kinds button{height:60px;border-radius:14px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;
  background:rgba(31,38,41,.05);color:var(--ink);font-size:12.5px;font-weight:700;padding:0 2px}
#cPop .kinds button svg{width:24px;height:24px}
#cPop .kinds button span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11.5px}
#cPop .kinds button.on{background:var(--ink);color:#fff}
/* a short landscape screen: the ways to fold in five columns, so the panel fits beside the toolbar */
@media (orientation:landscape) and (max-height:560px){
  #cPop{width:min(410px,calc(var(--vw) - 170px))}
  #cPop .kinds{grid-template-columns:repeat(5,minmax(0,1fr))}
  #cPop .kinds button{height:52px}
}
#cPop .phint{margin:9px 2px 0;font-size:12.5px;line-height:1.5;color:var(--sub)}
#cPop .phead{display:flex;align-items:baseline;justify-content:space-between}
#cPop .phead .ptitle{margin-bottom:0}
#cPop .angv{font-size:26px;font-weight:800;font-variant-numeric:tabular-nums;color:var(--ink)}
#cPop .arange{display:block;width:100%;margin:8px 0 10px;accent-color:var(--ink);height:30px;touch-action:pan-x}
#cPop .chips{display:flex;gap:6px;flex-wrap:wrap}
#cPop .chips button{height:34px;min-width:50px;padding:0 12px;border-radius:999px;background:rgba(31,38,41,.06);font-weight:700;font-size:13.5px;color:var(--ink)}
#cPop .chips button.on{background:var(--ink);color:#fff}
#cPop .apply{display:block;width:100%;height:40px;margin-top:10px;border-radius:12px;background:rgba(31,38,41,.08);font-weight:700;font-size:14px;color:var(--ink)}
#cPop .prow{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:8px 2px}
#cPop .plabel{font-size:14px;font-weight:700;color:var(--ink)}

/* crane steps */
#craneBar{bottom:0;justify-content:center;padding:8px calc(12px + var(--safe-r)) calc(14px + var(--safe-b)) calc(12px + var(--safe-l))}
.stepcard{width:min(460px,100%);background:var(--panel);border:1px solid var(--line);border-radius:20px;padding:12px 14px 12px;
  box-shadow:0 4px 18px rgba(30,30,25,.14);display:flex;gap:12px;align-items:center}
.stepcard .no{flex:none;width:44px;height:44px;border-radius:50%;background:var(--ink);color:#fff;display:grid;place-items:center;font-weight:800;font-size:15px;font-variant-numeric:tabular-nums}
.stepcard .txt{flex:1;min-width:0;font-size:15px;font-weight:650;line-height:1.45}
.stepcard .bar2{height:4px;border-radius:2px;background:rgba(31,38,41,.1);margin-top:7px;overflow:hidden}
.stepcard .bar2 i{display:block;height:100%;width:0;background:var(--accent);border-radius:2px;transition:width .35s}
.stepcard button{flex:none;height:44px;padding:0 14px;border-radius:14px;border:1px solid var(--line);font-weight:700;font-size:14px;color:var(--sub)}

/* ---- title ---- */
.screen{position:fixed;inset:0;z-index:8;display:flex;flex-direction:column;align-items:center}
#title{justify-content:space-between;padding:calc(36px + var(--safe-t)) calc(18px + var(--safe-r)) calc(18px + var(--safe-b)) calc(18px + var(--safe-l));pointer-events:none;
  background:linear-gradient(180deg,rgba(var(--bgr),.97) 0%,rgba(var(--bgr),.88) 20%,rgba(var(--bgr),0) 38%,rgba(var(--bgr),0) 52%,rgba(var(--bgr),.94) 78%)}
#title>*{pointer-events:auto}
.langpill{position:absolute;top:calc(10px + var(--safe-t));right:calc(12px + var(--safe-r));height:38px;padding:0 14px;border-radius:999px;
  background:var(--panel);border:1px solid var(--line);font-size:14px;font-weight:700;display:flex;align-items:center;gap:7px;
  box-shadow:0 2px 10px rgba(30,30,25,.08)}
.langpill svg{width:17px;height:17px}
.brand{text-align:center}
.brand h1{margin:0;font-size:clamp(46px,13vw,92px);font-weight:850;letter-spacing:.16em;line-height:1;padding-left:.16em;color:var(--ink)}
.brand .kana{margin:8px 0 0;font-size:14px;letter-spacing:.5em;padding-left:.5em;color:var(--sub);font-weight:700}
.brand .tag{margin:10px 0 0;font-size:15px;letter-spacing:.14em;color:var(--sub);font-weight:600}
.actions{width:min(420px,100%);display:grid;gap:10px}
.actions>button{height:58px;border-radius:16px;font-size:17px;font-weight:750;background:var(--panel);border:1px solid var(--line);
  box-shadow:0 3px 14px rgba(30,30,25,.10);transition:transform .12s}
.actions>button:active{transform:scale(.98)}
.actions .duo{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.actions .duo>button{height:58px;border-radius:16px;font-size:15.5px;padding:0 4px;font-weight:750;background:var(--panel);border:1px solid var(--line);
  box-shadow:0 3px 14px rgba(30,30,25,.10);transition:transform .12s;display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1.15}
.actions .duo>button small{font-size:12px;font-weight:650;color:var(--sub);margin-top:3px;font-variant-numeric:tabular-nums}
.actions .duo>button:active{transform:scale(.98)}
.primary{background:var(--ink)!important;color:#fff;border-color:transparent!important}
#bDaily{display:flex;align-items:center;justify-content:space-between;padding:0 20px}
#bDaily b{font-variant-numeric:tabular-nums;margin-left:6px}
#bDaily small{font-weight:600;opacity:.75;font-size:13px}
.ghost{background:transparent!important;box-shadow:none!important;border-color:transparent!important}
.actions>button.ghost{height:44px}
.foot{margin-top:6px;font-size:13px;color:var(--sub);text-align:center;display:flex;flex-direction:column;gap:4px;align-items:center}
.foot .links{display:flex;gap:6px;align-items:center}
.link{padding:6px 4px;text-decoration:underline;text-decoration-style:dotted;text-underline-offset:3px;color:var(--sub);font-size:13px}
.credit a{color:var(--sub)}

/* ---- select ---- */
#select{background:rgba(var(--bgr),.97);padding:calc(14px + var(--safe-t)) calc(14px + var(--safe-r)) 0 calc(14px + var(--safe-l))}
#select header{width:min(760px,100%);display:flex;align-items:center;gap:12px;margin-bottom:6px;flex:none}
#select h2{margin:0;font-size:20px;letter-spacing:.06em}
#select header .tot{margin-left:auto;font-size:14px;font-weight:700;color:var(--sub);display:flex;align-items:center;gap:4px;font-variant-numeric:tabular-nums}
#select header .tot i{width:16px;height:16px;color:var(--gold)}
#list{width:min(760px,100%);flex:1;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;touch-action:pan-y;overscroll-behavior:contain;
  padding:2px 2px calc(30px + var(--safe-b))}
.chap{display:flex;align-items:baseline;gap:10px;margin:18px 2px 10px}
.chap:first-child{margin-top:8px}
.chap h3{margin:0;font-size:16px;letter-spacing:.06em}
.chap span{font-size:12.5px;color:var(--sub);font-weight:650;font-variant-numeric:tabular-nums}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(98px,1fr));gap:10px}
.card{position:relative;aspect-ratio:1/1.12;background:var(--panel);border:1px solid var(--line);border-radius:18px;display:flex;flex-direction:column;
  align-items:center;justify-content:center;gap:6px;box-shadow:0 2px 10px rgba(30,30,25,.07);transition:transform .12s;padding:4px}
.card:active{transform:scale(.97)}
.card canvas{border-radius:6px;box-shadow:0 1px 3px rgba(0,0,0,.12)}
.card .no{position:absolute;top:8px;left:11px;font-size:12px;font-weight:750;color:var(--sub);font-variant-numeric:tabular-nums}
.card .nm{font-size:13px;font-weight:700;text-align:center;line-height:1.2;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.card .ss{display:flex;gap:2px;color:#b9b2a5}
.card .ss i{width:15px;height:15px}
.card .ss i.on{color:var(--gold)}
.card.endless .no{position:static;font-size:40px;color:var(--ink);font-weight:500}
.card .dice{width:46px;height:46px;color:var(--ink)}
.card .dice svg{width:46px;height:46px}
.card .sub{font-size:12px;color:var(--sub)}

/* ---- sheets ---- */
#scrim{position:fixed;inset:0;z-index:11;background:rgba(32,34,30,.38);animation:fade .25s ease-out}
@keyframes fade{from{opacity:0}to{opacity:1}}
.sheet{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(12px + var(--safe-b));z-index:12;width:min(440px,calc(var(--vw) - 20px));
  max-height:calc(100% - 24px - var(--safe-t) - var(--safe-b));overflow-y:auto;overscroll-behavior:contain;
  background:var(--panel);border:1px solid var(--line);border-radius:24px;box-shadow:0 12px 44px rgba(20,20,15,.2);padding:18px 18px 16px;
  animation:rise .34s cubic-bezier(.2,.9,.3,1.2)}
@keyframes rise{from{opacity:0;transform:translate(-50%,24px)}to{opacity:1;transform:translate(-50%,0)}}
#result{text-align:center}
.rate{font-size:15px;letter-spacing:.24em;font-weight:850;color:var(--sub);padding-left:.24em}
.rate.perfect{color:var(--gold);animation:pop .55s cubic-bezier(.2,1.6,.4,1)}.rate.great{color:var(--accent)}.rate.good{color:var(--ink)}
@keyframes pop{0%{transform:scale(.4);opacity:0}100%{transform:scale(1);opacity:1}}
#flash{position:fixed;inset:0;z-index:9;pointer-events:none;background:radial-gradient(circle at 50% 42%,rgba(255,248,226,.95),rgba(255,236,190,.35) 55%,rgba(255,230,180,0) 80%);opacity:0}
#flash.go{animation:flash .7s ease-out}
@keyframes flash{0%{opacity:.85}100%{opacity:0}}
.pct{font-size:60px;font-weight:850;line-height:1.02;font-variant-numeric:tabular-nums;letter-spacing:-.01em;margin:4px 0}
.pct small{font-size:26px;font-weight:750;margin-left:2px}
.stars{display:flex;justify-content:center;gap:6px;color:#bdb6a8;height:34px}
.stars .st{width:32px;height:32px;transition:transform .25s}
.stars .st.on{color:var(--gold);transform:scale(1.12)}
.meta{color:var(--sub);font-size:13.5px;margin:6px 0 2px;font-variant-numeric:tabular-nums}
#vsNote{white-space:pre-line}
.tip{text-align:left;font-size:13.5px;line-height:1.6;background:rgba(31,38,41,.05);border-radius:14px;padding:10px 13px;margin:10px 0 2px}
.row{display:flex;gap:8px;margin-top:12px}
.row button{flex:1;min-width:0;height:52px;border-radius:15px;font-weight:750;font-size:15px;border:1px solid var(--line);background:transparent;padding:0 6px}
.row button.primary{flex:1.35}
#how h3{margin:2px 0 12px;font-size:18px;letter-spacing:.04em}
.vidbtn{margin:10px auto 0;display:flex;align-items:center;gap:7px;height:38px;padding:0 14px;border-radius:999px;border:1px solid var(--line);font-weight:700;font-size:13.5px;color:var(--sub)}
.vidbtn svg{width:19px;height:19px}
.vidbtn.ready{background:var(--accent);color:#fff;border-color:transparent}
#recOverlay{position:fixed;inset:0;z-index:30;background:rgba(32,34,30,.55);color:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;font-weight:700;font-size:16px;text-align:center;padding:24px}
#recSub{font-weight:600;opacity:.8}
#recOverlay i{width:12px;height:12px;border-radius:50%;background:#e5483b;display:inline-block;animation:pulse 1s infinite;margin-right:8px;vertical-align:middle}
#how ol{margin:0;padding:0;list-style:none;display:grid;gap:10px}
#how li{display:flex;gap:12px;align-items:center;font-size:14.5px;line-height:1.5}
#how li svg{flex:none;width:52px;height:52px}
#how .row button{flex:1}

/* phones and narrow tablets: the creative toolbar is two rows of six so every tool is visible */
@media (max-width:739px) and (orientation:portrait){
  .tools{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:3px;overflow:visible;touch-action:manipulation;width:min(100%,420px)}
  .tool{width:auto;height:50px;min-width:0}
  .tool span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 1px}
}
/* narrow phones: the logo starts below the language button */
@media (max-width:520px) and (orientation:portrait){ #title{padding-top:calc(60px + var(--safe-t))} }
@media (max-height:700px) and (orientation:portrait){ .brand .tag{margin-top:6px} .actions>button{height:52px} .actions .duo>button{height:54px} .actions>button.ghost{height:38px} }

/* ---- phones held sideways: controls move to the sides ---- */
@media (orientation:landscape) and (max-height:560px){
  #title{flex-direction:row;align-items:center;justify-content:space-between;
    padding:calc(12px + var(--safe-t)) calc(18px + var(--safe-r)) calc(12px + var(--safe-b)) calc(18px + var(--safe-l));
    background:linear-gradient(90deg,rgba(var(--bgr),.96) 0%,rgba(var(--bgr),.80) 24%,rgba(var(--bgr),0) 38%,rgba(var(--bgr),0) 58%,rgba(var(--bgr),.94) 70%)}
  .brand{text-align:left;max-width:34vw;align-self:center}
  .brand h1{font-size:clamp(32px,6.5vw,60px);letter-spacing:.1em;padding-left:0}
  .brand .kana{padding-left:0;letter-spacing:.3em}
  .brand .tag{font-size:13px;letter-spacing:.06em}
  .actions{width:min(330px,40vw);gap:7px;align-self:center}
  .actions>button,.actions .duo>button{height:46px;font-size:15px}
  .actions>button.ghost{height:36px}
  .foot{margin-top:2px;font-size:12px}
  #top{padding:calc(6px + var(--safe-t)) calc(10px + var(--safe-r)) 6px calc(10px + var(--safe-l))}
  .ic{width:40px;height:40px}
  .ic svg{width:20px;height:20px}
  #bottom{left:auto;top:0;bottom:0;padding:0 calc(10px + var(--safe-r)) 0 0}
  .seg{flex-direction:column;border-radius:30px}
  .seg button{height:auto;min-width:0;width:78px;padding:12px 4px;flex-direction:column;gap:3px;font-size:13.5px;border-radius:24px}
  #gesture{bottom:calc(8px + var(--safe-b));font-size:13px}
  #toast{top:calc(58px + var(--safe-t))}
  .sheet{left:auto;right:calc(10px + var(--safe-r));transform:none;top:calc(8px + var(--safe-t));bottom:calc(8px + var(--safe-b));
    width:min(360px,46vw);max-height:none;padding:14px 14px 12px;animation:riseR .3s cubic-bezier(.2,.9,.3,1.1)}
  @keyframes riseR{from{opacity:0;transform:translateX(24px)}to{opacity:1;transform:none}}
  .pct{font-size:46px}
  .row{margin-top:8px}
  .row button{height:44px}
  #craneBar{left:auto;right:0;width:min(330px,44vw);padding:0 calc(10px + var(--safe-r)) calc(10px + var(--safe-b)) 0}
  #createBar{left:auto;top:calc(58px + var(--safe-t));bottom:auto;padding:0 calc(8px + var(--safe-r)) 0 0}
  .tools{display:grid;grid-template-columns:repeat(2,58px);gap:2px;overflow:visible;max-height:calc(var(--vh) - 66px - var(--safe-t) - var(--safe-b))}
  .tool{width:58px;height:calc((var(--vh) - 96px - var(--safe-t) - var(--safe-b)) / 6);max-height:52px;min-height:36px;font-size:10px}
  .stepcard{flex-wrap:wrap;padding:10px 12px}
  .stepcard .txt{font-size:14px}
}
@media (prefers-reduced-motion:reduce){#flash.go,.rate.perfect,.pulse,.nudge,.sheet{animation:none!important}}
.chap .star{display:inline-block;width:12px;height:12px;color:var(--gold);vertical-align:-1px;margin-right:3px}
/* share sheet: above the result sheet */
#shareScrim{position:fixed;inset:0;z-index:14;background:rgba(32,34,30,.42);animation:fade .2s ease-out}
#shareSheet{z-index:15}
#shareSheet h3{margin:2px 0 10px;font-size:18px;letter-spacing:.04em}
#shPreview{margin:0 0 12px;padding:10px 12px;border-radius:14px;background:rgba(31,38,41,.05);font:600 13px/1.55 system-ui,-apple-system,"Segoe UI","Hiragino Sans","Noto Sans JP","Yu Gothic UI",Meiryo,sans-serif;
  white-space:pre-wrap;word-break:break-all;color:var(--ink);max-height:150px;overflow:auto;-webkit-user-select:text;user-select:text}
.shgrid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.shbtn{display:flex;align-items:center;justify-content:center;height:48px;border-radius:14px;border:1px solid var(--line);background:#fff;font-weight:750;font-size:14.5px;
  color:var(--ink);text-decoration:none;text-align:center;padding:0 6px;line-height:1.2}
.shbtn:active{transform:scale(.97)}

/* ---- title: second row ---- */
.subrow{display:flex;justify-content:center;gap:6px}
.subrow>button{height:40px;padding:0 14px;border-radius:12px;font-weight:700;font-size:14.5px;color:var(--ink)}
.actions .duo>button small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}

/* ---- dress-up ---- */
#skin{pointer-events:none;justify-content:flex-end}
.skpanel{pointer-events:auto;width:min(560px,100%);max-height:58%;display:flex;flex-direction:column;background:var(--panel);border:1px solid var(--line);
  border-radius:24px 24px 0 0;box-shadow:0 -6px 30px rgba(20,20,15,.16);padding:12px 14px calc(10px + var(--safe-b))}
.skpanel header{display:flex;align-items:center;gap:10px;margin-bottom:8px}
.skpanel h2{margin:0;font-size:18px;letter-spacing:.06em}
.tabs{display:flex;gap:4px;background:rgba(31,38,41,.06);border-radius:14px;padding:4px;margin-bottom:8px;flex:none}
.tabs button{flex:1;height:38px;border-radius:10px;font-weight:750;font-size:14px;color:var(--sub)}
.tabs button.on{background:#fff;color:var(--ink);box-shadow:0 1px 4px rgba(0,0,0,.08)}
#skinBody{overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y;padding:0 2px 6px}
#skinBody h4{margin:10px 2px 6px;font-size:13px;color:var(--sub);letter-spacing:.06em}
.skgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(76px,1fr));gap:8px}
.sk{position:relative;display:flex;flex-direction:column;align-items:center;gap:4px;padding:6px 4px;border-radius:14px;border:1.5px solid transparent;background:#fff}
.sk canvas{width:58px;height:58px;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.15)}
.sk .nm{font-size:11.5px;font-weight:700;line-height:1.15;text-align:center}
.sk.on{border-color:var(--ink)}
.sk.locked canvas{filter:grayscale(.7) brightness(.85)}
.sk .lock{position:absolute;top:6px;left:50%;transform:translateX(-50%);width:calc(100% - 12px);background:rgba(31,38,41,.82);color:#fff;font-size:10px;font-weight:700;
  border-radius:8px;padding:3px 2px;line-height:1.2;text-align:center}
.chips{display:flex;flex-wrap:wrap;gap:6px}
.chip{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;border:2px solid transparent}
.chip.on{border-color:var(--ink)}
.chip i{width:26px;height:26px;border-radius:50%;display:block;box-shadow:inset 0 0 0 1.5px rgba(0,0,0,.15)}
.chip i.auto{background:conic-gradient(#d9483b,#e3a21a,#6f8f3a,#2a8a8c,#2f4f8f,#7d3c78,#d9483b)}
#skinBody .row{margin-top:4px}

/* ---- gallery ---- */
#gallery{background:var(--bg);padding:calc(14px + var(--safe-t)) calc(14px + var(--safe-r)) 0 calc(14px + var(--safe-l))}
#gallery header{width:min(760px,100%);display:flex;align-items:center;gap:12px;margin-bottom:10px;flex:none}
#gallery h2{margin:0;font-size:20px;letter-spacing:.06em}
#gallery header .tot{margin-left:auto;font-size:14px;font-weight:700;color:var(--sub)}
#galList{width:min(760px,100%);flex:1;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;touch-action:pan-y;display:grid;
  grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px;align-content:start;padding-bottom:calc(30px + var(--safe-b))}
.gcard{display:flex;flex-direction:column;background:var(--panel);border:1px solid var(--line);border-radius:16px;overflow:hidden;text-align:left}
.gcard img{width:100%;aspect-ratio:1;object-fit:cover;display:block;background:#3c4a44}
.gcard span{padding:7px 10px 1px;font-weight:750;font-size:13.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gcard small{padding:0 10px 8px;color:var(--sub);font-size:12px}
.gempty{grid-column:1/-1;text-align:center;color:var(--sub);font-weight:650;padding:40px 10px;line-height:1.7}
#galSheet img{display:block;width:100%;max-width:340px;margin:0 auto;border-radius:14px;aspect-ratio:1;object-fit:cover}
.galtitle{text-align:center;font-weight:800;font-size:17px;margin-top:10px}
#galDate{text-align:center}
#galDel.warn{background:var(--accent);color:#fff;border-color:transparent}

/* ---- examples ---- */
#exBanner{position:fixed;left:50%;transform:translateX(-50%);top:calc(70px + var(--safe-t));z-index:6;width:min(460px,calc(var(--vw) - 20px));
  background:rgba(31,38,41,.9);color:#fff;border-radius:16px;padding:9px 12px;box-shadow:0 4px 18px rgba(0,0,0,.18)}
.exinfo{display:flex;justify-content:space-between;gap:8px;font-size:12.5px;opacity:.85;font-weight:700}
#exText{font-size:14.5px;font-weight:700;line-height:1.45;margin:3px 0 7px}
.exbtns{display:flex;gap:6px;justify-content:flex-end}
.exbtns button{height:34px;padding:0 12px;border-radius:10px;font-weight:750;font-size:13px;background:rgba(255,255,255,.14);color:#fff}
.exlist{display:grid;gap:8px}
.exlist button{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:14px;border:1px solid var(--line);background:#fff;text-align:left}
.exlist button b{font-size:15.5px}
.exlist button small{display:block;color:var(--sub);font-size:12.5px;margin-top:2px}
.exlist .exicon{flex:none;width:44px;height:44px;border-radius:12px;background:var(--bg);display:grid;place-items:center}
.exlist .exicon svg{width:30px;height:30px}
.exlist .exhead{margin:8px 2px 0;font-size:13px;font-weight:800;color:var(--sub)}

/* ---- versus ---- */
.opt{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:8px 0}
.opt>span{font-weight:750;font-size:14px;flex:none}
.segopt{display:flex;flex-wrap:wrap;gap:4px;justify-content:flex-end}
.segopt button{height:36px;min-width:44px;padding:0 10px;border-radius:10px;border:1px solid var(--line);font-weight:700;font-size:13.5px;background:#fff}
.segopt button.on{background:var(--ink);color:#fff;border-color:transparent}
#vsHand{position:fixed;inset:0;z-index:25;background:rgba(32,34,30,.94);display:grid;place-items:center;padding:20px}
.vscard{background:var(--panel);border-radius:24px;padding:22px 20px;width:min(380px,100%);text-align:center;box-shadow:0 12px 44px rgba(0,0,0,.3)}
.vscard p{font-size:15px;line-height:1.6;font-weight:650;white-space:pre-line}
.vscard button{width:100%;height:52px;border-radius:15px;font-weight:800;font-size:16px}
.vstable{display:grid;grid-template-columns:auto 1fr 1fr;gap:4px 10px;margin:12px 0 4px;font-variant-numeric:tabular-nums;font-size:13.5px;align-items:center}
.vstable.one{grid-template-columns:auto 1fr}
.vstable .h{font-weight:800;color:var(--sub);font-size:12.5px}
.vstable .c{background:rgba(31,38,41,.05);border-radius:10px;padding:6px 8px;line-height:1.35;white-space:pre-line;min-height:1.35em}
.vstable .c.win{background:rgba(31,38,41,.13);font-weight:800;box-shadow:inset 0 0 0 1.5px rgba(31,38,41,.35)}
.vstable .r{font-weight:800;color:var(--sub)}
#timerChip{font-variant-numeric:tabular-nums}

@media (max-width:420px){
  .actions .duo>button{height:54px;font-size:14.5px}
  .actions .duo>button small{font-size:11px}
}
@media (orientation:landscape) and (max-height:560px){
  .actions .duo{grid-template-columns:repeat(3,1fr);gap:6px}
  .actions .duo>button{height:44px;font-size:13.5px}
  .actions .duo>button small{display:none}
  .subrow>button{height:32px;font-size:13px}
  .skpanel{max-height:100%;height:100%;width:min(420px,52vw);border-radius:20px 0 0 20px;margin-left:auto}
  #skin{flex-direction:row;justify-content:flex-end;align-items:stretch}
  #exBanner{top:calc(62px + var(--safe-t));width:min(400px,calc(var(--vw) - 180px));left:calc(50% - 60px)}
  .sheet{overflow-y:auto;overscroll-behavior:contain}
  #galSheet img{width:min(100%,calc(var(--vh) - 200px))}
  #vsSetup .opt{margin:5px 0}
  #vsSetup .segopt button{height:32px}
  #vsNote{font-size:12.5px;margin:4px 0 0}
}

/* ---- result: video + save ---- */
.minirow{display:flex;justify-content:center;gap:8px;flex-wrap:wrap;margin-top:10px}
.minirow .vidbtn{margin:0}
#rSave.done{border-color:var(--ink);color:var(--ink)}
.vscard .rate{margin-bottom:4px}
#vsSheet .rate{text-align:center}
/* ---- a dark desk under the title ---- */
:root.darkmat .brand h1{color:#eef1f4}
:root.darkmat .brand .kana,:root.darkmat .brand .tag,:root.darkmat .foot,:root.darkmat .link,:root.darkmat .credit a{color:#b9c3cc}
:root.darkmat .subrow>button{color:#eef1f4}
:root.darkmat #bDaily{box-shadow:0 0 0 1px rgba(255,255,255,.2),0 6px 20px rgba(0,0,0,.25)}
/* ---- the view button and the cut chip ---- */
#bView{position:fixed;right:calc(12px + var(--safe-r));top:80px;z-index:6;width:40px;height:40px}
#bView svg{width:20px;height:20px}
.chipbtn{position:fixed;left:50%;transform:translateX(-50%);z-index:6;height:40px;padding:0 16px;border-radius:999px;background:var(--panel);
  border:1px solid var(--line);font-weight:750;font-size:14px;display:flex;align-items:center;gap:7px;box-shadow:0 4px 16px rgba(30,30,25,.16)}
.chipbtn svg{width:19px;height:19px}
/* ---- online: the other player's progress ---- */
#opChip{position:fixed;left:50%;transform:translateX(-50%);top:calc(74px + var(--safe-t));z-index:6;background:rgba(31,38,41,.86);color:#fff;
  font-size:13px;font-weight:750;padding:6px 14px;border-radius:999px;white-space:nowrap;pointer-events:none}
.roomcode{font-size:44px;font-weight:850;letter-spacing:.28em;padding-left:.28em;text-align:center;margin:8px 0 2px;font-variant-numeric:tabular-nums;user-select:text;-webkit-user-select:text}
#roomIn{flex:1.4;min-width:0;height:52px;border-radius:15px;border:1.5px solid var(--line);background:#fff;font:inherit;font-size:24px;font-weight:800;
  letter-spacing:.3em;text-align:center;text-transform:uppercase;padding:0 8px;color:var(--ink)}
.meta.small{font-size:12px}
/* ---- paper sumo ---- */
#sumo{pointer-events:none}
#sumo>*{pointer-events:auto}
#suBack{position:absolute;left:calc(12px + var(--safe-l));top:calc(10px + var(--safe-t))}
.sucard{position:absolute;left:50%;transform:translateX(-50%);width:min(300px,calc(var(--vw) - 156px));background:var(--panel);border:1px solid var(--line);
  border-radius:16px;padding:7px 12px;box-shadow:0 2px 10px rgba(30,30,25,.1);pointer-events:none}
.sucard.p2{top:calc(10px + var(--safe-t))}
.sucard.p1{bottom:calc(10px + var(--safe-b))}
.sucard.p2.flip{transform:translateX(-50%) rotate(180deg)}
.suline{display:flex;justify-content:space-between;align-items:center;gap:8px}
.suline .nm{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.suline .wins{font-size:13px;letter-spacing:.15em;color:var(--ink);flex:none}
.sucard.p1 .nm{color:#b8392d}.sucard.p2 .nm{color:#2f4f8f}
.subars{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin-top:4px}
.subars.five{grid-template-columns:repeat(5,1fr)}
.surule{position:absolute;right:calc(12px + var(--safe-r));top:calc(16px + var(--safe-t));padding:5px 11px;border-radius:999px;background:var(--panel);
  border:1px solid var(--line);font-size:12px;font-weight:800;color:var(--ink);pointer-events:none}
.surule:empty{display:none}
.subar{display:flex;flex-direction:column;gap:2px;font-size:10.5px;font-weight:700;color:var(--sub)}
.subar i{display:block;height:5px;border-radius:3px;background:rgba(31,38,41,.1);overflow:hidden}
.subar b{display:block;height:100%;background:var(--ink);border-radius:3px}
#suCall{position:absolute;left:50%;top:42%;transform:translate(-50%,-50%);pointer-events:none;text-align:center;white-space:pre-line;
  font-size:clamp(28px,8vw,54px);font-weight:900;letter-spacing:.12em;color:#fff;text-shadow:0 2px 8px rgba(0,0,0,.45),0 0 24px rgba(0,0,0,.25);width:max-content;max-width:94vw}
#suCall.go{animation:pop .5s cubic-bezier(.2,1.6,.4,1)}
#suCall.end{font-size:clamp(24px,6.4vw,42px);animation:pop .5s cubic-bezier(.2,1.6,.4,1)}
.suhint{position:absolute;left:50%;transform:translateX(-50%);color:#fff;font-weight:700;font-size:13px;text-shadow:0 1px 3px rgba(0,0,0,.6);pointer-events:none;white-space:nowrap}
.suhint.p1{bottom:calc(92px + var(--safe-b))}
.suhint.p2{top:calc(92px + var(--safe-t));transform:translateX(-50%) rotate(180deg)}
#suEnd{position:absolute;left:50%;transform:translateX(-50%);bottom:calc(100px + var(--safe-b));width:min(360px,calc(var(--vw) - 32px))}
.sulist{display:grid;gap:8px;max-height:min(52vh,440px);overflow-y:auto;overscroll-behavior:contain;padding:2px}
.sucard2{display:block;text-align:left;padding:9px 12px;border-radius:14px;border:1.5px solid var(--line);background:#fff}
.sucard2.on{border-color:var(--ink);box-shadow:0 0 0 2px rgba(31,38,41,.12)}
.suhead{display:flex;align-items:center;gap:10px}
.suhead img{width:40px;height:40px;border-radius:8px;object-fit:cover}
.suhead b{font-size:15px}
.suhead small{margin-left:auto;color:var(--sub);font-size:12px;font-weight:700}
@media (orientation:landscape) and (max-height:560px){
  .sucard.p2{left:calc(12px + var(--safe-l));transform:none;top:auto;bottom:calc(10px + var(--safe-b));width:min(260px,38vw)}
  .sucard.p2.flip{transform:none}
  .sucard.p1{left:auto;right:calc(12px + var(--safe-r));transform:none;width:min(260px,38vw)}
  .suhint.p2{top:auto;bottom:calc(84px + var(--safe-b));left:25%;transform:translateX(-50%)}
  .suhint.p1{left:75%;bottom:calc(84px + var(--safe-b))}
}
@media (orientation:landscape) and (max-height:560px){
  #suPick .sulist{max-height:calc(var(--vh) - 150px)}
  #suPick .meta{display:none}
}

/* ---- Create: change the fold just made (one tap beside it) ---- */
#cPlace{position:fixed;left:50%;transform:translateX(-50%);z-index:6;display:flex;gap:4px;padding:5px;border-radius:18px;background:var(--panel);
  border:1px solid var(--line);box-shadow:0 4px 16px rgba(30,30,25,.16);bottom:calc(150px + var(--safe-b))}
#cPlace button{min-width:64px;height:52px;padding:0 8px;border-radius:13px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:11px;font-weight:750;color:var(--sub)}
#cPlace button svg{width:20px;height:20px}
#cAlt{position:fixed;left:50%;transform:translateX(-50%);z-index:6;display:flex;align-items:center;gap:4px;max-width:calc(var(--vw) - 16px);overflow-x:auto;
  padding:5px;border-radius:18px;background:var(--panel);border:1px solid var(--line);box-shadow:0 4px 16px rgba(30,30,25,.16);scrollbar-width:none}
#cAlt::-webkit-scrollbar{display:none}
#cAlt .altl{flex:none;font-size:12px;font-weight:800;color:var(--sub);padding:0 6px 0 8px;white-space:nowrap}
#cAlt button{flex:none;min-width:54px;height:52px;padding:0 6px;border-radius:13px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
  font-size:11px;font-weight:750;color:var(--sub)}
#cAlt button svg{width:20px;height:20px}
#cAlt button.on{background:var(--ink);color:#fff}
#cAlt button.flapb{border-left:1px solid var(--line);border-radius:0 13px 13px 0}
#cAlt button.flapb.on{background:#e0a33a;color:#1f2629}
#cAlt .altwait{flex:none;padding:0 8px;color:var(--sub)}
.chipbtn.warn{background:#fbe9e5;border-color:rgba(200,85,61,.5);color:#8a2f1d}
#cTurn.nudge,#cTurn.nudge svg{animation:nudge .6s ease-in-out 3}
/* text for screen readers only */
.sr{position:fixed;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}

/* ---- gallery: a work in 3D, step by step ---- */
#viewBar{bottom:0;flex-direction:column;align-items:stretch;gap:6px;margin:0 auto;max-width:560px;background:var(--panel);border:1px solid var(--line);
  border-radius:20px 20px 0 0;box-shadow:0 -4px 18px rgba(30,30,25,.12);padding:10px calc(14px + var(--safe-r)) calc(12px + var(--safe-b)) calc(14px + var(--safe-l))}
.vwtop{display:flex;align-items:center;gap:10px}
.vwtop .ic{width:40px;height:40px}
#vwName{flex:1;min-width:0;font-size:16px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#vwStep{font-size:13px;font-weight:750;color:var(--sub);font-variant-numeric:tabular-nums}
#vwText{font-size:14.5px;font-weight:650;min-height:1.4em}
#vwRange{width:100%;accent-color:var(--ink);height:28px}
.vwbtns{display:flex;align-items:center;gap:8px;justify-content:center;flex-wrap:wrap}
.vwbtns .ic{width:44px;height:44px}
.vwbtns .ic.primary{background:var(--ink);color:#fff;border-color:transparent}
.vwbtns .ic.primary svg{width:20px;height:20px}
#vwEdit{height:44px;padding:0 14px;border-radius:999px;border:1px solid var(--line);background:#fff;font-weight:750;font-size:14px}
.galname{display:flex;gap:6px;margin:6px 0 2px}
.galname input{flex:1;min-width:0;height:40px;border-radius:12px;border:1px solid var(--line);padding:0 12px;font:inherit;font-size:15px;background:#fff;color:var(--ink);-webkit-user-select:text;user-select:text}
.galname button{height:40px;padding:0 14px;border-radius:12px;border:1px solid var(--line);background:#fff;font-weight:750}
#galImg{cursor:pointer}

/* ---- paper sumo: choose from your works, the ranking, the match settings ---- */
.sutabs{display:flex;gap:4px;margin:2px 0 8px;background:rgba(31,38,41,.06);border-radius:12px;padding:3px}
.sutabs button{flex:1;height:36px;border-radius:9px;font-weight:750;font-size:13.5px;color:var(--sub);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 6px}
.sutabs button.on{background:#fff;color:var(--ink);box-shadow:0 1px 4px rgba(30,30,25,.12)}
.surk{flex:none;width:24px;height:24px;border-radius:50%;background:var(--ink);color:#fff;display:grid;place-items:center;font-size:12px;font-weight:800}
.suopts{margin-top:8px;display:grid;gap:6px}
.suopts .opt{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:13.5px;font-weight:700}
.suopts .segopt button{height:32px;font-size:12.5px;padding:0 8px}
.suopts .meta{margin:0}
.surate{margin:0 0 8px;text-align:center;font-size:13.5px;font-weight:700;white-space:pre-line}

/* ---- sumo: dressing a wrestler ---- */
.sudress{margin:6px 0 2px}
.sudress .segopt.wrap{flex-wrap:wrap}
.sudress .lk{margin-left:.35em;opacity:.7;font-size:.78em}
.sudress .swatch{display:inline-block;width:.8em;height:.8em;border-radius:50%;margin-right:.3em;vertical-align:-.05em;border:1px solid rgba(0,0,0,.2)}

/* ---- crease pattern (expert) ---- */
.cpsvg{display:block;width:min(100%,calc(var(--vh) - 300px));aspect-ratio:1;margin:4px auto 8px;border-radius:10px;border:1px solid var(--line)}

/* ---- support card (web only) ---- */
#support{position:fixed;left:50%;transform:translateX(-50%);top:calc(14px + var(--safe-t));z-index:15;width:min(380px,calc(var(--vw) - 24px));display:flex;align-items:center;gap:10px;
  padding:10px 10px 10px 14px;border-radius:16px;background:var(--panel);border:1px solid var(--line);box-shadow:0 6px 22px rgba(30,30,25,.18)}
#support p{flex:1;margin:0;font-size:13.5px;line-height:1.45}
#support a{flex:none;font-weight:800;font-size:13.5px;color:var(--ink);padding:8px 12px;border-radius:999px;border:1px solid var(--line);text-decoration:none;background:#fff}
#support .ic{width:36px;height:36px;box-shadow:none}
#vwDiagram{height:44px;padding:0 14px;border-radius:999px;border:1px solid var(--line);background:#fff;font-weight:750;font-size:14px}

/* ---- accessibility ---- */
.a11y .opt{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:7px 0;font-weight:700;font-size:14px}
.a11y .keys{font-size:13px;line-height:1.6;color:var(--sub);margin:8px 0 0;white-space:pre-line;max-height:28vh;overflow-y:auto}
#a11ySheet{max-height:calc(var(--vh) - 24px);overflow-y:auto}
#cap{position:fixed;left:50%;transform:translateX(-50%);top:calc(70px + var(--safe-t));z-index:7;pointer-events:none;display:flex;flex-direction:column;align-items:center;gap:4px}
#cap span{background:rgba(31,38,41,.86);color:#fff;font-size:14px;font-weight:700;padding:4px 12px;border-radius:999px;animation:capfade 1.6s forwards}
@keyframes capfade{0%,70%{opacity:1}100%{opacity:0}}
ruby rt{font-size:.5em;font-weight:600;letter-spacing:0}
ruby{ruby-position:over}
html.hc{--panel:#ffffff;--line:rgba(0,0,0,.6);--sub:#2b3135;--ink:#000}
html.hc .ic,html.hc .tool,html.hc .sheet,html.hc .seg,html.hc #cAlt,html.hc .chipbtn,html.hc .ttl{border-width:2px}
html.hc button:focus-visible,html.hc a:focus-visible,html.hc input:focus-visible{outline:3px solid #000;outline-offset:2px;box-shadow:0 0 0 6px #ffd84d}
html.hc #gesture{background:#000;color:#fff}
html.big{--vw:calc(100vw / 1.16);--vh:calc(100vh / 1.16)}
html.bigger{--vw:calc(100vw / 1.32);--vh:calc(100vh / 1.32)}
html.big .bar,html.big .sheet,html.big .screen,html.big #toast,html.big #gesture,html.big #cPop,html.big #cAlt,html.big .chipbtn,html.big #exBanner,html.big #cap{zoom:1.16}
html.bigger .bar,html.bigger .sheet,html.bigger .screen,html.bigger #toast,html.bigger #gesture,html.bigger #cPop,html.bigger #cAlt,html.bigger .chipbtn,html.bigger #exBanner,html.bigger #cap{zoom:1.32}
html.calm *{animation-duration:.01s!important;transition-duration:.01s!important}
#appVer{font-size:11px;color:var(--sub);opacity:.75;letter-spacing:.02em}
#histStrip .hhead{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-right:34px}
#histStrip .hdiag{flex:none;height:30px;padding:0 12px;border-radius:999px;background:var(--ink);color:#fff;font-size:12.5px;font-weight:750}

/* ===== look v2 (2026-11-14): 藍 indigo · 生成り unbleached white · 朱 vermilion. One quiet style for every panel:
   frosted white, a hairline, one soft shadow; what is chosen is indigo, what matters is vermilion. ===== */
:root{
  --ink:#1b2536; --sub:#5a6475; --line:rgba(27,37,54,.11); --panel:rgba(255,254,251,.86); --accent:#d8432f; --indigo:#26395a;
  --shadow:0 1px 2px rgba(27,37,54,.05),0 10px 28px rgba(27,37,54,.10);
}
.ic,.ttl,.langpill,.tools,.seg,#cAlt,#histStrip,#exBanner,#objPad,.vwtools,#cPop,.chipbtn,#cPlace,.actions>button:not(.ghost),.actions .duo>button{
  -webkit-backdrop-filter:blur(16px) saturate(1.3);backdrop-filter:blur(16px) saturate(1.3);box-shadow:var(--shadow);border-color:var(--line)}
.ic{width:44px;height:44px}
.ttl{border-radius:999px;padding:6px 20px}
#lvName{font-weight:750;letter-spacing:.04em}
/* the title */
.brand h1{font-weight:300;letter-spacing:.34em;padding-left:.34em;font-size:clamp(38px,11vw,80px)}
.brand .kana{font-weight:600;letter-spacing:.62em;padding-left:.62em;font-size:12.5px;margin-top:12px}
.brand .tag{font-weight:500;font-size:14px;letter-spacing:.2em;margin-top:8px}
.actions{width:min(440px,100%);gap:10px}
.actions>button{border-radius:18px}
.primary{background:var(--indigo)!important}
#bDaily{height:60px;padding:0 22px;box-shadow:0 10px 26px rgba(38,57,90,.28)}
.actions .duo{gap:10px}
.actions .duo>button{height:94px;border-radius:18px;font-size:15px;letter-spacing:.02em}
.actions .duo>button .mi{width:26px;height:26px;margin-bottom:6px;color:var(--indigo)}
.actions .duo>button small{font-size:11.5px;font-weight:600;margin-top:2px}
.actions .duo>button:hover{border-color:rgba(38,57,90,.32)}
.subrow>button{font-weight:650;color:var(--sub)}
#appVer{letter-spacing:.06em}
@media (max-height:700px) and (orientation:portrait){.actions .duo>button{height:78px}.actions .duo>button .mi{width:22px;height:22px;margin-bottom:3px}}
@media (orientation:landscape) and (max-height:560px){.actions .duo>button{height:46px;flex-direction:row;gap:6px}.actions .duo>button .mi{width:18px;height:18px;margin:0}.actions .duo>button small{display:none}#bDaily{height:46px}}
/* what is chosen */
.tool.on,.tool.segl.on,.seg button.on,#cAlt button.on,.segopt button.on,.segopt.games button.on,#histStrip .hdiag{background:var(--indigo);color:#fff}
.segopt.games button.on{border-color:var(--indigo)}
.tool.open{box-shadow:inset 0 0 0 2px var(--indigo);color:var(--indigo)}
.tools{border-radius:24px;padding:6px;gap:2px}
.tool{border-radius:15px;font-weight:650;letter-spacing:.02em}
.tool.segl,.tool.segr{background:rgba(27,37,54,.06)}
.tool.segl{border-radius:15px 6px 6px 15px}
.tool.segr{border-radius:6px 15px 15px 6px}
/* what the game says */
#gesture{background:rgba(27,37,54,.58);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);padding:7px 14px;border-radius:14px;font-size:12.5px;font-weight:600;
  text-shadow:none;max-width:min(88vw,470px);line-height:1.5}
#gesture:empty{display:none}
#toast{background:rgba(27,37,54,.93);border-radius:16px;padding:10px 16px;box-shadow:0 10px 28px rgba(27,37,54,.25);line-height:1.5}
#exBanner{background:var(--panel);color:var(--ink);border:1px solid var(--line);border-left:4px solid var(--accent);border-radius:16px;padding:10px 12px 10px 14px}
.exinfo{opacity:1;color:var(--sub)}
#exStep{color:var(--accent);font-variant-numeric:tabular-nums}
#exText{font-size:15px}
.exbtns button{background:rgba(27,37,54,.07);color:var(--ink);border-radius:11px}
.exbtns #exAuto{background:var(--indigo);color:#fff}
/* sheets */
#scrim,#shareScrim{background:rgba(27,37,54,.34);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}
.sheet{background:rgba(255,254,251,.97);border-radius:26px;box-shadow:0 24px 60px rgba(27,37,54,.24);border-color:var(--line)}
.sheet h3{letter-spacing:.06em}
.exlist button{border-radius:16px;border-color:var(--line);transition:border-color .15s,transform .12s}
.exlist button:hover{border-color:rgba(38,57,90,.32)}
.exlist button:active{transform:scale(.985)}
.exlist .exicon{background:rgba(38,57,90,.07);color:var(--indigo)}
.exlist .exhead{letter-spacing:.08em}
@media (prefers-reduced-transparency:reduce){.ic,.ttl,.langpill,.tools,.seg,#cAlt,#histStrip,#exBanner,#objPad,.vwtools,#cPop,.chipbtn,#cPlace,.actions>button,.actions .duo>button,#gesture{-webkit-backdrop-filter:none;backdrop-filter:none;background-color:#fffefb}#gesture{background:rgba(27,37,54,.9)}}
/* on the title a message sits in the open middle, not over the name */
body:has(#title:not(.hidden)) #toast{top:40%}
#title{background:linear-gradient(180deg,rgba(var(--bgr),.96) 0%,rgba(var(--bgr),.82) 17%,rgba(var(--bgr),0) 34%,rgba(var(--bgr),0) 50%,rgba(var(--bgr),.92) 74%)}
.actions .duo{grid-template-columns:repeat(3,minmax(0,1fr))}
.actions .duo>button small{white-space:normal;line-height:1.25;text-align:center;padding:0 3px}
.tools{justify-content:center}
/* a wide screen (a desk): the name and the ways to play in a column on the left, the demo large on the right */
@media (min-width:900px) and (min-aspect-ratio:6/5) and (min-height:561px){
  #title{align-items:flex-start;justify-content:center;gap:28px;padding-left:max(52px,6vw);
    background:linear-gradient(90deg,rgba(var(--bgr),.97) 0%,rgba(var(--bgr),.92) 30%,rgba(var(--bgr),0) 52%)}
  .brand,.actions{width:min(440px,40vw)}
  .brand{text-align:left}
  .brand h1{font-size:clamp(44px,5.4vw,76px);padding-left:0}
  .brand .kana{padding-left:.1em}
  .foot{align-items:flex-start;text-align:left}
  body:has(#title:not(.hidden)) #toast{top:auto;bottom:calc(22px + var(--safe-b));left:auto;right:28px;transform:none;max-width:min(46vw,520px)}
  body:has(#title:not(.hidden)) #toast.show{transform:none}
}
/* a tall narrow screen: the demo keeps a band of its own between the name and the buttons */
@media (max-width:899px) and (orientation:portrait){.actions .duo>button{height:84px}}

/* ---- Create v32: one row everyone uses, a second row for the fold-by-fold tools (くわしく), and もっと ---- */
#createBar{flex-direction:column;gap:5px}
#createBar .tools.pro{padding:3px 5px}
#createBar .tools.pro .tool{height:46px;font-size:10px}
#createBar .tools.pro .tool svg{width:20px;height:20px}
@media (max-width:739px) and (orientation:portrait){
  #createBar .tools{grid-template-columns:repeat(7,minmax(0,1fr));width:min(100%,460px)}
  #createBar .tool{height:54px}
  #createBar .tools.pro .tool{height:44px}
}
@media (orientation:landscape) and (max-height:560px){
  #createBar{flex-direction:row;align-items:flex-start;gap:5px}
  #createBar .tools{grid-template-columns:56px;max-height:none}
  #createBar .tool{width:56px;height:calc((var(--vh) - 92px - var(--safe-t) - var(--safe-b)) / 7);max-height:50px;min-height:34px}
  #createBar .tools.pro .tool{height:calc((var(--vh) - 92px - var(--safe-t) - var(--safe-b)) / 7);font-size:9.5px}
}
/* the ways to fold: whole names, on two lines when they are long */
#cPop .kinds button span{white-space:normal;overflow:visible;text-overflow:clip;line-height:1.15;text-align:center;font-size:11px}
@media (max-width:739px) and (orientation:portrait){#cPop{width:min(440px,calc(var(--vw) - 16px))}}
/* もっと: each tool with what it does */
#cPop.pop-more{width:min(460px,calc(var(--vw) - 16px))}
#cPop .mtiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin-bottom:11px}
#cPop .mtile{display:flex;align-items:center;gap:9px;text-align:left;padding:8px 10px;border-radius:14px;background:rgba(31,38,41,.05);color:var(--ink);min-height:58px}
#cPop .mtile svg{flex:none;width:22px;height:22px}
#cPop .mtx{display:flex;flex-direction:column;gap:2px;min-width:0}
#cPop .mtx b{font-size:13.5px;font-weight:750}
#cPop .mtx small{font-size:11.5px;line-height:1.35;color:var(--sub);font-weight:500}
#cPop .mtile.on{background:var(--indigo);color:#fff}
#cPop .mtile.on small{color:rgba(255,255,255,.82)}
#cPop .mlevel{display:flex;align-items:center;gap:10px;border-top:1px solid var(--line);padding-top:10px;margin-top:2px}
#cPop .mseg{display:flex;flex:none;background:rgba(31,38,41,.06);border-radius:999px;padding:3px}
#cPop .mseg button{height:34px;padding:0 13px;border-radius:999px;font-weight:750;font-size:13px;color:var(--sub)}
#cPop .mseg button.on{background:var(--indigo);color:#fff}
#cPop .mlevel small{font-size:11.5px;line-height:1.4;color:var(--sub)}
@media (orientation:landscape) and (max-height:560px){#cPop.pop-more{width:min(680px,calc(var(--vw) - 150px));padding:10px 10px 8px}#cPop .mtiles{grid-template-columns:repeat(4,minmax(0,1fr));margin-bottom:7px;gap:5px}#cPop .mtile{min-height:48px;padding:5px 7px;gap:6px}#cPop .mtx small{font-size:10.5px}#cPop.pop-more .ptitle{margin-bottom:5px}#cPop .mlevel{padding-top:7px}}
/* a sheet taller than the screen: its buttons stay at the foot while the rest scrolls */
.sheet>.row:last-child{position:sticky;bottom:-16px;margin-bottom:-16px;padding:8px 0 16px;background:#fdfcf9;z-index:1}
.sheet>.row:last-child::before{content:"";position:absolute;left:0;right:0;top:-14px;height:14px;background:linear-gradient(rgba(253,252,249,0),#fdfcf9);pointer-events:none}
@media (orientation:landscape) and (max-height:560px){.sheet>.row:last-child{bottom:-12px;margin-bottom:-12px;padding-bottom:12px}}
html.hc .sheet>.row:last-child{background:#fff}
/* the sound switch: a target a finger finds */
#bSound{min-height:40px;padding:0 12px}
/* how hard an example is */
.exlist .exlv{margin-left:auto;flex:none;font-style:normal;font-size:11.5px;font-weight:750;padding:4px 9px;border-radius:999px;background:rgba(38,57,90,.07);color:var(--indigo)}
.exlist .exlv.lv2{background:rgba(38,57,90,.14)}
.exlist .exlv.lv3{background:var(--indigo);color:#fff}
.rate.opened{color:var(--indigo);letter-spacing:.06em;padding-left:0;font-size:15.5px;animation:pop .45s cubic-bezier(.2,1.4,.4,1)}
/* 紙の形と大きさ (v35) */
#cPop .cmrow{display:flex;align-items:center;gap:6px;margin:12px 0 4px;flex-wrap:wrap;font-weight:700;font-size:13.5px;color:var(--ink)}
#cPop .cmin{width:5.6em;height:36px;padding:0 8px;border-radius:10px;border:1px solid var(--line);background:#fff;font:inherit;font-weight:700;color:var(--ink)}
#cPop .cmswap{width:36px;height:36px;border-radius:10px;display:grid;place-items:center;background:rgba(31,38,41,.06);color:var(--ink)}
#cPop .cmswap svg{width:18px;height:18px}
#cPop .sheetratio{display:block;color:var(--sub);font-size:12.5px;margin-top:2px}
#cPop .phint.bad{color:var(--accent)}
#cPop .apply:disabled{opacity:.45}
#cPop.pop-sheet{max-width:min(380px,calc(var(--vw) - 16px))}
/* 応援パック (v35) */
#skinBody .packbtn{display:block;width:100%;margin:2px 0 10px;padding:10px 14px;border-radius:12px;background:rgba(31,38,41,.06);font-weight:700;font-size:13.5px;color:var(--ink);text-align:left}
#packSheet ul{margin:6px 0 10px;padding-left:1.2em;line-height:1.7}
#packSheet .packcode{display:flex;align-items:center;gap:8px;margin-top:8px;font-weight:700}
#packSheet .packcode input{flex:1;min-width:0;height:38px;padding:0 10px;border-radius:10px;border:1px solid var(--line);background:#fff;font:inherit;font-size:13px}
#packSheet .btnlike{display:inline-flex;align-items:center;justify-content:center;text-decoration:none}
#exList .exmade{margin:0 2px 8px;color:var(--sub);font-size:12.5px}
#exList button{position:relative}
#exList .exdone{position:absolute;right:10px;top:8px;width:20px;height:20px;color:#2f7d4f}
#exList .exdone svg{width:100%;height:100%}

/* v36: the title word folds over (a hidden tap: KIRI-ORI ↔ ORI-KIRI), letter by letter */
#title .brand h1 .tl{display:inline-block;transform-origin:50% 55%;backface-visibility:hidden}
#title .brand h1.flipout .tl{animation:tlout .6s cubic-bezier(.5,0,.75,0) both;animation-delay:calc(var(--i) * 45ms)}
#title .brand h1.flipin .tl{animation:tlin .6s cubic-bezier(.25,1,.5,1) both;animation-delay:calc(var(--i) * 45ms)}
@keyframes tlout{to{transform:perspective(320px) rotateX(90deg)}}
@keyframes tlin{from{transform:perspective(320px) rotateX(-90deg)}}
@media (prefers-reduced-motion: reduce){#title .brand h1 .tl{animation:none!important}}
/* v36: the end of a sumo bout and of a plane match look alike: a share row above home / again */
#suShareRow,#plShareRow{margin-bottom:6px}
/* v36: the rules and the dress share one heading style in both pickers (sumo, planes) */
.suopts .ptitle,.sudress .ptitle{display:block;font-size:13px;font-weight:800;color:var(--sub);margin:4px 2px 2px}
.suopts .segopt button,.sudress .segopt button{min-height:36px}
/* v36: the viewer's video and link buttons look like their neighbours */
#vwVideo,#vwLink{height:44px;padding:0 14px;border-radius:999px;border:1px solid var(--line);background:#fff;font-weight:750;font-size:14px}
/* v37: random is a small link on the title now (it is in the puzzle list too); paper & desk is a card */
#title .subrow #bRandom svg,#title .subrow #bRandom small{display:none}
#title .subrow #bRandom span{font:inherit}
/* v37: the main row of つくる holds eight now (紙と机 came out of もっと): one row on a phone */
@media (max-width:739px) and (orientation:portrait){
  #createBar .tools.main{grid-template-columns:repeat(8,minmax(0,1fr));gap:2px}
  .tools.main .tool{font-size:10.5px}
  .tools.main .tool svg{width:21px;height:21px}
}
@media (orientation:landscape) and (max-height:560px){
  #createBar .tools.main .tool{height:calc((var(--vh) - 96px - var(--safe-t) - var(--safe-b)) / 8)}
}
/* v38: a colour chip is a circle round its swatch (the general button padding had pushed the swatch off centre) */
.chips .chip{padding:0;min-width:0;flex:none;box-sizing:border-box;display:grid;place-items:center;line-height:0}
.chips .chip i{margin:0}

/* v38: the pack lists its own things with a picture each; kind words in the 3D view */
#packList{list-style:none;padding:0;margin:6px 0}
#packList .packhead{font-weight:800;font-size:13px;color:var(--sub);margin:10px 2px 4px}
#packList .packgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(76px,1fr));gap:6px}
#packList .packitem{display:flex;flex-direction:column;align-items:center;gap:3px;font-size:11px;text-align:center}
#packList .packitem canvas{width:100%;aspect-ratio:1;border-radius:10px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.12)}
#packList .packall{margin-top:10px;font-weight:700;font-size:13px}
.vwreact{display:flex;flex-wrap:wrap;align-items:center;gap:6px;justify-content:center;margin-top:6px;font-size:13px;font-weight:700}
.vwreact button{height:36px;padding:0 12px;border-radius:999px;border:1px solid var(--line);background:#fff;font-weight:700}
#vwScene{height:44px;padding:0 14px;border-radius:999px;border:1px solid var(--line);background:#fff;font-weight:750;font-size:14px}
#sceneGrid canvas{width:100%;aspect-ratio:2/1;border-radius:8px}

/* v39: paper sizes in 紙と机: chips like the others, and any size in cm */
#skinBody .sheetchips{display:flex;flex-wrap:wrap;gap:6px}
#skinBody .sheetchips button{height:34px;padding:0 12px;border-radius:999px;background:rgba(31,38,41,.06);font-weight:700;font-size:13px;color:var(--ink);word-break:keep-all}
#skinBody .sheetchips button.on{background:var(--ink);color:#fff}
#skinBody .sizefree{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:8px 0 4px;font-size:13px;font-weight:700}
#skinBody .sizefree label{display:flex;align-items:center;gap:4px}
#skinBody .sizefree input{width:70px;height:36px;border-radius:10px;border:1px solid var(--line);padding:0 8px;font:inherit}
#skinBody .sizefree button{height:36px;padding:0 12px;border-radius:999px}
/* names under the tiles break only between phrases (word-break: keep-all with the marks the names carry) */
.sk .nm{word-break:keep-all;overflow-wrap:anywhere}
/* v39: 目盛り — the angle, the crease's length, the axiom — while a fold is dragged */
#measure{position:fixed;left:50%;transform:translateX(-50%);top:calc(64px + var(--safe-t));z-index:4;pointer-events:none;white-space:pre-line;text-align:center;
  background:rgba(255,253,248,.92);color:var(--ink);padding:6px 12px;border-radius:12px;font-size:12.5px;font-weight:700;box-shadow:0 2px 10px rgba(0,0,0,.12);max-width:calc(100vw - 24px);word-break:keep-all}
html.hc #measure{background:#000;color:#fff}
/* v39: themes for a long, easy play — soft (warm, lower contrast, less blue) and night (dark; the 3D view and
   pictures keep their own colours) */
html.theme-soft body{filter:sepia(.22) saturate(.88) brightness(.97)}
html.theme-night body{filter:invert(1) hue-rotate(180deg) brightness(.92)}
html.theme-night canvas,html.theme-night img{filter:invert(1) hue-rotate(180deg)}
/* the pages to read: the glossary and the world */
#infoSheet #infoBody{max-height:min(62vh,560px);overflow:auto;-webkit-overflow-scrolling:touch}
#infoSheet h4{margin:12px 2px 6px;font-size:13px;color:var(--sub)}
#infoSheet dl.gloss{margin:0}
#infoSheet dl.gloss dt{font-weight:800;margin-top:10px;word-break:keep-all}
#infoSheet dl.gloss dt small{font-weight:600;color:var(--sub);margin-left:4px}
#infoSheet dl.gloss dd{margin:3px 0 0;font-size:13.5px;line-height:1.6;word-break:keep-all;overflow-wrap:anywhere}
#infoSheet .wcard{display:flex;gap:10px;align-items:flex-start;padding:10px 0;border-bottom:1px solid var(--line)}
#infoSheet .wcard canvas{flex:none;width:64px;height:64px;border-radius:10px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.12)}
#infoSheet .wtx b{font-size:15px}
#infoSheet .wown{margin-left:8px;font-size:13px;color:var(--sub);font-weight:700}
#infoSheet .wtx p{margin:4px 0 6px;font-size:13.5px;line-height:1.6;word-break:keep-all;overflow-wrap:anywhere}
#infoSheet .wrow{display:flex;gap:6px;flex-wrap:wrap}
#infoSheet .wrow button{height:34px;padding:0 12px;border-radius:999px;font-weight:700}
#a11yBody .presets .segopt button{min-height:36px}

/* v39: the small links on the title wrap as whole words (four of them now); the ruler sits below the header */
#title .subrow{flex-wrap:wrap;row-gap:2px}
#title .subrow>button{white-space:nowrap;word-break:keep-all}
#measure{top:calc(112px + var(--safe-t))}
/* v40: large text: つくる's main row in two rows of four, so every name shows whole ("裏…" was cut) */
@media (max-width:739px) and (orientation:portrait){
  html.big #createBar .tools.main,html.bigger #createBar .tools.main{grid-template-columns:repeat(4,minmax(0,1fr))}
  html.big #createBar .tools.main .tool span,html.bigger #createBar .tools.main .tool span{overflow:visible;text-overflow:clip;white-space:normal;word-break:keep-all;line-height:1.1}
}

/* v40: moving pictures on the pages that explain (made from the game's own folds) */
#how .howfig{margin:4px 0 10px;text-align:center}
#how .howfig img{width:min(240px,62vw);height:auto;border-radius:14px;box-shadow:0 2px 10px rgba(0,0,0,.12);background:#ebe6db}
#how .howfig figcaption{font-size:12.5px;color:var(--sub);margin-top:6px;word-break:keep-all;overflow-wrap:anywhere}
#infoSheet dl.gloss dd .howgif{float:right;width:96px;height:96px;margin:0 0 6px 10px;border-radius:10px;background:#ebe6db;box-shadow:inset 0 0 0 1px rgba(0,0,0,.08)}
#infoSheet dl.gloss dd::after{content:"";display:block;clear:both}

/* v41: the language list (one tap opens it, one picks): the pill keeps one width so nothing moves under the finger */
.langpill{min-width:128px;justify-content:center}
#langMenu{position:absolute;top:calc(54px + var(--safe-t));right:calc(12px + var(--safe-r));z-index:40;min-width:200px;max-width:calc(100vw - 24px);
  display:grid;gap:2px;padding:6px;border-radius:18px;background:var(--panel);border:1px solid var(--line);box-shadow:var(--shadow,0 10px 28px rgba(27,37,54,.12));
  -webkit-backdrop-filter:blur(16px) saturate(1.3);backdrop-filter:blur(16px) saturate(1.3)}
#langMenu button{min-height:46px;padding:6px 16px 6px 38px;border:0;border-radius:12px;background:transparent;text-align:left;font-size:16px;font-weight:650;color:var(--ink);
  display:flex;flex-direction:column;justify-content:center;position:relative}
#langMenu button small{font-size:12px;font-weight:600;color:var(--sub)}
#langMenu button:first-child{border-bottom:1px solid var(--line);border-radius:12px 12px 4px 4px;margin-bottom:2px}
#langMenu button.on{background:rgba(27,37,54,.07);font-weight:800}
#langMenu button.on::before{content:'';position:absolute;left:15px;top:50%;width:11px;height:6px;margin-top:-5px;border-left:2.5px solid currentColor;border-bottom:2.5px solid currentColor;transform:rotate(-45deg)}
#langMenu button:focus-visible{outline:2px solid var(--blue);outline-offset:-2px}
@media (prefers-reduced-transparency:reduce){#langMenu{-webkit-backdrop-filter:none;backdrop-filter:none;background-color:#fffefb}}

/* v41: the palette as a card of 24 (6×4: warm / green-blue / pink-purple-brown / white-black), the chosen name under it */
.chips.palauto{align-items:center;gap:8px;margin-bottom:6px}
.palautolbl{font-size:13px;font-weight:700;color:var(--sub)}
.chips.palette{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:4px 6px;max-width:330px;padding:8px;border-radius:14px;background:#fff;box-shadow:inset 0 0 0 1px var(--line)}
.chips.palette .chip{width:100%;max-width:46px;height:auto;aspect-ratio:1;justify-self:center}
.chips.palette .chip i{width:78%;height:78%;border-radius:50%;box-shadow:inset 0 0 0 1px rgba(0,0,0,.12),inset 0 -3px 5px rgba(0,0,0,.10)}
.palname{margin:6px 4px 0;font-size:14px;font-weight:750;letter-spacing:.06em;color:var(--ink);min-height:1.3em}

/* v41: お絵描き — the pen bar along the bottom; while drawing, the rest of the screen's controls step aside */
body.painting #createBar,body.painting #skin .skpanel,body.painting #cPop,body.painting .ic.top,body.painting #objPad,body.painting #exBanner,body.painting #cPlace{display:none!important}
#paintBar{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(10px + var(--safe-b));z-index:60;width:min(560px,calc(100vw - 16px));
  display:grid;gap:8px;padding:10px;border-radius:20px;background:var(--panel);border:1px solid var(--line);box-shadow:var(--shadow,0 10px 28px rgba(27,37,54,.14));
  -webkit-backdrop-filter:blur(16px) saturate(1.3);backdrop-filter:blur(16px) saturate(1.3)}
#paintBar.hidden{display:none}
#paintBar .pinks{display:flex;justify-content:space-between;gap:2px}
#paintBar .pink{flex:none;width:clamp(28px,8vw,40px);height:clamp(28px,8vw,40px);padding:0;border-radius:50%;display:grid;place-items:center;border:2px solid transparent}
#paintBar .pink i{width:72%;height:72%;border-radius:50%;box-shadow:inset 0 0 0 1px rgba(0,0,0,.18)}
#paintBar .pink.on{border-color:var(--ink)}
#paintBar .pink svg,#paintBar .ptool svg{width:22px;height:22px}
#paintBar .ptools{display:flex;flex-wrap:wrap;gap:6px;align-items:center;justify-content:space-between}
#paintBar .psizes{display:flex;gap:4px;padding:2px;border-radius:12px;background:rgba(27,37,54,.06)}
#paintBar .psize{width:40px;height:40px;border-radius:10px;display:grid;place-items:center;border:2px solid transparent}
#paintBar .psize i{border-radius:50%;background:var(--ink);display:block}
#paintBar .psize.on{border-color:var(--ink);background:#fff}
#paintBar .ptool{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;background:#fff;border:1px solid var(--line)}
#paintBar .pdone{height:42px;padding:0 18px;border-radius:12px;font-weight:800;font-size:15px}
#paintBar button:focus-visible{outline:2px solid var(--blue);outline-offset:1px}
body.painting canvas{cursor:crosshair}

/* v41: a work's name from words (two rows of word chips, a dice); typing only for a grown-up */
#galPick{display:grid;gap:8px;margin:6px 0}
.gpktop{display:flex;gap:8px;flex-wrap:wrap}
.gpktop button{height:42px;padding:0 16px;border-radius:12px;font-weight:750}
.gpkbody{display:grid;gap:6px}
.gpkname{margin:2px 0;font-size:17px;font-weight:800;min-height:1.4em}
.gpklbl{font-size:12px;color:var(--sub);letter-spacing:.06em}
.gpkrow{display:flex;gap:6px;overflow-x:auto;padding:2px 2px 6px;scrollbar-width:thin;-webkit-overflow-scrolling:touch}
.gpkw{flex:none;height:40px;padding:0 14px;border-radius:999px;background:#fff;border:1px solid var(--line);font-size:15px;font-weight:650;white-space:nowrap}
.gpkw.on{background:var(--ink);color:#fff;border-color:var(--ink)}
.gpkbody>.primary{height:44px;border-radius:12px;font-weight:800}
.gpkbody>.primary:disabled{opacity:.45}
.gpktyped{justify-self:start;font-size:13px;color:var(--sub);text-decoration:underline;padding:4px 2px}
.gpkgate{display:flex;gap:8px;align-items:center;flex-wrap:wrap;font-size:14px}
.gpkgate input{width:90px;height:38px;border-radius:10px;border:1px solid var(--line);padding:0 8px;font-size:16px}
.gpkgate button{height:38px;padding:0 14px;border-radius:10px;border:1px solid var(--line);background:#fff}

/* v41: the support link is a full-size tap target (it was 18px tall) */
a[data-t="support"]{display:inline-block;padding:10px 6px;margin:-10px -6px}
#paintBar .pdone{margin-left:auto}
#cDraw{display:none!important} /* (only its icon is used, in the "more" menu) */

/* v42: the name KAMIHIRAKI (10 letters): one line on any screen */
.brand h1{font-size:clamp(22px,6.6vw,58px);letter-spacing:.26em;padding-left:.26em;white-space:nowrap}

/* v44: the paper lab — materials along the top, the tools in a 4-wide grid; the rest of the screen steps aside */
body.labbing #createBar,body.labbing #viewBar,body.labbing #vwTools,body.labbing #cPop,body.labbing #objPad,body.labbing #exBanner,body.labbing #cPlace,body.labbing #measure{display:none!important}
#labBar{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(10px + var(--safe-b));z-index:60;width:min(560px,calc(100vw - 16px));
  display:grid;gap:8px;padding:10px;border-radius:20px;background:var(--panel);border:1px solid var(--line);box-shadow:var(--shadow,0 10px 28px rgba(27,37,54,.14));
  -webkit-backdrop-filter:blur(16px) saturate(1.3);backdrop-filter:blur(16px) saturate(1.3)}
#labBar.hidden,#labStats.hidden{display:none}
#labBar .lmats{display:flex;gap:6px;overflow-x:auto;padding-bottom:2px;scrollbar-width:none}
#labBar .lmat{flex:none;height:36px;padding:0 13px;border-radius:999px;background:#fff;border:1px solid var(--line);font-size:14px;font-weight:700;white-space:nowrap}
#labBar .lmat.on{background:var(--ink);color:#fff;border-color:var(--ink)}
#labBar .ltools{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
#labBar .ltool{height:42px;border-radius:12px;background:#fff;border:1px solid var(--line);font-size:14px;font-weight:750;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 4px}
#labBar .ltool.on{background:#26395a;color:#fff;border-color:#26395a}
#labBar .ltool.lback{border-color:var(--ink)}
#labBar button:focus-visible{outline:2px solid var(--blue);outline-offset:1px}
#labStats{position:fixed;left:12px;top:calc(64px + var(--safe-t));z-index:59;padding:6px 10px;border-radius:10px;background:rgba(27,37,54,.82);color:#fff;font:600 12px/1.4 ui-monospace,Consolas,monospace}
body.labbing canvas{cursor:grab}

/* v44: the diorama — a panel of tabs along the bottom, back and photo on top; effects drawn over the picture */
.galdio{margin-left:auto;height:38px;padding:0 14px;border-radius:999px;font-weight:750;border:1px solid var(--line)!important}
#dioBar{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(10px + var(--safe-b));z-index:60;width:min(600px,calc(100vw - 16px));max-height:44vh;
  display:grid;grid-template-rows:auto minmax(0,1fr);gap:8px;padding:10px;border-radius:20px;background:var(--panel);border:1px solid var(--line);box-shadow:var(--shadow,0 10px 28px rgba(27,37,54,.14));
  -webkit-backdrop-filter:blur(16px) saturate(1.3);backdrop-filter:blur(16px) saturate(1.3)}
#dioBar.hidden,#dioTop.hidden,#dioFx.hidden{display:none}
#dioBar .dtabs{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px;padding:3px;border-radius:12px;background:rgba(27,37,54,.06)}
#dioBar .dtabs button{height:38px;border-radius:10px;font-size:14px;font-weight:750;white-space:nowrap}
#dioBar .dtabs button.on{background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.12)}
#dioBar .dbody{overflow-y:auto;display:grid;gap:8px;align-content:start}
#dioBar .dchips{display:flex;flex-wrap:wrap;gap:6px}
#dioBar .dchip{height:40px;padding:0 14px;border-radius:999px;background:#fff;border:1px solid var(--line);font-size:14px;font-weight:700}
#dioBar .dchip.on{background:var(--ink);color:#fff;border-color:var(--ink)}
#dioBar .dworks{display:grid;grid-template-columns:repeat(auto-fill,minmax(64px,1fr));gap:6px}
#dioBar .dwork{aspect-ratio:1;border-radius:12px;overflow:hidden;border:2px solid transparent;background:#fff;padding:0}
#dioBar .dwork img{width:100%;height:100%;object-fit:cover;display:block}
#dioBar .dwork.on{border-color:var(--ink);box-shadow:0 0 0 2px #fff inset}
#dioBar .dslider{display:grid;grid-template-columns:5.5em minmax(0,1fr) 3.6em;align-items:center;gap:8px;font-size:13px;font-weight:700}
#dioBar .dslider input{width:100%;accent-color:#26395a}
#dioBar .dslider output{text-align:right;font-variant-numeric:tabular-nums;color:var(--sub)}
#dioTop{position:fixed;top:calc(10px + var(--safe-t));left:calc(12px + var(--safe-l));right:calc(12px + var(--safe-r));z-index:60;display:flex;justify-content:space-between;align-items:center;pointer-events:none}
#dioTop>*{pointer-events:auto}
#dioTop .dphoto{height:44px;padding:0 18px;border-radius:999px;font-weight:800}
#dioFx{position:fixed;inset:0;z-index:5;pointer-events:none}
#dioFx.vignette{background:radial-gradient(ellipse at center,rgba(0,0,0,0) 45%,rgba(0,0,0,.45) 100%)}
#dioFx.tilt{-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);-webkit-mask-image:linear-gradient(#000 0,transparent 32%,transparent 68%,#000 100%);mask-image:linear-gradient(#000 0,transparent 32%,transparent 68%,#000 100%)}
#dioFx.vignette.tilt{background:radial-gradient(ellipse at center,rgba(0,0,0,0) 45%,rgba(0,0,0,.45) 100%)}
canvas.dio-film{filter:sepia(.28) contrast(1.08) saturate(.9)}
body.dio-flash::after{content:'';position:fixed;inset:0;background:#fff;opacity:.7;z-index:80;pointer-events:none}

/* v45: the new tools follow 見やすさ — larger with big text (sized to the zoomed screen), thicker lines with contrast,
   and in かんたん fewer, bigger buttons */
html.big #paintBar,html.big #labBar,html.big #dioBar,html.big #dioTop,html.big #langMenu,html.big #labStats{zoom:1.16}
html.bigger #paintBar,html.bigger #labBar,html.bigger #dioBar,html.bigger #dioTop,html.bigger #langMenu,html.bigger #labStats{zoom:1.32}
#paintBar,#labBar{width:min(560px,calc(var(--vw) - 16px))}
#dioBar{width:min(600px,calc(var(--vw) - 16px));max-height:calc(var(--vh) * .44)}
html.hc #labBar .ltool,html.hc #labBar .lmat,html.hc #dioBar .dchip,html.hc #dioBar .dwork,html.hc #paintBar .ptool,html.hc #paintBar .psize,html.hc #langMenu button{border-width:2px;border-color:#000}
html.hc #labBar .ltool.on,html.hc #dioBar .dchip.on,html.hc #labBar .lmat.on{outline:3px solid #ffd84d;outline-offset:-5px}
#labBar.easy .ltool{height:54px;font-size:16px}
#labBar.easy .lmat{height:42px;font-size:15px}
#labBar .llevel,#paintBar .plevel,#dioTop .dlevel{font-weight:800;border-style:dashed!important}
#paintBar .plevel{width:auto;padding:0 10px;font-size:13px}
#paintBar.easy .pink{width:clamp(36px,10vw,46px);height:clamp(36px,10vw,46px)}
#paintBar.easy .ptool{width:48px;height:48px}
#labBar .lpower{display:grid;grid-template-columns:4em minmax(0,1fr) 3.4em;align-items:center;gap:8px;font-size:13px;font-weight:700}
#labBar .lpower input{width:100%;accent-color:#26395a}
#labBar .lpower output{text-align:right;color:var(--sub);font-variant-numeric:tabular-nums}
#dioTop .dright{display:flex;gap:8px}
#dioTop .dlevel{height:44px;padding:0 14px;border-radius:999px;background:var(--panel);border:1px solid var(--line);font-size:14px}
#dioBar.easy .dchip{height:46px;font-size:15px;padding:0 16px}
#dioBar.easy .dtabs button{height:44px;font-size:15px}
#labBar .ltool{white-space:normal;word-break:keep-all;line-height:1.15;text-overflow:clip}
html.big #labBar .ltools,html.bigger #labBar .ltools{grid-template-columns:repeat(3,minmax(0,1fr))}
html.big #dioBar .dtabs button,html.bigger #dioBar .dtabs button{font-size:13px;padding:0 2px;white-space:normal;line-height:1.1}

/* v46: the paper lab — swatches for the material, tools as icon tiles in groups, a line of what is happening */
#labBar .lhead{display:flex;gap:6px;align-items:center;min-width:0}
#labBar .llevel{flex:none;height:38px;padding:0 12px;border-radius:999px;background:#fff;border:1.5px dashed var(--line);font-size:13px;font-weight:800}
#labBar .lmats{flex:1;min-width:0}
#labBar .lmat{display:flex;align-items:center;gap:6px;padding:0 12px 0 6px}
#labBar .lmat i{width:22px;height:22px;border-radius:50%;box-shadow:inset 0 0 0 1px rgba(0,0,0,.18),inset 0 -3px 4px rgba(0,0,0,.1);flex:none}
#labBar .lcats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;padding:3px;border-radius:12px;background:rgba(27,37,54,.06)}
#labBar .lcats button{height:34px;border-radius:9px;font-size:13px;font-weight:750;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#labBar .lcats button.on{background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.12)}
#labBar .ltiles{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
#labBar .ltile{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:62px;padding:6px 2px;border-radius:14px;background:#fff;border:1px solid var(--line);font-size:13px;font-weight:750;line-height:1.1;word-break:keep-all}
#labBar .ltile svg{width:26px;height:26px}
#labBar .ltile.on{background:#26395a;color:#fff;border-color:#26395a}
#labBar .ltile.lback{border:1.5px solid var(--ink)}
#labBar.easy .ltile{min-height:74px;font-size:15px}
#labBar.easy .ltile svg{width:30px;height:30px}
#labBar .lfoot{display:flex;align-items:center;gap:8px}
#labBar .lhint{flex:1;font-size:12.5px;color:var(--sub);font-weight:650;line-height:1.3}
#labBar .ldone{height:44px;padding:0 22px;border-radius:12px;font-weight:800}
#labState{position:fixed;left:50%;transform:translateX(-50%);top:calc(64px + var(--safe-t));z-index:58;max-width:calc(var(--vw) - 24px);padding:6px 14px;border-radius:999px;background:rgba(27,37,54,.78);color:#fff;font-size:13px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none}
#labState.hidden,#labGuide.hidden{display:none}
#labGuide{position:fixed;inset:0;width:100vw;height:100vh;z-index:57;pointer-events:none}
#labGuide line{stroke:#ffffff;stroke-width:3;stroke-dasharray:10 7;stroke-linecap:round;filter:drop-shadow(0 0 2px rgba(0,0,0,.6))}
#labStats{top:calc(100px + var(--safe-t))}
html.big #labState,html.big #labGuide{zoom:1}
html.big #labState{font-size:15px}
html.hc #labBar .ltile{border-width:2px;border-color:#000}
html.hc #labBar .ltile.on{outline:3px solid #ffd84d;outline-offset:-5px}
html.big #labBar .ltiles,html.bigger #labBar .ltiles{grid-template-columns:repeat(4,minmax(0,1fr))}
html.bigger #labBar .ltiles{grid-template-columns:repeat(3,minmax(0,1fr))}

/* v46: past dailies — a list of days, the locked ones marked */
.pastlist{display:grid;gap:6px}
.pastrow{display:grid;grid-template-columns:4.2em minmax(0,1fr) auto;align-items:center;gap:8px;min-height:48px;padding:0 14px;border-radius:12px;background:#fff;border:1px solid var(--line);text-align:left}
.pastrow b{font-size:16px}
.pastrow span{font-size:14px;color:var(--sub)}
.pastrow small{font-size:13px;font-weight:700}
.pastrow.locked{background:rgba(27,37,54,.04)}
.pastrow.locked small{color:var(--sub);border:1px dashed var(--line);border-radius:999px;padding:2px 10px}
#labBar .lrewind{display:flex;align-items:center;gap:6px;height:44px;padding:0 14px;border-radius:12px;background:#fff;border:1.5px solid var(--ink);font-size:14px;font-weight:800;white-space:nowrap}
#labBar .lrewind svg{width:20px;height:20px}
a[data-t="privacy"]{display:inline-block;padding:10px 6px;margin:-10px -6px}
