/* Rando page + the four games + winner reveal. */

.rando-hero { display: flex; align-items: center; gap: 18px; padding: 14px 0 22px; }
.rando-hero h1 { font-size: 40px; }
.rando-hero .sub { color: var(--muted); margin-top: 4px; }
.dice3d { width: 76px; height: 76px; flex: none; border-radius: 22px; display: grid; place-items: center; font-size: 44px;
  background: var(--brand); box-shadow: 0 14px 40px rgba(122, 63, 196, .45), inset 0 1px 0 rgba(255, 255, 255, .25); animation: wobble 4s ease-in-out infinite; }
@keyframes wobble { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(8deg) translateY(-4px); } }

.pool-card { padding: 16px; border-radius: 22px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.pool-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pool-label { width: 44px; color: var(--muted); font-size: 13px; font-weight: 500; }
.pool-line .seg { overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.pool-line .seg button { flex: none; }
.pool-card .chips { margin: 0 -16px; padding: 2px 16px; }
.pool-count { color: var(--muted); font-size: 14px; }
.pool-count b { color: var(--ink); font-size: 16px; }

.games { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
@media (min-width: 900px) { .games { grid-template-columns: repeat(4, 1fr); } }
.game-card {
  position: relative; overflow: hidden; min-height: 168px; padding: 16px; border-radius: 22px; text-align: left; display: flex; flex-direction: column; gap: 4px; justify-content: flex-end;
  color: #fff; transition: transform .15s, opacity .2s; isolation: isolate;
}
.game-card:nth-child(1) { background: linear-gradient(150deg, #2fb8f0, #3d33b8); }
.game-card:nth-child(2) { background: linear-gradient(150deg, #ff7a59, #b0247a); }
.game-card:nth-child(3) { background: linear-gradient(150deg, #ff5fb4, #7a3fc4); }
.game-card:nth-child(4) { background: linear-gradient(150deg, #8b6cff, #1267a1); }
.game-card::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(circle at 80% 0%, rgba(255, 255, 255, .3), transparent 50%); }
.game-card:hover { transform: translateY(-3px); }
.game-card:active { transform: scale(.98); }
.game-card[disabled] { opacity: .4; pointer-events: none; }
.game-emoji { position: absolute; top: 12px; left: 14px; font-size: 44px; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .3)); }
.game-card b { font-size: 18px; }
.game-card span:not(.game-emoji) { font-size: 13px; opacity: .88; line-height: 1.35; }
.game-card i { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .22); display: grid; place-items: center; }
.game-card i svg { width: 15px; height: 15px; margin-left: 2px; }

/* game overlay */
.game { display: flex; flex-direction: column; background: radial-gradient(ellipse at 50% 0%, rgba(120, 60, 179, .3), transparent 60%), var(--bg); }
.game-top { display: flex; align-items: center; justify-content: space-between; padding: calc(12px + var(--safe-t)) 16px 8px; }
.game-top b { font-size: 17px; }
.game-top span { width: 40px; }
.game-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 16px 30px; min-height: 0; }

/* wheel */
.wheel-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.wheel { position: relative; }
.wheel canvas { display: block; border-radius: 50%; box-shadow: 0 0 0 8px rgba(255, 255, 255, .06), 0 0 60px rgba(155, 107, 255, .35); }
.wheel-pointer { position: absolute; left: 50%; top: -14px; transform: translateX(-50%); width: 0; height: 0; border-left: 15px solid transparent; border-right: 15px solid transparent; border-top: 28px solid #fff; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5)); }
.wheel-spin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 86px; height: 86px; border-radius: 50%; background: #fff; color: #0b0d16; font-weight: 800; letter-spacing: .08em;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .5), 0 0 0 6px rgba(7, 8, 14, .6); transition: transform .15s; }
.wheel-spin:hover { transform: translate(-50%, -50%) scale(1.06); }
.wheel-spin.busy { pointer-events: none; opacity: .9; }
.wheel-ticker { display: flex; align-items: center; gap: 12px; height: 64px; padding: 8px 16px 8px 8px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); min-width: 240px; max-width: 92vw; }
.wheel-ticker img { width: 32px; height: 48px; border-radius: 6px; object-fit: cover; background: var(--panel-2); }
.wheel-ticker span { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wheel-ticker.tick img { animation: tick .18s ease; }
@keyframes tick { from { transform: translateY(-6px); opacity: .4; } }
.wheel-hint { font-size: 14px; }

/* showdown */
.sd { width: 100%; max-width: 640px; text-align: center; }
.sd-round { color: var(--cyan); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; font-size: 13px; }
.sd-q { font-size: 26px; margin: 4px 0 20px; }
.sd-pair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.sd-card { position: relative; border-radius: 18px; overflow: hidden; aspect-ratio: 2/3; background: var(--panel-2); box-shadow: 0 16px 40px rgba(0, 0, 0, .45); transition: transform .35s, opacity .35s, filter .35s; text-align: left; }
.sd-card img { width: 100%; height: 100%; object-fit: cover; }
.sd-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 12px 12px; background: linear-gradient(transparent, rgba(0, 0, 0, .9)); display: flex; flex-direction: column; }
.sd-info b { font-size: 15px; line-height: 1.2; }
.sd-info small { color: var(--ink-2); font-size: 12px; }
.sd-card:hover { transform: translateY(-4px); }
.sd-card.picked { transform: scale(1.05); box-shadow: 0 0 0 3px #fff, 0 20px 50px rgba(155, 107, 255, .5); }
.sd-card.out { opacity: .25; transform: scale(.92); filter: grayscale(1); }
.sd-vs { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: var(--brand); box-shadow: 0 0 24px rgba(155, 107, 255, .6); }
.sd-dots { display: flex; justify-content: center; gap: 6px; margin-top: 22px; }
.sd-dots i { width: 8px; height: 8px; border-radius: 4px; background: var(--panel-3); }
.sd-dots i.done { background: var(--faint); }
.sd-dots i.now { background: var(--cyan); width: 18px; }
@media (max-height: 700px) { .sd-pair { max-width: 420px; margin: 0 auto; } }

/* swipe */
.sw { width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.sw-count { color: var(--muted); font-weight: 500; }
.sw-deck { position: relative; width: min(100%, 52vh * .68); aspect-ratio: 2/3; }
.sw-card {
  --d: 0; --yes: 0; --no: 0;
  position: absolute; inset: 0; border-radius: 22px; overflow: hidden; background: var(--panel-2); touch-action: none; user-select: none; cursor: grab;
  transform: translateY(calc(var(--d) * 12px)) scale(calc(1 - var(--d) * .05)); box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
}
.sw-card img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.sw-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 18px 18px; background: linear-gradient(transparent, rgba(0, 0, 0, .92) 45%); }
.sw-info b { font-size: 22px; display: block; }
.sw-info small { color: var(--ink-2); }
.sw-info p { margin-top: 8px; font-size: 13.5px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sw-stamp { position: absolute; top: 28px; padding: 6px 14px; border: 4px solid; border-radius: 12px; font-size: 30px; font-weight: 800; letter-spacing: .06em; }
.sw-stamp.yes { left: 22px; color: var(--good); transform: rotate(-14deg); opacity: var(--yes); }
.sw-stamp.no { right: 22px; color: var(--bad); transform: rotate(14deg); opacity: var(--no); }
.sw-buttons { display: flex; gap: 28px; }
.sw-btn { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line-2); transition: transform .15s; }
.sw-btn svg.i { width: 30px; height: 30px; stroke-width: 2.6; }
.sw-btn.no { color: var(--bad); } .sw-btn.yes { color: var(--pink); }
.sw-btn:hover { transform: scale(1.08); }
.sw-end { text-align: center; } .sw-end .big { font-size: 56px; } .sw-end h2 { margin: 8px 0 4px; } .sw-end .btn { margin-top: 18px; }

/* mystery cards */
.mc { width: 100%; max-width: 720px; text-align: center; }
.mc-q { font-size: 26px; margin-bottom: 26px; }
.mc-table { --w: min(28vw, 190px, 34vh * .66); position: relative; height: calc(var(--w) * 1.5); width: calc(var(--n) * var(--w) + (var(--n) - 1) * 14px); margin: 0 auto; perspective: 1200px; }
.mc-card { position: absolute; top: 0; left: calc(var(--slot) * (var(--w) + 14px)); width: var(--w); aspect-ratio: 2/3; transition: left .3s cubic-bezier(.5, 0, .3, 1), transform .3s; }
.mc-card:not([disabled]):hover { transform: translateY(-8px); }
.mc-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.3, .7, .3, 1); }
.mc-card.flipped .mc-inner { transform: rotateY(180deg); }
.mc-back, .mc-front { position: absolute; inset: 0; border-radius: 16px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 16px 36px rgba(0, 0, 0, .5); }
.mc-back { background: var(--brand); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 3px solid rgba(255, 255, 255, .18); }
.mc-back::before { content: ""; position: absolute; inset: 8px; border-radius: 10px; border: 1.5px dashed rgba(255, 255, 255, .25); }
.mc-back img { width: 40%; border-radius: 10px; }
.mc-back b { font-size: 34px; }
.mc-front { transform: rotateY(180deg); background: var(--panel-2); }
.mc-front img { width: 100%; height: 100%; object-fit: cover; }
.mc-card.chosen { transform: translateY(-10px) scale(1.06); z-index: 2; }
.mc-card.chosen .mc-front { box-shadow: 0 0 0 3px #fff, 0 20px 50px rgba(155, 107, 255, .6); }
.mc-card.missed { opacity: .4; }
.mc-name { margin-top: 26px; font-size: 22px; font-weight: 700; min-height: 30px; }

/* winner reveal */
.reveal { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--bg); animation: fade .3s ease both; }
.reveal-bg { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); max-width: none; object-fit: cover; filter: blur(30px) brightness(.4) saturate(1.3); }
.reveal-in { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 20px; }
.reveal-kicker { font-size: 13px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); }
.reveal-poster { width: min(52vw, 230px, 34vh); border-radius: 18px; box-shadow: 0 30px 70px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .1); animation: reveal-pop .7s cubic-bezier(.2, 1.4, .4, 1) both; margin: 8px 0; }
@keyframes reveal-pop { from { transform: scale(.4) rotate(-8deg); opacity: 0; } }
.reveal h2 { font-size: 30px; max-width: 520px; }
.reveal-actions { display: flex; gap: 10px; margin-top: 10px; }
.reveal .btn.glass { margin-top: 4px; }
.confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
