/* Reference-inspired pack reveal, scoped away from catalogue and detail cards. */
/* A viewport-sized backdrop does not change when the reveal locks body scrolling. */
body.pack-home { isolation:isolate; background:transparent; }
body.pack-home::before { content:''; position:fixed; inset:0; z-index:-1; pointer-events:none; background:radial-gradient(circle at 52% 4%,rgba(53,224,166,.08),transparent 36rem),linear-gradient(180deg,#0d1210 0%,var(--bg) 58%,#050706 100%); }
.pack-art-dialog { width:min(680px,calc(100vw - 28px)); max-height:calc(100dvh - 28px); box-sizing:border-box; padding:22px; border:1px solid #394239; border-radius:22px; color:#eaf1e9; background:#101611; overflow:auto; }
.pack-art-dialog::backdrop { background:#000b; backdrop-filter:blur(6px); }
.pack-art-dialog header { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.pack-art-dialog h2 { margin:0; font-size:20px; font-weight:600; }
.pack-art-dialog header button { border:0; background:transparent; color:inherit; font-size:28px; padding:4px 12px; border-radius:10px; }
.pack-art-image { display:grid; place-items:center; padding:14px 0; }
.pack-art-image img { display:block; width:min(440px,100%,calc((100dvh - 180px) * .6977)); height:auto; filter:drop-shadow(0 3px 7px #090b09a0) drop-shadow(0 0 15px #d6b9743d); cursor:default; user-select:none; }
.pack-art-dialog p { text-align:center; font-size:12px; color:#a4b1a7; margin:0; }
#profile.pack-screen { min-height: calc(100svh - 28px); padding: 48px 12px 32px; align-content: start; }
#profile .pack-heading h1 { font-size: clamp(24px, 3vw, 32px); line-height: 1.2; font-weight: 800; text-shadow: none; letter-spacing: -.8px; }
#profile .pack-heading p { font-size: 13px; margin: 10px 0 0; color: #87938d; }
#profile [hidden] { display: none !important; }
.opening-stage { width: 100%; display: grid; justify-items: center; margin: 24px 0 0; }
.opening-position { font-size: 12px; color: #9eada6; margin: 0 0 16px; letter-spacing: .4px; }
.opening-viewport { position:relative; display: grid; place-items: center; perspective: 1100px; width: 100%; min-height: 230px; }
.opening-packet { display: block; width: 170px; padding: 0; background: transparent; border: none; filter: drop-shadow(0 3px 7px #090b09a0) drop-shadow(0 0 15px #d6b9743d); transition:filter .2s;touch-action:manipulation; }
.opening-packet img { display: block; width: 100%; user-select: none; }
.opening-packet:hover { filter: drop-shadow(0 4px 8px #090b0990) drop-shadow(0 0 20px #e4c78755); }
@media (hover: hover) and (pointer: fine) {
 .opening-packet:hover:not(:disabled) { transform:none; }
}
.opening-card-slot { position: relative; width: min(290px, 76vw, calc((100svh - 258px) * .6667)); min-width: 180px; perspective: 1100px; }
.opening-emerging-card { position: relative; z-index: 2; will-change: transform, opacity; }
.opening-split-packet { position: absolute; left: 50%; top: 50%; z-index: 3; pointer-events: none; }
.opening-packet-half { position: absolute; inset: 0; width: 100%; height: 100%; will-change: transform, opacity; }
.opening-packet-half-left { clip-path: polygon(0 0, 51% 0, 49% 16%, 52% 30%, 48% 46%, 51% 62%, 49% 80%, 51% 100%, 0 100%); transform-origin: 35% 50%; }
.opening-packet-half-right { clip-path: polygon(51% 0, 100% 0, 100% 100%, 51% 100%, 49% 80%, 51% 62%, 48% 46%, 52% 30%, 49% 16%); transform-origin: 65% 50%; }
.opening-card-slot .card-shell { width: 100%; margin: 0; animation: none; transform-style:flat; transform-origin: center; }
.opening-flip { position: relative; width: 100%; aspect-ratio: 2 / 3; transform-origin: 50% 50%; will-change: transform; }
.opening-flip-face { position: absolute; inset: 0; opacity:0; will-change:transform,opacity; }
.opening-flip-face > .card-shell { height: 100%; }
.opening-card-slot .card-face { transition: none; will-change: auto; }
.opening-card-slot .is-interactive-card:hover .card-face,
.opening-card-slot .is-interactive-card:focus-visible .card-face { transform: none; filter: none; }
.opening-card-slot .is-interactive-card:focus-visible { outline:none; }
@media (hover:hover) and (pointer:fine) {
 .opening-card-slot .is-interactive-card:focus-visible .card-face { filter:drop-shadow(0 0 7px #f2d58fcc); }
}
.opening-card-back { height: 100%; border: 7px solid #b5d8c8; border-radius: 17px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 14px; color: #d8f2e5; background: repeating-linear-gradient(45deg, #ffffff03 0 1px, transparent 1px 12px), radial-gradient(ellipse at center, #214c3b, #101d17 75%); box-shadow: inset 0 0 0 2px #62927b; }
.opening-back-monogram { font: 64px Georgia, serif; letter-spacing: -13px; padding-right: 13px; }
.opening-card-back > span:not(.opening-back-monogram) { font-size: 13px; letter-spacing: 4px; }
.opening-card-back small { font-size: 7px; letter-spacing: 2px; }
.opening-navigation { display: flex; align-items: center; gap: 15px; margin: 18px 0 0; padding: 6px; border: 1px solid #b1e9cd20; border-radius: 40px; background: linear-gradient(135deg, #253c3060, #111b16b0); box-shadow: 0 8px 24px #0003, inset 0 1px 0 #ffffff08; }
.opening-navigation > button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; color: #d7fbe9; background: linear-gradient(145deg, #456a5760, #20392b90); border: 1px solid #9bd8b52b; transition: background .18s, transform .18s, box-shadow .18s; }
.opening-navigation > button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.opening-navigation > button:hover:not(:disabled) { background: #395f4a; box-shadow: 0 0 16px #72dfaa1c; transform: translateY(-1px); }
.opening-navigation > button:active:not(:disabled) { transform: scale(.94); }
.opening-navigation button:disabled { cursor: default; opacity: .3; }
.opening-dots { display: flex; align-items: center; gap: 0; }
.opening-dots button { padding: 0; width: 24px; height: 44px; border: 0; background: transparent; display: grid; place-items: center; }
.opening-dots button::after { content: ''; width: 6px; height: 6px; border-radius: 10px; background: #52635b; transition: background .18s, width .18s; }
.opening-dots button.is-revealed::after { background: #92c5ac; }
.opening-dots button.is-current::after { width: 20px; background: #9af3c9; box-shadow: 0 0 12px #8deaba40; }
#profile[data-opening-kind='super'] .opening-navigation { border-color:#c5a4ef35; background:linear-gradient(135deg,#47305d80,#20172db0); box-shadow:0 8px 24px #0003,inset 0 1px 0 #eadbff10; }
#profile[data-opening-kind='super'] .opening-navigation > button { color:#eddbff; background:linear-gradient(145deg,#76539260,#3b285390); border-color:#c5a4ef40; }
#profile[data-opening-kind='super'] .opening-navigation > button:hover:not(:disabled) { background:#664482; box-shadow:0 0 16px #c5a4ef30; }
#profile[data-opening-kind='super'] .opening-dots button::after { background:#685774; }
#profile[data-opening-kind='super'] .opening-dots button.is-revealed::after { background:#b298d1; }
#profile[data-opening-kind='super'] .opening-dots button.is-current::after { background:#dfbaff; box-shadow:0 0 12px #c5a4ef65; }
#profile[data-opening-kind='super'][data-opening-mode='cards'] #open-pack { background:#bc8be7; border-color:#d0a6f2; color:#29123d; }
#profile[data-opening-kind='super'] .opening-stage button:focus-visible,
#profile[data-opening-kind='super'] #open-pack:focus-visible { outline-color:#d7aff9; }
#profile .pack-actions { margin: 20px 0 0; display: flex; justify-content:center; gap:8px; width: auto; flex-wrap:wrap; }
#profile #open-pack { min-height: 42px; min-width: 154px; padding: 10px 24px; border-radius: 7px; font-size: 14px; font-weight: 600; background: #4dc99b; color: #082a1c; box-shadow: none; border: 1px solid #5bd9a9; }
#profile[data-opening-mode='idle'] #open-pack, #profile[data-opening-mode='opening'] #open-pack { background: none; color: #63dcb0; border-color: transparent; }
#profile[data-opening-kind='super'][data-opening-mode='opening'] #open-pack { color:#bc8be7; }
#profile #open-pack:disabled { opacity: .55; }
.opening-test-actions { display: grid; justify-items: center; gap: 6px; margin-top: 12px; }
.earned-super-panel { min-width:0; box-sizing:border-box; margin:0; padding:16px 12px; display:grid; align-content:center; gap:7px; border:1px solid #c5a4ef44; border-radius:18px; background:linear-gradient(120deg,#34243f66,#1d202966); color:#ecdafa; font-size:12px; }
.earned-super-panel strong { font-size:20px; color:#dcc0fa; }
.earned-super-panel strong > span:last-child { color:#a99ab8; }
#profile #open-earned-super { min-height:42px; min-width:154px; padding:10px 24px; border-radius:7px; border:1px solid transparent; background:none; color:#c5a4ef; box-shadow:none; font-weight:600; font-size:14px; }
#profile:not([data-opening-mode='idle']) #open-earned-super { display:none; }
#open-earned-super:disabled { opacity:.5; cursor:default; }
#profile[data-opening-mode='idle'] .pack-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:min(390px,100%); gap:10px; align-items:center; }
#profile[data-opening-mode='idle'] .pack-actions > button { min-width:0; width:100%; box-sizing:border-box; }
#profile[data-opening-mode='idle'] #open-pack { font-size:17px; padding:10px 8px; }
#profile .pack-referral { min-width:0; max-width:100%; padding:10px; gap:4px; white-space:normal; border-radius:12px; }
#profile .pack-referral span { font-size:11px; }
#profile .pack-referral strong { font-size:13px; line-height:1.35; }
@media(max-width:480px){ #profile[data-opening-mode='idle'] .pack-actions { gap:8px; } }
#profile .pack-referral[hidden], #profile #open-earned-super[hidden] { display:none; }
#profile .pack-referral:focus-visible { outline:2px solid #ead4ff; outline-offset:3px; }
.earned-super-panel small { color:#b5aabd; font-size:11px; }
#profile:not([data-opening-mode='idle']) .earned-super-panel { display:none; }
#open-legendary-test-pack { min-height: 44px; padding: 10px 18px; border-radius: 8px; border: 1px solid #d8b65980; background: #312914; color: #f5da88; font-size: 12px; }
#open-legendary-test-pack:hover:not(:disabled) { background: #473917; }
#open-legendary-test-pack:focus-visible { outline: 2px solid #f5da88; outline-offset: 3px; }
.opening-test-actions small { font-size: 10px; color: #9c9c88; }
#profile.pack-screen { position: relative; }
#profile .opening-test-zone { position: absolute; top: 150px; right: 12px; width: 215px; padding: 16px; box-sizing: border-box; border: 1px dashed #8ca29450; border-radius: 12px; background: #14201980; }
#profile .opening-test-zone h2 { margin: 0 0 14px; font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; color: #a6b6ae; }
#profile .opening-test-zone > div { margin: 0; }
#profile .opening-test-zone > div + div { margin-top: 16px; padding-top: 16px; border-top: 1px solid #8ca29425; }
#profile .opening-test-zone button { width: 100%; }
#profile:not([data-opening-mode='idle']) .opening-test-zone { display: none; }
@media (max-width: 1200px) {
 #profile .opening-test-zone { position: static; justify-self: end; order: 10; margin-top: 24px; }
}
.opening-stock { margin: 13px 0 0; min-width: 138px; padding: 13px 19px; border: 1px solid #25312a; border-radius: 9px; display: grid; gap: 5px; }
.opening-stock strong { color: #69dcb2; font-size: 22px; line-height: 1; font-weight: 500; }
.opening-stock small { color: #95a099; font-size: 11px; }
.opening-stock span { color: #6b7970; font-size: 10px; }
.timed-pack-stock { margin-top: 16px; padding: 16px 24px; border: 1px solid #ffffff18; border-radius: 18px; background: #ffffff03; display: grid; gap: 7px; color: #87938d; font-size: 12px; }
.timed-pack-stock strong { color: #55d6ad; font-size: 20px; }
.timed-pack-stock strong > span:last-child { color: #87938d; }
.timed-pack-stock small { color: #55d6ad; font-size: 12px; }
#profile:not([data-opening-mode='idle']) .timed-pack-stock { display: none; }
#profile .pack-counter { margin-top: 24px; padding: 16px 22px; width: min(290px, 85vw); gap: 7px; border: 1px solid #abd4bd1c; border-radius: 16px; background: linear-gradient(135deg, #203b2d65, #111b1645); opacity: 1; }
#profile .pack-counter strong { font-size: 22px; font-variant-numeric: tabular-nums; color: #ddf8e9; }
#profile .pack-counter small { color: #9db8aa; font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; }
#opening-collection-progress { display: block; width: 100%; height: 4px; margin-top: 6px; border: 0; border-radius: 8px; overflow: hidden; appearance: none; background: #ffffff0c; color: #87e8bb; }
#opening-collection-progress::-webkit-progress-bar { background: #ffffff0c; border-radius: 8px; }
#opening-collection-progress::-webkit-progress-value { background: linear-gradient(90deg, #49bc8c, #bcebd3); border-radius: 8px; }
#opening-collection-progress::-moz-progress-bar { background: #87e8bb; border-radius: 8px; }
#profile .pack-counter small, #profile .result-summary { font-size: 11px; }
.opening-counters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: min(390px, 100%); margin-top: 24px; align-items: stretch; }
#profile .opening-counters > div { margin: 0; width: auto; min-width: 0; padding: 16px 12px; align-content: center; }
#profile .opening-counters > :is(.timed-pack-stock, .earned-super-panel) { padding: 8px 12px; gap: 4px; }
#profile:not([data-opening-mode='idle']) .opening-counters { display: none; }
@media (max-width: 480px) {
 .opening-counters { gap: 8px; }
 #profile .opening-counters > div { padding: 12px 8px; }
 #profile .opening-counters > :is(.timed-pack-stock, .earned-super-panel) { padding: 7px 8px; }
 #profile .opening-counters .pack-counter strong { font-size: 18px; }
 #profile .opening-counters .pack-counter small { font-size: 9px; letter-spacing: .6px; }
}
#profile .result-summary { max-width: 380px; color: #83998b; margin: 12px 0 0; }
#profile[data-opening-mode='cards'] { padding-top: 18px; }
#profile[data-opening-mode='cards'] .opening-stage { margin-top: 0; }
#profile[data-opening-mode='cards'] .pack-counter { margin-top: 18px; }
#profile[data-opening-mode='opening'] .pack-counter,
#profile[data-opening-mode='cards'] .pack-counter { display: none !important; }
.opening-stage button:focus-visible, #open-pack:focus-visible { outline: 2px solid #8deaca; outline-offset: 4px; }
@media (max-width: 980px) {
 body.pack-home .sidebar { padding: 12px 20px; background: #0c100e; backdrop-filter: none; }
 body.pack-home .brand { min-height: 32px; }
 body.pack-home .brand-word { font-size: 20px; }
 body.pack-home .main-nav { position: fixed; z-index: 20; inset: auto 0 0; margin: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; padding: 7px 5px max(8px, env(safe-area-inset-bottom)); background: #101512f5; border-top: 1px solid #263128; backdrop-filter: blur(14px); }
 body.pack-home .main-nav a { min-height: 45px; display: flex; flex-direction: column; gap: 4px; justify-content: center; padding: 2px; font-size: 10px; font-weight: 500; border: none; border-radius: 0; background: transparent; }
 body.pack-home .main-nav a.active .nav-icon { color: var(--accent); }
 body.pack-home .main-nav strong { display: none; }
 body.pack-home .nav-icon { height: 19px; font-size: 20px; }
 body.pack-home .app-shell { padding-top: 0; }
 #profile.pack-screen { min-height: calc(100svh - 65px); padding-top: 35px; padding-bottom: 95px; }
 #profile[data-opening-mode='cards'] { padding-top: 15px; }
 .opening-card-slot { width: min(270px, 76vw, calc((100svh - 550px) * .6667)); }
 #profile[data-opening-mode='cards'] .pack-counter { display: grid; margin-top: 16px; padding: 12px 18px; }
}
@media (prefers-reduced-motion: reduce) { .opening-stage *, #profile #open-pack { transition: none !important; animation: none !important; } }
.pack-sound-toggle{display:block;margin:0 0 10px auto;padding:7px 11px;border:1px solid #456650;border-radius:999px;background:#15271c;color:#b9d7c4;font:12px system-ui,sans-serif;cursor:pointer;}
.opening-card-slot{isolation:isolate}
.opening-wish-badge{position:absolute;top:8px;right:8px;z-index:5;display:grid;place-items:center;width:30px;height:30px;border:1px solid #ffd4df;border-radius:50%;background:#a91e4a;color:#fff2f5;font:700 21px/1 system-ui,sans-serif;box-shadow:0 2px 7px #0006;pointer-events:none}
.pack-sound-toggle[aria-pressed=false]{color:#91a297;}.pack-sound-toggle:focus-visible{outline:2px solid #ffe2a0;outline-offset:3px;}

.referral-reward-dialog { box-sizing:border-box; width:min(420px,calc(100vw - 32px)); max-height:calc(100dvh - 40px); overflow:auto; padding:28px 24px; border:1px solid #b6a46d; border-radius:22px; background:radial-gradient(ellipse at top,#354d32,#13271c 65%); color:#edf4e9; text-align:center; box-shadow:0 24px 80px #0009; }
.referral-reward-dialog::backdrop { background:#030d09bd; backdrop-filter:blur(4px); }
.referral-reward-star { display:grid; place-items:center; width:64px; height:64px; margin:0 auto 14px; border:1px solid #c9b66e; border-radius:20px; background:#ffe2a017; color:#ffe2a0; font-size:40px; }
.referral-reward-dialog .referral-reward-eyebrow { color:#ddc98e; font:600 10px/1.5 system-ui,sans-serif; letter-spacing:.16em; }
.referral-reward-dialog h2 { margin:10px 0; color:#ffe2a0; font-size:28px; line-height:1.15; }
.referral-reward-dialog p { font-size:14px; line-height:1.6; }
.referral-reward-dialog .referral-reward-note { color:#b6c9bd; font-size:12px; }
.referral-reward-dialog [data-referral-reward-error]:empty { display:none; }
.referral-reward-dialog [data-referral-reward-error] { color:#ffd2a1; }
.referral-reward-dialog button { width:100%; min-height:44px; padding:10px 14px; margin-top:10px; border:0; border-radius:10px; background:#ffe2a0; color:#17251c; font:700 14px/1.3 system-ui,sans-serif; cursor:pointer; }
.referral-reward-dialog button:focus-visible { outline:2px solid #fff4c5; outline-offset:4px; }
.referral-reward-dialog button:disabled { opacity:.6; cursor:wait; }

.opening-copy-count{position:absolute;top:8px;right:8px;z-index:5;display:grid;place-items:center;min-width:32px;height:27px;box-sizing:border-box;padding:0 7px;border:1px solid #e8d39b;border-radius:8px;background:#152e26ed;color:#ffe4a8;font:700 14px/1 system-ui,sans-serif;font-variant-numeric:tabular-nums;box-shadow:0 2px 7px #0005;pointer-events:none}
.opening-copy-count[hidden]{display:none}
.opening-wish-badge~.opening-copy-count{right:46px}
.opening-packet-preview{filter:drop-shadow(0 3px 7px #090b09a0) drop-shadow(0 0 15px #d6b9743d)}
