/* Spin & Solve: TV studio look. Emerald and teal board, glowing white tiles that light blue and flip,
   a huge glossy wheel rising from the bottom edge. */
.sp { position: relative; flex: 1; margin: -1.5vh -3vw -2.5vh; padding: 1.5vh 3vw 2.5vh; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 1vh; overflow: hidden; --peek: 36vh; }
.sp.wheel-up { --peek: 50vh; }
.sp-studio { position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background: radial-gradient(ellipse at 50% 38%, rgba(40, 210, 180, .28), transparent 55%), radial-gradient(ellipse at 15% 90%, rgba(20, 140, 200, .3), transparent 50%), radial-gradient(ellipse at 85% 90%, rgba(40, 200, 120, .26), transparent 50%); }
.sp-twinkle { position: absolute; inset: 0; background-image: radial-gradient(circle, #fff 0 .12vh, transparent .3vh), radial-gradient(circle, #bff5ff 0 .1vh, transparent .26vh); background-size: 9vh 11vh, 13vh 7vh; background-position: 0 0, 4vh 5vh; opacity: .5; animation: sp-twinkle 3.2s ease-in-out infinite alternate; }
.sp-twinkle.b { background-size: 11vh 13vh, 7vh 9vh; background-position: 3vh 2vh, 1vh 6vh; animation-delay: -1.6s; }
@keyframes sp-twinkle { to { opacity: .1; } }
.sp-head { position: relative; z-index: 2; display: flex; align-items: center; justify-content: flex-start; gap: 2vw; }
.sp-mode { padding: 1.1vh 2.2vw; border-radius: 99px; font-weight: 900; font-size: 3vh; box-shadow: 0 0 0 .3vh #fff, 0 0 3vh rgba(127, 243, 220, .9); animation: sp-modepulse 1.8s ease-in-out infinite alternate; letter-spacing: .08em; text-transform: uppercase; color: #06342c; background: linear-gradient(180deg, #7ff3dc, #1ec9b0); box-shadow: 0 0 2vh rgba(30, 201, 176, .6); }
.sp-main { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; min-height: 0; padding-right: calc(var(--peek) + 4vh); transition: padding-right 1.1s cubic-bezier(.6, 0, .3, 1); }
.sp-boardwrap { display: grid; justify-items: center; align-content: center; gap: 1.3vh; transform-origin: 50% 0; transition: transform 1s cubic-bezier(.6, 0, .3, 1); }
.sp.wheel-up .sp-boardwrap { transform: scale(.86); }

/* ---------- the board ---------- */
.sp-frame { position: relative; overflow: hidden; padding: 2vh 2.4vh; border-radius: 2.4vh; background: linear-gradient(180deg, #0f6b6f, #05363f); box-shadow: 0 0 0 .7vh #1ec9b0, 0 0 0 1.2vh #0a4d4a, 0 0 6vh rgba(30, 201, 176, .55), inset 0 0 4vh rgba(0, 0, 0, .5); }
.sp-frame::before { content: ""; position: absolute; inset: -1.9vh; border-radius: 3.2vh; pointer-events: none;
    background: radial-gradient(circle, #fff9d8 0 .45vh, rgba(255, 230, 140, .6) .7vh, transparent .9vh) 0 0 / 3.2vh 3.2vh;
    -webkit-mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); padding: 1.1vh;
    animation: bulb-twinkle 1.1s ease-in-out infinite alternate; }
@keyframes bulb-twinkle { from { filter: brightness(.8) drop-shadow(0 0 .4vh rgba(255, 216, 74, .5)); } to { filter: brightness(1.35) drop-shadow(0 0 1.2vh rgba(255, 216, 74, .95)); } }
.sp-board { display: grid; gap: .7vh; }
.sp-row { display: flex; justify-content: center; gap: .55vh; }
.sp-tile { position: relative; width: 6.8vh; height: 8.6vh; border-radius: .6vh; display: grid; place-items: center; perspective: 40vh; }
.sp-tile.blank { background: linear-gradient(160deg, #1d9a78, #0c5a47 60%, #083f33); box-shadow: inset 0 .3vh 0 rgba(255, 255, 255, .18), inset 0 -.4vh .8vh rgba(0, 0, 0, .4); }
.sp-tile.hid, .sp-tile.punct, .sp-tile.on { background: linear-gradient(180deg, #ffffff, #e8f3f7); box-shadow: 0 0 1.4vh rgba(200, 245, 255, .55), inset 0 -.5vh .8vh rgba(120, 160, 180, .35); }
.sp-tile b { font-family: var(--display); font-weight: 900; font-size: 6.4vh; line-height: 1; color: #0c1016; opacity: 0; }
.sp-tile.punct b, .sp-tile.on b { opacity: 1; }
.sp-tile.lit { background: linear-gradient(180deg, #8fd6ff, #2d8cff); box-shadow: 0 0 3vh #3aa0ff, 0 0 1vh #fff inset; animation: sp-lit .7s ease both; }
@keyframes sp-lit { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }
.sp-tile.on { animation: sp-flip .45s cubic-bezier(.3, 1.4, .5, 1) both; }
.sp-cat { padding: 1vh 4vw; border-radius: 99px; font-family: var(--display); font-weight: 900; font-size: 3.8vh; letter-spacing: .06em; text-transform: uppercase; color: #fff;
    background: linear-gradient(180deg, #3d8cff, #1b4fb0); box-shadow: 0 0 0 .4vh #9fd4ff, 0 0 3vh rgba(61, 140, 255, .6); }
.sp-used { display: flex; gap: .35vw; }
.sp-used i { font-style: normal; font-weight: 900; font-size: 3vh; width: 4.2vh; height: 4.6vh; display: grid; place-items: center; border-radius: .7vh; color: #fff; background: linear-gradient(180deg, #0f5f5c, #07302f); box-shadow: inset 0 0 0 .18vh rgba(127, 243, 220, .7), 0 0 1.2vh rgba(127, 243, 220, .35); text-shadow: 0 0 1vh rgba(255, 255, 255, .6); }
.sp-used i.v { color: #ffe58a; text-shadow: 0 0 1vh rgba(255, 216, 74, .7); }
.sp-used i.x { opacity: .22; text-decoration: line-through; box-shadow: none; }
.sp-note { position: relative; z-index: 4; min-height: 4.6vh; font-family: var(--display); font-weight: 900; font-size: 3.8vh; color: #fff3b0; text-align: center; transition: bottom 1.1s cubic-bezier(.6, 0, .3, 1), left 1.1s, width 1.1s; text-shadow: 0 0 2vh rgba(255, 216, 74, .6), 0 .4vh 0 rgba(0, 0, 0, .5); }
.sp-note.pop { animation: sp-notein .5s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes sp-notein { from { opacity: 0; filter: blur(.6vh); } }

/* ---------- players ---------- */
.sp-side { display: grid; justify-items: center; gap: .6vh; width: 100%; }
.sp-side-h { margin: 0; font-family: var(--display); font-size: 2.2vh; color: #7ff3dc; text-transform: uppercase; letter-spacing: .08em; }
.sp-players { display: flex; flex-wrap: wrap; justify-content: center; gap: .8vh; }
.sp-seat { min-width: 20vh; display: grid; grid-template-columns: 4vh 1fr auto; grid-template-rows: auto auto; column-gap: 1vh; align-items: center; padding: 1vh 1.2vh; border-radius: 1.2vh; background: linear-gradient(180deg, rgba(15, 107, 111, .75), rgba(5, 54, 63, .85)); box-shadow: inset 0 0 0 .2vh rgba(127, 243, 220, .35); transition: transform .4s, box-shadow .4s; }
.sp-seat em { grid-row: span 2; font-style: normal; font-family: var(--display); font-weight: 900; font-size: 3vh; color: #7ff3dc; text-align: center; }
.sp-seat b { font-weight: 900; font-size: 2.4vh; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-seat span { font-family: var(--display); font-weight: 900; font-size: 2.6vh; color: #fff3b0; }
.sp-seat small { grid-column: 2 / 4; font-weight: 800; font-size: 1.8vh; color: #bfe9e1; }
.sp-seat.turn { transform: scale(1.05); box-shadow: 0 0 0 .35vh #ffd84a, 0 0 3vh rgba(255, 216, 74, .6); animation: sp-turn 1.2s ease-in-out infinite alternate; }
@keyframes sp-turn { to { box-shadow: 0 0 0 .35vh #fff3b0, 0 0 5vh rgba(255, 216, 74, .8); } }
.sp-seat.locked { opacity: .5; filter: grayscale(.7); }
.sp-watch { font-weight: 800; font-size: 2vh; color: #bfe9e1; }

/* ---------- the wheel ---------- */
.sp-wheelwrap { position: absolute; z-index: 3; top: 54%; right: calc(var(--peek) - 110vh); width: 110vh; height: 110vh; margin-top: -55vh; transition: right 1.1s cubic-bezier(.6, 0, .3, 1); pointer-events: none; }
.sp-wheel { width: 100%; height: 100%; border-radius: 50%; filter: drop-shadow(0 -2vh 4vh rgba(0, 0, 0, .55)) drop-shadow(0 0 3vh rgba(255, 216, 74, .25)); will-change: transform; }
.sp-pointer { position: absolute; left: -3.4vh; top: 50%; width: 0; height: 0; z-index: 2; transform: rotate(-90deg); }
.sp-pointer i { position: absolute; left: -2.6vh; top: 0; width: 5.2vh; height: 8vh; clip-path: polygon(0 0, 100% 0, 50% 100%); background: linear-gradient(180deg, #fff8d8, #e8c24a 45%, #8a5a14); filter: drop-shadow(0 .6vh .8vh rgba(0, 0, 0, .6)); transform-origin: 50% 12%; }
.sp-pointer.kick i { animation: sp-kick .12s ease-out; }
@keyframes sp-kick { 40% { transform: rotate(-14deg); } }
.sp-landed { position: absolute; left: 1vh; top: calc(50% - 15vh); transform: scale(.4); transform-origin: 0 100%; opacity: 0; transition: opacity .3s, transform .5s cubic-bezier(.2, 1.6, .4, 1); white-space: nowrap; }
.sp-landed.on { opacity: 1; transform: scale(1); }
.sp-landed b { display: block; padding: .8vh 3vw; border-radius: 1.4vh; font-family: var(--display); font-weight: 900; font-size: 5.6vh; letter-spacing: .04em; color: #fff;
    background: linear-gradient(180deg, color-mix(in srgb, var(--c) 70%, #fff), var(--c)); box-shadow: 0 0 0 .5vh #ffe58a, 0 0 5vh color-mix(in srgb, var(--c) 80%, transparent), 0 1.2vh 0 rgba(0, 0, 0, .35); text-shadow: 0 .4vh 0 rgba(0, 0, 0, .45); }

@media (prefers-reduced-motion: reduce) { .sp-twinkle, .sp-frame::before, .sp-seat.turn { animation: none; } }

/* ================= phone ================= */
.spp { display: grid; grid-template-columns: minmax(0, 1fr); gap: .8rem; min-width: 0; }
.spp-board { display: grid; gap: 3px; padding: 7px; overflow: hidden; border-radius: 12px; background: linear-gradient(180deg, #0f6b6f, #05363f); box-shadow: 0 0 0 3px #1ec9b0; }
.spp-row { display: flex; justify-content: center; gap: 2px; }
.spp-row i { width: min(5.2vw, 22px); aspect-ratio: .78; border-radius: 3px; display: grid; place-items: center; font-style: normal; font-weight: 900; font-size: min(4.6vw, 17px); color: #0c1016; }
.spp-row i.b { background: #0c5a47; } .spp-row i.h { background: #f4fbfd; } .spp-row i.s { background: #fff; }
.spp-cat { justify-self: center; padding: .25rem 1rem; border-radius: 99px; font-weight: 900; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: #fff; background: linear-gradient(180deg, #3d8cff, #1b4fb0); }
.spp-solve { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; }
.spp-solve .input { min-width: 0; }
.spp-input { text-transform: uppercase; font-weight: 800; letter-spacing: .04em; }
.spp-msg { padding: .7rem .9rem; border-radius: 10px; text-align: center; font-weight: 800; background: rgba(15, 107, 111, .45); }
.spp-msg.good { background: rgba(46, 158, 107, .45); } .spp-msg.bad { background: rgba(200, 16, 46, .35); }
.spp-seat { font-weight: 800; font-size: .85rem; color: #7ff3dc; text-align: center; }
.spp-actions { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .6rem; align-items: center; }
.spp-spin { justify-self: center; margin: .8rem 0 .4rem; width: 11rem; height: 11rem; border-radius: 50%; border: 0; display: grid; place-content: center; justify-items: center; gap: .1rem; color: #1a1206; cursor: pointer; touch-action: none;
    background: radial-gradient(circle at 35% 30%, #fff8d8, #ffd84a 45%, #b8801a); box-shadow: 0 0 0 6px transparent, 0 0 0 10px #e3262f, 0 0 0 14px #1f6fd6, 0 0 0 18px #1fa35a, 0 0 30px rgba(255, 216, 74, .7); animation: spp-pulse 1.2s ease-in-out infinite alternate; }
.spp-spin span { font-size: 2.6rem; line-height: 1; } .spp-spin b { font-family: var(--display); font-weight: 900; font-size: 1.8rem; } .spp-spin small { font-weight: 800; font-size: .75rem; }
.spp-spin.sm { width: 6.5rem; height: 6.5rem; box-shadow: 0 0 0 4px #e3262f, 0 0 0 8px #1f6fd6, 0 0 20px rgba(255, 216, 74, .6); } .spp-spin.sm span { font-size: 1.6rem; } .spp-spin.sm b { font-size: 1.1rem; }
@keyframes spp-pulse { to { transform: scale(1.05); filter: brightness(1.1); } }
.spp-keys { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .35rem; }
.spp-key { padding: .7rem 0; border: 0; border-radius: 8px; font-weight: 900; font-size: 1.1rem; color: #0c1016; background: linear-gradient(180deg, #fff, #dcecf2); box-shadow: 0 3px 0 #7aa3b3; }
.spp-key:disabled { opacity: .25; box-shadow: none; }
.spp-idle { display: grid; justify-items: center; gap: .3rem; padding: 1.4rem 0; text-align: center; font-size: 2.6rem; }
.spp-idle b { font-family: var(--display); font-size: 1.4rem; } .spp-idle span { font-size: .95rem; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .spp-spin { animation: none; } }

/* ---------- life and sparkle ---------- */
@keyframes sp-modepulse { to { box-shadow: 0 0 0 .3vh #fff, 0 0 5vh rgba(127, 243, 220, 1); } }
/* board: a sheen sweeps across and glints twinkle over the tiles */
.sp-sheen { position: absolute; inset: 0; pointer-events: none; z-index: 2; background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .22) 48%, rgba(255, 255, 255, .05) 53%, transparent 60%); background-size: 260% 100%; animation: sp-sheen 6s ease-in-out infinite; }
@keyframes sp-sheen { 0% { background-position: 170% 0; } 55%, 100% { background-position: -70% 0; } }
.sp-glints { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.sp-glints b { position: absolute; width: var(--s); height: var(--s); margin: calc(var(--s) / -2); background: #fff; clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%); filter: drop-shadow(0 0 .8vh #bff5ff); opacity: 0; animation: sp-glint 4s ease-in-out var(--d) infinite; }
@keyframes sp-glint { 0%, 70%, 100% { opacity: 0; transform: scale(.2) rotate(0); } 80% { opacity: 1; transform: scale(1) rotate(45deg); } 90% { opacity: .4; transform: scale(.6) rotate(90deg); } }
/* wheel: a light sweep glides over the wedges and a ring of rim bulbs chases around */
.sp-sweep { position: absolute; inset: 0; border-radius: 50%; pointer-events: none; mix-blend-mode: screen; background: conic-gradient(from 0deg, transparent 0deg, rgba(255, 255, 255, .28) 12deg, transparent 26deg, transparent 360deg); -webkit-mask: radial-gradient(circle, transparent 16%, #000 17%, #000 93%, transparent 94%); mask: radial-gradient(circle, transparent 16%, #000 17%, #000 93%, transparent 94%); animation: sp-sweep 5s linear infinite; }
@keyframes sp-sweep { to { transform: rotate(-360deg); } }
.sp-bulbs { position: absolute; inset: 0; border-radius: 50%; pointer-events: none; background: repeating-conic-gradient(from 0deg, #fff9d8 0deg 2.2deg, transparent 2.2deg 7.5deg); -webkit-mask: radial-gradient(circle, transparent 95.2%, #000 95.8%, #000 98.6%, transparent 99.2%); mask: radial-gradient(circle, transparent 95.2%, #000 95.8%, #000 98.6%, transparent 99.2%); filter: drop-shadow(0 0 .8vh #ffe58a); animation: sp-wheelbulbs 1.4s steps(4) infinite; }
@keyframes sp-wheelbulbs { to { transform: rotate(7.5deg); } }
.sp-pointer i { animation: sp-ptr 1.6s ease-in-out infinite alternate; }
@keyframes sp-ptr { to { filter: drop-shadow(0 .6vh .8vh rgba(0, 0, 0, .6)) drop-shadow(0 0 2vh #ffe58a); } }
@media (prefers-reduced-motion: reduce) { .sp-sheen, .sp-glints b, .sp-sweep, .sp-bulbs, .sp-pointer i, .sp-mode { animation: none; } }

/* fit everything in the height so the board can sit centered */
.sp-head .wg-title span { font-size: 5vh; } .sp-head .wg-title b { font-size: 4.8vh; }
.sp-side-h { display: none; }
.sp-seat { min-width: 17vh; padding: .6vh 1vh; }
.sp-seat b { font-size: 2vh; } .sp-seat em { font-size: 2.4vh; } .sp-seat span { font-size: 2.2vh; } .sp-seat small { font-size: 1.6vh; }
.sp-cat { padding: .8vh 4vw; font-size: 3.4vh; }

/* ---------- v3 layout: category marquee, status beside it, bigger board, bolder bulbs ---------- */
.sp { --tw: min(8.4vh, 4.3vw); }
@media (min-aspect-ratio: 19/10) { .sp { --peek: 48vh; } .sp.wheel-up { --peek: 58vh; } }
.sp-head { gap: 2.4vw; align-items: center; }
.sp-marq { min-width: 34vh; max-width: 52vw; justify-content: center; }
.sp-marq .sp-marq-t { font-size: 5vh; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; }
.sp-marq.flip { animation: sp-marqflip .6s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes sp-marqflip { 0% { transform: scaleY(.1); filter: brightness(2); } 100% { transform: none; filter: none; } }
.sp-headtext { min-width: 0; display: grid; gap: .3vh; }
.sp-headtext .sp-mode { justify-self: start; padding: 0; background: none; box-shadow: none; animation: none; color: #7ff3dc; font-size: 2.4vh; letter-spacing: .14em; text-shadow: 0 0 1.4vh rgba(127, 243, 220, .8); }
.sp-headtext .sp-note { position: static; width: auto; min-height: 0; transform: none; text-align: left; font-size: 3.4vh; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* tiles sized from both width and height so the board fills the space */
.sp-tile { width: var(--tw); height: calc(var(--tw) * 1.27); }
.sp-tile b { font-size: calc(var(--tw) * .92); }
/* a 2D flip: a 3D rotate can drop the letter on some graphics cards */
@keyframes sp-flip { from { transform: scaleX(0); } to { transform: none; } }
/* the frame no longer clips, so the bulb ring shows in full; the sheen and glints clip inside their own layer */
.sp-frame { overflow: visible; margin: 2.6vh; }
.sp-fx { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; z-index: 2; }
.sp-frame::before { inset: -2.9vh; border-radius: 4vh; padding: 1.7vh;
    background: radial-gradient(circle, #fffbe6 0 .55vh, #ffd84a .8vh, rgba(255, 180, 60, .45) 1.15vh, transparent 1.35vh) 0 0 / 3.4vh 3.4vh;
    animation: bulb-twinkle 1.1s ease-in-out infinite alternate; }
.sp-frame::after { content: ""; position: absolute; inset: -1vh; border-radius: 3vh; pointer-events: none; box-shadow: 0 0 0 .5vh #e8c24a, 0 0 0 .9vh #7a4a10, 0 0 4vh rgba(255, 216, 74, .45); }
.sp-rimsparks { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.sp-rimsparks b { position: absolute; width: 2.6vh; height: 2.6vh; margin: -1.3vh; background: #fff; 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 #ffe58a); opacity: 0; animation: sp-glint 3s ease-in-out var(--d) infinite; }
.sp-cat { display: none; }
@media (prefers-reduced-motion: reduce) { .sp-frame::before, .sp-rimsparks b, .sp-marq.flip { animation: none; } }

/* ---------- the reveal as pure CSS: white tile, blue light, flip, letter ---------- */
.sp-tile.on { animation: sp-reveal .95s ease both; animation-delay: var(--k, 0ms); }
.sp-tile.on b { animation: sp-letter .95s steps(1) both; animation-delay: var(--k, 0ms); }
@keyframes sp-reveal {
    0% { background: linear-gradient(180deg, #ffffff, #e8f3f7); transform: none; }
    18%, 48% { background: linear-gradient(180deg, #8fd6ff, #2d8cff); box-shadow: 0 0 3vh #3aa0ff; transform: scale(1.06); }
    60% { transform: scaleX(0); }
    100% { transform: none; }
}
@keyframes sp-letter { 0% { opacity: 0; } 60%, 100% { opacity: 1; } }
/* the hint bubble */
.sp-hint { max-width: 92%; padding: .8vh 3vw; border-radius: 99px; font-weight: 800; font-size: 2.4vh; line-height: 1.3; text-align: center; color: #fff;
    background: linear-gradient(180deg, #3d8cff, #1b4fb0); box-shadow: 0 0 0 .35vh #9fd4ff, 0 0 3vh rgba(61, 140, 255, .55);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sp-hint[hidden] { display: none; }
.sp { --tw: min(7.3vh, 4.1vw); }
@media (prefers-reduced-motion: reduce) { .sp-tile.on, .sp-tile.on b { animation: none; } }

/* readability pass (Oct 28): the small projector text one size up so it reads from the back of the room */
.sp-seat small { font-size: 1.9vh; }
.sp-seat b { font-size: 2.2vh; }
