/* Superkids V1 -- Sticker pack (win popup) + Sticker Book */

/* ---------- home button ---------- */
.sk-book-btn {
  position: relative; width: 72px; height: 72px; font-size: 38px;
  background: linear-gradient(#fff, #fff6e0);
  box-shadow: 0 6px 0 var(--sun-d), 0 10px 18px rgba(0,0,0,.14);
}
.sk-book-btn:active { box-shadow: 0 1px 0 var(--sun-d); }
.sk-book-n {
  position: absolute; right: -6px; bottom: -6px; min-width: 30px; height: 30px; padding: 0 6px;
  border-radius: 999px; background: var(--pink); color: #fff;
  font-size: 18px; font-weight: 800; line-height: 30px;
  box-shadow: 0 3px 0 var(--pink-d);
}
.sk-book-btn.has-new::after {
  content: '✨'; position: absolute; top: -10px; left: -8px; font-size: 24px;
  animation: sk-wiggle 1s ease-in-out infinite;
}
.sk-book-btn.bump { animation: sk-bump .5s cubic-bezier(.34,1.56,.64,1); }

/* ---------- sticker pack in win popup ---------- */
.sk-win-sticker {
  position: relative; height: min(150px, 20vh); margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
}
.skp {
  position: absolute; height: 100%; aspect-ratio: 3 / 4; padding: 0; background: none;
  transform: scale(0); z-index: 3;
}
.skp.in { animation: skp-in .5s forwards cubic-bezier(.34,1.56,.64,1); }
.skp.in.shake { transform: scale(1); animation: skp-shake .5s ease-in-out infinite; }
.skp-body {
  position: absolute; left: 0; right: 0; top: 14%; bottom: 0; border-radius: 10px 10px 16px 16px;
  background:
    linear-gradient(115deg, rgba(255,255,255,.0) 30%, rgba(255,255,255,.6) 45%, rgba(255,255,255,0) 60%),
    linear-gradient(160deg, #a29bfe, #6C5CE7 55%, #FF6B9D);
  background-size: 250% 100%, 100% 100%;
  box-shadow: 0 6px 0 var(--grape-d), 0 12px 20px rgba(0,0,0,.2);
  display: flex; align-items: center; justify-content: center;
  animation: skp-shine 1.6s linear infinite;
}
.skp-top {
  position: absolute; left: 0; right: 0; top: 0; height: 18%;
  background: linear-gradient(#ffe39a, var(--sun));
  clip-path: polygon(0 100%, 0 30%, 8% 0, 16% 30%, 25% 0, 33% 30%, 42% 0, 50% 30%, 58% 0, 67% 30%, 75% 0, 83% 30%, 92% 0, 100% 30%, 100% 100%);
  transform-origin: 0 100%;
}
.skp-star { font-size: 52px; filter: drop-shadow(0 3px 0 rgba(0,0,0,.2)); animation: sk-float 1.2s ease-in-out infinite; }
.skp.open { animation: skp-gone .55s forwards ease-in; }
.skp.open .skp-top { animation: skp-tear .45s forwards ease-out; }

.skp-reveal {
  position: relative; height: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.skp-rays {
  position: absolute; inset: -30%; border-radius: 50%; opacity: 0;
  background: repeating-conic-gradient(rgba(255,203,110,.8) 0 10deg, rgba(255,255,255,0) 10deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 25%, transparent 68%); mask: radial-gradient(circle, #000 25%, transparent 68%);
}
.skp-img {
  position: relative; height: 100%; width: 100%; object-fit: contain; transform: scale(0);
  filter: drop-shadow(3px 0 0 #fff) drop-shadow(-3px 0 0 #fff) drop-shadow(0 3px 0 #fff) drop-shadow(0 -3px 0 #fff) drop-shadow(0 6px 6px rgba(0,0,0,.25));
}
.sk-win-sticker.revealed .skp-img { animation: skp-reveal .7s .1s forwards cubic-bezier(.34,1.56,.64,1); }
.sk-win-sticker.revealed .skp-img.bounce { transform: scale(1) rotate(-6deg); animation: skb-bounce .6s cubic-bezier(.34,1.56,.64,1); }
.sk-win-sticker.revealed .skp-rays { animation: skp-rays-in .5s .1s forwards, sk-spin 8s linear infinite; }

.skp-burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; z-index: 4; pointer-events: none; }
.skp-burst i {
  position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%; opacity: 0;
  transform: rotate(var(--a)) translateY(0);
}
.skp-burst i:nth-child(3n) { border-radius: 3px; }
.skp-burst i:nth-child(4n)::after { content: ''; }
.sk-win-sticker.revealed .skp-burst i { animation: skp-burst .8s forwards ease-out; }

@keyframes skp-in { 0% { transform: scale(0) rotate(-20deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes skp-shake {
  0%,100% { transform: rotate(0) scale(1); } 20% { transform: rotate(-9deg) scale(1.04); }
  40% { transform: rotate(8deg) scale(1.06); } 60% { transform: rotate(-6deg) scale(1.08); } 80% { transform: rotate(5deg) scale(1.05); }
}
@keyframes skp-shine { from { background-position: 150% 0, 0 0; } to { background-position: -150% 0, 0 0; } }
@keyframes skp-tear { to { transform: translate(30px, -60px) rotate(40deg); opacity: 0; } }
@keyframes skp-gone { 0% { transform: scale(1); opacity: 1; } 40% { transform: scale(1.2); opacity: 1; } 100% { transform: scale(.2) translateY(40px); opacity: 0; } }
@keyframes skp-reveal { 0% { transform: scale(0) rotate(-180deg); } 100% { transform: scale(1) rotate(-6deg); } }
@keyframes skp-rays-in { to { opacity: 1; } }
@keyframes skp-burst {
  0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(1); }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(-1 * var(--d))) scale(.4); }
}

/* ---------- the book overlay ---------- */
.skb {
  position: fixed; inset: 0; z-index: 70;
  display: flex; flex-direction: column; align-items: center;
  padding: max(12px, env(safe-area-inset-top)) 16px max(14px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 20% 15%, rgba(255,255,255,.35) 0 80px, transparent 81px),
    radial-gradient(circle at 85% 80%, rgba(255,255,255,.25) 0 120px, transparent 121px),
    linear-gradient(160deg, #8e7cf8, #6C5CE7 50%, #ff8fb5);
  animation: sk-fade .25s;
  touch-action: pan-y;
}
.skb-head { width: 100%; max-width: 1100px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.skb-count {
  display: flex; align-items: center; gap: 6px;
  background: #fff; border-radius: 999px; padding: 6px 20px 6px 14px;
  font-size: 30px; font-weight: 800; line-height: 1.2;
  box-shadow: 0 6px 0 var(--sun-d), 0 10px 18px rgba(0,0,0,.15);
}
.skb-count b { color: var(--pink); font-size: 36px; }
.skb-of { opacity: .5; font-size: 24px; }
.skb-close {
  width: 76px; height: 76px; border-radius: 50%;
  background: var(--coral); color: #fff; font-size: 38px; font-weight: 900; line-height: 1;
  box-shadow: 0 7px 0 var(--coral-d), 0 12px 20px rgba(0,0,0,.2);
  transition: transform .1s;
}
.skb-close:active { transform: translateY(6px); box-shadow: 0 1px 0 var(--coral-d); }

.skb-stage {
  flex: 1; width: 100%; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  perspective: 1800px;
}
.skb-book {
  --w: min(100%, 1000px, calc((100dvh - 230px) * 4 / 3));
  position: relative; width: var(--w); aspect-ratio: 4 / 3;
  transform: rotateX(12deg); transform-style: preserve-3d;
  animation: skb-open .6s cubic-bezier(.34,1.56,.64,1);
}
/* moti jild (cover) peeche */
.skb-book::before {
  content: ''; position: absolute; inset: -12px -14px -18px; border-radius: 26px;
  background: linear-gradient(90deg, #e2487c, #FF6B9D 48%, #c93a6b 50%, #FF6B9D 52%, #e2487c);
  box-shadow: 0 10px 0 #b02e5a, 0 30px 50px rgba(0,0,0,.35);
  transform: translateZ(-2px);
}
.skb-page {
  position: absolute; top: 0; bottom: 0; width: 50%; padding: 5%;
  background-color: #fffaf0;
  background-image: radial-gradient(rgba(108,92,231,.10) 1.5px, transparent 1.6px);
  background-size: 18px 18px;
  overflow: hidden;
}
.skb-page.left {
  left: 0; border-radius: 18px 4px 4px 18px;
  box-shadow: inset -26px 0 30px -18px rgba(0,0,0,.28), inset 0 0 0 1px rgba(0,0,0,.05);
}
.skb-page.right {
  right: 0; border-radius: 4px 18px 18px 4px;
  box-shadow: inset 26px 0 30px -18px rgba(0,0,0,.28), inset 0 0 0 1px rgba(0,0,0,.05);
}
.skb-spine {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 3%; transform: translateX(-50%);
  background: linear-gradient(90deg, rgba(0,0,0,0), rgba(0,0,0,.22) 50%, rgba(0,0,0,0));
  pointer-events: none; z-index: 2;
}

.skb-grid {
  height: 100%; display: grid; gap: 6%;
  grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(3, 1fr);
}
.skb-slot {
  position: relative; min-width: 64px; min-height: 64px; padding: 6%;
  background: none; border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
}
.skb-slot::before {      /* sticker ki khaali jagah */
  content: ''; position: absolute; inset: 4%; border-radius: 22px;
  border: 3px dashed rgba(108,92,231,.25);
}
.skb-slot img {
  position: relative; width: 100%; height: 100%; object-fit: contain; pointer-events: none;
  filter: brightness(0) opacity(.15);
}
.skb-slot.got::before { border-color: transparent; background: rgba(253,203,110,.18); }
.skb-slot.got img {
  transform: rotate(var(--t, 0deg));
  filter: drop-shadow(3px 0 0 #fff) drop-shadow(-3px 0 0 #fff) drop-shadow(0 3px 0 #fff) drop-shadow(0 -3px 0 #fff) drop-shadow(0 5px 5px rgba(0,0,0,.22));
}
.skb-slot.got.bounce img { animation: skb-bounce .6s cubic-bezier(.34,1.56,.64,1); }
.skb-slot.nope { animation: sk-shake .4s; }
.skb-slot.fresh::before { animation: skb-glow 1.2s ease-in-out infinite; background: rgba(253,203,110,.45); }
.skb-slot.fresh img { animation: skb-bounce .8s .4s cubic-bezier(.34,1.56,.64,1) both; }

.skb-trophy { height: 100%; display: flex; align-items: center; justify-content: center; }
.skb-trophy span { font-size: min(160px, 22vw, 20vh); filter: brightness(0) opacity(.15); }
.skb-trophy.full span { filter: drop-shadow(0 8px 0 rgba(224,169,60,.6)); animation: sk-float 2s ease-in-out infinite; }

/* panna palatna */
.skb-leaf {
  position: absolute; top: 0; bottom: 0; width: 50%; z-index: 5;
  transform-style: preserve-3d; transition: transform .7s cubic-bezier(.45,.05,.35,1);
  pointer-events: none;
}
.skb-leaf.fwd { left: 50%; transform-origin: 0 50%; }
.skb-leaf.back { left: 0; transform-origin: 100% 50%; }
.skb-leaf.fwd.go { transform: rotateY(-180deg); }
.skb-leaf.back.go { transform: rotateY(180deg); }
.skb-leaf .skb-face { left: 0; right: 0; width: 100%; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.skb-leaf .skb-face.back { transform: rotateY(180deg); }

.skb-nav { display: flex; align-items: center; justify-content: center; gap: 22px; padding-top: 18px; }
.skb-arrow {
  width: 80px; height: 72px; border-radius: 999px;
  background: var(--sun); color: var(--ink); font-size: 34px; line-height: 1;
  box-shadow: 0 7px 0 var(--sun-d), 0 12px 20px rgba(0,0,0,.18);
  transition: transform .1s, opacity .2s;
}
.skb-arrow:active { transform: translateY(6px); box-shadow: 0 1px 0 var(--sun-d); }
.skb-arrow:disabled { opacity: .35; cursor: default; }
.skb-dots { display: flex; gap: 10px; }
.skb-dots i { width: 16px; height: 16px; border-radius: 50%; background: rgba(255,255,255,.45); transition: transform .2s; }
.skb-dots i.on { background: #fff; transform: scale(1.3); }

@keyframes skb-open { from { transform: rotateX(12deg) scale(.6); opacity: 0; } to { transform: rotateX(12deg) scale(1); opacity: 1; } }
@keyframes skb-bounce {
  0% { transform: rotate(var(--t, 0deg)) scale(1); }
  35% { transform: rotate(calc(var(--t, 0deg) * -1)) scale(1.3) translateY(-10%); }
  65% { transform: rotate(var(--t, 0deg)) scale(.92); }
  100% { transform: rotate(var(--t, 0deg)) scale(1); }
}
@keyframes skb-glow { 0%,100% { box-shadow: 0 0 0 0 rgba(253,203,110,.8); } 50% { box-shadow: 0 0 0 10px rgba(253,203,110,0); } }

@media (max-width: 600px) {
  .sk-book-btn { width: 64px; height: 64px; font-size: 32px; }
  .sk-book-n { min-width: 26px; height: 26px; line-height: 26px; font-size: 16px; }
  .skb-book { --w: min(100%, calc((100dvh - 220px) * 4 / 3)); }
  .skb-page { padding: 4%; }
  .skb-grid { gap: 4%; }
  .skb-slot { padding: 3%; border-radius: 16px; }
  .skb-slot::before { border-radius: 16px; border-width: 2px; }
  .skb-count { font-size: 26px; }
  .skb-count b { font-size: 30px; }
}
/* phone khada (portrait): kitaab upar-neeche khulti hai, panna upar palatta hai */
@media (orientation: portrait) and (max-width: 700px) {
  .skb-book {
    --w: min(100%, calc((100dvh - 230px) * 3 / 4.4));
    aspect-ratio: 3 / 4.4; transform: rotateX(4deg);
    animation-name: skb-open-p;
  }
  .skb-book::before { background: linear-gradient(180deg, #e2487c, #FF6B9D 48%, #c93a6b 50%, #FF6B9D 52%, #e2487c); }
  .skb-page { width: auto; left: 0; right: 0; height: 50%; }
  .skb-page.left { top: 0; bottom: auto; border-radius: 18px 18px 4px 4px; box-shadow: inset 0 -26px 30px -18px rgba(0,0,0,.28), inset 0 0 0 1px rgba(0,0,0,.05); }
  .skb-page.right { top: auto; bottom: 0; border-radius: 4px 4px 18px 18px; box-shadow: inset 0 26px 30px -18px rgba(0,0,0,.28), inset 0 0 0 1px rgba(0,0,0,.05); }
  .skb-spine { left: 0; right: 0; top: 50%; bottom: auto; width: auto; height: 3%; transform: translateY(-50%);
    background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.22) 50%, rgba(0,0,0,0)); }
  .skb-grid { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); }
  .skb-leaf { width: auto; left: 0; right: 0; height: 50%; }
  .skb-leaf.fwd { left: 0; top: 50%; bottom: auto; transform-origin: 50% 0; }
  .skb-leaf.back { top: 0; bottom: auto; transform-origin: 50% 100%; }
  .skb-leaf.fwd.go { transform: rotateX(180deg); }
  .skb-leaf.back.go { transform: rotateX(-180deg); }
  .skb-leaf .skb-face { top: 0; bottom: 0; height: 100%; }
  .skb-leaf .skb-face.back { transform: rotateX(180deg); }
}
@keyframes skb-open-p { from { transform: rotateX(4deg) scale(.6); opacity: 0; } to { transform: rotateX(4deg) scale(1); opacity: 1; } }

@media (max-width: 420px) {
  .sk-topbar .sk-top-right { gap: 8px; }
}
