/* Sweet Shift Saga v4.5.1.4 — Sweetfolio pack cinematic
   Self-contained top-level overlay. Deliberately avoids all Sweetfolio screen selectors. */

#sweetfolio-pack-cinematic {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  background:
    radial-gradient(circle at 50% 42%, rgba(214,112,255,.28), transparent 28%),
    radial-gradient(circle at 50% 38%, rgba(255,143,205,.18), transparent 42%),
    rgba(25,9,33,.90);
  backdrop-filter: blur(12px);
  overflow: hidden;
}
#sweetfolio-pack-cinematic[hidden] { display: none !important; }
#sweetfolio-pack-cinematic * { box-sizing: border-box; }

.sf-pack-cine-shell {
  position: relative;
  width: min(1120px, 96vw);
  min-height: min(720px, 91vh);
  max-height: 92vh;
  display: grid;
  grid-template-rows: auto minmax(0,1fr) auto;
  overflow: hidden;
  border: 4px solid #fff;
  border-radius: 34px;
  background:
    radial-gradient(circle at 18% 8%, rgba(255,255,255,.58), transparent 20%),
    radial-gradient(circle at 84% 12%, rgba(255,227,246,.72), transparent 22%),
    linear-gradient(180deg,#d63c8a 0 118px,#fff7fc 118px 100%);
  box-shadow: 0 28px 70px rgba(0,0,0,.42), inset 0 2px 0 rgba(255,255,255,.7);
}
.sf-pack-cine-shell::before,
.sf-pack-cine-shell::after {
  content:"";
  position:absolute;
  border-radius:50%;
  pointer-events:none;
  opacity:.32;
}
.sf-pack-cine-shell::before {
  width:190px;height:190px;left:-76px;bottom:42px;
  background:radial-gradient(circle at 34% 30%,#fff 0 11%,#ff83ca 12% 42%,#d23e98 43% 66%,transparent 67%);
}
.sf-pack-cine-shell::after {
  width:145px;height:145px;right:-36px;top:165px;
  background:radial-gradient(circle at 33% 28%,#fff 0 10%,#ffd06f 11% 42%,#ec8b3e 43% 65%,transparent 66%);
}

.sf-pack-cine-head {
  position: relative;
  z-index: 4;
  min-height: 118px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:5px;
  padding:18px 88px 14px;
  color:#fff;
  text-align:center;
  text-shadow:0 2px 2px rgba(88,17,60,.28);
}
.sf-pack-cine-head small {
  font-size:.64rem;
  font-weight:1000;
  letter-spacing:.15em;
  color:#ffe6f5;
}
.sf-pack-cine-head strong {
  font-size:1.65rem;
  line-height:1;
}
.sf-pack-cine-close {
  position:absolute;
  top:22px;
  right:24px;
  z-index:8;
  width:54px;
  height:54px;
  border:3px solid #fff;
  border-radius:50%;
  background:linear-gradient(180deg,#936bce,#6541a2);
  color:#fff;
  box-shadow:0 5px 0 #493071,0 10px 18px rgba(66,41,76,.2);
  font:1000 1.15rem/1 inherit;
  cursor:pointer;
}

.sf-pack-cine-body {
  position:relative;
  z-index:3;
  min-height:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px 28px 10px;
}

.sf-pack-cine-pack-stage {
  position:absolute;
  inset:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:18px;
  transition:opacity .28s ease, transform .5s cubic-bezier(.2,.8,.2,1);
}
.sf-pack-cine-pack {
  width:220px;
  height:280px;
  object-fit:contain;
  filter:drop-shadow(0 22px 18px rgba(68,31,74,.28));
  transform-origin:center;
  animation:sfPackFloat 1.15s ease-in-out infinite alternate;
}
.sf-pack-cine-hint {
  min-width:240px;
  min-height:48px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:9px 20px;
  border:3px solid #fff;
  border-radius:18px;
  background:linear-gradient(180deg,#916ad0,#6642a3);
  color:#fff;
  box-shadow:0 6px 0 #493071,0 12px 20px rgba(66,41,76,.15);
  font-size:.68rem;
  font-weight:1000;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.sf-pack-cine-shell.is-tearing .sf-pack-cine-pack {
  animation:sfPackTear .62s cubic-bezier(.3,.8,.2,1) both;
}
.sf-pack-cine-shell.is-revealing .sf-pack-cine-pack-stage {
  opacity:0;
  transform:translateY(-70px) scale(.75);
  pointer-events:none;
}

.sf-pack-cine-flash {
  position:absolute;
  left:50%;top:50%;
  width:90px;height:90px;
  transform:translate(-50%,-50%) scale(.2);
  border-radius:50%;
  opacity:0;
  pointer-events:none;
  background:#fff;
  box-shadow:0 0 80px 30px rgba(255,255,255,.85),0 0 150px 80px rgba(255,214,100,.4);
}
.sf-pack-cine-shell.is-tearing .sf-pack-cine-flash { animation:sfPackFlash .6s ease-out .28s both; }
.sf-pack-cine-burst {
  position:absolute;
  left:50%;top:50%;
  transform:translate(-50%,-50%) scale(.4) rotate(-8deg);
  opacity:0;
  padding:10px 18px;
  border:4px solid #fff;
  border-radius:18px;
  background:linear-gradient(180deg,#ffdd62,#f49a2c);
  color:#6c3d14;
  box-shadow:0 7px 0 #9d5f1c,0 16px 26px rgba(86,48,18,.18);
  font-size:1.4rem;
  font-weight:1000;
  letter-spacing:.06em;
  pointer-events:none;
}
.sf-pack-cine-shell.is-tearing .sf-pack-cine-burst { animation:sfPackBurst .68s cubic-bezier(.2,.9,.25,1.15) .3s both; }

.sf-pack-cine-results {
  width:100%;
  min-height:0;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:center;
  gap:14px;
  padding:10px 12px 16px;
  opacity:0;
  transform:translateY(18px);
  pointer-events:none;
  transition:opacity .25s ease,transform .25s ease;
}
.sf-pack-cine-shell.is-revealing .sf-pack-cine-results {
  opacity:1;
  transform:none;
  pointer-events:auto;
}
.sf-pack-cine-card {
  width:150px;
  min-height:236px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  padding:9px 9px 11px;
  border:3px solid #fff;
  border-radius:22px;
  background:linear-gradient(180deg,#fffefc,#fff1f8);
  box-shadow:0 7px 0 rgba(134,87,141,.13),0 14px 22px rgba(71,43,78,.11);
  opacity:0;
  transform:translateY(34px) scale(.82) rotate(-2deg);
}
.sf-pack-cine-card.show { animation:sfPackCardReveal .42s cubic-bezier(.2,.9,.25,1.18) both; }
.sf-pack-cine-card.shiny {
  background:linear-gradient(145deg,#fff0a7,#dbfbff 52%,#f8d8ff);
  box-shadow:0 0 0 3px #ffe56b,0 0 30px rgba(190,235,255,.75),0 13px 23px rgba(71,43,78,.12);
}
.sf-pack-cine-card small {
  min-height:22px;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  color:#cb4b91;
  font-size:.49rem;
  font-weight:1000;
  letter-spacing:.035em;
}
.sf-pack-cine-card-art {
  width:100%;
  height:130px;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  border:2px solid rgba(255,255,255,.95);
  border-radius:16px;
  background:#fff5fb;
}
.sf-pack-cine-card-art img { width:100%;height:100%;object-fit:cover;display:block; }
.sf-pack-cine-card strong {
  width:100%;
  min-height:33px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#69456f;
  font-size:.56rem;
  line-height:1.15;
  text-align:center;
}
.sf-pack-cine-card span { color:#8e718e;font-size:.48rem;font-weight:800; }

.sf-pack-cine-foot {
  position:relative;
  z-index:5;
  min-height:86px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:8px 18px 22px;
}
.sf-pack-cine-done {
  min-width:250px;
  min-height:54px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:3px solid #fff;
  border-radius:18px;
  background:linear-gradient(180deg,#ffd96c,#eea52e);
  color:#684315;
  box-shadow:0 6px 0 #a66d1d,0 12px 20px rgba(84,52,19,.14);
  font-size:.7rem;
  font-weight:1000;
  letter-spacing:.04em;
  cursor:pointer;
}
.sf-pack-cine-done[hidden] { display:none !important; }

@keyframes sfPackFloat { from{transform:translateY(4px) rotate(-1deg)} to{transform:translateY(-7px) rotate(1deg)} }
@keyframes sfPackTear {
  0%{transform:scale(1) rotate(0)}
  20%{transform:scale(1.06) rotate(-6deg)}
  42%{transform:scale(1.08) rotate(6deg)}
  64%{transform:scale(1.12) rotate(-4deg)}
  100%{transform:scale(.86) rotate(8deg);opacity:.08}
}
@keyframes sfPackFlash { 0%{opacity:0;transform:translate(-50%,-50%) scale(.2)} 35%{opacity:1} 100%{opacity:0;transform:translate(-50%,-50%) scale(6)} }
@keyframes sfPackBurst { 0%{opacity:0;transform:translate(-50%,-50%) scale(.35) rotate(-9deg)} 45%{opacity:1;transform:translate(-50%,-50%) scale(1.12) rotate(4deg)} 100%{opacity:0;transform:translate(-50%,-50%) scale(1.35) rotate(1deg)} }
@keyframes sfPackCardReveal { 0%{opacity:0;transform:translateY(34px) scale(.82) rotate(-2deg)} 70%{opacity:1;transform:translateY(-4px) scale(1.025) rotate(.4deg)} 100%{opacity:1;transform:none} }

@media(max-width:900px){
  .sf-pack-cine-shell{min-height:min(680px,92vh);}
  .sf-pack-cine-pack{width:175px;height:225px;}
  .sf-pack-cine-card{width:132px;min-height:214px;}
  .sf-pack-cine-card-art{height:112px;}
}
@media(max-width:620px){
  #sweetfolio-pack-cinematic{padding:8px;}
  .sf-pack-cine-shell{width:100%;height:94vh;min-height:0;border-radius:24px;}
  .sf-pack-cine-head{min-height:100px;padding:16px 64px 12px;}
  .sf-pack-cine-head strong{font-size:1.15rem;}
  .sf-pack-cine-close{width:44px;height:44px;top:16px;right:16px;}
  .sf-pack-cine-body{padding:12px 8px;overflow-y:auto;}
  .sf-pack-cine-pack{width:145px;height:190px;}
  .sf-pack-cine-results{gap:9px;}
  .sf-pack-cine-card{width:45%;min-width:128px;min-height:206px;padding:7px;}
  .sf-pack-cine-card-art{height:104px;}
  .sf-pack-cine-foot{min-height:70px;padding-bottom:14px;}
  .sf-pack-cine-done{min-width:210px;min-height:48px;}
}
