/* Overlays, packs, card grids, rewards, wheel, season track, chat. */

/* modal */
.modal-bg { position: fixed; inset: 0; z-index: 110; background: rgba(3, 3, 8, .82); display: grid; place-items: center; padding: 16px; animation: k-fade .18s; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: linear-gradient(180deg, #15151f, #0f0f17); border: 1px solid var(--line2); border-radius: 24px; padding: 24px; position: relative; box-shadow: var(--shadow); animation: k-pop .28s var(--ease); }
.modal.wide { width: min(940px, 100%); }
.modal .x { position: absolute; top: 14px; right: 14px; z-index: 2; }
@keyframes k-fade { from { opacity: 0; } }
@keyframes k-pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.cardview { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
@media (max-width: 680px) { .cardview { grid-template-columns: 1fr; } .cardview > :first-child { max-width: 240px; width: 100%; margin: 0 auto; } }

/* toasts */
#toasts { position: fixed; z-index: 150; top: 76px; right: 18px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 360px; padding: 10px 16px; border-radius: 14px; background: rgba(22, 22, 32, .96); border: 1px solid var(--line2); box-shadow: var(--shadow); font-weight: 700; font-size: 14px; animation: k-toast-in .3s var(--ease); }
.toast.out { animation: k-toast-out .25s forwards; }
.toast.err { border-color: rgba(255, 90, 110, .5); color: #ff9aa8; }
.toast.ok { border-color: rgba(61, 220, 151, .45); color: #8ff0c3; }
.toast.reward { border-color: rgba(255, 200, 61, .5); color: var(--gold); }
.toast.live { border-color: color-mix(in srgb, var(--c) 55%, transparent); background: linear-gradient(90deg, color-mix(in srgb, var(--c) 18%, #16161f), #16161f 70%); color: var(--text); font-weight: 500; }
.toast.live img { width: 34px; height: 46px; object-fit: cover; border-radius: 6px; border: 2px solid var(--c); }
.toast.live b { color: var(--c); }
@keyframes k-toast-in { from { opacity: 0; transform: translateX(30px); } }
@keyframes k-toast-out { to { opacity: 0; transform: translateX(30px); } }
@media (max-width: 1023px) { #toasts { top: 64px; right: 10px; left: 10px; align-items: stretch; } .toast { max-width: none; } }

/* reward popup */
.reward-bg { position: fixed; inset: 0; z-index: 120; display: flex; flex-direction: column; align-items: center; justify-content: safe center; overflow: auto; background: radial-gradient(circle, rgba(40, 20, 50, .85), rgba(3, 3, 8, .92)); animation: k-fade .2s; padding: 20px; }
@media (max-height: 640px) { .levelbig { font-size: 64px; } .reward .burst { width: 140px; height: 140px; margin: -20px auto -110px; } .reward .items { margin: 12px 0; } }
.reward { text-align: center; max-width: 520px; animation: k-pop .45s var(--ease); }
.reward .burst { width: 220px; height: 220px; margin: -40px auto -150px; border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(255, 200, 61, .22) 0 8deg, transparent 8deg 22deg); animation: k-rays-ui 14s linear infinite; -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%); mask: radial-gradient(circle, #000 30%, transparent 70%); }
@keyframes k-rays-ui { to { transform: rotate(360deg); } }
.reward h2 { font-size: clamp(26px, 6vw, 40px); font-weight: 900; margin-bottom: 6px; }
.reward .items { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 22px 0; }
.reward .item { min-width: 110px; padding: 14px 16px; border-radius: 18px; background: var(--surface2); border: 1px solid var(--line2); animation: k-item .5s var(--ease) backwards; }
.reward .item b { display: block; font-family: var(--display); font-size: 22px; }
.reward .item span { font-size: 12.5px; color: var(--muted); }
@keyframes k-item { from { opacity: 0; transform: translateY(20px) scale(.8); } }
.levelbig { font-family: var(--display); font-weight: 900; font-size: 110px; line-height: 1; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 10px 40px rgba(255, 200, 61, .45)); }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 160; }

/* pack art */
.pack-art { --c: var(--gold); position: relative; aspect-ratio: 5 / 7; border-radius: 16px; overflow: hidden; display: grid; place-items: center; cursor: pointer;
  background: radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--c) 85%, #fff) 0%, var(--c) 30%, color-mix(in srgb, var(--c) 35%, #000) 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .18), inset 0 -30px 60px rgba(0, 0, 0, .35), 0 16px 40px color-mix(in srgb, var(--c) 35%, transparent);
  transition: transform .3s var(--ease); container-type: inline-size; }
.pack-art::before { content: ''; position: absolute; inset: 0; background: repeating-radial-gradient(circle at 50% 120%, transparent 0 9cqw, rgba(255, 255, 255, .08) 9cqw 10cqw); }
.pack-art::after { content: ''; position: absolute; left: 0; right: 0; top: 7cqw; height: 4cqw; background: repeating-linear-gradient(90deg, rgba(0, 0, 0, .35) 0 4cqw, transparent 4cqw 7cqw); }
.pack-art .shine { position: absolute; top: 0; bottom: 0; width: 45%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent); transform: translateX(-160%) skewX(-15deg); animation: k-pack-shine 4.5s ease-in-out infinite; }
@keyframes k-pack-shine { 60%, 100% { transform: translateX(330%) skewX(-15deg); } }
.pack-art b { position: relative; font-size: 42cqw; color: rgba(255, 255, 255, .95); text-shadow: 0 1cqw 6cqw rgba(0, 0, 0, .45); line-height: 1; }
.pack-art span { position: absolute; bottom: 9cqw; left: 6cqw; right: 6cqw; text-align: center; font-family: var(--display); font-weight: 900; font-size: 8cqw; letter-spacing: .06em; text-transform: uppercase; color: #fff; text-shadow: 0 .5cqw 2cqw rgba(0, 0, 0, .5); }
.pack-art em { position: absolute; top: 14cqw; font-style: normal; font-family: var(--mono); font-size: 6cqw; font-weight: 700; color: rgba(255, 255, 255, .85); letter-spacing: .2em; }
.pack-art:hover { transform: translateY(-6px) rotate(-1.5deg); }
.float { animation: k-float 3s ease-in-out infinite; }
@keyframes k-float { 50% { transform: translateY(-10px) rotate(1deg); } }

.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.pack-tile { --c: var(--gold); position: relative; border-radius: 22px; padding: 14px; background: radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--c) 18%, transparent), transparent 60%), var(--surface); border: 1px solid color-mix(in srgb, var(--c) 30%, var(--line)); display: flex; flex-direction: column; gap: 10px; }
.pack-tile h3 { font-size: 15px; }
.pack-tile .sub { color: var(--muted); font-size: 12.5px; margin-top: -6px; }
.pack-tile .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.pack-tile .acts .btn { flex: 1; padding: 8px 10px; font-size: 12.5px; }
.pack-tile .tag { position: absolute; top: 10px; right: 10px; z-index: 3; }

/* card grids */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.cards.sm { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 11px; }
/* no content-visibility here: its paint containment cut off the top of a card lifted and tilted on hover */
.cards .item { cursor: pointer; }
.cards .item > .card { transition: transform .2s var(--ease); }
.cards .item:hover > .card { transform: translateY(-4px); }
.cards .cap { font-size: 12px; color: var(--muted); margin-top: 7px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cards .cap b { color: var(--chakra); font-family: var(--mono); }
.pick { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 14px; }

/* opening */
.opening { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 24px; overflow: auto;
  background: radial-gradient(circle at 50% 42%, #0b2a66, #04102a 45%, #02050f 75%); animation: k-fade .2s; }
.opening .title { text-align: center; }
.opening .title .eyebrow { color: var(--c); }
.opening .sealed { width: min(240px, 58vw); cursor: pointer; }
.opening .sealed.tear { animation: k-tear .6s forwards; }
@keyframes k-tear { 30% { transform: scale(1.08) rotate(-4deg); } 100% { transform: scale(1.35); opacity: 0; filter: brightness(3); } }
.opening .hint { color: var(--muted); font-size: 13px; animation: k-blink 1.4s infinite; }
@keyframes k-blink { 50% { opacity: .3; } }
.reveal { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; max-width: 1060px; }
.reveal .slot { width: clamp(118px, 17vw, 182px); aspect-ratio: 5 / 7; position: relative; cursor: pointer; animation: k-deal .45s var(--ease) backwards; }
.reveal.many .slot { width: clamp(76px, 10vw, 120px); }
.reveal .slot > * { position: absolute; inset: 0; }
.reveal .slot:not(.flip) > .card, .reveal .slot.flip > .back { display: none; }
.reveal .slot.flip > .card { animation: k-flipin .5s var(--ease); }
.reveal .slot.big:not(.flip) > .back { animation: k-shake 1s infinite; box-shadow: 0 0 40px var(--glow), 0 0 80px var(--glow); }
.reveal .slot.big:not(.flip)::after { content: ''; position: absolute; inset: -20%; border-radius: 50%; background: radial-gradient(circle, var(--glow), transparent 65%); opacity: .45; z-index: -1; animation: k-pulse-glow 1.2s infinite; }
@keyframes k-pulse-glow { 50% { opacity: .8; transform: scale(1.08); } }
@keyframes k-deal { from { transform: translateY(80px) scale(.7) rotate(-8deg); opacity: 0; } }
@keyframes k-flipin { from { transform: perspective(800px) rotateY(90deg) scale(.9); } 60% { transform: perspective(800px) rotateY(-8deg) scale(1.06); } }
@keyframes k-shake { 10%, 30% { transform: rotate(-2deg); } 20%, 40% { transform: rotate(2deg); } 50% { transform: none; } }
.flash { position: fixed; inset: 0; pointer-events: none; z-index: 140; background: radial-gradient(circle, #fff, var(--c) 40%, transparent 75%); animation: k-flash .8s forwards; }
@keyframes k-flash { from { opacity: .9; } to { opacity: 0; } }
.summary { display: grid; gap: 14px; width: min(1060px, 100%); }
.summary .stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.summary .stats .pill { font-size: 13px; padding: 6px 14px; }
.kind-banner { font-family: var(--display); font-weight: 900; font-size: clamp(22px, 5vw, 38px); background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; animation: k-pop .5s var(--ease); }

/* wheel */
.wheel-wrap { position: relative; width: min(340px, 82vw); aspect-ratio: 1; margin: 0 auto; }
/* overflow hidden: the rotated label layers must never stick out of the circle (it made the window scroll and jump) */
.wheel { position: relative; width: 100%; height: 100%; border-radius: 50%; border: 6px solid #1e1e2c; overflow: hidden; box-shadow: 0 0 0 3px rgba(255, 200, 61, .5), 0 20px 60px rgba(0, 0, 0, .6), inset 0 0 30px rgba(0, 0, 0, .5); will-change: transform; transform: translateZ(0); }
.wheel-labels { position: absolute; inset: 0; }
.wheel-win { position: absolute; inset: 0; border-radius: 50%; opacity: 0; pointer-events: none; }
.wheel-win.on { animation: wheel-win 1.2s ease-in-out 3; }
@keyframes wheel-win { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
.wheel-pin { transform-origin: 50% 0; }
.wheel-pin.flick { animation: pin-flick .18s ease-out; }
@keyframes pin-flick { 0% { transform: translateX(-50%) rotate(0); } 40% { transform: translateX(-50%) rotate(-16deg); } 100% { transform: translateX(-50%) rotate(0); } }
.wheel-pin { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 15px solid transparent; border-right: 15px solid transparent; border-top: 30px solid var(--gold); filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .6)); z-index: 2; }
.wheel-hub { position: absolute; inset: 39%; border-radius: 50%; background: var(--grad); display: grid; place-items: center; font-size: 26px; color: #fff; box-shadow: 0 0 0 5px #1e1e2c, 0 6px 20px rgba(0, 0, 0, .5); }

/* season track */
.track { display: flex; gap: 10px; overflow-x: auto; padding: 6px 2px 14px; scroll-snap-type: x proximity; }
.tier { flex: none; width: 104px; scroll-snap-align: start; border-radius: 16px; padding: 10px; text-align: center; background: var(--surface); border: 1px solid var(--line); position: relative; }
.tier .n { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.tier .ic { font-size: 26px; margin: 4px 0; }
.tier .lbl { font-size: 11.5px; font-weight: 700; min-height: 30px; }
.tier.unlocked { border-color: rgba(255, 200, 61, .5); background: rgba(255, 200, 61, .07); }
.tier.claimed { opacity: .45; }
.tier.big { border-color: rgba(29, 143, 225, .6); background: linear-gradient(180deg, rgba(29, 143, 225, .16), transparent); }
.tier.locked .ic { filter: grayscale(1); opacity: .5; }

/* hub tiles */
.hub { display: grid; gap: 16px; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .hub { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .hub { grid-template-columns: 1fr 1fr; gap: 10px; } }
.tile { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; transition: transform .2s var(--ease), border-color .2s; min-height: 150px; }
.tile:hover { transform: translateY(-3px); border-color: var(--line2); }
.tile .ic { font-size: 30px; line-height: 1; }
.tile h3 { font-size: 15px; }
.tile p { color: var(--muted); font-size: 12.5px; }
.tile .foot-row { margin-top: auto; }
.tile.ready { border-color: rgba(255, 200, 61, .55); box-shadow: 0 0 0 1px rgba(255, 200, 61, .2), 0 10px 40px rgba(255, 200, 61, .12); }
.tile.ready::after { content: 'PRÊT'; position: absolute; top: 12px; right: 12px; font-family: var(--mono); font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--gold-grad); color: #241500; animation: k-blink 1.6s infinite; }

/* live feed */
.feed { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.pull { --c: var(--r-L); display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 12%, transparent), transparent 70%), var(--surface); border: 1px solid color-mix(in srgb, var(--c) 30%, var(--line)); animation: k-pop .4s var(--ease); }
.pull[data-r=M] { --c: var(--r-M); }
.pull .thumb { width: 46px; height: 64px; border-radius: 8px; object-fit: cover; object-position: 50% 20%; border: 2px solid var(--c); flex: none; }
.pull .r { color: var(--c); font-size: 11.5px; font-weight: 700; font-family: var(--mono); }
.pull b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* wiki list thumbnails: colour when owned, greyed with a padlock otherwise */
.wthumb { position: relative; flex: none; width: 42px; height: 58px; border-radius: 9px; overflow: hidden; border: 2px solid var(--c); background: var(--surface2); }
.wthumb img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.wthumb.locked { border-color: var(--line2); }
.wthumb.locked img { filter: grayscale(.75) brightness(.8); }
.wthumb.locked::after { content: '🔒'; position: absolute; right: 2px; bottom: 1px; font-size: 11px; }

/* market */
.listings { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 16px; }
.listing { cursor: pointer; }
.listing .meta { margin-top: 8px; font-size: 13px; }

/* chat */
.chat { position: fixed; right: 18px; bottom: 18px; z-index: 70; width: min(390px, calc(100vw - 24px)); height: min(580px, calc(100vh - 110px)); display: flex; flex-direction: column; background: #11111a; border: 1px solid var(--line2); border-radius: 22px; box-shadow: var(--shadow); animation: k-pop .25s var(--ease); }
.chat header { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.chat .msgs { flex: 1; overflow: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 9px; }
.chat .msg { font-size: 14px; line-height: 1.4; }
.chat .msg .who { font-size: 13px; color: var(--gold); }
.chat .msg .cardline { display: inline-flex; align-items: center; gap: 8px; padding: 5px 9px; border-radius: 10px; background: var(--surface); margin-top: 5px; border: 1px solid var(--c); }
.chat .msg .cardline img { width: 24px; height: 33px; object-fit: cover; border-radius: 4px; }
.chat form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }
.chat-fab { position: fixed; right: 20px; bottom: 20px; z-index: 50; }
@media (max-width: 1023px) { .chat-fab { display: none; } .chat { right: 12px; bottom: 96px; height: min(560px, calc(100vh - 170px)); } }
.dm { display: grid; grid-template-columns: 260px 1fr; gap: 14px; }
@media (max-width: 720px) { .dm { grid-template-columns: 1fr; } }
.bubbles { display: flex; flex-direction: column; gap: 6px; height: 380px; overflow: auto; padding: 12px; background: rgba(0, 0, 0, .3); border-radius: 16px; border: 1px solid var(--line); }
.bubble { max-width: 78%; padding: 8px 13px; border-radius: 16px 16px 16px 4px; background: var(--surface2); align-self: flex-start; font-size: 14px; }
.bubble.me { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: linear-gradient(135deg, rgba(76, 201, 255, .5), rgba(29, 143, 225, .5)); }

/* chart */
.chart { width: 100%; height: 140px; }
.chart path.l { fill: none; stroke: var(--chakra); stroke-width: 2; }
.chart path.a { fill: rgba(111, 227, 255, .1); }

/* misc */
.counters { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.counter { --c: var(--accent2); flex: 1 0 auto; display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--muted); }
.counter i { font-style: normal; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 20%, transparent); color: var(--c); font-weight: 700; }
.counter b { font-family: var(--mono); color: var(--c); }
.mission { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.mission .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface2); font-size: 17px; }
.mission.done { opacity: .5; }
.mission.ready { border-color: rgba(61, 220, 151, .5); background: rgba(61, 220, 151, .06); }
.mission .bar { margin-top: 6px; }
.streak { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.streak .d { text-align: center; padding: 12px 4px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.streak .d b { display: block; font-size: 22px; margin: 2px 0; }
.streak .d.ok { border-color: rgba(61, 220, 151, .5); background: rgba(61, 220, 151, .08); }
.streak .d.now { border-color: var(--gold); box-shadow: 0 0 24px rgba(255, 200, 61, .3); }
@media (max-width: 560px) { .streak { gap: 4px; } .streak .d { padding: 8px 2px; font-size: 11px; } .streak .d b { font-size: 16px; } }
.ach { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.ach .a { display: flex; gap: 11px; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); align-items: center; }
.ach .a > i { font-style: normal; width: 42px; height: 42px; border-radius: 14px; background: var(--surface2); display: grid; place-items: center; font-weight: 700; flex: none; font-size: 18px; }
.ach .a.got > i { background: var(--gold-grad); color: #241500; }
.ach .a.ready { border-color: rgba(61, 220, 151, .5); }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat { padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.stat small { display: block; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.stat b { display: block; font-family: var(--display); font-size: 24px; margin-top: 2px; }
.filters { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-bottom: 12px; }
@media (max-width: 700px) { .filters { grid-template-columns: 1fr; } }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 18px; border: 1px solid rgba(255, 200, 61, .4); background: linear-gradient(90deg, rgba(255, 200, 61, .12), rgba(29, 143, 225, .1)); }
.banner .ic { font-size: 28px; }
.banner .grow { min-width: 200px; }
.stars { color: var(--gold); letter-spacing: 2px; }
.trade-col { border: 1px solid var(--line); border-radius: 16px; padding: 12px; background: rgba(0, 0, 0, .25); }

/* ===== booster opening: rolling reels of cards ===== */
.casino { gap: 20px; }
.machine {
  --cw: clamp(76px, calc((min(94vw, 1000px) - (var(--reels) - 1) * 16px) / var(--reels)), 170px);
  --sh: calc(var(--cw) * 1.4 + 16px);
  --win: calc(var(--sh) * 2.2);
  position: relative;
}
.reels { position: relative; display: flex; gap: 16px; justify-content: center; }
/* soft light band behind the winning row */
.reels::before { content: ''; position: absolute; left: -40px; right: -40px; top: 50%; height: var(--sh); transform: translateY(-50%); pointer-events: none;
  background: radial-gradient(55% 100% at 50% 50%, color-mix(in srgb, var(--c) 30%, transparent), transparent 75%); filter: blur(6px); }
/* each reel keeps some room on its sides (cancelled by negative margins): a card growing and
   tilting under the pointer is not cut by the mask */
.reel { --rc: var(--r-C); --room: 24px; position: relative; width: calc(var(--cw) + 2 * var(--room)); margin: 0 calc(-1 * var(--room)); padding: 0 var(--room); box-sizing: border-box; height: var(--win); overflow: hidden;
  -webkit-mask: linear-gradient(180deg, transparent 0, #000 22%, #000 78%, transparent 100%); mask: linear-gradient(180deg, transparent 0, #000 22%, #000 78%, transparent 100%); }
.reel[data-r=U] { --rc: var(--r-U); } .reel[data-r=R] { --rc: var(--r-R); } .reel[data-r=E] { --rc: var(--r-E); } .reel[data-r=L] { --rc: var(--r-L); } .reel[data-r=M] { --rc: var(--r-M); }
.reel.empty { visibility: hidden; }
/* absolute boxes start at the padding edge: inset by the room so cards sit centred, with space on both sides */
.strip { position: absolute; left: var(--room); right: var(--room); top: 0; will-change: transform; }
.rsym { height: var(--sh); padding: 8px 0; display: flex; align-items: center; transition: transform .45s var(--ease), opacity .45s, filter .45s; }
.rsym .card { width: var(--cw); }
.reel.spinning .strip { opacity: .92; }
/* keep the reels light: card animations only run on the cards that won */
.reel:not(.stopped) .card *, .reel:not(.stopped) .card *::before, .reel:not(.stopped) .card *::after,
.reel.stopped .rsym:not(:nth-child(2)) .card *, .reel.stopped .rsym:not(:nth-child(2)) .card *::before, .reel.stopped .rsym:not(:nth-child(2)) .card *::after { animation: none !important; }
.reel.stopped .rsym:not(:nth-child(2)) { opacity: .38; transform: scale(.88); filter: saturate(.5); }
.reel.stopped .rsym:nth-child(2) { transform: scale(1.03); }
.reel.stopped .rsym:nth-child(2) .card { filter: drop-shadow(0 0 16px color-mix(in srgb, var(--rc) 70%, transparent)); }
.reel.tease::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(60% 30% at 50% 50%, rgba(255, 255, 255, .35), transparent 70%); animation: k-tease-pulse .3s ease-in-out infinite alternate; }
@keyframes k-tease-pulse { from { opacity: .2; } to { opacity: 1; } }
.results { width: min(1060px, 100%); }
.casino .stats { margin-bottom: 4px; }
@media (max-width: 560px) { .reels { gap: 6px; } .machine { --cw: clamp(56px, calc((94vw - (var(--reels) - 1) * 6px) / var(--reels)), 120px); } }

/* "mode fluide": decorative loops off */
.lite .pack-art .shine, .lite .bar > i::after, .lite .reward .burst, .lite .reels::before { display: none; }
.lite .float, .lite .tile.ready::after { animation: none; }

/* won cards can be opened in the detail view */
.reel.stopped .rsym:nth-child(2), .results [data-zoom] { cursor: zoom-in; }
.reel.stopped .rsym:nth-child(2):hover { transform: scale(1.07); }

/* nothing inside the wheel moves on its own while it spins */
.wheel-wrap .flame path { animation: none; }

/* booster opening: the vortex sits behind everything (js/ui/vortex.js) */
.op-vortex { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; }
.opening > :not(.op-vortex) { position: relative; z-index: 1; }
/* once the reels stop, only the won cards stay, floating on an arc */
.machine.won .reel { overflow: visible; -webkit-mask: none; mask: none; transform: translateY(calc(var(--cw) * .2 * var(--k2, 0))) rotate(calc(var(--k, 0) * 8deg)); transition: transform .9s cubic-bezier(.2, .9, .3, 1.25); }
.machine.won .rsym:not(:nth-child(2)) { opacity: 0 !important; pointer-events: none; transition: opacity .5s; }
.machine.won .rsym:nth-child(2) { animation: won-float 3.4s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -.55s); }
.machine.won .rsym:nth-child(2) .card { filter: drop-shadow(0 0 22px color-mix(in srgb, var(--rc) 75%, transparent)) drop-shadow(0 18px 18px rgba(0, 0, 0, .55)); }
.machine.won .reel::after { content: ''; position: absolute; left: 50%; top: calc(50% + var(--sh) / 2 + 6px); width: calc(var(--cw) * .8); height: 16px; translate: -50% 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--rc) 55%, transparent), transparent); animation: won-shadow 3.4s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -.55s); }
.machine.won .reels::before { opacity: .35; transition: opacity .6s; }
@keyframes won-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }
@keyframes won-shadow { 0%, 100% { opacity: .9; scale: 1; } 50% { opacity: .45; scale: .8; } }
.lite .machine.won .rsym:nth-child(2), .lite .machine.won .reel::after { animation: none; }
@media (prefers-reduced-motion: reduce) { .machine.won .rsym:nth-child(2), .machine.won .reel::after { animation: none; } }
/* phones: the arc of won cards is a bit narrower so the outer cards stay on screen */
@media (max-width: 560px) {
  .machine.won .reels { scale: .86; }
  .machine.won .reel { transform: translateY(calc(var(--cw) * .2 * var(--k2, 0))) rotate(calc(var(--k, 0) * 6deg)); }
}
