/* Kideotainment play kit styles: TapGame (.tg-*) + the "Your turn!" spelling overlay (.sp-*) */

/* ---------- TapGame ---------- */
.tg{display:flex;flex-direction:column;align-items:center;gap:22px;width:100%}
.tg-slots{display:flex;justify-content:center;gap:6px;width:100%;flex-wrap:nowrap}
.tg-slot{--s:min(64px,calc((100vw - 44px) / var(--n,4) - 6px));width:var(--s);height:calc(var(--s) * 1.15);border-radius:12px;border:3px dashed #b9c4e6;background:#fff;
  display:grid;place-items:center;font-family:KFredoka,KNunito,system-ui,sans-serif;font-size:calc(var(--s) * .72);line-height:1;color:var(--c,#1c2340);transition:border-color .2s,background .2s}
.tg-slot.current{border-color:#2f6bff;background:#f0f4ff;box-shadow:0 0 0 4px rgba(47,107,255,.15)}
.tg-slot.filled{border-style:solid;border-color:var(--c,#2f6bff);background:#fff}
.tg-slot.given{border-color:transparent;background:transparent;width:calc(var(--s) * .45)}
.tg-slot.pop{animation:tg-pop .45s cubic-bezier(.3,1.6,.5,1)}
.tg-slot.nudge{animation:tg-wiggle .45s ease}
.tg-tiles{display:flex;flex-wrap:wrap;justify-content:center;gap:12px;max-width:560px}
.tg-tile{--c:#2f6bff;min-width:72px;height:72px;padding:0 8px;border:0;border-radius:18px;background:var(--c);color:#fff;cursor:pointer;
  font-family:KFredoka,KNunito,system-ui,sans-serif;font-size:42px;line-height:1;box-shadow:0 6px 0 rgba(0,0,0,.18);text-shadow:0 2px 0 rgba(0,0,0,.15);
  touch-action:manipulation;-webkit-tap-highlight-color:transparent;transition:transform .08s,opacity .2s;user-select:none}
.tg-tile:active{transform:translateY(3px);box-shadow:0 3px 0 rgba(0,0,0,.18)}
.tg-tile:focus-visible{outline:4px solid #1c2340;outline-offset:3px}
.tg-tile.used{visibility:hidden}
.tg-tile.wiggle{animation:tg-wiggle .5s ease}
.tg-tile.hint{animation:tg-glow 1.1s ease-in-out infinite;outline:4px solid #ffc914;outline-offset:3px}
.tg-live{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.tg-fly{position:fixed;z-index:1001;border-radius:18px;color:#fff;display:grid;place-items:center;font-family:KFredoka,KNunito,system-ui,sans-serif;font-size:42px;
  pointer-events:none;box-shadow:0 8px 18px rgba(0,0,0,.18);transform-origin:center}
.tg-spark{position:fixed;z-index:1002;font-size:18px;pointer-events:none;transform:translate(-50%,-50%)}
.tg-confetti{position:fixed;inset:0;width:100vw;height:100vh;z-index:1003;pointer-events:none}
@keyframes tg-pop{0%{transform:scale(.6)}60%{transform:scale(1.18)}100%{transform:scale(1)}}
@keyframes tg-wiggle{0%,100%{transform:translateX(0) rotate(0)}20%{transform:translateX(-6px) rotate(-5deg)}40%{transform:translateX(5px) rotate(4deg)}60%{transform:translateX(-3px) rotate(-2deg)}80%{transform:translateX(2px)}}
@keyframes tg-glow{0%,100%{box-shadow:0 6px 0 rgba(0,0,0,.18),0 0 0 0 rgba(255,201,20,.9)}50%{box-shadow:0 6px 0 rgba(0,0,0,.18),0 0 22px 10px rgba(255,201,20,.75);transform:scale(1.06)}}

/* ---------- "Your turn!" button (under the preview) ---------- */
.yt-btn{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:64px;margin-top:10px;border:0;border-radius:16px;cursor:pointer;
  background:linear-gradient(135deg,#ff5aae,#7f5cff);color:#fff;font-family:KFredoka,KNunito,system-ui,sans-serif;font-size:24px;box-shadow:0 5px 0 #6a3fd6;
  touch-action:manipulation;transition:transform .08s}
.yt-btn:active{transform:translateY(3px);box-shadow:0 2px 0 #6a3fd6}
.yt-btn:focus-visible{outline:4px solid #1c2340;outline-offset:3px}
.yt-btn[hidden]{display:none}
.yt-btn.appear{animation:tg-pop .5s cubic-bezier(.3,1.6,.5,1)}

/* ---------- overlay ---------- */
html.sp-lock,html.sp-lock body{overflow:hidden}
.sp-overlay{position:fixed;inset:0;z-index:1000;background:linear-gradient(180deg,#eaf0ff 0%,#fff4fb 100%);overflow-y:auto;-webkit-overflow-scrolling:touch}
.sp-overlay[hidden]{display:none}
.sp-panel{max-width:640px;margin:0 auto;min-height:100%;padding:max(10px,env(safe-area-inset-top)) 14px max(24px,env(safe-area-inset-bottom));display:flex;flex-direction:column;align-items:center;gap:10px}
.sp-top{display:flex;align-items:center;gap:10px;width:100%}
.sp-x{width:52px;height:52px;border-radius:50%;border:0;background:#fff;color:#1c2340;font-size:22px;cursor:pointer;box-shadow:0 3px 10px rgba(31,79,214,.15)}
.sp-stars{font-family:KFredoka,KNunito,system-ui,sans-serif;font-size:22px;background:#fff;border-radius:99px;padding:8px 14px;box-shadow:0 3px 10px rgba(31,79,214,.12);color:#5a3b00}
.sp-stars.bump{animation:tg-pop .5s cubic-bezier(.3,1.6,.5,1)}
.sp-tools{margin-left:auto;display:flex;align-items:center;gap:8px}
.sp-tool{width:52px;height:52px;border-radius:50%;border:0;background:#fff;font-size:22px;cursor:pointer;opacity:.55;box-shadow:0 3px 10px rgba(31,79,214,.12)}
.sp-tool.on{opacity:1;box-shadow:0 0 0 3px #7f5cff}
.sp-level{display:flex;background:#fff;border-radius:99px;padding:4px;box-shadow:0 3px 10px rgba(31,79,214,.12)}
.sp-level[hidden]{display:none}
.sp-level button{border:0;background:transparent;border-radius:99px;min-height:44px;padding:0 12px;font:inherit;font-weight:900;font-size:14px;color:#62698a;cursor:pointer}
.sp-level button.on{background:#2f6bff;color:#fff}
.sp-title{margin:4px 0 0;font-family:KFredoka,KNunito,system-ui,sans-serif;font-size:clamp(30px,8vw,44px);color:#1f4fd6;text-align:center}
.sp-pic{height:120px;display:grid;place-items:center}
.sp-pic[hidden]{display:none}
.sp-pic img{height:120px;width:auto;animation:sp-bob 2.4s ease-in-out infinite}
.sp-pic img.pair{height:130px}
.sp-ask{margin:0;font-weight:900;color:#62698a;font-size:16px;text-align:center}
.sp-ask[hidden]{display:none}
.sp-game{width:100%;padding-top:6px}
.sp-done{display:flex;flex-direction:column;align-items:center;gap:12px;width:100%;text-align:center}
.sp-done[hidden]{display:none}
.sp-cheer{width:200px;height:auto;animation:sp-jump 1.2s ease-in-out infinite}
.sp-yay{margin:0;font-family:KFredoka,KNunito,system-ui,sans-serif;font-size:clamp(28px,7.5vw,40px);color:#ff5aae;outline:none}
.sp-btns{display:flex;gap:10px;width:100%;max-width:420px}
.sp-btn{flex:1;min-height:64px;border:0;border-radius:16px;font-family:KFredoka,KNunito,system-ui,sans-serif;font-size:21px;cursor:pointer;touch-action:manipulation}
.sp-btn.again{background:#fff;color:#1f4fd6;box-shadow:0 5px 0 #c9d3f0,0 0 0 2.5px #2f6bff inset}
.sp-btn.new{background:#35c759;color:#fff;box-shadow:0 5px 0 #239a42}
.sp-btn.video{width:100%;max-width:420px;flex:none;background:#ffc914;color:#4a3000;box-shadow:0 5px 0 #d9a400}
.sp-btn:active{transform:translateY(3px)}
.sp-btn:focus-visible,.sp-x:focus-visible,.sp-tool:focus-visible,.sp-level button:focus-visible{outline:4px solid #1c2340;outline-offset:3px}
.sp-hear{color:#7f5cff;font-weight:900;font-size:15px;text-decoration:underline;padding:10px}
.sp-hear[hidden]{display:none}
.sp-overlay.won .sp-pic{display:none}
@keyframes sp-bob{0%,100%{transform:translateY(0)}50%{transform:translateY(-6px)}}
@keyframes sp-jump{0%,100%{transform:translateY(0) rotate(0)}30%{transform:translateY(-14px) rotate(-3deg)}60%{transform:translateY(0) rotate(2deg)}}
@media (max-width:380px){.tg-tile{min-width:64px;height:64px;font-size:36px}.sp-level button{padding:0 9px}}
@media (prefers-reduced-motion:reduce){
  .tg-slot.pop,.tg-slot.nudge,.tg-tile.wiggle,.sp-pic img,.sp-cheer,.sp-stars.bump,.yt-btn.appear{animation:none}
  .tg-tile.hint{animation:none;box-shadow:0 0 0 6px rgba(255,201,20,.9)}
  .tg-tile.wiggle{opacity:.6}
}
/* completion: leftover decoys out of the way, keep everything on one phone screen */
body[data-play-state="done"] .sp-overlay .tg-tiles{display:none}
body[data-play-state="done"] .sp-cheer{width:auto;max-width:200px;max-height:min(34vh,300px);object-fit:contain}
/* share row on the done screen */
.sp-share{width:100%;max-width:420px;margin-top:2px}
.sp-share .sh-btn{min-height:52px;font-size:16px}
