/* ===== Jumplin effects (fx.js) + Sweat Shop + Red Light, Green Light ===== */
.fx-hop-token { position: fixed; left: 0; top: 0; z-index: 99; pointer-events: none; will-change: transform; transform-origin: 50% 100%; }
.fx-hop-token .token { visibility: visible !important; box-shadow: 0 0 0 2px #fff, 0 8px 14px rgb(0 0 0 / .28); }
.fx-float-text { position: fixed; z-index: 140; pointer-events: none; font-family: 'Fredoka', system-ui, sans-serif; font-weight: 800; font-size: 20px;
  color: #0369a1; text-shadow: 0 2px 0 #fff, 0 0 10px rgb(255 255 255 / .9); white-space: nowrap; will-change: transform, opacity; }
.fx-flash { position: fixed; inset: 0; z-index: 111; pointer-events: none; mix-blend-mode: screen; }
.fx-pow { position: fixed; z-index: 113; pointer-events: none; width: 120px; height: 120px; will-change: transform, opacity; filter: drop-shadow(0 6px 0 rgb(0 0 0 / .25)); }
.fx-pow svg { position: absolute; inset: 0; }
.fx-pow span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: 'Fredoka', system-ui, sans-serif;
  font-weight: 900; font-size: 30px; color: #ef4444; letter-spacing: -1px; transform: rotate(-8deg); -webkit-text-stroke: 2px #1f2937; paint-order: stroke fill; }
.fx-turn-banner { position: fixed; left: 50%; top: 14px; z-index: 114; pointer-events: none; display: flex; align-items: center; gap: 10px;
  padding: 8px 18px 8px 8px; border-radius: 999px; color: #fff; will-change: transform, opacity;
  background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 70%, #000)); box-shadow: 0 10px 30px rgb(0 0 0 / .25), inset 0 2px 0 rgb(255 255 255 / .35);
  border: 3px solid #fff; transform: translate(-50%, 0); }
.fx-turn-av { width: 42px; height: 42px; border-radius: 999px; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 26px; overflow: hidden; flex-shrink: 0; }
.fx-turn-av img { width: 88%; height: 88%; object-fit: contain; }
.fx-turn-txt { display: flex; flex-direction: column; line-height: 1; }
.fx-turn-txt b { font-family: 'Fredoka', system-ui, sans-serif; font-weight: 800; font-size: 20px; letter-spacing: .5px; white-space: nowrap; max-width: 60vw; overflow: hidden; text-overflow: ellipsis; }
.fx-turn-txt small { font-size: 10px; font-weight: 900; letter-spacing: 2px; opacity: .9; margin-top: 3px; }
@media (min-width: 1024px) { .fx-turn-banner { top: 18px; padding: 10px 26px 10px 10px; } .fx-turn-txt b { font-size: 26px; } .fx-turn-av { width: 52px; height: 52px; font-size: 32px; } }

/* Dice */
.fx-dice-rolling { animation: fxDiceTumble .32s linear infinite; }
@keyframes fxDiceTumble { 0% { transform: rotate(0) scale(1); } 25% { transform: rotate(14deg) scale(.94) translateY(-4px); } 50% { transform: rotate(-10deg) scale(1.04); } 75% { transform: rotate(8deg) scale(.96) translateY(-2px); } 100% { transform: rotate(0) scale(1); } }
.fx-dice-land { animation: fxDiceLand .5s cubic-bezier(.2,1.6,.4,1); }
@keyframes fxDiceLand { 0% { transform: scale(.82); } 45% { transform: scale(1.14); } 100% { transform: scale(1); } }
/* Lucky Dice pick */
.dice-pick { display: flex; gap: 12px; justify-content: center; margin: 4px 0 8px; }
.dice-pick button { width: 72px; height: 72px; border-radius: 14px; background: #fff; border: 3px solid #334155; box-shadow: 0 6px 0 #cbd5e1; font: 900 34px 'Fredoka', system-ui, sans-serif; color: #713f12; }
.dice-pick button:active { transform: translateY(3px); box-shadow: 0 3px 0 #cbd5e1; }
.dice-pick button:focus-visible { outline: 4px solid #facc15; outline-offset: 2px; }

/* Tiles + counters */
.fx-tile-pop { animation: fxTilePop .9s cubic-bezier(.2,1.4,.4,1); z-index: 3; }
@keyframes fxTilePop { 0% { transform: scale(1); } 25% { transform: scale(1.12) rotate(-2deg); filter: brightness(1.15); } 55% { transform: scale(.98) rotate(1deg); } 100% { transform: scale(1); } }
.fx-count-bump { animation: fxCountBump .45s cubic-bezier(.2,1.8,.4,1); display: inline-block; }
@keyframes fxCountBump { 0% { transform: scale(1); } 40% { transform: scale(1.35); color: #0284c7; } 100% { transform: scale(1); } }

/* Piece cosmetics: hat above, ring around (player colour stays inside) */
.token { position: relative; overflow: visible !important; }
.token .tok-hat { position: absolute; left: 50%; top: -11px; transform: translateX(-50%) rotate(-8deg); font-size: 13px; line-height: 1; pointer-events: none; filter: drop-shadow(0 1px 0 rgb(0 0 0 / .25)); }
.space-card .tokens { overflow: visible; }
.token.ring-gold { box-shadow: 0 0 0 2px #fde047, 0 0 0 3.5px #b45309, 0 3px 6px rgb(0 0 0 / .25) !important; }
@keyframes fxSpin { to { transform: rotate(360deg); } }

/* Victory dances (win modal avatar) */
.win-dancer { display: inline-flex; width: 96px; height: 96px; align-items: center; justify-content: center; font-size: 64px; margin: 0 auto 8px; }
.vd-cheer { animation: dCheer .9s ease-in-out infinite; }
@keyframes dCheer { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-14px) scale(1.06); } }
.vd-bounce { animation: dBounce .55s cubic-bezier(.3,0,.7,1) infinite alternate; transform-origin: 50% 100%; }
@keyframes dBounce { 0% { transform: translateY(0) scale(1.12, .88); } 100% { transform: translateY(-30px) scale(.94, 1.06); } }
.vd-spin { animation: dSpin 1.2s cubic-bezier(.5,0,.5,1) infinite; }
@keyframes dSpin { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(180deg) scale(1.15); } 100% { transform: rotate(360deg) scale(1); } }
.vd-robot { animation: dRobot 1s steps(4) infinite; }
@keyframes dRobot { 0% { transform: rotate(-12deg) translateX(-6px); } 25% { transform: rotate(0) translateY(-8px); } 50% { transform: rotate(12deg) translateX(6px); } 75% { transform: rotate(0) translateY(-8px); } 100% { transform: rotate(-12deg) translateX(-6px); } }
.vd-disco { animation: dDisco .5s ease-in-out infinite alternate; filter: drop-shadow(0 0 12px #f0abfc); }
@keyframes dDisco { 0% { transform: rotate(-14deg) translateY(0); filter: drop-shadow(0 0 12px #f0abfc) hue-rotate(0); } 100% { transform: rotate(14deg) translateY(-10px); filter: drop-shadow(0 0 18px #67e8f9) hue-rotate(90deg); } }
.win-disco-lights { position: fixed; inset: 0; z-index: 109; pointer-events: none; background: conic-gradient(from 0deg at 50% 0%, rgb(244 114 182 / .18), rgb(56 189 248 / .18), rgb(250 204 21 / .18), rgb(244 114 182 / .18)); animation: fxSpin 4s linear infinite; }

/* ===== Red Light, Green Light ===== */
.rl-stage { position: relative; border-radius: 22px; padding: 12px 12px 14px; color: #fff; text-align: center; overflow: hidden; transition: background-color .18s ease; }
.rl-stage.is-green { background: radial-gradient(120% 90% at 50% 0%, #4ade80, #16a34a 60%, #15803d); }
.rl-stage.is-red { background: radial-gradient(120% 90% at 50% 0%, #f87171, #dc2626 60%, #991b1b); }
.rl-stage.is-intro { background: linear-gradient(#1f2937, #111827); }
.rl-top { display: flex; align-items: center; justify-content: center; gap: 14px; }
.rl-lamps { display: inline-flex; flex-direction: column; gap: 6px; padding: 7px; background: #111827; border-radius: 16px; box-shadow: inset 0 0 0 3px #374151, 0 6px 0 rgb(0 0 0 / .25); }
.rl-lamp { width: 30px; height: 30px; border-radius: 999px; background: #374151; transition: background .15s, box-shadow .15s; }
.rl-lamp.red.on { background: #ef4444; box-shadow: 0 0 18px 4px #f87171; }
.rl-lamp.green.on { background: #22c55e; box-shadow: 0 0 18px 4px #4ade80; }
.rl-word { font-family: 'Fredoka', system-ui, sans-serif; font-weight: 900; font-size: clamp(30px, 9vw, 48px); line-height: 1; letter-spacing: .5px; text-shadow: 0 3px 0 rgb(0 0 0 / .25); }
.rl-cmd { font-weight: 900; font-size: 15px; letter-spacing: 2px; margin-top: 4px; opacity: .95; }
.rl-sprite-box { margin: 10px auto 6px; width: 100%; max-width: 260px; height: 190px; background: rgb(255 255 255 / .92); border-radius: 18px; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.rl-sprite { background-repeat: no-repeat; }
.rl-emoji { font-size: 96px; line-height: 190px; }
.rl-timer { font: 900 28px 'Fredoka', system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.rl-bar { height: 8px; border-radius: 99px; background: rgb(255 255 255 / .3); overflow: hidden; margin-top: 6px; }
.rl-bar > i { display: block; height: 100%; background: #fff; border-radius: 99px; width: 0; }
.rl-flip { animation: rlFlip .38s cubic-bezier(.2,1.5,.4,1); }
@keyframes rlFlip { 0% { transform: scale(.9); } 50% { transform: scale(1.04); } 100% { transform: scale(1); } }
.rl-edge { position: fixed; inset: 0; z-index: 101; pointer-events: none; box-shadow: inset 0 0 0 10px var(--rl), inset 0 0 60px 10px var(--rl); opacity: .8; transition: box-shadow .18s; }
body.mp-is-screen .rl-sprite-box { height: 260px; max-width: 340px; }
body.mp-is-screen .rl-word { font-size: 64px; }
.rl-skip-hint { font-size: 12px; font-weight: 800; color: #713f12; }

/* ===== Sweat Shop ===== */
.shop-players { display: flex; gap: 8px; padding: 12px 16px 0; overflow-x: auto; }
.shop-player { display: flex; align-items: center; gap: 6px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 2px solid rgb(133 77 14 / .2); background: #fff; font-weight: 800; font-size: 13px; color: #713f12; white-space: nowrap; min-height: 44px; }
.shop-player[aria-pressed="true"] { border-color: var(--c, #854d0e); background: color-mix(in srgb, var(--c, #854d0e) 12%, #fff); box-shadow: 0 3px 0 color-mix(in srgb, var(--c, #854d0e) 35%, transparent); }
.shop-player .sp-av { width: 32px; height: 32px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 20px; background: #fefce8; overflow: hidden; }
.shop-player .sp-av img { width: 90%; height: 90%; object-fit: contain; }
.shop-player .sp-bank { color: #0369a1; font-variant-numeric: tabular-nums; }
.shop-tabs { display: flex; gap: 6px; padding: 10px 16px 0; overflow-x: auto; scrollbar-width: none; }
.shop-tabs::-webkit-scrollbar { display: none; }
.shop-tab { flex-shrink: 0; min-height: 40px; padding: 6px 12px; border-radius: 12px; border: 2px solid transparent; background: #fef3c7; font-weight: 800; font-size: 13px; color: #713f12; }
.shop-tab[aria-selected="true"] { background: #713f12; color: #fff; }
.shop-item { position: relative; border-radius: 18px; border: 2px solid rgb(133 77 14 / .2); background: #fff; padding: 10px 8px 10px; text-align: center; transition: transform .12s, border-color .12s; min-height: 118px; }
.shop-item:active { transform: scale(.97); }
.shop-item.owned { background: #fefce8; }
.shop-item.equipped { border-color: #16a34a; box-shadow: 0 0 0 3px rgb(22 163 74 / .18); }
.shop-item.cant { opacity: .62; }
.shop-item .si-icon { font-size: 34px; line-height: 1.1; }
.shop-item .si-name { font-weight: 800; font-size: 12.5px; color: #713f12; margin-top: 2px; }
.shop-item .si-desc { font-size: 10.5px; color: rgb(113 63 18 / .8); line-height: 1.2; margin-top: 2px; min-height: 2.4em; }
.shop-item .si-tag { margin-top: 6px; display: inline-block; font-size: 11px; font-weight: 900; padding: 2px 9px; border-radius: 999px; background: #e0f2fe; color: #075985; }
.shop-item.owned .si-tag { background: #dcfce7; color: #166534; }
.shop-item.equipped .si-tag { background: #16a34a; color: #fff; }
.shop-item .si-preview { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 999px; background: #fef3c7; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.player-bank { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 999px; background: #e0f2fe; color: #075985; font-weight: 900; font-variant-numeric: tabular-nums; }
.pu-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 12px; border-radius: 14px; border: 2px dashed #0ea5e9; background: #f0f9ff; color: #075985; font-weight: 900; font-size: 13px; }
.pu-btn[disabled] { opacity: .5; }

@media (prefers-reduced-motion: reduce) {
  .fx-dice-rolling, .fx-dice-land, .fx-tile-pop, .fx-count-bump, .rl-flip,
  .vd-cheer, .vd-bounce, .vd-spin, .vd-robot, .vd-disco, .win-disco-lights { animation: none !important; }
}
