/* Texas Hold'em: projector and phone. */
#sc-poker { padding: 0.5vh 1.6vw 1.5vh; }
.pk { display: grid; grid-template-rows: auto 1fr; gap: 1vh; height: 100%; }
.pk-head { display: flex; justify-content: space-between; align-items: center; }
.pk-info { display: flex; gap: 1.6vw; font-weight: 800; font-size: 2.4vh; } .pk-info b { color: var(--gold); font-size: 3vh; }
.pk-body { display: grid; grid-template-columns: minmax(0, 1fr) 22vw; gap: 1.4vw; min-height: 0; }
.pk-felt { position: relative; min-height: 0; }
.pk-oval { position: absolute; inset: 4% 6%; border-radius: 44% / 50%; background: radial-gradient(ellipse at 50% 40%, #1f8a55, #0c4a2c 70%);
    box-shadow: inset 0 0 0 1.2vh #6b3c14, inset 0 0 0 1.6vh #d9b35a, inset 0 0 6vh rgba(0, 0, 0, .6), 0 3vh 6vh rgba(0, 0, 0, .7); display: grid; place-items: center; }
.pk-center { display: grid; justify-items: center; gap: 1.2vh; }
.pk-street { font-family: var(--display); font-weight: 900; font-size: 2.6vh; letter-spacing: .14em; text-transform: uppercase; color: #d9f7e4; opacity: .8; }
.pk-board { display: flex; gap: .6vw; }
.pk-card { display: inline-block; width: 11vh; filter: drop-shadow(0 .8vh 1.4vh rgba(0, 0, 0, .55)); transition: transform .3s, filter .3s; }
.pk-card svg { display: block; width: 100%; height: auto; }
.pk-card.deal { animation: pk-deal .7s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes pk-deal { 0% { transform: translateY(-14vh) rotateY(90deg) scale(.6); opacity: 0; } 60% { transform: rotateY(0) scale(1.1); opacity: 1; } }
.pk-card.best { transform: translateY(-1vh); filter: drop-shadow(0 0 1.6vh #ffd84a); }
.pk-slot { width: 11vh; aspect-ratio: 5 / 7; border-radius: .8vh; border: .25vh dashed rgba(255, 255, 255, .2); }
.pk-pot { display: flex; align-items: center; gap: .6vw; padding: .6vh 1.4vw; border-radius: 99px; background: rgba(0, 0, 0, .45); font-weight: 800; font-size: 2.4vh; }
.pk-pot b { font-family: var(--display); color: var(--gold); font-size: 3.2vh; animation: pk-pulse .5s; }
@keyframes pk-pulse { 50% { transform: scale(1.25); } }
.pk-chips { display: inline-block; width: 2.6vh; height: 2.6vh; border-radius: 50%; background: radial-gradient(circle, #fff 0 25%, #d0142f 28% 60%, #fff 62% 70%, #d0142f 72%); box-shadow: 0 .4vh 0 #7a0a1b, 0 .8vh 0 #d0142f, 0 1.1vh 0 #7a0a1b; }
.pk-win { min-height: 0; }
.pk-banner { padding: 1vh 2vw; border-radius: 1.4vh; background: rgba(0, 0, 0, .7); box-shadow: 0 0 3vh rgba(255, 216, 74, .6), inset 0 0 0 .3vh #ffd84a; font-weight: 800; font-size: 2.6vh; text-align: center; animation: bg-slam .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.pk-banner b { color: var(--gold); }
.pk-seat { position: absolute; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: .4vh; width: 15vw; transition: filter .4s; }
.pk-seat.dim { filter: grayscale(.8) brightness(.55); }
.pk-hole { display: flex; gap: .3vw; min-height: 6vh; }
.pk-hole .pk-card { width: 5.4vh; }
.pk-plate { position: relative; display: grid; justify-items: center; min-width: 11vw; padding: .7vh 1vw; border-radius: 1.2vh; background: rgba(12, 10, 22, .9); box-shadow: inset 0 0 0 .25vh rgba(255, 255, 255, .15); font-size: 2vh; }
.pk-plate b { font-size: 2.2vh; white-space: nowrap; max-width: 13vw; overflow: hidden; text-overflow: ellipsis; }
.pk-plate span { color: var(--gold); font-weight: 800; }
.pk-plate em { font-style: normal; font-weight: 800; font-size: 1.7vh; color: #7af0ff; }
.pk-plate small { font-weight: 800; color: #ffd84a; }
.pk-plate.empty { color: var(--muted); font-weight: 700; opacity: .6; }
.pk-seat.turn .pk-plate { box-shadow: 0 0 0 .4vh #f2700f, 0 0 3vh #f2700f; animation: pk-glow 1s ease-in-out infinite; }
.pk-seat.turn .pk-plate::after { content: ""; position: absolute; left: 0; bottom: 0; height: .5vh; width: calc(var(--t) * 100%); border-radius: 99px; background: #f2700f; transition: width .25s linear; }
@keyframes pk-glow { 50% { box-shadow: 0 0 0 .4vh #ffb02e, 0 0 5vh #ffb02e; } }
.pk-seat.won .pk-plate { box-shadow: 0 0 0 .4vh #ffd84a, 0 0 5vh #ffd84a; }
.pk-bet { display: flex; align-items: center; gap: .4vw; font-weight: 900; font-size: 2vh; color: #fff; animation: ct-sit .4s both; }
.pk-btn { position: absolute; top: -1.4vh; right: 0; display: grid; place-items: center; width: 3.4vh; height: 3.4vh; border-radius: 50%; background: #fff; color: #111; font-style: normal; font-weight: 900; font-size: 1.8vh; box-shadow: 0 .4vh .8vh rgba(0, 0, 0, .5); }
.pk-side { display: grid; grid-template-rows: auto 1fr auto; gap: 1vh; padding: 1.4vh 1vw; border-radius: 2vh; background: rgba(0, 0, 0, .35); min-height: 0; }
.pk-side h3 { margin: 0; font-size: 2.4vh; }
.pk-log { display: grid; gap: .5vh; align-content: start; overflow: hidden; font-size: 1.9vh; }
.pk-log div { padding: .5vh .6vw; border-radius: .8vh; background: rgba(255, 255, 255, .05); }
.pk-log div:first-child { background: rgba(242, 112, 15, .25); font-weight: 800; }
.pk-join { font-weight: 800; font-size: 2vh; color: #7af0ff; text-align: center; animation: bg-pulse 1.6s ease-in-out infinite; }
/* phone */
.pkp { display: grid; gap: .7rem; text-align: center; }
.pkp-seats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; }
.pkp-open { padding: .8rem .2rem; border: 0; border-radius: .8rem; background: linear-gradient(180deg, #1f8a55, #0c4a2c); color: #fff; font: inherit; font-weight: 900; cursor: pointer; box-shadow: inset 0 0 0 2px #d9b35a; }
.pkp-taken { display: grid; place-items: center; padding: .8rem .2rem; border-radius: .8rem; background: rgba(255, 255, 255, .06); font-size: .75rem; font-weight: 800; color: var(--muted); overflow: hidden; }
.pkp-mine { display: flex; justify-content: center; gap: .5rem; padding: .6rem; border-radius: 1rem; background: radial-gradient(ellipse, #1f8a55, #0c4a2c 80%); box-shadow: inset 0 0 0 3px #d9b35a; }
.pkp-mine.turn { box-shadow: inset 0 0 0 3px #f2700f, 0 0 1.2rem #f2700f; }
.pkp-mine .pk-card.big { width: 5.6rem; animation: hl-pop .45s cubic-bezier(.2, 1.4, .4, 1) both; }
.pkp-hand { font-weight: 800; } .pkp-hand b { color: var(--gold); }
.pkp-table { display: grid; justify-items: center; gap: .4rem; padding: .6rem; border-radius: 1rem; background: rgba(0, 0, 0, .3); }
.pkp-street { font-weight: 900; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pkp-board { display: flex; gap: .25rem; } .pkp-board .pk-card, .pkp-board .pk-slot { width: 2.9rem; }
.pkp-pot b { color: var(--gold); font-family: var(--display); font-size: 1.2rem; }
.pkp-win { font-weight: 800; font-size: .9rem; } .pkp-win b { color: var(--gold); }
.pkp-players { display: grid; gap: .3rem; text-align: left; }
.pkp-p { display: grid; grid-template-columns: 1fr auto; gap: 0 .5rem; padding: .4rem .6rem; border-radius: .6rem; background: rgba(255, 255, 255, .05); font-size: .82rem; }
.pkp-p b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .pkp-p span { color: var(--gold); font-weight: 800; text-align: right; }
.pkp-p em { grid-column: 1 / -1; font-style: normal; color: #7af0ff; font-weight: 700; font-size: .75rem; }
.pkp-p.turn { box-shadow: inset 0 0 0 2px #f2700f; } .pkp-p.me { background: rgba(122, 240, 255, .1); } .pkp-p.dim { opacity: .45; }
.pkp-theirs { grid-column: 1 / -1; display: flex; gap: .2rem; } .pkp-theirs .pk-card { width: 2rem; }
.pkp-dock { gap: .45rem; }
.pkp-clock { font-weight: 900; } .pkp-clock.low { color: #ff5a6e; animation: bg-pulse .5s infinite; }
.pkp-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: .3rem; }
.pkp-presets button { padding: .45rem 0; border: 0; border-radius: .6rem; background: rgba(255, 255, 255, .1); color: var(--text); font: inherit; font-weight: 800; font-size: .8rem; cursor: pointer; }
.pkp-presets button.on { background: var(--gold); color: #1a1206; }
.pkp-slider { width: 100%; accent-color: #f2700f; }
/* fit: keep every seat on screen */
.pk-oval { inset: 16% 13%; }
.pk-seat { width: 13vw; gap: .2vh; }
.pk-hole { min-height: 5vh; } .pk-hole .pk-card { width: 4.6vh; }
.pk-plate { min-width: 9.5vw; padding: .5vh .8vw; font-size: 1.8vh; } .pk-plate b { font-size: 2vh; }
.pk-card { width: 7.4vh; } .pk-slot { width: 7.4vh; }
.pk-felt { overflow: visible; }

/* ---------- flying chips, clock ring, blinds countdown ---------- */
.pk-fly { position: fixed; z-index: 70; display: flex; align-items: center; gap: .4vw; padding: .4vh .8vw; border-radius: 99px; background: rgba(0, 0, 0, .6); font-weight: 900; font-size: 2vh; color: var(--gold); pointer-events: none; }
.pk-clock { position: absolute; left: -2.2vh; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 4.6vh; height: 4.6vh; border-radius: 50%;
    background: conic-gradient(#f2700f calc(var(--t) * 360deg), rgba(255, 255, 255, .12) 0); box-shadow: 0 0 1.6vh rgba(242, 112, 15, .7); }
.pk-clock b { display: grid; place-items: center; width: 3.5vh; height: 3.5vh; border-radius: 50%; background: #0c0a16; font-family: var(--display); font-size: 1.8vh; max-width: none; }
.pk-clock.low { animation: bg-pulse .5s infinite; background: conic-gradient(#ff3b5c calc(var(--t) * 360deg), rgba(255, 255, 255, .12) 0); }
.pk-seat.turn .pk-plate::after { display: none; }
.pk-up { color: #ffb02e; } .pk-up b { color: #ffd84a !important; }
/* phone: peek-to-see */
.pkp-peek { position: relative; display: inline-block; }
.pkp-peek .face { position: absolute; inset: 0; opacity: 0; transform: rotateY(90deg); transition: opacity .15s, transform .2s; }
.pkp-mine.peek .face, .pkp-mine.show .face { opacity: 1; transform: none; }
.pkp-mine.peek .back, .pkp-mine.show .back { opacity: 0; }
.pkp-mine .pk-card.big { animation: none; }
.pkp-mine { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: pointer; }
.pkp-peekhint { font-weight: 800; font-size: .8rem; color: #7af0ff; }
.pkp-tools { display: flex; gap: .4rem; justify-content: center; flex-wrap: wrap; }
.pkp-up { font-weight: 800; font-size: .8rem; color: #ffb02e; }
.pkp-mine:not(.peek):not(.show) ~ .pkp-hand { visibility: hidden; }

/* ---------- waiting: empty felt with the dealer working the deck ---------- */
.pk-idle { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; justify-items: center; align-items: center; gap: 2vh; }
.pk-idle-felt { position: relative; width: min(80vw, 130vh); height: min(52vh, 44vw); border-radius: 50%;
    background: radial-gradient(ellipse at 50% 40%, #1f7a4a, #0e4a2c 60%, #07301c); box-shadow: 0 0 0 1.4vh #3a2412, 0 0 0 1.8vh #e8c24a, 0 3vh 6vh rgba(0, 0, 0, .6), inset 0 0 6vh rgba(0, 0, 0, .55); }
.pk-deckwrap { position: relative; width: 44vh; height: 20vh; margin: 0 auto; }
.pk-deckwrap.big { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.pk-deckwrap.big .ct-shuffle { top: 0; }
.pk-chips { position: absolute; width: 7vh; height: 7vh; border-radius: 50%; background: repeating-conic-gradient(var(--c, var(--pumpkin)) 0 30deg, #fff 30deg 45deg); box-shadow: 0 .7vh 0 color-mix(in srgb, var(--c, var(--pumpkin)) 55%, #000), 0 1.4vh 0 color-mix(in srgb, var(--c, var(--pumpkin)) 55%, #000), 0 2.2vh 1.4vh rgba(0, 0, 0, .5); animation: pk-glint 3s ease-in-out infinite; }
.pk-chips::after { content: ""; position: absolute; inset: 22%; border-radius: 50%; background: color-mix(in srgb, var(--c, var(--pumpkin)) 85%, #fff); }
.pk-chips.a { left: 16%; top: 58%; --c: var(--blood); } .pk-chips.b { left: 76%; top: 26%; --c: var(--violet); animation-delay: -1s; } .pk-chips.c { left: 22%; top: 20%; --c: var(--ecto); animation-delay: -2s; }
@keyframes pk-glint { 50% { filter: brightness(1.35); transform: translateY(-.6vh); } }
.pk-idle-cap { padding: 1vh 2.6vw; border-radius: 99px; font-family: var(--display); font-weight: 900; font-size: 3.8vh; color: #1a1206; background: linear-gradient(180deg, #fff3b0, #ffc23a); box-shadow: 0 0 3vh rgba(255, 194, 58, .5); }
.pk-idle-cap.in { animation: mg-cap .6s cubic-bezier(.2, 1.5, .4, 1) both; }
@media (prefers-reduced-motion: reduce) { .pk-chips, .pk-idle-cap.in { animation: none; } }

/* ---------- the magician: close-up card flourishes, then back to the table ---------- */
.pk-idle { position: relative; }
.pk-idle-felt { transition: transform 1.2s cubic-bezier(.6, 0, .3, 1), filter 1.2s, opacity 1.2s; }
.pk-idle.close .pk-idle-felt { transform: scale(1.9); filter: blur(.5vh) brightness(.55); }
.pk-idle.close .pk-deckwrap, .pk-idle.close .pk-chips { opacity: 0; transition: opacity .4s; }
.pk-magic { position: absolute; inset: 0; pointer-events: none; opacity: 0; transform: scale(.6); transition: opacity .8s, transform 1.2s cubic-bezier(.6, 0, .3, 1); }
.pk-idle.close .pk-magic { opacity: 1; transform: none; transition-delay: .3s; }
.pk-magic i, .pk-magic b { position: absolute; display: block; }
.mg-spot { left: 50%; top: 52%; width: 90vh; height: 60vh; margin: -30vh 0 0 -45vh; border-radius: 50%; background: radial-gradient(ellipse, rgba(255, 245, 210, .22), transparent 70%); }
.mg-glove { position: absolute; top: 38%; width: 26vh; height: 78vh; margin: 0 0 0 -13vh; transform-origin: 50% 100%; filter: drop-shadow(0 2vh 2.4vh rgba(0, 0, 0, .55)); transition: left 1s cubic-bezier(.5, 0, .3, 1), top 1s, transform 1s; z-index: 3; }
.mg-glove svg { width: 100%; height: 100%; }
.mg-glove.l { left: 36%; transform: rotate(12deg) scaleX(-1); } .mg-glove.r { left: 64%; transform: rotate(-12deg); }
.mg-card { left: 50%; top: 50%; width: 9vh; height: 13vh; margin: -6.5vh 0 0 -4.5vh; border-radius: 1vh; z-index: 2; opacity: 0;
    background: repeating-linear-gradient(45deg, var(--violet) 0 1.2vh, color-mix(in srgb, var(--violet) 60%, #000) 1.2vh 2.4vh); box-shadow: inset 0 0 0 .5vh #fff, 0 .6vh 1.2vh rgba(0, 0, 0, .45); }
.mg-card::after { content: var(--theme-icon, "🎃"); position: absolute; inset: 0; display: grid; place-items: center; font-size: 4vh; }
/* the spring: cards arc in a stream from the right hand to the left */
.t-spring .mg-card { opacity: 1; animation: mg-spring 1.7s cubic-bezier(.4, 0, .6, 1) calc(var(--i) * .12s) infinite; }
@keyframes mg-spring { 0% { transform: translate(12vw, -4vh) rotate(18deg); } 50% { transform: translate(0, -20vh) rotate(0); } 100% { transform: translate(-12vw, -4vh) rotate(-18deg); } }
.t-spring .mg-glove.r { animation: mg-squeeze .3s ease-in-out infinite alternate; }
@keyframes mg-squeeze { to { transform: rotate(-9deg) translateY(.8vh); } }
/* the riffle: two packets bend and the cards rain together in the middle */
.t-riffle .mg-glove.l { left: 39%; } .t-riffle .mg-glove.r { left: 61%; }
.t-riffle .mg-card { opacity: 1; animation: mg-riffle 2.2s cubic-bezier(.5, 0, .6, 1) calc(var(--i) * .09s) infinite; }
@keyframes mg-riffle { 0%, 12% { transform: translate(calc(var(--s) * 11vw), -2vh) rotate(calc(var(--s) * 32deg)); } 40% { transform: translate(calc(var(--s) * 4vw), -8vh) rotate(calc(var(--s) * 12deg)); } 70%, 100% { transform: translate(0, calc(4vh - var(--i) * .25vh)) rotate(calc(var(--s) * 2deg)); } }
.t-riffle .mg-glove { animation: mg-bend 2.2s ease-in-out infinite; }
@keyframes mg-bend { 40% { top: 37%; } }
/* the fan and reveal: the left hand fans the deck, the right hand plucks a card and it flips to an ace */
.t-reveal .mg-glove.l { left: 42%; top: 46%; } .t-reveal .mg-glove.r { left: 68%; animation: mg-pluck 9s ease-in-out both; }
@keyframes mg-pluck { 0%, 22% { top: 46%; } 26% { top: 40%; left: 58%; } 45%, 100% { top: 22%; left: 68%; } }
.t-reveal .mg-card { opacity: 1; transform-origin: 50% 130%; animation: mg-fan 9s cubic-bezier(.3, 1.3, .5, 1) both; }
@keyframes mg-fan { 0% { transform: translate(-8vw, 2vh) rotate(0); } 18%, 100% { transform: translate(-8vw, 2vh) rotate(calc((var(--i) - 5.5) * 9deg)); } }
.mg-ace { position: absolute; left: 50%; top: 50%; width: 12vh; height: 17vh; margin: -8.5vh 0 0 -6vh; z-index: 2; perspective: 60vh; opacity: 0; }
.t-reveal .mg-ace { animation: mg-ace 9s ease-in-out both; }
@keyframes mg-ace { 0%, 20% { opacity: 0; transform: translate(-6vw, 0); } 26% { opacity: 1; transform: translate(-6vw, 0); } 45% { opacity: 1; transform: translate(18vw, -22vh) rotate(-8deg) scale(1.35); } 100% { opacity: 1; transform: translate(18vw, -22vh) rotate(-8deg) scale(1.35); } }
.mg-ace b { position: absolute; inset: 0; border-radius: 1.2vh; backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .8s; }
.mg-ace-back { background: repeating-linear-gradient(45deg, var(--violet) 0 1.2vh, color-mix(in srgb, var(--violet) 60%, #000) 1.2vh 2.4vh); box-shadow: inset 0 0 0 .6vh #fff; }
.mg-ace-face { display: grid; place-items: center; align-content: center; background: #fffdf6; box-shadow: inset 0 0 0 .5vh var(--gold), 0 0 5vh rgba(255, 216, 74, .8); transform: rotateY(180deg); color: #111; }
.mg-ace-face span { font-family: var(--display); font-weight: 900; font-size: 6vh; line-height: 1; } .mg-ace-face em { font-style: normal; font-size: 7vh; line-height: 1; }
.t-reveal .mg-ace-back { animation: mg-flipb 9s both; } .t-reveal .mg-ace-face { animation: mg-flipf 9s both; }
@keyframes mg-flipb { 0%, 48% { transform: rotateY(0); } 58%, 100% { transform: rotateY(180deg); } }
@keyframes mg-flipf { 0%, 48% { transform: rotateY(180deg); } 58%, 100% { transform: rotateY(360deg); } }
@media (prefers-reduced-motion: reduce) { .pk-magic *, .pk-idle-felt { animation: none !important; transition: none !important; } }

/* ---------- the magician over a waiting table: close-ups cover the table, pull-backs reveal the seats ---------- */
.pk-overlay.pk-idle { display: block; position: absolute; inset: 0; z-index: 30; pointer-events: none; opacity: 0; transition: opacity 1s ease;
    background: radial-gradient(ellipse at 50% 48%, rgba(40, 20, 50, .55), rgba(4, 2, 10, .94) 72%); }
.pk-overlay.pk-idle.close { opacity: 1; }
/* the card fountain: cards spray up from one glove and rain back down */
.t-fountain .mg-glove.r { left: 60%; top: 46%; animation: mg-flick .55s ease-in-out infinite alternate; }
.t-fountain .mg-glove.l { left: 34%; top: 50%; }
@keyframes mg-flick { to { transform: rotate(-20deg) translateY(-1.5vh); } }
.t-fountain .mg-card { opacity: 1; animation: mg-fountain 2.3s cubic-bezier(.2, .7, .4, 1) calc(var(--i) * .13s) infinite; }
@keyframes mg-fountain {
    0% { transform: translate(10vw, 0) rotate(0) scale(.8); opacity: 1; }
    45% { transform: translate(calc((var(--i) - 5.5) * 2.2vw), -30vh) rotate(calc(var(--i) * 70deg)) scale(1); opacity: 1; }
    100% { transform: translate(calc((var(--i) - 5.5) * 4.4vw), 42vh) rotate(calc(var(--i) * 150deg)) scale(1); opacity: 0; }
}
/* the card storm: cards flung at the camera, spinning and growing until they fly past */
.t-throw .mg-glove.l { left: 43%; top: 44%; } .t-throw .mg-glove.r { left: 57%; top: 44%; animation: mg-flick .4s ease-in-out infinite alternate; }
.t-throw .mg-card { opacity: 1; animation: mg-throw 1.7s cubic-bezier(.5, 0, .9, .6) calc(var(--i) * .14s) infinite; }
@keyframes mg-throw {
    0% { transform: translate(0, 6vh) scale(.5) rotate(0); opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translate(calc((var(--i) - 5.5) * 7vw), calc(var(--s) * 24vh)) scale(5) rotate(calc(var(--s) * 540deg)); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .pk-overlay.pk-idle { display: none; } }

/* a squared-up deck in the right hand while it springs or fountains cards */
.mg-deck { left: 64%; top: 50%; width: 9vh; height: 13vh; margin: -8vh 0 0 -1vh; border-radius: 1vh; z-index: 4; opacity: 0; transform: rotate(-14deg); transition: opacity .4s;
    background: repeating-linear-gradient(45deg, var(--violet) 0 1.2vh, color-mix(in srgb, var(--violet) 60%, #000) 1.2vh 2.4vh); box-shadow: inset 0 0 0 .5vh #fff, .3vh .3vh 0 #ddd, .6vh .6vh 0 #bbb, .9vh .9vh 1.2vh rgba(0, 0, 0, .5); }
.t-spring .mg-deck, .t-fountain .mg-deck { opacity: 1; }
.t-fountain .mg-deck { left: 60%; top: 52%; }
/* the arms sway a little while they wait, like real arms */
.pk-idle.close .mg-glove svg { animation: mg-breathe 3.2s ease-in-out infinite alternate; transform-origin: 50% 100%; }
@keyframes mg-breathe { to { transform: rotate(1.5deg) translateY(-.6vh); } }

/* ---------- velvet curtains, the cape swirl, and the top hat trick ---------- */
.mg-curtain { top: -2vh; bottom: -2vh; width: 52%; z-index: 8; background: repeating-linear-gradient(90deg, rgba(0, 0, 0, .3) 0 1.6vh, transparent 1.6vh 5.5vh), linear-gradient(180deg, #a0102a, #5a0816); box-shadow: 0 0 5vh rgba(0, 0, 0, .8); transition: transform 1.2s cubic-bezier(.6, 0, .3, 1); }
.mg-curtain.l { left: 0; transform-origin: 0 0; } .mg-curtain.r { right: 0; transform-origin: 100% 0; }
.mg-curtain::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2.4vh; background: repeating-linear-gradient(90deg, #e8c24a 0 .7vh, transparent .7vh 1.6vh); }
.pk-magic .mg-curtain.l { transform: translateX(0); } .pk-magic .mg-curtain.r { transform: translateX(0); }
.mg-open .mg-curtain.l { transform: translateX(-92%) scaleX(.35); } .mg-open .mg-curtain.r { transform: translateX(92%) scaleX(.35); }
.mg-cape { position: absolute; left: 110%; top: -20vh; width: 140vh; height: 140vh; z-index: 9; border-radius: 50% 10% 50% 50%; background: radial-gradient(ellipse at 30% 30%, #2a2334, #06040a 70%); box-shadow: 0 0 8vh rgba(0, 0, 0, .9); opacity: 0; }
.mg-cape .lining { position: absolute; inset: 8% 8% 30% 30%; border-radius: 50%; background: radial-gradient(ellipse at 40% 40%, #e3262f, #7a0818 70%); filter: blur(.4vh); }
.mg-swirl .mg-cape { animation: mg-cape 1.4s cubic-bezier(.6, 0, .3, 1) both; }
@keyframes mg-cape { 0% { opacity: 1; left: 110%; transform: rotate(40deg) scale(.7); } 45% { left: -20%; transform: rotate(-20deg) scale(1.1); } 100% { opacity: 1; left: -160%; transform: rotate(-60deg) scale(.8); } }
.mg-hat { position: absolute; left: 44%; top: 58%; width: 20vh; height: 20vh; margin-left: -10vh; z-index: 3; opacity: 0; transform-origin: 50% 100%; }
.mg-hat .crown { left: 18%; right: 18%; top: 0; bottom: 18%; border-radius: 1vh 1vh .4vh .4vh; background: linear-gradient(90deg, #0a0810, #2a2334 40%, #0a0810); }
.mg-hat .band { left: 18%; right: 18%; bottom: 22%; height: 3vh; background: #7a0818; }
.mg-hat .brim { left: 0; right: 0; bottom: 12%; height: 5vh; border-radius: 50%; background: radial-gradient(ellipse at 50% 30%, #2a2334, #06040a 70%); }
.t-hat .mg-hat { opacity: 1; animation: mg-hatshake 8s ease-in-out both; }
@keyframes mg-hatshake { 0%, 34% { transform: none; } 36% { transform: rotate(-6deg) scaleY(.94); } 38% { transform: rotate(5deg); } 40% { transform: rotate(-4deg) scaleY(1.06); } 42%, 100% { transform: none; } }
.mg-wand { left: 60%; top: 40%; width: 1.4vh; height: 26vh; z-index: 4; opacity: 0; border-radius: 1vh; background: linear-gradient(180deg, #fff 0 14%, #0a0810 14% 86%, #fff 86%); box-shadow: 0 0 1.4vh rgba(255, 255, 255, .4); transform-origin: 50% 90%; }
.t-hat .mg-wand { opacity: 1; animation: mg-tap 8s ease-in-out both; }
@keyframes mg-tap { 0%, 14% { transform: rotate(40deg); } 18%, 26%, 34% { transform: rotate(-30deg); } 22%, 30% { transform: rotate(-10deg); } 40%, 100% { transform: rotate(40deg); } }
.t-hat .mg-glove.l { left: 30%; top: 52%; } .t-hat .mg-glove.r { left: 66%; top: 44%; animation: mg-taparm 8s ease-in-out both; }
@keyframes mg-taparm { 0%, 14% { transform: rotate(-12deg); } 18%, 26%, 34% { transform: rotate(-24deg) translateY(1vh); } 22%, 30% { transform: rotate(-16deg); } 40%, 100% { transform: rotate(-12deg); } }
.mg-pop { left: 44%; top: 62%; z-index: 3; font-size: 6vh; opacity: 0; font-style: normal; }
.t-hat .mg-pop { animation: mg-pop 2.6s cubic-bezier(.2, .8, .4, 1) calc(3.4s + var(--d)) both; }
@keyframes mg-pop { 0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(.4); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(-44vh) rotate(260deg) scale(1.3); } }
@media (prefers-reduced-motion: reduce) { .mg-cape, .mg-curtain { display: none; } }

/* the cape shows even while the stage is still pulled back */
.pk-idle.mg-swirl .pk-magic { opacity: 1; transform: none; transition-delay: 0s; }
.pk-idle.mg-swirl:not(.close) .pk-magic > :not(.mg-cape) { visibility: hidden; }
.mg-pop.mc { width: 5vh; height: 7vh; border-radius: .6vh; background: repeating-linear-gradient(45deg, var(--violet) 0 .8vh, color-mix(in srgb, var(--violet) 60%, #000) .8vh 1.6vh); box-shadow: inset 0 0 0 .35vh #fff; }

/* ---------- the Top Hat v2: a big upturned hat rises, the wand waves, and out comes a rabbit, bats, and cards ---------- */
.t-hat .mg-hat { left: 50%; top: auto; bottom: -46vh; width: 40vh; height: 34vh; margin-left: -20vh; opacity: 1; animation: mg-hatrise 8s cubic-bezier(.3, 1.2, .4, 1) both; }
@keyframes mg-hatrise { 0% { transform: translateY(0); } 14%, 40% { transform: translateY(-50vh); } 42% { transform: translateY(-50vh) rotate(-4deg); } 44% { transform: translateY(-51vh) rotate(3deg); } 46%, 100% { transform: translateY(-50vh); } }
.t-hat .mg-hat .brim { left: -4vh; right: -4vh; top: 0; bottom: auto; height: 8vh; border-radius: 50%; background: radial-gradient(ellipse at 50% 40%, #3a3344, #0a0810 70%); box-shadow: 0 1vh 2vh rgba(0, 0, 0, .6); z-index: 1; }
.t-hat .mg-hat .open { left: 10%; right: 10%; top: 1.4vh; height: 5.2vh; border-radius: 50%; background: radial-gradient(ellipse at 50% 60%, #000, #120e18 80%); z-index: 2; }
.t-hat .mg-hat .crown { left: 10%; right: 10%; top: 4vh; bottom: 0; border-radius: 0 0 1.4vh 1.4vh; background: linear-gradient(90deg, #0a0810, #2e2638 45%, #0a0810); z-index: 0; }
.t-hat .mg-hat .band { left: 10%; right: 10%; top: 6vh; bottom: auto; height: 4vh; background: linear-gradient(180deg, #a0102a, #5a0816); z-index: 0; }
.mg-hat .rabbit { position: absolute; left: 50%; top: 1vh; width: 20vh; margin-left: -10vh; text-align: center; font-size: 16vh; line-height: 1; opacity: 0; z-index: 1; transform: translateY(6vh) scale(.4); font-style: normal; }
.t-hat .mg-hat .rabbit { animation: mg-rabbit 8s cubic-bezier(.3, 1.6, .5, 1) both; }

.t-hat .mg-glove.l { left: 26%; top: 46%; } .t-hat .mg-glove.r { left: 70%; top: 30%; animation: mg-wavearm 8s ease-in-out both; }
@keyframes mg-wavearm { 0%, 14% { transform: rotate(-12deg); } 18%, 26%, 34% { transform: rotate(-26deg) translateX(-2vh); } 22%, 30%, 38% { transform: rotate(-8deg); } 44%, 100% { transform: rotate(-12deg); } }
.t-hat .mg-wand { left: 59%; top: 30%; height: 30vh; width: 1.6vh; opacity: 1; transform-origin: 50% 100%; animation: mg-wave 8s ease-in-out both; }
@keyframes mg-wave { 0%, 14% { transform: rotate(-35deg); } 18%, 26%, 34% { transform: rotate(-65deg); } 22%, 30%, 38% { transform: rotate(-20deg); } 44%, 100% { transform: rotate(-35deg); } }
.mg-wand .tip { position: absolute; left: 50%; top: -1.4vh; width: 3vh; height: 3vh; margin-left: -1.5vh; border-radius: 50%; background: radial-gradient(circle, #fff, rgba(255, 243, 176, .6) 50%, transparent 70%); opacity: 0; }
.t-hat .mg-wand .tip { animation: mg-tipglow 8s ease-in-out both; }
@keyframes mg-tipglow { 0%, 14% { opacity: 0; } 18%, 40% { opacity: 1; } 46%, 100% { opacity: 0; } }
.mg-spark { left: 49%; top: 52%; width: 2.4vh; height: 2.4vh; z-index: 4; opacity: 0; background: #fff6c8; clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%); filter: drop-shadow(0 0 1vh #ffd84a); }
.t-hat .mg-spark { animation: mg-sparkfall 1.4s ease-out calc(1.5s + var(--d)) 2 both; }
@keyframes mg-sparkfall { 0% { opacity: 1; transform: translate(0, -6vh) scale(.5) rotate(0); } 100% { opacity: 0; transform: translate(var(--x), 8vh) scale(1.3) rotate(180deg); } }
.t-hat .mg-pop { left: 50%; top: 46%; }
.t-hat .mg-pop { animation-delay: calc(3.9s + var(--d)); }
/* ---------- the top hat: a big wand held in the right hand's fingers, and a left hand that gestures ---------- */
.mg-held { display: none; left: 30%; top: -26%; width: 2.6vh; height: 50vh; border-radius: 1.3vh; z-index: 1;
    background: linear-gradient(180deg, #fff 0 12%, #0a0810 12% 88%, #fff 88%); box-shadow: 0 0 1.6vh rgba(255, 255, 255, .35); transform-origin: 50% 88%; transform: rotate(-24deg); }
.mg-held b { position: absolute; left: 50%; top: -2.4vh; width: 5vh; height: 5vh; margin-left: -2.5vh; border-radius: 50%; background: radial-gradient(circle, #fff, rgba(255, 243, 176, .6) 45%, transparent 70%); opacity: 0; }
.t-hat .mg-glove.r .mg-held { display: block; animation: mg-heldwave 8s ease-in-out both; }
.t-hat .mg-glove.r .mg-held b { animation: mg-tipglow 8s ease-in-out both; }
@keyframes mg-heldwave { 0%, 14% { transform: rotate(-24deg); } 18%, 26%, 34% { transform: rotate(-52deg); } 22%, 30%, 38% { transform: rotate(-8deg); } 46%, 100% { transform: rotate(-24deg); } }
.t-hat .mg-wand { display: none; }
.t-hat .mg-glove.l { animation: mg-lefthat 8s ease-in-out both; }
@keyframes mg-lefthat {
    0%, 8% { transform: rotate(14deg) scaleX(-1); }
    16% { transform: rotate(34deg) translate(-3vh, -8vh) scaleX(-1); }
    24% { transform: rotate(-4deg) translate(2vh, -3vh) scaleX(-1); }
    32% { transform: rotate(30deg) translate(-3vh, -9vh) scaleX(-1); }
    40% { transform: rotate(0deg) translate(2vh, -4vh) scaleX(-1); }
    48% { transform: rotate(-22deg) translate(4vh, -14vh) scaleX(-1); }
    56% { transform: rotate(-30deg) translate(5vh, -16vh) scaleX(-1); }
    64% { transform: rotate(-18deg) translate(3vh, -13vh) scaleX(-1); }
    76%, 88% { transform: rotate(-34deg) translate(6vh, -17vh) scaleX(-1); }
    100% { transform: rotate(14deg) scaleX(-1); }
}
/* the wand sits behind the glove, so the fingers wrap over it and it pivots from the palm */
.mg-held { z-index: -1; left: 44%; top: -22%; }
/* the rabbit: pops out big, looks around, and hops away; then the cards spit out of the hat */
.mg-hat .rabbit { width: 26vh; margin-left: -13vh; font-size: 22vh; top: 0; }
@keyframes mg-rabbit {
    0%, 42% { opacity: 0; transform: translate(0, 8vh) scale(.3); }
    44% { opacity: 1; }
    48% { transform: translate(0, -24vh) scale(1.08); }
    51% { transform: translate(0, -20vh) scale(1) rotate(0); }
    54% { transform: translate(0, -20vh) scale(1) rotate(-8deg); }
    57% { transform: translate(0, -20vh) scale(-1, 1) rotate(0); }
    60% { transform: translate(0, -20vh) scale(-1, 1) rotate(8deg); }
    63% { opacity: 1; transform: translate(0, -20vh) scale(1) rotate(-6deg); }
    67% { transform: translate(22vh, -38vh) scale(1) rotate(10deg); }
    71% { transform: translate(44vh, -16vh) scale(1) rotate(0); }
    75% { opacity: 1; transform: translate(66vh, -34vh) scale(.95) rotate(10deg); }
    79%, 100% { opacity: 0; transform: translate(90vh, -10vh) scale(.9); }
}
.t-hat .mg-pop { animation-delay: calc(6.1s + var(--d) * .5) !important; }

/* ---------- the Austrian curtain: one velvet curtain that lifts into scalloped swags ---------- */
.mg-curtain.r { display: none; }
.pk-magic .mg-curtain.l { left: 0; width: 100%; transform-origin: 50% 0; transform: none;
    background: radial-gradient(ellipse 9vh 6vh at 50% 100%, rgba(0, 0, 0, .35), transparent 70%) 0 0 / 18vh 14vh,
        repeating-linear-gradient(90deg, rgba(0, 0, 0, .28) 0 .5vh, transparent .5vh 2.2vh, rgba(255, 255, 255, .06) 2.2vh 2.6vh, transparent 2.6vh 4vh),
        linear-gradient(180deg, #b0142e, #5a0816);
    -webkit-mask: radial-gradient(9vh 6vh at 50% 0, #000 98%, transparent) 0 100% / 18vh 6vh repeat-x, linear-gradient(#000, #000) 0 0 / 100% calc(100% - 6vh) no-repeat;
    mask: radial-gradient(9vh 6vh at 50% 0, #000 98%, transparent) 0 100% / 18vh 6vh repeat-x, linear-gradient(#000, #000) 0 0 / 100% calc(100% - 6vh) no-repeat;
    transition: transform 1.8s cubic-bezier(.45, 0, .35, 1); }
.mg-open .mg-curtain.l { transform: scaleY(.17); transition-duration: 2.2s; }
/* ---------- the top hat: hands flank the hat, above it, so the wand reaches over the hat from the grip ---------- */
.t-hat .mg-glove { z-index: 4; }
.t-hat .mg-glove.l { left: 25%; } .t-hat .mg-glove.r { left: 75%; }
.mg-hat .rabbit { font-size: 0; width: 24vh; height: 29vh; margin-left: -12vh; top: -12vh; }
.mg-hat .rabbit svg { width: 100%; height: 100%; filter: drop-shadow(0 1vh 1.4vh rgba(0, 0, 0, .45)); }
/* the curtain hangs from just under the header (the stage now runs edge to edge) */
.pk-magic .mg-curtain.l { top: 0; }

/* readability pass (Oct 28): the small projector text one size up so it reads from the back of the room */
.pk-plate { font-size: 2.1vh; }
.pk-join { font-size: 2.4vh; }
