/* One dark, game-like theme for the whole site. */
:root {
  --bg: #0a0d1f;
  --bg2: #10153a;
  --surface: rgba(255, 255, 255, .05);
  --surface2: rgba(255, 255, 255, .09);
  --line: rgba(255, 255, 255, .1);
  --text: #eef1ff;
  --muted: #9aa3c7;
  --accent: #ff6a3d;
  --good: #4cf0a0;
  --bad: #ff7a7a;
  --gold: #ffd76a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text);
  background: radial-gradient(1200px 600px at 50% -10%, #1f2a6e 0%, transparent 60%), radial-gradient(900px 500px at 100% 100%, #3a1450 0%, transparent 60%), var(--bg);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
a { color: inherit; text-decoration: none; }
h1 { font-size: clamp(24px, 4vw, 34px); line-height: 1.25; margin: 20px 0 8px; letter-spacing: .5px; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
button { font: inherit; }

/* ---------- header ---------- */
.top { position: fixed; left: 0; right: 0; top: 0; z-index: 20; background: rgba(10, 13, 31, .78); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 12px; height: 54px; padding: 0 16px; max-width: 1240px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 17px; letter-spacing: 1px; white-space: nowrap; }
.ball { display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #ffe7cf 35%, #ff9a3d 75%, #d4600a); box-shadow: 0 0 10px rgba(255, 140, 40, .6); flex: none; }
.ball.big { width: 56px; height: 56px; margin-bottom: 8px; box-shadow: 0 6px 18px rgba(255, 140, 40, .6); }
.chips { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 99px; background: var(--surface2); border: 1px solid var(--line); font-size: 13px; white-space: nowrap; color: var(--text); }
.chip i { font-style: normal; }
.chip em { font-style: normal; color: var(--gold); font-size: 12px; }
.chip.icon { cursor: pointer; padding: 4px 9px; min-width: 30px; justify-content: center; font-weight: 800; }
.chip.bump { animation: bump .5s; }
@keyframes bump { 30% { transform: scale(1.25); background: rgba(255, 215, 106, .25); } }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.tabs a { position: relative; padding: 6px 14px; border-radius: 99px; color: var(--muted); white-space: nowrap; font-weight: 600; }
.tabs a.on { color: #fff; background: linear-gradient(135deg, #ff7a45, #e8492f); box-shadow: 0 4px 14px rgba(232, 73, 47, .35); }
.tabs .dot { position: absolute; top: 4px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: #ff3b5c; box-shadow: 0 0 6px #ff3b5c; }
.foot { color: var(--muted); font-size: 12px; padding: 48px 16px 32px; opacity: .7; }
body.play { overflow: hidden; }
main.wrap { padding-top: 60px; }
@media (max-width: 760px) {
  .top-in { flex-wrap: wrap; height: auto; padding: 8px 12px 6px; gap: 6px 8px; }
  .brand-t { display: none; }
  .chips { margin-left: auto; }
  .tabs { order: 3; width: 100%; }
  .tabs a { padding: 4px 12px; }
  .chip { padding: 3px 7px; font-size: 12px; }
  .chip em { display: none; }
  main.wrap { padding-top: 92px; }
}

/* ---------- buttons ---------- */
.cta {
  position: relative; overflow: hidden; border: 0; cursor: pointer; font-weight: 800; font-size: 18px; letter-spacing: 2px;
  color: #fff; padding: 15px 38px; border-radius: 16px; margin: 18px 0 8px;
  background: linear-gradient(135deg, #ff7a45, #e8492f 45%, #b8246b);
  box-shadow: 0 10px 30px rgba(232, 73, 47, .4), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .15s, box-shadow .15s, filter .2s;
}
.cta:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(232, 73, 47, .55); }
.cta:active:not(:disabled) { transform: translateY(1px) scale(.98); }
.cta:disabled { filter: grayscale(.8); opacity: .55; cursor: not-allowed; }
.cta-glow { position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .55) 50%, transparent 65%); transform: translateX(-100%); animation: sweep 2.6s infinite; }
.cta:disabled .cta-glow { display: none; }
.cta span:last-child { position: relative; }
@keyframes sweep { 60%, 100% { transform: translateX(100%); } }
.ghost { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 12px; padding: 8px 14px; cursor: pointer; }
.ghost:hover:not(:disabled) { background: var(--surface2); }
.ghost:disabled { opacity: .45; cursor: not-allowed; }
.gbtn { border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08); color: #fff; font-weight: 600; padding: 10px 20px; border-radius: 12px; cursor: pointer; backdrop-filter: blur(6px); }
.gbtn:hover { background: rgba(255, 255, 255, .16); }
.gbtn.primary { background: linear-gradient(135deg, #ff7a45, #e8492f); border-color: transparent; }
.gbtn:disabled { opacity: .5; cursor: default; }

/* ---------- pack view ---------- */
.hero { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 40px; align-items: center; padding: 30px 0 10px; }
.hero-pack { display: flex; justify-content: center; perspective: 900px; }
.hero-pack .pack { width: 230px; height: 334px; }
.trade { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.rules ul { margin: 6px 0 0; padding-left: 18px; }
.rules summary { cursor: pointer; }
@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; gap: 0; text-align: center; padding-top: 10px; }
  .hero-pack .pack { width: 180px; height: 262px; }
  .trade { justify-content: center; }
  .rules { text-align: left; }
}

/* ---------- tier palette ---------- */
.t-N { --tc: #9aa4b2; --tc2: #5d6673; --tglow: transparent; --holo: 0; }
.t-R { --tc: #4f9dff; --tc2: #1d4fb8; --tglow: rgba(79, 157, 255, .55); --holo: .18; }
.t-SR { --tc: #b46cff; --tc2: #5a1fb0; --tglow: rgba(180, 108, 255, .65); --holo: .32; }
.t-SSR { --tc: #ffc94a; --tc2: #b06a00; --tglow: rgba(255, 201, 74, .8); --holo: .42; }
.t-UR { --tc: #ff6ad5; --tc2: #6a3cff; --tglow: rgba(255, 140, 220, .9); --holo: .55; }

/* ---------- pack ---------- */
.pack { position: relative; width: 200px; height: 290px; transform-style: preserve-3d; }
.pack-idle { animation: float 4s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0) rotateY(-14deg) rotateX(4deg); } 50% { transform: translateY(-12px) rotateY(10deg) rotateX(-3deg); } }
.pack-body, .pack-top { position: absolute; left: 0; right: 0; overflow: hidden; background: linear-gradient(160deg, #1b2a6b, #0b1238 55%, #3b0f4f); box-shadow: 0 20px 50px rgba(0, 0, 0, .5), inset 0 0 0 2px rgba(255, 255, 255, .12); }
.pack-body { top: 34px; bottom: 0; border-radius: 0 0 14px 14px; clip-path: polygon(0 4px, 4% 0, 8% 4px, 12% 0, 16% 4px, 20% 0, 24% 4px, 28% 0, 32% 4px, 36% 0, 40% 4px, 44% 0, 48% 4px, 52% 0, 56% 4px, 60% 0, 64% 4px, 68% 0, 72% 4px, 76% 0, 80% 4px, 84% 0, 88% 4px, 92% 0, 96% 4px, 100% 0, 100% 100%, 0 100%); }
.pack-idle .pack-body { top: 0; border-radius: 14px; clip-path: none; }
.pack-top { top: 0; height: 38px; border-radius: 14px 14px 0 0; z-index: 2; clip-path: polygon(0 0, 100% 0, 100% 34px, 96% 38px, 92% 34px, 88% 38px, 84% 34px, 80% 38px, 76% 34px, 72% 38px, 68% 34px, 64% 38px, 60% 34px, 56% 38px, 52% 34px, 48% 38px, 44% 34px, 40% 38px, 36% 34px, 32% 38px, 28% 34px, 24% 38px, 20% 34px, 16% 38px, 12% 34px, 8% 38px, 4% 34px, 0 38px); }
.pack-foil { position: absolute; inset: 0; mix-blend-mode: color-dodge; opacity: .55; background: repeating-linear-gradient(115deg, #ff5f6d 0%, #ffc371 8%, #47ffb0 16%, #3fa9ff 24%, #b56cff 32%, #ff5f6d 40%); background-size: 300% 300%; animation: foil 6s linear infinite; }
@keyframes foil { to { background-position: 300% 300%; } }
.pack-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #fff; text-align: center; text-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.pack-label b { font-size: 22px; letter-spacing: 3px; }
.pack-label small { font-size: 11px; opacity: .8; }
.pack-label em { font-style: normal; font-weight: 800; font-size: 15px; padding: 2px 12px; border-radius: 99px; background: rgba(255, 255, 255, .18); margin-top: 6px; }
.tear { position: absolute; left: 0; bottom: 3px; height: 3px; width: 0; background: linear-gradient(90deg, #fff, var(--tc, #fff)); box-shadow: 0 0 12px 3px var(--tc, #fff); }
.pack-light { position: absolute; left: 6%; right: 6%; top: 30px; height: 0; z-index: 1; border-radius: 50%; background: radial-gradient(ellipse at 50% 100%, #fff, var(--tc, #fff) 40%, transparent 70%); filter: blur(6px); opacity: 0; }

/* ---------- stage ---------- */
body.lock { overflow: hidden; }
.stage { position: fixed; inset: 0; z-index: 10; padding-top: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; user-select: none; -webkit-user-select: none; touch-action: none; }
.stage[hidden] { display: none; }
.st-bg { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, #1c2350 0%, #0a0d1f 62%, #04050c 100%); transition: filter .6s; overflow: hidden; }
/* a table tennis table seen from the umpire's chair */
.table-lines {
  position: absolute; left: 50%; top: 56%; width: min(94vw, 1040px); height: min(60vh, 560px);
  transform: translate(-50%, -50%) perspective(1100px) rotateX(32deg);
  border: 3px solid rgba(255, 255, 255, .55); border-radius: 6px;
  background: radial-gradient(ellipse at 50% 30%, #2a6fd6, #164a9e 55%, #0d2f6b);
  box-shadow: 0 40px 80px rgba(0, 0, 0, .55), inset 0 0 80px rgba(0, 0, 0, .35);
}
.table-lines::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: rgba(255, 255, 255, .5); }
.table-lines::after { content: ""; position: absolute; top: -14px; bottom: -14px; left: 50%; width: 6px; margin-left: -3px; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .55) 0 2px, rgba(255, 255, 255, .12) 2px 6px); border-radius: 2px; box-shadow: 0 0 12px rgba(0, 0, 0, .5); }
.empty { position: relative; z-index: 3; text-align: center; max-width: 420px; padding: 24px; background: rgba(10, 13, 31, .72); border: 1px solid var(--line); border-radius: 20px; backdrop-filter: blur(8px); }
.empty h2 { margin: 0 0 8px; }
.empty .row { margin-top: 14px; }
.coach { position: absolute; z-index: 9; left: 50%; top: max(70px, 12vh); transform: translateX(-50%); text-align: center; font-weight: 800; font-size: clamp(18px, 3.4vw, 26px); text-shadow: 0 2px 12px rgba(0, 0, 0, .7); pointer-events: none; white-space: nowrap; animation: coach 2.4s ease-in-out infinite; }
.coach small { display: block; font-size: 14px; font-weight: 600; opacity: .8; margin-top: 4px; }
@keyframes coach { 50% { transform: translateX(-50%) translateY(-6px); } }
.serve { position: absolute; z-index: 5; left: 50%; bottom: calc(max(28px, env(safe-area-inset-bottom)) + 64px); width: 64px; height: 64px; margin-left: -32px; display: flex; align-items: center; justify-content: center; cursor: grab; touch-action: none; }
.serve::after { content: ""; position: absolute; bottom: 6px; width: 30px; height: 6px; border-radius: 50%; background: rgba(0, 0, 0, .45); filter: blur(2px); animation: shadow 1.1s ease-in infinite; }
.serve-ball { width: 30px; height: 30px; animation: hop 1.1s ease-in infinite; }
.serve.held .serve-ball, .serve.held::after { animation: none; }
@keyframes hop { 0%, 100% { transform: translateY(0); } 45% { transform: translateY(-26px); animation-timing-function: ease-in; } }
@keyframes shadow { 0%, 100% { transform: scale(1); opacity: .9; } 45% { transform: scale(.55); opacity: .4; } }
.fly-ball { position: absolute; z-index: 7; left: 0; top: 0; width: 30px; height: 30px; margin: -15px 0 0 -15px; pointer-events: none; }
.stage.dim .st-bg { filter: brightness(.25); }
.stage.focusing .slots { opacity: .12; filter: blur(2px); }
.stage.focusing .bar { opacity: 0; pointer-events: none; }
.fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 6; }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 7; }
.rays {
  position: absolute; left: 50%; top: 45%; width: 190vmax; height: 190vmax; margin: -95vmax 0 0 -95vmax; pointer-events: none; opacity: 0; z-index: 1;
  background: repeating-conic-gradient(from 0deg, var(--ray, rgba(255, 255, 255, .18)) 0deg 5deg, transparent 5deg 15deg);
  -webkit-mask: radial-gradient(circle, #000 0%, rgba(0, 0, 0, .6) 18%, transparent 48%); mask: radial-gradient(circle, #000 0%, rgba(0, 0, 0, .6) 18%, transparent 48%);
  animation: spin 18s linear infinite; transition: opacity .5s;
}
.rays.on { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }
.pack-wrap { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 22px; perspective: 900px; }
.pack-wrap .pack { width: min(62vw, 240px); height: min(90vw, 348px); cursor: grab; animation: bob 3s ease-in-out infinite; }
.pack-wrap .pack.tremble { animation: tremble .12s linear infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-8px) rotate(1deg); } }
@keyframes tremble { 0% { transform: translate(1px, 0) rotate(.4deg); } 50% { transform: translate(-1px, 1px) rotate(-.4deg); } 100% { transform: translate(1px, -1px) rotate(.2deg); } }
.hint { font-size: 14px; opacity: .8; letter-spacing: 1px; animation: blink 1.6s ease-in-out infinite; text-align: center; padding: 0 16px; margin: 0; }
@keyframes blink { 50% { opacity: .35; } }
.slots { position: relative; z-index: 3; margin-bottom: 120px; display: flex; gap: clamp(8px, 3vw, 32px); justify-content: center; padding: 0 12px; transition: opacity .4s, filter .4s; }
.focus { position: absolute; inset: 0; padding-top: calc(54px + min(6vh, 50px)); z-index: 8; pointer-events: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.focus > * { pointer-events: auto; }
.bar { position: absolute; left: 0; right: 0; bottom: max(28px, env(safe-area-inset-bottom)); z-index: 9; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; padding: 0 16px; transition: opacity .3s; }
.summary { text-align: center; font-size: 14px; opacity: .85; width: 100%; }
.stamp { position: absolute; left: 50%; top: calc(58px + 1vh); z-index: 9; transform: translateX(-50%); pointer-events: none; white-space: nowrap; font-weight: 900; font-size: clamp(28px, min(8vw, 7vh), 60px); letter-spacing: 6px; opacity: 0; }
.stamp.t-UR { background: linear-gradient(90deg, #ff5f6d, #ffc371, #47ffb0, #3fa9ff, #b56cff, #ff5f6d); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: foil 2s linear infinite; filter: drop-shadow(0 0 18px rgba(255, 150, 220, .8)); }
.stamp.t-SSR { color: #ffd76a; text-shadow: 0 0 24px rgba(255, 190, 60, .9), 0 4px 0 #8a5200; }
.stamp.good { color: var(--good); text-shadow: 0 0 20px rgba(76, 240, 160, .7); }

/* ---------- card ---------- */
.gc { --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%; position: relative; width: clamp(92px, 24vw, 200px); aspect-ratio: 5 / 7; perspective: 1000px; container-type: inline-size; cursor: pointer; flex: none; }
.gc-in { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .75s cubic-bezier(.3, 1.4, .5, 1); transform: rotateX(var(--rx)) rotateY(var(--ry)); }
.gc.flipped .gc-in { transform: rotateX(var(--rx)) rotateY(calc(var(--ry) + 180deg)); }
.gc-back, .gc-front { position: absolute; inset: 0; border-radius: 6cqw; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.gc-front { transform: rotateY(180deg); }
.gc.static .gc-front { transform: none; }
.gc-back {
  background:
    linear-gradient(90deg, transparent 49%, rgba(255, 255, 255, .85) 49%, rgba(255, 255, 255, .85) 51%, transparent 51%),
    linear-gradient(0deg, transparent 49.2%, rgba(255, 255, 255, .95) 49.2%, rgba(255, 255, 255, .95) 50.8%, transparent 50.8%),
    linear-gradient(160deg, #1e5fc0, #0d3a85 60%, #0a2a63);
  box-shadow: inset 0 0 0 3cqw #f3f6ff, inset 0 0 0 4cqw #0a2a63, 0 6px 18px rgba(0, 0, 0, .45);
  display: flex; align-items: center; justify-content: center;
}
.gc-back::after { content: ""; width: 30cqw; height: 30cqw; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #ffe7cf 35%, #ff9a3d 75%, #d4600a); box-shadow: 0 0 0 2cqw rgba(255, 255, 255, .15), 0 2cqw 6cqw rgba(0, 0, 0, .4); }
.gc.hint-SR:not(.flipped), .gc.hint-SSR:not(.flipped), .gc.hint-UR:not(.flipped) { animation: hintglow 1.4s ease-in-out infinite; }
.gc.hint-SR { --hc: rgba(180, 108, 255, .9); }
.gc.hint-SSR { --hc: rgba(255, 201, 74, 1); }
.gc.hint-UR { --hc: rgba(255, 120, 220, 1); }
@keyframes hintglow { 0%, 100% { filter: drop-shadow(0 0 2px var(--hc)); } 50% { filter: drop-shadow(0 0 14px var(--hc)) drop-shadow(0 0 4px #fff); } }
.gc.charge { animation: charge .09s linear infinite !important; }
.gc.charge .gc-back { box-shadow: inset 0 0 0 3cqw #fff, inset 0 0 0 4cqw #0a2a63, 0 0 30px 6px var(--hc, #fff), 0 0 80px 20px var(--hc, #fff); }
@keyframes charge { 0% { translate: 1.5px 0; } 25% { translate: -1.5px 1px; } 50% { translate: 1px -1.5px; } 75% { translate: -1px 0; } }
.gc-front { background: linear-gradient(160deg, var(--tc), var(--tc2)); padding: 3.2cqw; box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
.t-UR .gc-front { background: linear-gradient(120deg, #ff5f6d, #ffc371, #47ffb0, #3fa9ff, #b56cff, #ff5f6d); background-size: 300% 300%; animation: foil 5s linear infinite; }
.gc-face { position: relative; height: 100%; border-radius: 4cqw; overflow: hidden; color: #fff; background: radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, .18), transparent 60%), linear-gradient(170deg, #17244f, #0a1030 60%, #120a2c); display: flex; flex-direction: column; padding: 5cqw 5cqw 4cqw; }
.gc-top, .gc-vs, .gc-ev, .gc-rd { position: relative; z-index: 1; }
.gc-top { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 7cqw; line-height: 1; }
.gc-tier { padding: 1.6cqw 3.2cqw; border-radius: 99px; background: linear-gradient(135deg, var(--tc), var(--tc2)); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.t-UR .gc-tier { background: #120a2c; box-shadow: 0 0 0 .8cqw #fff, 0 0 4cqw rgba(255, 150, 230, .9); }
.gc-year { opacity: .75; font-size: 6.5cqw; }
.gc-vs { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 2cqw; }
.gc-side { display: flex; align-items: center; gap: 3cqw; min-width: 0; transition: opacity .4s; }
.gc-side img, .gc-side .noflag { width: 15cqw; height: 11cqw; border-radius: 1.5cqw; object-fit: cover; flex: none; box-shadow: 0 0 0 .6cqw rgba(255, 255, 255, .35); }
.gc-side .noflag { background: rgba(255, 255, 255, .15); box-shadow: none; }
.gc-name { font-weight: 800; font-size: 9.5cqw; line-height: 1.15; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.gc-name.dbl { font-size: 7cqw; }
.gc-side.win .gc-name { color: var(--gold); }
.gc-side.win .gc-name::after { content: " 🏆"; font-size: .8em; }
.gc-side.lose { opacity: .45; }
.gc-mid { display: flex; align-items: center; gap: 2cqw; }
.gc-mid::before, .gc-mid::after { content: ""; flex: 1; height: .6cqw; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent); }
.gc-mid i { width: 6cqw; height: 6cqw; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #ff9a3d 75%); }
.gc-ev { font-size: 6cqw; font-weight: 700; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.gc-rd { font-size: 5.5cqw; opacity: .8; margin-top: 1cqw; }
.gc-legend { position: absolute; z-index: 1; left: 0; right: 0; top: 17cqw; text-align: center; font-size: 5.2cqw; font-weight: 700; color: #ffe9a8; padding: 0 4cqw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gc-res { position: absolute; z-index: 1; right: 4cqw; bottom: 18cqw; font-size: 8cqw; font-weight: 900; transform: rotate(-12deg); padding: 1cqw 3cqw; border: .8cqw solid currentColor; border-radius: 2cqw; }
.gc-res.ok { color: var(--good); }
.gc-res.no { color: var(--bad); }
.gc-upset { position: absolute; z-index: 1; left: 4cqw; bottom: 18cqw; font-size: 5.5cqw; font-weight: 900; color: #ffef5a; background: rgba(0, 0, 0, .45); padding: .6cqw 2.4cqw; border-radius: 99px; }
.gc-holo, .gc-glare { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }
.gc-holo {
  opacity: var(--holo); mix-blend-mode: color-dodge;
  background-image: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .35), transparent 40%), repeating-linear-gradient(115deg, #ff5f6d 0%, #ffc371 6%, #47ffb0 12%, #3fa9ff 18%, #b56cff 24%, #ff5f6d 30%);
  background-size: 100% 100%, 250% 250%; background-position: center, var(--mx) var(--my);
  filter: brightness(.75) contrast(1.3) saturate(1.3);
}
.t-UR .gc-holo, .t-SSR .gc-holo {
  background-image: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .45), transparent 40%), radial-gradient(circle, rgba(255, 255, 255, .9) 0 .8px, transparent 1.2px), repeating-linear-gradient(115deg, #ff5f6d 0%, #ffc371 6%, #47ffb0 12%, #3fa9ff 18%, #b56cff 24%, #ff5f6d 30%);
  background-size: 100% 100%, 7px 7px, 250% 250%; background-position: center, calc(var(--mx) * .2) calc(var(--my) * .2), var(--mx) var(--my);
}
.gc-glare { background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .55), transparent 45%); mix-blend-mode: overlay; opacity: 0; transition: opacity .3s; }
.gc.tilting .gc-glare, .gc.big .gc-glare { opacity: 1; }
/* finishes: every card has one, the tier sets its strength (--fin) */
.t-N { --fin: .5; } .t-R { --fin: .65; } .t-SR { --fin: .8; } .t-SSR { --fin: .9; } .t-UR { --fin: 1; }
.t-SSR.f-0, .t-UR.f-0 { --fin: .45; } /* their own foil is already rainbow */
.gc-fin { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; overflow: hidden; opacity: var(--fin); }
.gc-fin::before, .gc-fin::after { content: ""; position: absolute; inset: 0; }
/* 0 · 幻彩: rainbow bands drifting diagonally, plus a soft prism bloom */
.f-0 .gc-fin::before {
  inset: -60%; mix-blend-mode: screen; opacity: .38;
  background: repeating-linear-gradient(115deg, #ff5f6d 0 4%, #ffc371 8%, #47ffb0 12%, #3fa9ff 16%, #b56cff 20%, #ff5f6d 24%);
  animation: fin-drift 7s linear infinite;
}
.f-0 .gc-fin::after { mix-blend-mode: screen; background: radial-gradient(ellipse at var(--mx) var(--my), rgba(255, 255, 255, .25), transparent 55%); }
/* 1 · 流银: brushed metal with a bright beam sweeping across */
.f-1 .gc-fin::before { background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .09) 0 1px, transparent 1px 3px), linear-gradient(160deg, rgba(220, 230, 255, .3), rgba(220, 230, 255, .04) 40%, transparent 60%, rgba(220, 230, 255, .22)); }
.f-1 .gc-fin::after {
  inset: -20% -100%; mix-blend-mode: screen;
  background: linear-gradient(105deg, transparent 38%, rgba(200, 220, 255, .25) 45%, rgba(255, 255, 255, .95) 50%, rgba(200, 220, 255, .25) 55%, transparent 62%);
  animation: fin-sweep 3s cubic-bezier(.5, 0, .3, 1) infinite;
}
/* 2 · 星砂: two layers of glitter twinkling out of step */
.f-2 .gc-fin::before, .f-2 .gc-fin::after { mix-blend-mode: screen; }
.f-2 .gc-fin::before {
  background:
    radial-gradient(circle, #fff 0 1px, transparent 1.6px) 0 0 / 11cqw 13cqw,
    radial-gradient(circle, #ffe9a8 0 1.2px, transparent 2px) 5cqw 7cqw / 17cqw 19cqw,
    radial-gradient(ellipse at 30% 20%, rgba(120, 200, 255, .22), transparent 60%),
    radial-gradient(ellipse at 75% 85%, rgba(255, 120, 220, .2), transparent 60%);
  animation: fin-twinkle 2.2s ease-in-out infinite;
}
.f-2 .gc-fin::after {
  background:
    radial-gradient(circle, #bfe6ff 0 1.2px, transparent 2px) 3cqw 4cqw / 14cqw 11cqw,
    radial-gradient(circle, #fff 0 .8px, transparent 1.4px) 8cqw 2cqw / 9cqw 16cqw;
  animation: fin-twinkle 2.2s ease-in-out -1.1s infinite;
}
@keyframes fin-drift { from { transform: translate(-12%, -12%); } to { transform: translate(12%, 12%); } }
@keyframes fin-sweep { 0%, 10% { transform: translateX(-40%); } 80%, 100% { transform: translateX(40%); } }
@keyframes fin-twinkle { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-1.5%); } }
.gc.tilting .gc-in, .gc.big.live .gc-in { transition: transform .08s linear; }
.gc.big { width: min(70vw, 330px, 40vh); cursor: grab; }
.gc.big .gc-front { box-shadow: 0 0 0 1px rgba(255, 255, 255, .1), 0 30px 80px rgba(0, 0, 0, .6), 0 0 60px 6px var(--tglow, transparent); }
.gc.big .gc-back { box-shadow: inset 0 0 0 3cqw #f3f6ff, inset 0 0 0 4cqw #0a2a63, 0 30px 80px rgba(0, 0, 0, .6); }
.gc .gc-new { position: absolute; top: -2.5cqw; right: -2.5cqw; z-index: 3; background: #ff3b5c; color: #fff; font-weight: 900; font-size: 7cqw; padding: 1cqw 3cqw; border-radius: 99px; box-shadow: 0 2px 8px rgba(0, 0, 0, .4); transform: rotate(8deg); opacity: 0; transition: opacity .3s .5s; }
.gc.flipped .gc-new, .gc.static .gc-new { opacity: 1; }
.gc .gc-count { position: absolute; left: 4cqw; bottom: -3cqw; z-index: 3; font-size: 7cqw; font-weight: 800; background: #fff; color: #10153a; border-radius: 99px; padding: .5cqw 3cqw; }
.gc.locked { cursor: default; }
.gc.locked .gc-front { background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px var(--line); }
.gc.locked .gc-face { background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .03) 0 8px, transparent 8px 16px); align-items: center; justify-content: center; text-align: center; gap: 3cqw; color: var(--muted); }
.gc.locked .lk-q { font-size: 22cqw; font-weight: 900; opacity: .35; line-height: 1; }
.gc.locked .lk-t { font-size: 6.5cqw; line-height: 1.3; }
.gc.locked .lk-btn { font-size: 6.5cqw; border: 0; border-radius: 99px; padding: 1.5cqw 5cqw; background: linear-gradient(135deg, var(--tc), var(--tc2)); color: #fff; font-weight: 800; cursor: pointer; }
.gc.locked .lk-btn:disabled { filter: grayscale(1); opacity: .5; cursor: not-allowed; }

/* ---------- guess panel ---------- */
.panel { width: min(92vw, 420px); text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; opacity: 0; transform: translateY(10px); transition: opacity .4s, transform .4s; }
.panel.show { opacity: 1; transform: none; }
.panel .meta { font-size: 15px; opacity: .9; text-shadow: 0 1px 6px rgba(0, 0, 0, .8); width: 100%; }
.guess { display: flex; gap: 8px; width: 100%; }
.guess button { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* ---------- daily ---------- */
.daily-head h1 small { font-size: 15px; color: var(--muted); font-weight: 600; margin-left: 8px; }
.d-progress { display: flex; gap: 8px; margin: 14px 0 22px; }
.d-progress i { flex: 1; height: 6px; border-radius: 6px; background: var(--surface2); }
.d-progress i.ok { background: var(--good); box-shadow: 0 0 8px var(--good); }
.d-progress i.no { background: var(--bad); }
.d-progress i.cur { background: #fff; animation: blink 1.2s infinite; }
.d-stage { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 32px; align-items: center; }
.d-stage .gc { width: 100%; }
.d-q h2 { margin: 0 0 4px; font-size: 22px; }
.d-q .meta { color: var(--muted); margin-bottom: 18px; }
.d-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.d-pick button { display: flex; align-items: center; gap: 10px; padding: 16px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 800; font-size: 17px; cursor: pointer; text-align: left; transition: transform .15s, background .2s, border-color .2s; }
.d-pick button:hover:not(:disabled) { transform: translateY(-2px); border-color: rgba(255, 255, 255, .35); background: var(--surface2); }
.d-pick button img { width: 30px; height: 22px; border-radius: 4px; object-fit: cover; flex: none; }
.d-pick button.won { border-color: var(--good); background: rgba(76, 240, 160, .12); }
.d-pick button.picked { box-shadow: 0 0 0 2px #fff inset; }
.d-pick button:disabled { cursor: default; }
.d-verdict { margin-top: 16px; min-height: 56px; font-size: 18px; font-weight: 800; }
.d-verdict.ok { color: var(--good); }
.d-verdict.no { color: var(--bad); }
.d-verdict small { display: block; font-size: 13px; color: var(--muted); font-weight: 500; }
.d-result { text-align: center; padding: 20px 0; }
.d-result .score { font-size: 64px; font-weight: 900; line-height: 1; background: linear-gradient(90deg, #ffd76a, #ff8a5c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.d-result .grid5 { font-size: 34px; letter-spacing: 6px; margin: 10px 0; }
.d-result pre { display: inline-block; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; font: 14px/1.6 inherit; white-space: pre-wrap; }
.d-result .row { margin-top: 14px; }
.d-recap { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 26px; }
.d-recap .gc { width: 100%; }
@media (max-width: 720px) {
  .d-stage { grid-template-columns: 1fr; gap: 16px; }
  .d-stage .gc { width: min(62vw, 260px); margin: 0 auto; }
  .d-q { text-align: center; }
  .d-pick button { font-size: 15px; padding: 14px 10px; }
  .d-recap { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- albums ---------- */
.album { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; margin: 16px 0; }
.album-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; cursor: pointer; }
.album-head h2 { margin: 0; font-size: 18px; }
.album-head .muted { font-size: 13px; flex: 1 1 200px; }
.album-bar { flex: 1 1 100%; height: 6px; border-radius: 6px; background: var(--surface2); overflow: hidden; }
.album-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ff7a45, #ffd76a); }
.album.done { border-color: rgba(255, 215, 106, .5); box-shadow: 0 0 24px rgba(255, 215, 106, .12); }
.album .count { font-weight: 800; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 12px; margin-top: 14px; }
.album-grid .gc { width: 100%; }
.badge { font-size: 12px; font-weight: 800; color: #10153a; background: var(--gold); border-radius: 99px; padding: 1px 10px; }

/* ---------- collection ---------- */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; font-size: 12px; color: var(--muted); }
.stat b { display: block; font-size: 16px; color: var(--text); }
.stat .bar2 { height: 4px; border-radius: 4px; background: var(--surface2); margin-top: 6px; overflow: hidden; }
.stat .bar2 i { display: block; height: 100%; background: linear-gradient(90deg, var(--tc2), var(--tc)); }
.filter { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 16px; }
.filter button { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 99px; padding: 4px 14px; font-size: 13px; cursor: pointer; }
.filter button.on { background: #fff; color: #10153a; border-color: #fff; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 14px; }
.grid .gc { width: 100%; }
@media (max-width: 560px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 110; background: rgba(4, 6, 14, .85); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-in { position: relative; width: min(100%, 860px); max-height: calc(100vh - 32px); overflow-y: auto; background: #0f1430; border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.x { position: absolute; top: 6px; right: 12px; background: none; border: 0; color: #fff; font-size: 30px; cursor: pointer; opacity: .7; z-index: 2; }
.modal-body { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 24px; align-items: start; }
.modal-body .gc.big { width: 100%; }
.modal-body h3 { margin: 0 0 4px; font-size: 20px; padding-right: 24px; }
.modal-body .panel { align-items: stretch; text-align: left; width: 100%; }
.modal-body .panel .meta { text-shadow: none; }
.player { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; margin: 10px 0 12px; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.modal-body a { color: #9cc3ff; }
@media (max-width: 720px) {
  .modal-body { grid-template-columns: 1fr; }
  .modal-body .gc.big { width: min(64vw, 260px); margin: 0 auto; }
}

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 120; transform: translate(-50%, 30px); opacity: 0; background: #fff; color: #10153a; font-weight: 700; padding: 10px 18px; border-radius: 99px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); transition: opacity .3s, transform .3s; pointer-events: none; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .rays, .pack-foil, .cta-glow, .pack-idle, .hint, .t-UR .gc-front, .gc-fin::before, .gc-fin::after { animation: none !important; }
}

/* ---------- performance: grids hold hundreds of cards ----------
   Blend-mode foil and animated rainbow frames are only for the card you're looking at:
   a big card, or a grid card under the pointer. Everything else paints flat. */
.gc.static:not(.big):not(.tilting) .gc-holo,
.gc.static:not(.big):not(.tilting) .gc-glare { display: none; }
.gc.static:not(.big):not(.tilting) .gc-fin::before, .gc.static:not(.big):not(.tilting) .gc-fin::after { animation: none; mix-blend-mode: normal; }
.gc.static:not(.big) .gc-front { animation: none; }
.gc.static:not(.big) { perspective: none; }
.gc.locked .gc-front { animation: none; background: rgba(255, 255, 255, .06); }
.gc.static:not(.big):not(.tilting) .gc-in { transform: none; transform-style: flat; }
.gc.static:not(.big) .gc-front { backface-visibility: visible; -webkit-backface-visibility: visible; }

/* live card: real frames from the match, only once the result is out */
.gc-photo { position: absolute; inset: 0; z-index: 0; background-size: cover; background-position: center; opacity: .42; transition: background-image .7s; }
.gc-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 16, 48, .75) 0%, rgba(10, 16, 48, .25) 40%, rgba(10, 16, 48, .85) 100%); }
.rules-box h3 { margin-top: 0; }
.rules-box ul { padding-left: 20px; line-height: 1.9; }
.modal-body.single { display: block; }
@media (max-width: 760px) {
  .stage { padding-top: 88px; }
  .focus { padding-top: calc(88px + 2vh); }
  .stamp { top: 92px; }
  .slots .gc { width: min(29vw, 200px); }
  .coach { top: 104px; white-space: normal; width: 92vw; }
  .table-lines { top: 58%; height: 52vh; }
}

/* language picker: a tiny chip with the native select laid invisibly on top */
.chip.lang { position: relative; gap: 3px; font-size: 12px; font-weight: 800; }
.chip.lang select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
/* pick the right CJK glyphs per language */
:lang(zh-Hant) body { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif; }
:lang(ja) body { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", "Noto Sans JP", sans-serif; }
