body[data-mode="cards"] .scoreboard,
body[data-mode="cards"] .quick-restart-button,
body[data-mode="cards"] .home-button,
body[data-mode="cards"] .scene { display: none; }
.pack-screen { padding: clamp(16px, 3vw, 28px); border: 1px solid #bda15a66; border-radius: 16px; background: linear-gradient(140deg, #142b43, #09192d); }
.pack-screen[hidden], .pack-screen [hidden] { display: none; }
.pack-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pack-kicker { color: #d6ba78; font-size: 10px; letter-spacing: 2px; margin: 0 0 8px; }
.pack-heading h2 { margin: 0; color: #ffe2a0; font-size: 30px; }
.pack-screen button { font: inherit; cursor: pointer; }
.pack-home, .pack-previews button { padding: 10px 14px; border: 1px solid #bda15a77; border-radius: 7px; background: #122b43; color: #f2dab0; }
.pack-intro, .pack-rating-notice { color: #acbfcd; font-size: 12px; line-height: 1.8; }
.pack-rates { color: #e0cb97; font-size: 12px; line-height: 2; }
.pack-stage { --pack-color: #b6c5ce; --pack-power: 0.2; --pack-spread: 0.65; position: relative; display: grid; place-items: center; min-height: 405px; overflow: hidden; border: 1px solid #8a9fa52b; border-radius: 12px; background: radial-gradient(ellipse, #18394b, #081728 75%); padding: 24px; isolation: isolate; }
.pack-stage[data-rarity="rare"] { --pack-color: #64bdff; --pack-power: 0.36; --pack-spread: 0.85; }
.pack-stage[data-rarity="epic"] { --pack-color: #c193ff; --pack-power: 0.5; --pack-spread: 1; }
.pack-stage[data-rarity="legendary"] { --pack-color: #ffda6d; --pack-power: 0.66; --pack-spread: 1.2; }
.pack-glow { position: absolute; width: min(80%, 390px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, var(--pack-color), transparent 68%); opacity: 0; pointer-events: none; }
.is-opening .pack-glow { animation: pack-halo var(--pack-duration) ease-out both; }
.pack-result-card { position: relative; width: min(100%, 270px); padding: 22px; border: 2px solid var(--pack-color); border-radius: 15px; background: linear-gradient(155deg, #2c4354, #101e31 65%); box-shadow: 0 12px 30px #0006; text-align: center; }
.pack-rarity { margin: 0; color: var(--pack-color); font-size: 11px; letter-spacing: 1px; }
.pack-ovr { margin: 10px 0; color: #fff3d5; font-size: 30px; font-weight: 900; }
.pack-avatar { display: block; color: var(--pack-color); font-size: 45px; line-height: 1.2; }
.pack-player-name { margin: 12px 0 6px; font-size: 23px; overflow-wrap: anywhere; }
.pack-player-position { margin: 0; color: #b8cbd9; font-size: 13px; }
.pack-attributes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 16px 0 0; }
.pack-attributes dt { color: #a7bdcd; font-size: 10px; }
.pack-attributes dd { margin: 3px 0 0; color: #e4d8af; font-size: 17px; }
.pack-preview-label { color: #f4d485; font-size: 11px; }
.pack-placeholder { color: #a7bdcd; font-size: 14px; text-align: center; }
.pack-placeholder span { display: block; margin-top: 22px; opacity: 0.4; font-size: 55px; }
.pack-sparks { position: absolute; inset: 0; pointer-events: none; }
.pack-sparks i { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; background: var(--pack-color); border-radius: 50%; opacity: 0; --x: 0px; --y: -160px; }
.pack-sparks i:nth-child(2) { --x: 145px; --y: -100px; }
.pack-sparks i:nth-child(3) { --x: 175px; --y: 0px; }
.pack-sparks i:nth-child(4) { --x: 145px; --y: 110px; }
.pack-sparks i:nth-child(5) { --x: 0px; --y: 170px; }
.pack-sparks i:nth-child(6) { --x: -145px; --y: 110px; }
.pack-sparks i:nth-child(7) { --x: -175px; --y: 0px; }
.pack-sparks i:nth-child(8) { --x: -145px; --y: -100px; }
.is-opening .pack-sparks i { animation: pack-spark var(--pack-duration) ease-out both; }
.pack-stage[data-rarity="common"] .pack-sparks { display: none; }
.pack-stage[data-rarity="rare"] .pack-sparks i:nth-child(even) { display: none; }
.pack-stage[data-rarity="legendary"] .pack-result-card { background: linear-gradient(145deg, #6c542a, #222735 70%); }
.pack-actions { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 22px; }
.pack-screen .pack-draw { padding: 14px 30px; border: 1px solid #ffe7a2; border-radius: 8px; background: linear-gradient(#f6de9a, #d6a947); color: #152139; font-weight: 900; }
.pack-owned-count { color: #b7c7d4; font-size: 12px; }
.pack-message { min-height: 3em; text-align: center; color: #f1d693; font-size: 13px; line-height: 1.7; }
.pack-previews { border-top: 1px solid #bda15a44; padding-top: 16px; }
.pack-previews h3 { font-size: 15px; }.pack-previews small { color: #9ab0c1; font-size: 11px; font-weight: normal; }
.pack-previews > div { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pack-previews [data-preview="common"] { border-color: #b6c5ce; }.pack-previews [data-preview="rare"] { border-color: #64bdff; }.pack-previews [data-preview="epic"] { border-color: #c193ff; }.pack-previews [data-preview="legendary"] { border-color: #ffda6d; }
.pack-screen button:disabled { opacity: 0.45; cursor: wait; }.pack-screen button:focus-visible, .pack-result-card:focus-visible { outline: 2px solid #ffe2a0; outline-offset: 4px; }
@keyframes pack-halo { 0%, 100% { opacity: 0; transform: scale(0.5); } 70% { opacity: var(--pack-power); transform: scale(var(--pack-spread)); } }
@keyframes pack-spark { 0%, 45% { opacity: 0; transform: translate(0, 0); } 65% { opacity: var(--pack-power); } 100% { opacity: 0; transform: translate(calc(var(--x) * var(--pack-spread)), calc(var(--y) * var(--pack-spread))); } }
@media (max-width: 540px) { .pack-previews > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }.pack-stage { padding: 18px; }.pack-sparks i:nth-child(even) { display: none; } }
@media (prefers-reduced-motion: reduce) { .pack-glow, .pack-sparks { display: none; } }

/* Rarity choreography: finite effects, at most 20 lightweight particles. */
.pack-stage {
  background: linear-gradient(#0b1a2a 0%, #22384a 25%, #172a38 58%, #214e3d 59%, #102e25 100%);
}
.pack-stage::before { content: ""; position: absolute; inset: 12% 0 42%; background: repeating-linear-gradient(transparent 0 17px, #08162477 18px 21px), radial-gradient(circle, #91a9ac66 1px, transparent 2px) 0 0 / 12px 10px; pointer-events: none; }
.pack-stage::after { content: ""; position: absolute; left: 18%; right: 18%; bottom: -9%; height: 35%; border: 1px solid #cce6c633; border-radius: 50%; pointer-events: none; }
.pack-stage[data-rarity="common"] { --pack-color: #e0e8ee; --pack-power: 0.26; }
.pack-darken, .pack-beams, .pack-ring, .pack-lightning, .pack-rain { position: absolute; pointer-events: none; }
.pack-darken { inset: 0; background: #02070f; opacity: 0; z-index: 1; }
.pack-beams { inset: 0; z-index: 2; }
.pack-beams::before, .pack-beams::after { content: ""; position: absolute; top: -10%; left: 24%; width: 25%; height: 125%; background: linear-gradient(to bottom, var(--pack-color), transparent); clip-path: polygon(45% 0, 55% 0, 100% 100%, 0 100%); transform: rotate(-12deg); transform-origin: top center; opacity: 0; }
.pack-beams::after { left: 53%; transform: rotate(12deg); }
.pack-ring { left: 50%; top: 50%; width: 270px; aspect-ratio: 1; border: 2px solid var(--pack-color); border-radius: 50%; opacity: 0; z-index: 3; }
.pack-lightning { inset: 0; z-index: 3; opacity: 0; }
.pack-lightning::before, .pack-lightning::after { content: ""; position: absolute; top: 6%; left: 16%; width: 45px; height: 75%; background: #d9baff; clip-path: polygon(65% 0, 95% 0, 48% 42%, 80% 40%, 12% 100%, 37% 53%, 0 55%); }
.pack-lightning::after { left: auto; right: 15%; transform: scaleX(-1); }
.pack-rain { inset: 0; z-index: 4; }
.pack-rain i { position: absolute; top: -8%; left: calc(8% + var(--rain-index) * 7.5%); width: 3px; height: 10px; border-radius: 2px; background: #ffe5a0; box-shadow: 0 0 5px #edc04b77; opacity: 0; }
.pack-glow { z-index: 3; }
.pack-sparks { z-index: 4; }
.pack-result-card, .pack-placeholder { z-index: 5; }
.pack-placeholder { position: relative; }
.pack-bundle { position: relative; z-index: 5; display: grid; justify-items: center; align-content: center; gap: 20px; width: min(100%, 230px); min-height: 280px; padding: 24px; border: 2px solid #dfc17d; border-radius: 14px; background: linear-gradient(135deg, #8b713d, #21334a 42%, #102034); box-shadow: 0 0 40px #dfc17d33; text-align: center; }
.pack-bundle span { font-size: 55px; }.pack-bundle strong { letter-spacing: 3px; color: #ffe6ab; }.pack-bundle small { color: #c2d3df; }
.pack-stage[data-rarity="common"].is-opening .pack-sparks { display: block; }
.pack-stage[data-rarity="common"] .pack-sparks i:nth-child(n+4) { display: none; }
.pack-stage[data-rarity="rare"].is-opening .pack-beams::before,
.pack-stage[data-rarity="rare"].is-opening .pack-beams::after { animation: pack-blue-beam var(--pack-duration) ease-out both; }
.pack-stage[data-rarity="epic"].is-opening .pack-lightning { animation: pack-lightning-strike var(--pack-duration) ease-out both; }
.pack-stage[data-rarity="epic"].is-opening .pack-ring { animation: pack-ring-expand var(--pack-duration) ease-out both; }
.pack-stage[data-rarity="epic"].is-opening { animation: pack-quake 300ms calc(var(--pack-duration) * 0.5) ease-out both; }
.pack-stage[data-rarity="legendary"].is-opening .pack-darken { animation: pack-nightfall var(--pack-duration) ease-in-out both; }
.pack-stage[data-rarity="legendary"].is-opening .pack-beams::before,
.pack-stage[data-rarity="legendary"].is-opening .pack-beams::after { animation: pack-gold-beam var(--pack-duration) ease-out both; }
.pack-stage[data-rarity="legendary"].is-opening .pack-rain i { animation: pack-gold-rain calc(var(--pack-duration) * 0.5) calc(var(--pack-duration) * 0.3 + var(--rain-index) * 20ms) linear both; }
.pack-stage[data-rarity="legendary"].is-opening .pack-ring { animation: pack-ring-expand var(--pack-duration) ease-out both; }
.pack-draw-ten, .pack-skip { padding: 13px 22px; border: 1px solid #d2b56e; border-radius: 8px; background: #24394c; color: #ffe4a2; }
.pack-skip { background: #102438; color: #c8d8e4; border-color: #708ca0; }
.pack-summary { margin: 20px 0; }.pack-summary > p { color: #aabfce; font-size: 12px; }
.pack-summary-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.pack-summary-grid button { --result-color: #cbd7df; display: grid; align-content: start; gap: 10px; min-width: 0; padding: 14px 8px; border: 1px solid var(--result-color); border-radius: 10px; background: #172e43; color: #e6edf2; text-align: center; }
.pack-summary-grid [data-rarity="rare"] { --result-color: #64bdff; background: #19354d; }
.pack-summary-grid [data-rarity="epic"] { --result-color: #c193ff; background: #302647; }
.pack-summary-grid [data-rarity="legendary"] { --result-color: #ffda6d; background: #483c24; box-shadow: 0 0 10px #ffda6d22; }
.pack-summary-grid small { color: var(--result-color); font-size: 10px; }.pack-summary-grid strong { font-size: 14px; overflow-wrap: anywhere; }.pack-summary-grid span { color: #bfcedb; font-size: 11px; }
.pack-summary-grid [aria-pressed="true"] { outline: 2px solid var(--result-color); outline-offset: 2px; }
.pack-summary-detail { padding: 16px; margin-top: 18px; border: 1px solid #d2b56e55; border-radius: 10px; background: #102438; }.pack-summary-detail h4 { margin: 0; color: #ffe4a2; }.pack-summary-detail > p { color: #b5c8d5; font-size: 11px; overflow-wrap: anywhere; }
@keyframes pack-blue-beam { 0%, 30%, 100% { opacity: 0; } 55% { opacity: 0.5; } 75% { opacity: 0.22; } }
@keyframes pack-lightning-strike { 0%, 35%, 85%, 100% { opacity: 0; } 52% { opacity: 0.65; } }
@keyframes pack-ring-expand { 0%, 35% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); } 60% { opacity: 0.5; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(2.2); } }
@keyframes pack-quake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-2px); } 65% { transform: translateX(2px); } }
@keyframes pack-nightfall { 0%, 100% { opacity: 0; } 22%, 72% { opacity: 0.78; } }
@keyframes pack-gold-beam { 0%, 28%, 100% { opacity: 0; } 50% { opacity: 0.6; } 75% { opacity: 0.72; } }
@keyframes pack-gold-rain { 0% { opacity: 0; transform: translateY(0) rotate(-15deg); } 20%, 70% { opacity: 0.8; } 100% { opacity: 0; transform: translateY(380px) rotate(120deg); } }
@media (max-width: 540px) { .pack-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.pack-rain i:nth-child(even) { display: none; }.pack-lightning::before { left: 6%; }.pack-lightning::after { right: 6%; } }
@media (prefers-reduced-motion: reduce) {
  .pack-darken, .pack-beams, .pack-ring, .pack-lightning, .pack-rain, .pack-sparks, .pack-glow { display: none !important; }
  .pack-stage[data-rarity="epic"].is-opening { animation: none; }
}
.pack-history-toggle { padding: 13px 20px; border: 1px solid #8fa4b677; border-radius: 8px; background: #172e43; color: #e9d7a7; }
.pack-history { margin: 20px 0; padding: 18px; border: 1px solid #bda15a55; border-radius: 12px; background: #0a1d30; }
.pack-history h3 { margin: 0 0 12px; color: #ffe2a0; }
.pack-history > p, .pack-history-status { color: #a9bfce; font-size: 12px; line-height: 1.7; }
.pack-history-list { display: grid; gap: 14px; padding: 0; list-style: none; }
.pack-history-list > li { padding: 14px; border: 1px solid #7890a344; border-radius: 8px; background: #132b40; }
.pack-history time { display: block; margin-bottom: 9px; color: #b9cbd8; font-size: 11px; }
.pack-history h4 { margin: 0; font-size: 14px; color: #e8d399; }
.pack-history summary { cursor: pointer; color: #e8d399; font-size: 14px; }
.pack-history-cards { display: grid; gap: 8px; padding: 0; margin: 12px 0 0; list-style: none; }
.pack-history-cards li { padding-left: 10px; border-left: 2px solid #c5cfd6; }
.pack-history-cards [data-rarity="rare"] { border-color: #64bdff; }.pack-history-cards [data-rarity="epic"] { border-color: #c193ff; }.pack-history-cards [data-rarity="legendary"] { border-color: #ffda6d; }
.pack-history-cards strong { display: block; color: #dce6ed; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.pack-history-cards small { display: block; color: #9db4c5; font-size: 10px; overflow-wrap: anywhere; }
