/* Loop Stitch: sampler cloth. Linen paper, indigo ink, three thread colours. */
.ls{position:relative;min-height:600px;color:#25324b;font-family:system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;-webkit-tap-highlight-color:transparent}
.ls [hidden]{display:none!important}
.ls-top{display:flex;justify-content:space-between;font-size:.8rem;font-weight:600;padding:0 .15rem .4rem;color:#4a5a78}
.ls-card{background:#fbf6ea;border:2px dashed #b9a67f;border-radius:10px;padding:.6rem .8rem;margin-bottom:.6rem;box-shadow:0 0 0 4px #fbf6ea,0 0 0 5px #d8c9a4,0 3px 8px rgba(37,50,75,.12)}
.ls-goal{margin:.4rem 0 0;font-size:.74rem;color:#6a6552;border-top:1px dotted #b9a67f;padding-top:.3rem}
.ls-card h2{margin:0 0 .35rem;font-family:Georgia,'Times New Roman',serif;font-size:1.02rem;font-weight:700;letter-spacing:0;line-height:1.25;color:#25324b}
.ls-rules{list-style:none;margin:0;padding:0}
.ls-rule{display:flex;gap:.55rem;align-items:flex-start;font-size:.9rem;line-height:1.3;padding:.18rem 0}
.ls-mark{flex:0 0 18px;height:18px;border-radius:50%;border:2px solid #8a7a55;margin-top:1px;position:relative;transition:background .2s,border-color .2s}
.ls-rule.ok .ls-mark{background:#2b8a80;border-color:#2b8a80}
.ls-rule.ok .ls-mark::after{content:"";position:absolute;left:5px;top:1px;width:4px;height:8px;border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg)}
.ls-rule.bad .ls-mark{background:#b3261e;border-color:#b3261e}
.ls-rule.bad .ls-mark::after{content:"";position:absolute;left:3px;top:6px;width:8px;height:2px;background:#fff}
.ls-rule.bad{color:#8e1e17;font-weight:600}
.ls-stage{display:flex;justify-content:center;touch-action:none;user-select:none;-webkit-user-select:none;padding:.3rem 0;border-radius:14px;background:repeating-linear-gradient(0deg,rgba(120,95,55,.06) 0 1px,transparent 1px 4px),repeating-linear-gradient(90deg,rgba(120,95,55,.06) 0 1px,transparent 1px 4px)}
#ls-canvas{display:block;filter:drop-shadow(0 6px 8px rgba(37,50,75,.28));touch-action:none;cursor:pointer;border-radius:50%;max-width:100%;outline-offset:4px}
.ls-coach{min-height:2.6em;margin:.5rem 0;font-size:.88rem;line-height:1.3;text-align:center;color:#3b4a68}
.ls-dock{min-height:118px}
.ls-chips{display:flex;gap:.4rem;margin-bottom:.45rem}
.ls-chip{flex:1;min-height:48px;border-radius:10px;border:2px solid var(--tc);background:#fbf6ea;color:#25324b;display:flex;flex-direction:column;align-items:center;justify-content:center;font:inherit;cursor:pointer;padding:.15rem}
.ls-chip.act{background:var(--tc);color:#fff}
.ls-chip-n{font-weight:700;font-size:.85rem}.ls-chip-v{font-size:.72rem;opacity:.85}
.ls-row{display:flex;gap:.4rem;flex-wrap:wrap}
.ls-btn{flex:1 1 0;min-width:76px;min-height:48px;border-radius:10px;border:0;background:#25324b;color:#efe5cf;font:inherit;font-weight:600;font-size:.88rem;cursor:pointer;outline:2px dashed rgba(239,229,207,.4);outline-offset:-5px;padding:.4rem .5rem}
.ls-btn:disabled{opacity:.4;cursor:default}
.ls-btn.pri{background:#c4483c;color:#fff}
.ls-btn.big{display:block;width:100%;min-height:54px;margin-top:.55rem;font-size:1rem}
.ls-btn:focus-visible,.ls-chip:focus-visible,.ls-cell:focus-visible{outline:3px solid #d49a1e;outline-offset:2px}
.ls-btn:active:not(:disabled){transform:translateY(2px);box-shadow:none}
.ls-btn{box-shadow:0 3px 0 rgba(0,0,0,.28)}
.ls-chip{transition:transform .12s}.ls-chip.act{transform:translateY(-2px);box-shadow:0 3px 0 rgba(0,0,0,.25)}
#ls-result:not([hidden]){animation:ls-rise .28s ease-out}
@keyframes ls-rise{from{transform:translateY(10px);opacity:0}to{transform:none;opacity:1}}
.ls-ot::after{content:"";display:block;height:4px;margin:.45rem auto 0;width:96px;background:repeating-linear-gradient(90deg,#c4483c 0 12px,transparent 12px 18px,#d49a1e 18px 30px,transparent 30px 36px,#2b8a80 36px 48px,transparent 48px 54px)}
.ls-result{background:#fbf6ea;border:2px dashed #b9a67f;border-radius:10px;padding:.7rem .8rem;text-align:center}
.ls-result.lost{border-color:#b3261e}
.ls-rh{margin:0;font-family:Georgia,'Times New Roman',serif;font-size:1.2rem;color:#25324b}
.ls-rm{margin:.3rem 0;font-size:.9rem}.ls-rn{margin:.2rem 0 .4rem;font-size:.8rem;color:#4a5a78}
.ls-stars{display:inline-flex;gap:6px;margin:.3rem 0}
.ls-star{width:22px;height:22px;background:#d6cbb0;clip-path:polygon(50% 0,62% 36%,100% 38%,70% 60%,80% 100%,50% 76%,20% 100%,30% 60%,0 38%,38% 36%)}
.ls-star.on{background:#d49a1e}
.ls-stars.big .ls-star{width:34px;height:34px}
.ls-stars.big .ls-star.on{animation:ls-pop .5s ease-out both}
.ls-stars.big .ls-star:nth-child(2).on{animation-delay:.12s}.ls-stars.big .ls-star:nth-child(3).on{animation-delay:.24s}
@keyframes ls-pop{0%{transform:scale(.2) rotate(-40deg)}70%{transform:scale(1.25)}100%{transform:scale(1)}}
.ls-over{position:absolute;inset:0;z-index:5;background:rgba(241,233,214,.97);border:2px dashed #b9a67f;border-radius:12px;padding:1.1rem 1rem;overflow:auto;display:flex;flex-direction:column;justify-content:center}
.ls-over:empty,.ls-over[hidden]{display:none}
.ls-over.book{justify-content:flex-start}
.ls-ot{margin:0 0 .4rem;text-align:center;font-family:Georgia,'Times New Roman',serif;font-size:1.9rem;color:#25324b;letter-spacing:0}
.ls-op{margin:.3rem 0;text-align:center;font-size:.92rem;line-height:1.4}
.ls-facts{display:flex;justify-content:center;gap:.9rem;flex-wrap:wrap;font-size:.8rem;font-weight:600;color:#4a5a78;margin:.4rem 0}
.ls-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:6px;margin:.5rem 0}
.ls-cell{min-height:52px;border-radius:8px;border:2px solid #b9a67f;background:#fbf6ea;color:#25324b;font:inherit;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;cursor:pointer;padding:2px}
.ls-cell:not(.lock):not(:disabled):active{transform:scale(.95)}.ls-cell.cur{border-color:#c4483c}.ls-cell.lock{opacity:.4;cursor:default}
.ls-cn{font-weight:700;font-size:.9rem}
.ls-dots{display:flex;gap:3px}.ls-dots i{width:7px;height:7px;border-radius:50%;background:#d6cbb0}.ls-dots i.on{background:#d49a1e}
.ls-keys{text-align:center;font-size:.75rem;color:#6a6552;margin:.6rem 0 0}
@media (hover:none){.ls-keys{display:none}}
@media (prefers-reduced-motion:reduce){.ls *{animation:none!important;transition:none!important}}
@media (max-width:360px){.ls-btn{min-width:66px;font-size:.8rem}}
#ls-result[hidden],#ls-controls[hidden]{display:none}

/* full screen (immersive and native): fill the stage, nothing scrolls */
html.pip-immersive .ls{height:100%;min-height:0;display:flex;flex-direction:column;padding:6px 8px;overflow:hidden}
html.pip-immersive .ls-goal,html.pip-immersive .ls-keys,html.pip-immersive .ad-well{display:none}
html.pip-immersive .ls-card{margin-bottom:4px;padding:.35rem .6rem}
html.pip-immersive .ls-top{padding-bottom:2px}
html.pip-immersive .ls-stage{flex:1 1 0;min-height:0;min-width:0;display:grid;place-items:center;padding:0;overflow:hidden;position:relative}
html.pip-immersive .ls-coach{min-height:0;margin:3px 0;font-size:.82rem}
html.pip-immersive .ls-dock{min-height:0;padding-bottom:env(safe-area-inset-bottom,0px)}
html.pip-immersive .ls-btn,html.pip-immersive .ls-chip{min-height:44px}
html.pip-immersive .ls-over{overflow:auto}
@media (orientation:landscape) and (max-height:520px){
html.pip-immersive .ls{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr);grid-template-rows:auto auto 1fr auto;column-gap:10px}
html.pip-immersive .ls-top{grid-column:1;grid-row:1}
html.pip-immersive .ls-card{grid-column:1;grid-row:2;overflow:auto;max-height:38vh}
html.pip-immersive .ls-stage{grid-column:2;grid-row:1/5}
html.pip-immersive .ls-coach{grid-column:1;grid-row:3;align-self:start}
html.pip-immersive .ls-dock{grid-column:1;grid-row:4}
html.pip-immersive .ls-btn{min-width:60px}
}
/* finish: stitched inner border and soft light on the stage */
.ls-stage{box-shadow:inset 0 0 0 2px rgba(185,166,127,.45),inset 0 10px 24px rgba(255,255,255,.35),inset 0 -12px 28px rgba(120,95,55,.12)}
