/* Cell Split: tailor's cutting mat. Mat green, cream pattern paper, vermilion cuts, thread gold. */
.cs{--mat:#16332e;--mat2:#1d4039;--line:#2c5a50;--paper:#f2e9d4;--ink:#1c2733;--cut:#d9472b;--gold:#f4b942;--ok:#4fae7b;--txt:#e9efe6;--mut:#a9bdb3;
  position:relative;background:var(--mat);color:var(--txt);border-radius:16px;border:1px solid var(--line);padding:10px 10px calc(10px + env(safe-area-inset-bottom));
  font-family:"Trebuchet MS","Segoe UI",system-ui,sans-serif;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;overflow:hidden}
.cs [hidden]{display:none!important}
.cs button{font-family:inherit;touch-action:manipulation;-webkit-tap-highlight-color:transparent;cursor:pointer}
.cs-top{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:44px}
.cs-mode{flex:1;text-align:center;font-weight:700;font-size:.9rem;color:var(--mut);letter-spacing:.02em}
.cs-btn{min-height:44px;min-width:64px;padding:0 14px;border-radius:10px;border:1px solid var(--line);background:var(--mat2);color:var(--txt);font-weight:700;font-size:.9rem}
.cs-btn:disabled{opacity:.4;cursor:default}
.cs-btn:active:not(:disabled){transform:translateY(1px);background:#24524a}
.cs button:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
.cs-body{position:relative;min-height:520px}
.cs-target{display:flex;align-items:baseline;justify-content:center;gap:12px;margin:6px 0 8px}
.cs-target span{color:var(--mut);font-size:.9rem}
.cs-target b{font-size:2.3rem;line-height:1;color:var(--gold);font-variant-numeric:tabular-nums;text-shadow:0 2px 0 #0a1a17}
.cs-timer{position:relative;height:22px;border-radius:11px;background:#0e2420;border:1px solid var(--line);overflow:hidden;margin-bottom:8px}
.cs-timer i{position:absolute;left:0;top:0;bottom:0;width:100%;background:var(--ok);transition:width .2s linear}
.cs-timer i[data-low="1"]{background:var(--cut)}
.cs-timer span{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:.8rem;color:#fff;text-shadow:0 1px 2px #000}
.cs-stage{display:flex;justify-content:center;border-radius:12px;overflow:hidden;background:var(--mat)}
.cs-stage canvas{display:block;touch-action:none;-ms-touch-action:none;cursor:crosshair;border-radius:12px;max-width:100%}
.cs-status{min-height:2.6em;display:flex;align-items:center;justify-content:center;text-align:center;font-size:.92rem;color:var(--txt);margin:8px 4px 4px;line-height:1.3}
.cs-status[data-tone="good"]{color:#8be0ae;font-weight:700}
.cs-ctl{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.cs-cuts{margin-left:auto;font-size:.85rem;color:var(--mut);font-variant-numeric:tabular-nums}
.cs-keys{display:none;margin-top:8px;font-size:.72rem;color:var(--mut);text-align:center}
@media (hover:hover) and (pointer:fine){.cs-keys{display:block}}
.cs-screen{position:absolute;inset:0;background:var(--mat);z-index:3;display:flex;flex-direction:column;align-items:stretch;gap:10px;padding:8px 4px 10px;overflow-y:auto;overscroll-behavior:contain}
.cs[data-screen="title"] .cs-screen#cs-title,.cs[data-screen="result"] .cs-screen#cs-result{justify-content:center}
.cs-logo{display:flex;align-items:center;justify-content:center;gap:10px;margin:6px 0 2px;font-family:Georgia,"Times New Roman",serif;font-weight:700;font-size:2.6rem;line-height:1;color:var(--paper)}
.cs-logo span:first-child{transform:rotate(-4deg) translateY(2px)}
.cs-logo span:last-child{transform:rotate(3deg) translateY(-3px);color:var(--gold)}
.cs-logo i{display:block;width:0;height:2.4rem;border-left:4px dashed var(--cut);transform:rotate(14deg)}
.cs-tag{text-align:center;color:var(--mut);font-size:.95rem;line-height:1.35;margin:0 8px 2px}
.cs-rank{text-align:center;color:var(--gold);font-size:.85rem;font-weight:700;margin-bottom:4px}
.cs-big-btn{min-height:58px;border-radius:14px;border:2px solid var(--line);background:var(--mat2);color:var(--txt);display:flex;flex-direction:column;align-items:center;justify-content:center;padding:6px 12px;font-size:1.05rem;box-shadow:0 4px 0 #0b1c19}
.cs-big-btn small{font-size:.75rem;color:var(--mut);margin-top:2px;font-weight:600}
.cs-big-btn.primary{background:var(--cut);border-color:#f06a4d;color:#fff;box-shadow:0 4px 0 #8b2614}
.cs-big-btn.primary small{color:#ffe1d8}
.cs-big-btn:active{transform:translateY(3px);box-shadow:0 1px 0 #0b1c19}
.cs-lhead{display:flex;align-items:center;gap:12px}
.cs-lhead h2{font-size:1.2rem}
.cs-grid h3{font-size:.8rem;color:var(--gold);margin:12px 0 6px;letter-spacing:.04em;text-transform:uppercase}
.cs-row{display:grid;grid-template-columns:repeat(6,1fr);gap:6px}
.cs-lv{min-height:52px;border-radius:10px;border:1px solid var(--line);background:var(--mat2);color:var(--txt);display:flex;flex-direction:column;align-items:center;justify-content:center;padding:2px}
.cs-lv b{font-size:1rem}
.cs-lv span{font-size:.58rem;color:var(--mut)}
.cs-lv:disabled{opacity:.35;cursor:default}
.cs-screen h2{text-align:center;font-family:Georgia,serif;font-size:1.7rem;color:var(--paper)}
.cs-res-stars{display:flex;justify-content:center;gap:8px;min-height:56px}
.cs-star{width:52px;height:52px;fill:#294b43;stroke:#3b6a5f;stroke-width:1}
.cs-star.on{fill:var(--gold);stroke:#fff1c4;animation:cs-pop .45s cubic-bezier(.2,1.6,.4,1) both}
.cs-star.on:nth-child(2){animation-delay:.12s}.cs-star.on:nth-child(3){animation-delay:.24s}
.cs-big{font-size:3.4rem;font-weight:800;color:var(--gold);font-variant-numeric:tabular-nums}
.cs-res-lines{text-align:center;color:var(--mut);font-size:.95rem;line-height:1.5}
.cs-noscript{padding:20px;text-align:center}
@keyframes cs-pop{0%{transform:scale(.2) rotate(-30deg);opacity:0}100%{transform:scale(1) rotate(0);opacity:1}}
@media (prefers-reduced-motion:reduce){.cs *{animation:none!important;transition:none!important}}
@media (max-width:360px){.cs-logo{font-size:2.2rem}.cs-btn{padding:0 10px;min-width:56px}}

/* Full screen (shell immersive / native): hide page chrome, fill the stage */
html.pip-immersive .game-header,html.pip-immersive .ad-well,html.pip-immersive footer,html.pip-immersive #similar-games,html.pip-immersive .cs-keys,
html.pip-native .game-header,html.pip-native .ad-well,html.pip-native footer,html.pip-native #similar-games,html.pip-native .cs-keys{display:none!important}
html.pip-immersive .game-wrap,html.pip-native .game-wrap{max-width:none;height:100%;padding:0;display:flex;flex-direction:column}
html.pip-immersive .cs,html.pip-native .cs{flex:1;min-height:0;display:flex;flex-direction:column;border-radius:0;border:0;padding:6px 8px calc(6px + env(safe-area-inset-bottom))}
html.pip-immersive .cs-body,html.pip-native .cs-body{flex:1;min-height:0;display:flex;flex-direction:column}
html.pip-immersive .cs-stage,html.pip-native .cs-stage{flex:1;min-height:0;align-items:center}
html.pip-immersive .cs-target,html.pip-native .cs-target{margin:2px 0 4px}
html.pip-immersive .cs-status,html.pip-native .cs-status{min-height:1.4em;margin:4px}
