:root {
  color-scheme: dark;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #fff9fa;
  background: #110d20;
  --muted: #b6a9c7;
  --lime: #e1ff83;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--lime); outline-offset: 5px; }
.top {
  min-height: 76px; padding: 12px max(24px, calc((100vw - 1140px)/2)); display: flex;
  align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #302642;
}
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; font-weight: 800; white-space: nowrap; }
.brand-icon { display: grid; place-items: center; width: 42px; height: 42px; font-size: 30px; line-height: 1; color: #191024; background: var(--lime); border-radius: 12px; }
.brand small { display: block; font: 700 10px system-ui; letter-spacing: .13em; color: var(--muted); }
nav { display: flex; gap: 4px; padding: 4px; border: 1px solid #352a47; border-radius: 30px; }
nav button, .sound, footer button, .filters button, .close { background: transparent; border: 0; }
nav button { color: var(--muted); border-radius: 100px; padding: 8px 16px; font-size: 14px; white-space: nowrap; }
nav button[aria-current] { color: #fff; background: #382b50; }
.sound { width: 42px; height: 42px; border: 1px solid #473858; border-radius: 50%; font-size: 20px; color: var(--muted); }
.sound[aria-pressed="true"] { color: var(--lime); border-color: var(--lime); }
main { width: min(1140px, calc(100% - 48px)); margin: auto; }
.intro { text-align: center; padding: 32px 0 24px; }
h1 { margin: 0; font-size: clamp(36px, 7vw, 68px); line-height: 1.12; font-weight: 900; letter-spacing: -.065em; }
h1 em { font-style: normal; color: var(--lime); }
.intro p, .actions p, .empty { color: var(--muted); margin: 12px 0 0; }
.stage {
  position: relative; overflow: hidden; isolation: isolate; min-height: 430px; display: grid;
  place-items: center; border: 1px solid #47345e; border-radius: 28px;
  background: radial-gradient(ellipse at 50% 47%, #4f2871 0, #281a41 48%, #1c142b 83%);
}
.stage-lines { position: absolute; inset: 0; z-index: -2; opacity: .43; background: radial-gradient(circle, #b3a0cd 1px, transparent 1.5px) 0 0 / 24px 24px; mask-image: radial-gradient(ellipse, transparent 18%, #000); }
.orbit { position: absolute; z-index: -1; width: min(600px, 92%); height: 71%; border: 1px solid #9473ab55; border-radius: 50%; transform: rotate(-12deg); pointer-events: none; }
.orbit::before, .orbit::after { content: ""; position: absolute; inset: 9% -5%; border: 1px solid #9473ab55; border-radius: 50%; }
.orbit::after { inset: -7% 11%; transform: rotate(44deg); }
.pack { position: relative; width: 206px; height: 290px; border: 0; padding: 0; background: transparent; transform: rotate(-8deg); transition: transform .25s ease; filter: drop-shadow(0 24px 24px #10071baf); }
.pack:hover { transform: translateY(-8px) rotate(-4deg) scale(1.045); }
.foil {
  position: absolute; inset: 0; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 32px 12px; color: #1c1036; background: linear-gradient(145deg,#f9d2ff,#a892ff 32%,#c3a6ff 52%,#ffbae5 82%,#e2ff88);
  clip-path: polygon(0 0,100% 0,98% 8%,98% 92%,100% 100%,0 100%,2% 92%,2% 8%);
  box-shadow: inset 0 0 0 4px #ffffff55, inset -8px 0 18px #3f27775c;
}
.foil::before, .foil::after { content: ""; position: absolute; left: 0; right: 0; height: 17px; background: repeating-linear-gradient(90deg,#160c3338 0 2px,#ffffff55 3px 5px), linear-gradient(90deg,#b1a3eb,#f6dbff,#d4b4ff); border-block: 1px solid #5f4c9c88; }
.foil::before { top: 0; }
.foil::after { bottom: 0; }
.pack-label { position: relative; z-index: 1; font: 1000 italic 38px/.82 system-ui; letter-spacing: -.085em; transform: rotate(-5deg); }
.pack-label span { display: block; font: 900 15px/1 system-ui; letter-spacing: .18em; margin-top: 9px; }
.pack-star { display: grid; place-items: center; width: 95px; height: 95px; border: 1px solid #29134588; border-radius: 50%; background: #2a1746; color: var(--lime); font: 88px/.9 system-ui; box-shadow: 0 0 0 7px #e6d5ff70, 0 0 0 8px #29134566; }
.pack-count { font-size: 14px; font-weight: 900; letter-spacing: .1em; }
.pack.tearing { pointer-events: none; animation: tear .63s both; }
@keyframes tear { 25% { transform: rotate(10deg) scale(1.09); } 55% { transform: rotate(-13deg) scale(1.13); opacity: 1; } to { transform: translateY(-55px) rotate(-5deg) scale(1.22); opacity: 0; } }
.burst { position: absolute; inset: 0; pointer-events: none; }
.burst i { position: absolute; top: 50%; left: 50%; width: 6px; height: 6px; background: var(--spark); opacity: 0; border-radius: 2px; animation: scatter .85s ease-out backwards; box-shadow: 0 0 12px var(--spark); }
@keyframes scatter { 12% { opacity: 1; } to { transform: translate(var(--x), var(--y)) rotate(120deg) scale(.1); opacity: 0; } }
.actions { text-align: center; padding: 23px 0 27px; }
.actions p { font-size: 14px; }
.primary { min-width: 215px; min-height: 52px; padding: 11px 22px; border: 1px solid #f2ffcb; border-radius: 12px; background: var(--lime); color: #181520; font-weight: 900; box-shadow: 0 4px 0 #819b40; transition: transform .15s, background .15s; }
.primary:hover { transform: translateY(-2px); background: #edffac; }
.primary:active { transform: translateY(2px); }
.primary:disabled { opacity: .65; cursor: progress; }
.hand { width: 100%; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; padding: 28px; z-index: 1; }
.slot { min-width: 0; aspect-ratio: 5 / 7; padding: 0; background: none; border: 0; perspective: 850px; animation: deal .48s both; animation-delay: var(--delay); }
@keyframes deal { from { transform: translateY(24px) scale(.9); opacity: 0; } }
.flip { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.18,.72,.25,1); }
.slot:not(.revealed):hover .flip { transform: translateY(-6px) rotateY(-8deg); }
.slot.revealed:hover .face, .collected-card:hover .face { filter: brightness(1.12); }
.slot.revealed .flip { transform: rotateY(180deg); }
.back, .face { border-radius: 12px; overflow: hidden; }
.back, .slot .face { position: absolute; inset: 0; backface-visibility: hidden; }
.back { display: grid; place-items: center; border: 2px solid #b399ef; background: repeating-linear-gradient(45deg,#ffffff0c 0 1px,transparent 1px 11px), radial-gradient(ellipse,#573b81,#26183e); box-shadow: inset 0 0 0 5px #35224d; color: #e1ceff; }
.back b { display: grid; place-items: center; width: 58%; aspect-ratio: 1; border: 1px solid #9d75d0; border-radius: 50%; font-size: clamp(24px, 6vw, 68px); }
.back[data-tier] {
  color: var(--tone); border-color: var(--tone);
  box-shadow: inset 0 0 14px var(--tone), 0 0 15px color-mix(in srgb, var(--tone), transparent 38%);
  animation: back-glow 2s ease-in-out infinite alternate;
}
.back[data-tier] b { border-color: currentColor; text-shadow: 0 0 12px currentColor; }
.back[data-tier="SSR"] { background: repeating-conic-gradient(from 15deg, #ffd47f35 0 2deg, transparent 2deg 22deg), radial-gradient(circle, #835128, #30202d); }
.back[data-tier="UR"] { background: repeating-radial-gradient(circle, #f9a3e830 0 2px, transparent 3px 15px), radial-gradient(circle, #66356e, #241a50); }
.back[data-tier="UR"] b { border-style: dashed; }
.back[data-tier="LR"] {
  color: #f7ffcc; border-color: transparent;
  background: radial-gradient(circle at 30% 38%, #406468, #221642 68%) padding-box,
    conic-gradient(#fa9ed7, #a889ff, #8eeaff, #e5ff8f, #ffc391, #fa9ed7) border-box;
}
.back[data-tier="LR"] b { box-shadow: 0 0 20px #a0f9ffa8, inset 0 0 20px #f5a9ff99; }
.back-rarity {
  position: absolute; bottom: 8%; background: #150e25; border: 1px solid currentColor;
  border-radius: 5px; padding: 2px 7px; font: 900 clamp(10px, 2.8vw, 15px)/1.35 system-ui;
  letter-spacing: .13em;
}
@keyframes back-glow { to { box-shadow: inset 0 0 26px color-mix(in srgb, var(--tone), transparent 25%), 0 0 22px var(--tone); } }
.slot .face { transform: rotateY(180deg); }
.face { position: relative; display: flex; flex-direction: column; gap: 1px; background: #21192c; border: 2px solid var(--tone); box-shadow: 0 0 18px color-mix(in srgb, var(--tone), transparent 68%); padding: 5px; text-align: left; }
.face img { width: 100%; min-height: 0; flex: 1; object-fit: cover; border-radius: 7px; background: #383043; }
.face-name { font-weight: 900; font-size: clamp(13px,2vw,21px); padding: 3px 4px; overflow-wrap: anywhere; line-height: 1.1; }
.face[data-tier="SSR"], .face[data-tier="UR"], .face[data-tier="LR"] {
  --foil-accent: #ffe3a0;
  isolation: isolate;
  border: 3px solid transparent;
}
.face[data-tier="SSR"] {
  background: repeating-linear-gradient(123deg,#784312 0 8px,#986223 8px 9px,#553223 9px 19px) padding-box,
    linear-gradient(125deg,#79501c,#fff2a4,#b37731,#ffeeb7,#6c4118) border-box;
}
.face[data-tier="UR"] {
  --foil-accent: #f4b6ff;
  background: repeating-linear-gradient(145deg,#553163 0 6px,#ac5498 7px 8px,#35245c 8px 16px) padding-box,
    linear-gradient(130deg,#ab7eff,#ffd0fb,#9b58d7,#ffc1f2,#584cd8) border-box;
}
.face[data-tier="LR"] {
  --foil-accent: #b6fcff;
  background: linear-gradient(160deg,#34234e,#265360,#262035) padding-box,
    conic-gradient(from 35deg,#fda1eb,#fff2a4,#dfff83,#8df7ff,#d5adff,#fda1eb) border-box;
}
.face[data-tier="SSR"]::before, .face[data-tier="UR"]::before, .face[data-tier="LR"]::before {
  content: ""; position: absolute; z-index: 1; inset: 4px; pointer-events: none; border-radius: 7px;
  border: 1px solid color-mix(in srgb, var(--foil-accent), transparent 42%);
  box-shadow: inset 0 0 12px color-mix(in srgb, var(--foil-accent), transparent 48%);
}
.face[data-tier="SSR"]::after, .face[data-tier="UR"]::after, .face[data-tier="LR"]::after {
  content: ""; position: absolute; z-index: 1; inset: 0; pointer-events: none;
  padding: 5px;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  background: linear-gradient(120deg,transparent 32%,#fff1bc91 47%,#fff8ec2c 53%,transparent 64%);
  background-size: 245% 100%;
  animation: foil-shine 4.1s ease-in-out infinite;
  mix-blend-mode: screen;
}
.face[data-tier="UR"]::after { background-image: linear-gradient(115deg,transparent 28%,#ad7cff8a 40%,#ffb1ef77 47%,#8ad9ff48 54%,transparent 68%); animation-duration: 3.5s; }
.face[data-tier="LR"]::after { background-image: linear-gradient(120deg,transparent 22%,#ff9ae590 32%,#ffe7a185 42%,#a1ffbf85 50%,#a8eaff85 58%,#caa4ff75 66%,transparent 76%); animation-duration: 2.8s; }
.face[data-tier] .rarity, .face[data-tier] .quantity { z-index: 2; }
.face[data-tier="SSR"] .face-name, .face[data-tier="UR"] .face-name, .face[data-tier="LR"] .face-name { color: #fff9fd; position: relative; z-index: 2; text-shadow: 0 1px 4px #0a0610; }
@keyframes foil-shine { 0%, 18% { background-position: 110% 0; } 70%, 100% { background-position: -10% 0; } }
.rarity, .quantity { position: absolute; top: 9px; padding: 2px 6px; font: 900 12px/1.4 system-ui; border-radius: 4px; }
.rarity { left: 9px; color: #17101e; background: var(--tone); }
.quantity { right: 9px; color: #fff; background: #14101ddf; }
.filters { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.filters button { border: 1px solid #4a3d61; border-radius: 20px; padding: 5px 12px; }
.filters [aria-pressed="true"] { background: #423258; border-color: #bea3ec; }
.binder { display: grid; grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: 14px; padding-bottom: 24px; }
.binder .face { aspect-ratio: 5 / 7; }
.collected-card { min-width: 0; padding: 0; border: 0; border-radius: 12px; background: transparent; }
.empty { text-align: center; padding: 28px 0 55px; }
footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid #332843; color: var(--muted); font-size: 14px; padding: 15px 0; }
footer button { color: inherit; padding: 3px 0; text-decoration: underline; text-underline-offset: 3px; }
dialog { width: min(440px, calc(100% - 36px)); padding: 24px; color: inherit; background: #211831; border: 1px solid #57446d; border-radius: 20px; }
dialog::backdrop { background: #0b0815bc; }
dialog h2 { margin: 0; }
dialog p { color: var(--muted); }
dialog dl { margin-bottom: 0; }
dialog dl div { display: flex; justify-content: space-between; margin-top: 7px; }
.close { position: absolute; top: 10px; right: 12px; font-size: 25px; }
.effect-preview {
  min-width: 76px; background: #372844; border: 1px solid #645077;
  border-radius: 6px; padding: 2px 6px; margin-left: 8px; font-size: 13px;
}
#rates > div { display: grid; align-items: center; grid-template-columns: 1fr 64px 86px; }
#rates dd { margin: 0; text-align: right; }
.spotlight {
  --tone: #c9c5d4;
  --halo: var(--tone);
  --arrival: .52s;
  margin: auto; padding: 26px; width: min(660px, calc(100% - 28px));
  max-height: calc(100dvh - 28px); overflow: auto;
  border-color: color-mix(in srgb, var(--tone), transparent 53%);
  background: #1b1429;
}
.spotlight[data-effect]:not([data-effect=""]) {
  display: grid; grid-template-rows: minmax(min-content, 1fr) auto; gap: 18px;
  width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 24px; border: 0; border-radius: 0;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--halo), #0d091a 69%), #100b1e 68%);
}
.spotlight:not([open]) { display: none !important; }
.spotlight[data-effect="SSR"] { --halo: #ee9b36; }
.spotlight[data-effect="UR"] { --halo: #dd57ff; --arrival: .74s; }
.spotlight[data-effect="LR"] { --halo: #8ba2ff; --arrival: .92s; }
.spotlight-frame { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 270px) minmax(0, 1fr); align-items: center; gap: clamp(22px, 5vw, 58px); }
.spotlight[data-effect]:not([data-effect=""]) .spotlight-frame { width: min(760px, 100%); margin: auto; }
.spotlight-clue { position: relative; z-index: 1; display: grid; place-items: center; text-align: center; align-self: center; min-height: min(300px, 50dvh); }
.clue-text { width: min(680px, 100%); overflow-wrap: anywhere; }
.clue-text p { margin: 0 0 10px; color: var(--tone); font-size: clamp(16px, 4vw, 24px); font-weight: 850; }
.clue-text strong { font-size: clamp(28px, 7vw, 76px); line-height: 1.15; white-space: pre-wrap; display: block; }
.clue-text[data-step="1"] strong, .clue-text[data-step="3"] strong { animation: spotlight-text-in .28s ease-out both; }
.clue-text[data-step="2"] strong { animation: clue-slide .28s ease-out both; }
@keyframes clue-slide { from { opacity: 0; transform: translateX(14px); } }
.preview-back { width: min(220px, 52vw); aspect-ratio: 5 / 7; position: relative; }
.preview-back .back { position: absolute; inset: 0; }
.spotlight-actions { position: relative; z-index: 1; text-align: center; padding: 12px 0 6px; }
.spotlight-card .face { aspect-ratio: 5 / 7; padding: 7px; }
.spotlight-card .face-name { padding: 6px; }
.spotlight-card { position: relative; isolation: isolate; perspective: 850px; }
.spotlight-card-surface {
  position: relative; z-index: 1; border-radius: 12px; cursor: grab; touch-action: pan-y;
  user-select: none; transform-style: preserve-3d; transform: rotateY(var(--card-turn, 0deg));
  transition: transform .32s cubic-bezier(.2,.78,.24,1);
}
.spotlight-card-surface::before {
  content: ""; position: absolute; inset: 0; border: 1px solid #ffffff55; border-radius: inherit;
  background: color-mix(in srgb, var(--tone), #161024 76%);
  transform: translateZ(-5px); box-shadow: 0 9px 18px #06030c80;
}
.spotlight-card-surface.dragging { cursor: grabbing; transition: none; }
.spotlight-card-surface:focus-visible { outline: 2px solid var(--tone); outline-offset: 5px; }
.spotlight-details { position: relative; z-index: 1; }
.spotlight-tier { color: var(--tone); font-weight: 900; font-size: clamp(22px, 5vw, 58px); line-height: 1; }
.spotlight h2 { font-size: clamp(26px, 6vw, 56px); margin: .15em 0 .35em; overflow-wrap: anywhere; }
.spotlight .primary { min-width: 140px; }
.person-profile { margin: 0 0 20px; }
.spotlight .person-profile div { display: grid; grid-template-columns: 4em 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid #ffffff29; }
.person-profile dt { color: #ded0e8; }
.person-profile dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.spotlight-effects {
  display: none; position: absolute; inset: -28px -40px; z-index: 0;
  overflow: hidden; pointer-events: none;
  mask-image: radial-gradient(ellipse, #000 38%, #0008 59%, transparent 76%);
}
.spotlight[data-effect]:not([data-effect=""]) .spotlight-effects { display: block; }
.spotlight:not([data-stage="card"]) .spotlight-wave,
.spotlight:not([data-stage="card"]) .spotlight-particles { display: none; }
.spotlight-halo, .spotlight-wave, .spotlight-particles { position: absolute; top: 50%; left: 50%; }
.spotlight-halo {
  width: 165%; aspect-ratio: 1; opacity: .67; translate: -50% -50%;
  background: repeating-conic-gradient(from 10deg, transparent 0deg 13deg, var(--halo) 14deg, transparent 17deg 30deg);
  mask-image: radial-gradient(circle, transparent 10%, #000 32%, transparent 68%);
  animation: spotlight-spin 12s linear infinite;
}
.spotlight-wave {
  width: 64%; aspect-ratio: 1; border: 2px solid var(--tone); border-radius: 50%;
  box-shadow: 0 0 38px var(--halo), inset 0 0 28px var(--halo);
  animation: spotlight-ring 1.25s ease-out both;
}
[data-effect="UR"] .spotlight-halo {
  width: 120%; mask-image: none;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 7%, #fb94e640 7.1% 7.9%, transparent 8% 13%);
  animation: spotlight-nebula 2.8s ease-in-out infinite alternate;
}
[data-effect="UR"] .spotlight-wave { border-radius: 28%; rotate: 45deg; }
[data-effect="LR"] .spotlight-halo {
  opacity: .8; mask-image: radial-gradient(circle, transparent 5%, #000 38%, transparent 66%);
  background: conic-gradient(#ffa5e6, #9772fa, #88edff, #e4ff99, #ffd49a, #ffa5e6);
  animation-duration: 7s;
}
[data-effect="LR"] .spotlight-wave { border-width: 5px; animation-duration: 1.75s; }
.spotlight-particles i {
  position: absolute; width: 5px; height: 5px; border-radius: 50%; opacity: 0;
  background: var(--tone); box-shadow: 0 0 12px var(--tone);
  animation: spotlight-spark 1.5s ease-out var(--wait) both;
}
[data-effect="UR"] .spotlight-particles i { height: 13px; border-radius: 0; background: #f5adff; }
[data-effect="LR"] .spotlight-particles i { width: 13px; height: 13px; border-radius: 0; background: #eaffca; clip-path: polygon(50% 0, 61% 38%, 100% 50%, 61% 62%, 50% 100%, 39% 62%, 0 50%, 39% 38%); }
.spotlight[data-effect]:not([data-effect=""]) .spotlight-card { animation: spotlight-card-in var(--arrival) cubic-bezier(.2,.7,.2,1.18) both; }
.spotlight[data-effect]:not([data-effect=""]) .spotlight-details { animation: spotlight-text-in .35s ease-out calc(var(--arrival) * .65) both; }
@keyframes spotlight-card-in {
  from { opacity: 0; transform: translateY(28px) scale(.82); }
  to { opacity: 1; transform: none; }
}
@keyframes spotlight-text-in { from { opacity: 0; transform: translateY(15px); } }
@keyframes spotlight-spin { to { rotate: 360deg; } }
@keyframes spotlight-nebula { from { scale: .86; } to { scale: 1.2; opacity: .76; } }
@keyframes spotlight-ring { from { opacity: .84; transform: translate(-50%,-50%) scale(.18); } to { opacity: 0; transform: translate(-50%,-50%) scale(1.9); } }
@keyframes spotlight-spark { 18% { opacity: 1; } to { transform: translate(var(--x), var(--y)) rotate(var(--angle)) scale(.35); opacity: 0; } }
@media (max-width: 640px) {
  main { width: calc(100% - 24px); }
  .top { min-height: 64px; padding: 8px 12px; }
  .brand-icon, .sound { width: 34px; height: 34px; }
  .brand-icon { font-size: 24px; }
  .brand { gap: 7px; font-size: 14px; }
  nav button { padding: 5px 8px; }
  .intro { padding: 29px 0 19px; }
  .stage { min-height: 360px; border-radius: 19px; }
  .hand { grid-template-columns: repeat(3, minmax(0, 106px)); justify-content: center; gap: 8px; padding: 12px; }
  .binder { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 9px; }
  .spotlight-frame { grid-template-columns: 1fr; align-content: center; gap: 13px; }
  .spotlight-card { width: min(51vw, 29dvh, 225px); margin: auto; }
  .spotlight-details { width: min(370px, 100%); margin: auto; }
  .spotlight h2 { margin-bottom: .15em; }
  .spotlight .person-profile div { padding: 4px 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
  .spotlight-halo, .spotlight-wave, .spotlight-particles { animation: none !important; }
  .spotlight-wave { display: none; }
  .face[data-tier]::after { background-position: 45% 0; }
}
