/* Pop Gira — the game show of Rede POP. Shared parts (strip, header, buttons, lobby, waiting room, chat, overlays, ranking)
   copied from damas/src/damas.css; the Pop Gira parts (players, board, tiles, keyboard, wheel) are at the end. */
:root {
  --ink: #1e1b4b; --muted: #6b6f8a; --line: #e5e7f0; --soft: #f5f3ff;
  --r: #E11D2E; --b: #1D4ED8; --g: #16A34A; --y: #FACC15; --w: #111827;
  --pink: #ec4899; --purple: #7c3aed;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body { background: #fff; color: var(--ink); font-family: 'Baloo 2', 'Sora', system-ui, sans-serif;
  min-height: 100dvh; display: flex; flex-direction: column; align-items: center; overscroll-behavior: none; }
button { font: inherit; cursor: pointer; color: inherit; }
.hidden { display: none !important; }

/* platform strip (same as every game page) */
.platform-strip { position: relative; overflow: hidden; padding: 8px 0; flex-shrink: 0; width: 100%; min-height: 58px; background: #fff; }
.platform-strip::before, .platform-strip::after { content: ''; position: absolute; top: 0; bottom: 0; width: 32px; z-index: 2; pointer-events: none; }
.platform-strip::before { left: 0; background: linear-gradient(to right, #fff, transparent); }
.platform-strip::after { right: 0; background: linear-gradient(to left, #fff, transparent); }
.platform-track { display: flex; align-items: center; gap: 10px; width: max-content; animation: platformMarquee 36s linear infinite; }
@keyframes platformMarquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.platform-card { flex: 0 0 auto; width: 76px; height: 42px; border-radius: 12px; background: #fff; border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,.06); display: flex; align-items: center; justify-content: center; }
.platform-card img { height: 22px; width: auto; max-width: 90%; object-fit: contain; display: block; }
@media (prefers-reduced-motion: reduce) { .platform-track { animation: none; } }

/* header */
.top { width: 100%; max-width: 480px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px; padding: 2px 12px; }
.top .brand { height: 42px; width: auto; justify-self: center; }
body.in-lobby .top .brand { visibility: hidden; }   /* the big logo is right below */
.icon-group { display: flex; gap: 5px; }
.icon { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; padding: 0;
  background: #fff; border: 1.5px solid #ece7f7; box-shadow: 0 3px 0 #ece7f7; color: var(--ink); font-weight: 800; font-size: 17px;
  transition: transform .15s cubic-bezier(.34,1.56,.64,1); overflow: hidden; }
.icon:active { transform: scale(.88); }
#btnBack { font-size: 26px; line-height: 1; }

main { width: 100%; max-width: 480px; flex: 1; display: flex; flex-direction: column; padding: 0 12px calc(12px + env(safe-area-inset-bottom)); }
.view { display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* buttons drawn in code (the Codex jelly art was dropped, owner Oct 19) */
.jelly { --b1: #ff5fa8; --b2: #e11d74; --bd: #a30f52; position: relative; border: 0; width: 100%; max-width: 340px; min-height: 52px;
  padding: 10px 18px; border-radius: 18px; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(180deg, var(--b1), var(--b2)); box-shadow: 0 5px 0 var(--bd), 0 10px 18px -6px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.35);
  text-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .1s, box-shadow .1s; cursor: pointer; overflow: hidden; }
.jelly::after { content: ''; position: absolute; left: 10px; right: 10px; top: 4px; height: 38%; border-radius: 14px 14px 30px 30px;
  background: linear-gradient(180deg, rgba(255,255,255,.32), rgba(255,255,255,0)); pointer-events: none; }
.jelly.blue { --b1: #4f9dff; --b2: #2563eb; --bd: #1740a8; }
.jelly span { font-weight: 800; font-size: clamp(17px, 5vw, 20px); line-height: 1.1; }
.jelly small { font-size: 12.5px; font-weight: 600; opacity: .92; margin-top: 3px; }
.jelly:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--bd), 0 4px 8px -4px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.35); }
.jelly:disabled { filter: grayscale(.7) opacity(.6); }
/* the two big lobby buttons: icon disc, text on the left, arrow on the right */
.jelly.big { flex-direction: row; justify-content: flex-start; gap: 14px; min-height: 76px; padding: 12px 16px; text-align: left; border-radius: 22px; }
.jelly.big .bi { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 25px;
  background: rgba(255,255,255,.22); box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); text-shadow: none; }
.jelly.big .bt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.jelly.big span { font-size: 20px; }
.jelly.big .bx { flex: 0 0 auto; font-size: 26px; font-weight: 800; opacity: .9; }
.jelly.big.pink { animation: bigPulse 2.4s ease-in-out infinite; }
@keyframes bigPulse { 0%,100% { box-shadow: 0 5px 0 var(--bd), 0 10px 18px -6px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.35); }
  50% { box-shadow: 0 5px 0 var(--bd), 0 10px 26px -2px rgba(236,72,153,.55), inset 0 1px 0 rgba(255,255,255,.35); } }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; font-size: 15px; padding: 6px; }
.mini-btn { border: 0; border-radius: 12px; padding: 8px 12px; font-weight: 800; color: #fff; text-decoration: none; font-size: 14px; }
.mini-btn.blue { background: linear-gradient(180deg, #5fb4ff, #1e6fe0); }
.mini-btn.green { background: linear-gradient(180deg, #4ade80, #16a34a); }

/* lobby */
.hero { text-align: center; margin-top: -6px; }
.hero-logo { width: min(250px, 62vw); height: auto; animation: logoFloat 3.4s ease-in-out infinite; }
@keyframes logoFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.hero-tag { margin: 0; color: var(--muted); font-weight: 600; font-size: 14px; }
#btnQuick small { min-height: 1em; }
.code-join { display: flex; gap: 6px; width: 100%; max-width: 340px; }
.code-join input { flex: 1; min-width: 0; border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 12px; font: inherit; font-size: 15px; background: #fafaff; color: var(--ink); text-transform: uppercase; }
.code-join input::placeholder { text-transform: none; }
.code-join button { border: 0; border-radius: 14px; padding: 0 16px; font-weight: 800; color: #fff; background: linear-gradient(180deg, #a78bfa, #7c3aed); }
.panel { position: relative; width: 100%; background: #fff; border: 1.5px solid var(--line); border-radius: 20px; padding: 14px; box-shadow: 0 4px 14px rgba(30,27,75,.06); }
.panel h3 { margin: 0 0 8px; display: flex; align-items: center; gap: 8px; font-size: 19px; }
.panel h4 { margin: 14px 0 6px; font-size: 16px; }
.h-ico { font-size: 22px; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; line-height: 1.35; }
.legend { display: grid; grid-template-columns: 1fr; gap: 8px; }
.legend .row { display: flex; align-items: center; gap: 10px; font-size: 14px; line-height: 1.3; }
.legend .row .pc { flex: 0 0 auto; }
.pts-rule { margin: 0; font-size: 14px; line-height: 1.45; }
.live-list { display: flex; flex-direction: column; gap: 8px; }
.live-empty { text-align: center; color: var(--muted); font-size: 14px; }
.live-empty img { width: 170px; height: auto; display: block; margin: 0 auto 2px; }
.live-empty p { margin: 0; }
.live-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 14px; background: var(--soft); }
.live-row .avs { display: flex; }
.live-row .avs > * { margin-left: -8px; border: 2px solid #fff; border-radius: 50%; }
.live-row .avs > *:first-child { margin-left: 0; }
.live-row .who { flex: 1; min-width: 0; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-row button { border: 0; border-radius: 12px; padding: 6px 12px; font-weight: 800; color: #fff; background: linear-gradient(180deg, #a78bfa, #7c3aed); }
/* waiting room */
#waitView h2 { margin: 6px 0 0; font-size: 22px; text-align: center; }
.wait-code { text-align: center; background: var(--soft); border-radius: 18px; padding: 10px 14px; width: 100%; max-width: 340px; }
.wait-code span { color: var(--muted); font-size: 13px; display: block; }
.wait-code b { font-size: 30px; letter-spacing: 4px; }
.wait-share { display: flex; gap: 8px; justify-content: center; margin-top: 6px; }
.wait-seats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; width: 100%; max-width: 360px; }
.wseat { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 4px; border-radius: 16px; background: #fff; border: 1.5px solid var(--line); text-align: center; }
.wseat b { font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wseat .av { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #f1f0fb; font-size: 22px; color: var(--muted); }
.wseat.off { opacity: .5; }
.wseat.empty { border-style: dashed; color: var(--muted); }
.wait-hint { margin: 0; text-align: center; color: var(--muted); font-size: 14.5px; max-width: 340px; }
.watch-badge { background: var(--soft); border-radius: 14px; padding: 8px 12px; font-weight: 700; color: var(--purple); }
/* chat (same as Pop Match / Pop Go) */
.talk-row { display: flex; align-items: center; gap: 6px; width: calc(100% - 84px); align-self: flex-start; }
.talk-row.no-react .reaction-bar { display: none; }
.talk-log-btn { position: relative; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-size: 17px; }
.talk-unread { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; border-radius: 9px; background: #dc2626; color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.reaction-bar { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; padding: 2px 0; }
.reaction-bar::-webkit-scrollbar { display: none; }
.reaction-bar button { flex: 0 0 auto; border: 1.5px solid var(--line); background: #faf9ff; border-radius: 10px; font-size: 18px; padding: 2px 7px; }
.pop-chat { display: flex; gap: 6px; width: calc(100% - 84px); align-self: flex-start; }
.pop-chat input { flex: 1; min-width: 0; height: 38px; border-radius: 19px; border: 1.5px solid #ddd6fe; padding: 0 14px; font: inherit; background: #f8fafc; color: var(--ink); }
.pop-chat button { width: 42px; height: 38px; border: 0; border-radius: 19px; background: linear-gradient(180deg, #f59e0b, #ea580c); color: #fff; font-size: 16px; }
.talk-log { position: fixed; left: 12px; right: 96px; bottom: calc(84px + env(safe-area-inset-bottom)); max-height: 46dvh; z-index: 300; background: #fff; border: 1.5px solid var(--line);
  border-radius: 18px; box-shadow: 0 10px 30px rgba(30,27,75,.2); display: flex; flex-direction: column; overflow: hidden; }
.talk-log-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.talk-log-head button { border: 0; background: none; font-size: 16px; }
.talk-log-list { overflow-y: auto; padding: 6px 12px 10px; display: flex; flex-direction: column; gap: 5px; font-size: 14px; }
.talk-item { display: flex; gap: 6px; align-items: baseline; }
.talk-item .who { font-weight: 800; color: var(--purple); }
.talk-item .what { flex: 1; word-break: break-word; }
.talk-item.emoji .what { font-size: 18px; }
.talk-item .when { color: var(--muted); font-size: 11px; }
.talk-empty { color: var(--muted); text-align: center; padding: 10px; }
.net-badge { position: fixed; left: 50%; top: 70px; transform: translateX(-50%); background: #fef3c7; color: #92400e; border: 1.5px solid #fcd34d; font-weight: 800; padding: 6px 14px; border-radius: 14px; z-index: 400; }

/* overlays */
.overlay { position: fixed; inset: 0; z-index: 600; background: rgba(30,27,75,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.sheet { position: relative; background: #fff; border-radius: 22px; padding: 18px 16px; width: 100%; max-width: 420px; max-height: 86dvh; overflow-y: auto; box-shadow: 0 16px 40px rgba(30,27,75,.3); }
.sheet.center { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sheet h2 { margin: 0 0 8px; font-size: 22px; }
.sheet ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 7px; font-size: 14.5px; line-height: 1.35; }
.sheet-x { position: absolute; right: 10px; top: 10px; border: 0; background: var(--soft); width: 32px; height: 32px; border-radius: 50%; }
.gate-logo { width: 160px; height: auto; }
.win-box { position: relative; background: #fff; border-radius: 24px; padding: 14px 16px 12px; width: 100%; max-width: 380px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 8px; box-shadow: 0 16px 40px rgba(30,27,75,.3); }
.crown { position: relative; width: 230px; margin-top: -60px; }
.crown img { width: 100%; height: auto; display: block; }
.crown b { position: absolute; left: 19%; right: 19%; top: 61.5%; height: 16%; /* the ribbon's front band: y 215-290 of 360, centre 70% */ display: flex; align-items: center; justify-content: center; color: #5a2a00;
  font-size: 17px; font-weight: 800; letter-spacing: .2px; text-shadow: 0 1px 0 rgba(255,240,180,.8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-box h2 { margin: 0; font-size: 24px; }
.win-rank { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 5px; }
.win-rank li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 12px; background: #faf9ff; font-size: 14.5px; }
.win-rank li.me { background: #fdf2f8; border: 1.5px solid #f9a8d4; }
.win-rank .who { flex: 1; text-align: left; font-weight: 700; }
.win-rank .pts { font-weight: 800; color: #16a34a; }
.win-sponsor { display: flex; align-items: center; gap: 8px; border-radius: 14px; padding: 6px 12px; color: #fff; text-decoration: none; font-weight: 700; font-size: 14px; }
.win-sponsor img { height: 26px; width: auto; }
.win-box > * { position: relative; z-index: 1; }
.win-box > .fx-confetti { position: absolute; left: -10px; right: -10px; top: -60px; height: 360px; pointer-events: none; background: url(/pop/asset/game/fx-confetti.webp) 0 0 / 1600% 100% no-repeat; z-index: 0; opacity: .85; }
.fx-confetti.go { animation: confetti 1.4s steps(16, jump-none) forwards, confettiOut .5s 1.2s forwards; }
@keyframes confetti { to { background-position-x: 100%; } }
@keyframes confettiOut { to { opacity: 0; } }
/* ranking sheet */
.rank-list { display: flex; flex-direction: column; gap: 6px; }
.rank-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 12px; background: #faf9ff; }
.rank-row.me { background: #fdf2f8; border: 1.5px solid #f9a8d4; }
.rank-row .pos { width: 28px; text-align: center; font-weight: 800; color: var(--muted); }
.rank-row .pos img { width: 26px; height: auto; display: block; margin: 0 auto; }
.rank-row .who { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .pts { font-weight: 800; color: var(--purple); }
/* ======================= Pop Damas ======================= */
/* the lobby's big logo is right below; also before login, when in-lobby isn't set yet */
body:has(#lobbyView:not(.hidden)) .top .brand { visibility: hidden; }
.jelly.big .bi { font-size: 24px; }
.bot-av { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #eef2ff; font-size: 17px; }
.bot-av.big { width: 40px; height: 40px; font-size: 22px; }

/* ======================= Pop Gira ======================= */
:root { --night: #2a0f5c; --violet: #6b2bd9; --magenta: #e0218a; --gold: #ffc93c; --gold2: #c98a12; --teal: #14c8c8; --cream: #fff4dc; }
.legend { grid-template-columns: 1fr 1fr; }
.legend .row i { flex: 0 0 auto; width: 34px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-style: normal; font-size: 10.5px; font-weight: 800; color: #fff; }
.peek-host { margin-top: 64px; }
.peek { position: absolute; left: 18px; top: -78px; width: 84px; height: 84px; background: url(../asset/game/host-peek.webp) 0 0 / 1200% 100% no-repeat;
  animation: peekRun 1.6s steps(12, jump-none) infinite; pointer-events: none; }
@keyframes peekRun { to { background-position-x: 100%; } }
.hero-logo { width: min(290px, 74vw); }

/* the game screen sits on the stage (Codex art) */
body.in-game { background: var(--night) url(../asset/game/bg-portrait.webp) center top / cover fixed; }
@media (min-aspect-ratio: 1/1) { body.in-game { background-image: url(../asset/game/bg-landscape.webp); } }
body.in-game .platform-strip { background: rgba(255,255,255,.96); }
body.in-game .top .icon { background: rgba(255,255,255,.92); }
#gameView { gap: 6px; position: relative; color: #fff; padding-bottom: 6px; }

/* players: plates drawn in CSS */
.players { display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: 6px; width: 100%; }
.plate { position: relative; display: flex; flex-direction: column; align-items: center; padding: 5px 4px 6px; border-radius: 14px; color: #fff;
  background: linear-gradient(180deg, #4b1fa8, #2a0f5c); border: 2px solid rgba(255,201,60,.35); box-shadow: 0 3px 0 #160733, inset 0 1px 0 rgba(255,255,255,.2); min-width: 0; }
.plate .who { display: flex; align-items: center; gap: 5px; max-width: 100%; }
.plate .who b { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plate .av > :first-child { width: 24px !important; height: 24px !important; }
.plate .bot-av { width: 24px; height: 24px; font-size: 14px; }
.plate .bank { font-size: 20px; font-weight: 800; line-height: 1.05; color: var(--gold); text-shadow: 0 2px 0 rgba(0,0,0,.35); font-variant-numeric: tabular-nums; }
.plate .tot { font-size: 11px; font-weight: 700; opacity: .85; }
.plate.turn { border-color: var(--gold); background: linear-gradient(180deg, #e0218a, #8a1166); box-shadow: 0 3px 0 #4d0a39, 0 0 16px rgba(255,201,60,.55); animation: plateGlow 1.4s ease-in-out infinite; }
@keyframes plateGlow { 50% { box-shadow: 0 3px 0 #4d0a39, 0 0 24px rgba(255,201,60,.9); } }
.plate.me .who b { color: #ffe9a8; }
.plate.off { opacity: .5; } .plate.left { opacity: .3; filter: grayscale(1); }
.plate .bubble { position: absolute; left: 50%; top: -8px; transform: translate(-50%, -100%); background: #fff; color: var(--ink); border-radius: 12px; padding: 3px 9px;
  font-weight: 700; font-size: 13px; white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; z-index: 8; box-shadow: 0 4px 10px rgba(0,0,0,.25); transition: opacity .3s; }
.plate .bubble.emoji { font-size: 24px; background: transparent; box-shadow: none; padding: 0; }
.plate .bubble.out { opacity: 0; }
.plate .delta { position: absolute; left: 50%; top: 40%; transform: translateX(-50%); font-weight: 800; font-size: 18px; color: #4ade80; text-shadow: 0 2px 4px rgba(0,0,0,.6);
  pointer-events: none; animation: deltaUp 1.3s ease-out forwards; z-index: 6; white-space: nowrap; }
.plate .delta.neg { color: #fb7185; }
@keyframes deltaUp { from { opacity: 0; transform: translate(-50%, 6px); } 15% { opacity: 1; } to { opacity: 0; transform: translate(-50%, -34px); } }
.round-line { font-size: 13px; font-weight: 800; color: #ffe9a8; text-align: center; min-height: 18px; text-shadow: 0 1px 3px rgba(0,0,0,.5); }

/* the board: Codex frame, tiles drawn in CSS inside its window (x 8%..92%, y 17.74%..82.26%) */
.board-wrap { width: 100%; display: flex; justify-content: center; }
.board-frame { position: relative; width: min(100%, 460px); aspect-ratio: 1200 / 620; }
.board-frame img { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.bf-bulbs { mix-blend-mode: screen; opacity: 0; animation: bulbs 1.1s steps(1) infinite; }
.bf-bulbs.b { animation-delay: .55s; }
@keyframes bulbs { 0% { opacity: 1; } 50% { opacity: 0; } }
.board-frame.party .bf-bulbs { animation-duration: .3s; } .board-frame.party .bf-bulbs.b { animation-delay: .15s; }
.board { position: absolute; left: 8%; top: 17.74%; width: 84%; height: 64.52%; display: grid; grid-template-columns: repeat(14, 1fr); grid-template-rows: repeat(4, 1fr); gap: 2px; }
.tile { position: relative; border-radius: 3px; display: grid; place-items: center; font-weight: 800; color: var(--night); font-size: clamp(11px, 3.6vw, 19px); line-height: 1; }
.tile.x { background: linear-gradient(180deg, #3a1789, #251060); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.tile.h, .tile.l, .tile.p { background: linear-gradient(180deg, #fffaf0, var(--cream)); box-shadow: inset 0 -2px 0 #e6c98d, 0 1px 0 rgba(0,0,0,.35); }
.tile.l.new { animation: flipIn .55s cubic-bezier(.3,1.4,.5,1) both; }
@keyframes flipIn { 0% { transform: rotateY(90deg); background: #ffe066; } 60% { background: #ffe066; } 100% { transform: rotateY(0); } }
.tile .spark { position: absolute; left: 50%; top: 50%; width: 180%; aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none;
  background: url(../asset/game/sparkle.webp) 0 0 / 600% 100% no-repeat; mix-blend-mode: screen; animation: spark .5s steps(6, jump-none) forwards; }
@keyframes spark { to { background-position-x: 100%; } }

/* category + clue, with the host next to it */
.clue-bar { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 64px; }
.host { flex: 0 0 auto; width: 70px; height: 70px; background: url(../asset/game/host-idle.webp) 0 0 / 800% 100% no-repeat; animation: hostIdle 1s steps(8, jump-none) infinite; }
.host.talk { background-image: url(../asset/game/host-talk.webp); animation: hostIdle .8s steps(8, jump-none) infinite; }
.host.cheer { background-image: url(../asset/game/host-cheer.webp); background-size: 1000% 100%; animation: hostOnce .85s steps(10, jump-none) forwards; }
.host.shock { background-image: url(../asset/game/host-shock.webp); background-size: 1000% 100%; animation: hostOnce .85s steps(10, jump-none) forwards; }
@keyframes hostIdle { to { background-position-x: 100%; } }
@keyframes hostOnce { to { background-position-x: 100%; } }
.host.big { width: 120px; height: 120px; margin-top: -70px; }
.clue-box { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 7px 12px; border-radius: 16px;
  background: rgba(255,255,255,.95); color: var(--ink); box-shadow: 0 4px 0 rgba(0,0,0,.25); position: relative; }
.clue-box::before { content: ''; position: absolute; left: -7px; top: 50%; transform: translateY(-50%); border: 7px solid transparent; border-right-color: rgba(255,255,255,.95); border-left: 0; }
.clue-box .cat { font-size: 11.5px; font-weight: 800; color: #fff; background: linear-gradient(180deg, var(--magenta), #a3125f); padding: 1px 9px; border-radius: 8px; text-transform: uppercase; letter-spacing: .4px; }
.clue-box .clue { font-size: 14.5px; font-weight: 700; line-height: 1.2; }

/* status + timer */
#gameView .status { color: #fff; font-size: 16px; text-shadow: 0 2px 4px rgba(0,0,0,.5); min-height: 22px; }
#gameView .status.mine { color: var(--gold); }
.timer { width: 100%; max-width: 420px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.18); overflow: hidden; }
.timer i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), #ff7a3d); transition: width .25s linear; }
.timer i.low { background: linear-gradient(90deg, #fb7185, #dc2626); }

/* the three actions */
.acts { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 6px; width: 100%; max-width: 440px; }
.act { --bd: #000; position: relative; border: 0; border-radius: 16px; min-height: 54px; padding: 6px 4px; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  font-weight: 800; box-shadow: 0 4px 0 var(--bd), inset 0 1px 0 rgba(255,255,255,.35); transition: transform .1s, box-shadow .1s, filter .2s; text-shadow: 0 1px 2px rgba(0,0,0,.3); }
.act span { font-size: 15px; line-height: 1; } .act small { font-size: 11px; opacity: .9; } .act b { font-size: 13px; letter-spacing: 1px; }
.act.spin { --bd: #a87a1f; background: linear-gradient(180deg, #ffe9a8, #f4cf6e 45%, #d9a23a); color: #3a2200; text-shadow: none; flex-direction: row; gap: 8px; }
.act.spin span { font-size: 19px; }
.act.vowel { --bd: #0b6e6e; background: linear-gradient(180deg, #4fe3e3, #0fa3a3); }
.act.solve { --bd: #80104f; background: linear-gradient(180deg, #ff5fa8, #c4166b); }
.act:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--bd); }
.act:disabled { filter: grayscale(.85) brightness(.75); }
.act.on:not(:disabled) { animation: actPulse 1.3s ease-in-out infinite; }
@keyframes actPulse { 50% { transform: scale(1.04); } }
.mini-wheel { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #a87a1f; flex: 0 0 auto;
  background: conic-gradient(#e0218a 0 45deg, #ffc93c 0 90deg, #14c8c8 0 135deg, #6b2bd9 0 180deg, #e0218a 0 225deg, #ffc93c 0 270deg, #14c8c8 0 315deg, #6b2bd9 0); }
.act.spin.on:not(:disabled) .mini-wheel { animation: miniSpin 2.4s linear infinite; }
@keyframes miniSpin { to { transform: rotate(360deg); } }

/* keyboard: called letters greyed, the kind you may pick glows */
.kbd { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 4px; }
.kbd .kr { display: flex; justify-content: center; gap: 4px; }
.kbd button { flex: 1; max-width: 40px; height: 40px; border: 0; border-radius: 9px; font-weight: 800; font-size: 17px; color: var(--ink);
  background: linear-gradient(180deg, #fff, #ece6fb); box-shadow: 0 3px 0 #b9a8e6; padding: 0; }
.kbd button.v { color: #0b7e7e; }
.kbd button.used { background: #4b3a7a; color: rgba(255,255,255,.35); box-shadow: none; text-decoration: line-through; }
.kbd button.hit { background: #5b2fb0; color: #ffd84d; box-shadow: none; text-decoration: none; }
.kbd.pick button:not(:disabled) { background: linear-gradient(180deg, #fff6c8, #ffd84d); box-shadow: 0 3px 0 #b8860b; }
.kbd button:disabled { cursor: default; }
.kbd.pick button:not(:disabled):active { transform: translateY(2px); box-shadow: 0 1px 0 #b8860b; }
.solve-form { display: flex; gap: 6px; width: 100%; max-width: 440px; }
.solve-form input { flex: 1; min-width: 0; height: 46px; border-radius: 14px; border: 2px solid var(--gold); padding: 0 12px; font: inherit; font-size: 17px; font-weight: 800;
  text-transform: uppercase; color: var(--ink); background: #fff; }
.solve-form button { border: 0; border-radius: 14px; padding: 0 14px; font-weight: 800; color: #fff; background: linear-gradient(180deg, #ff5fa8, #c4166b); box-shadow: 0 3px 0 #80104f; }
#gameView .watch-badge { background: rgba(255,255,255,.9); }
#gameView .talk-row { width: 100%; max-width: 440px; align-self: center; }
#gameView .reaction-bar button { background: rgba(255,255,255,.9); }
.table-toast { position: fixed; left: 50%; top: 44%; transform: translate(-50%, -50%) scale(.6); opacity: 0; pointer-events: none; z-index: 520;
  background: rgba(30,10,60,.92); color: #fff; font-weight: 800; padding: 10px 18px; border-radius: 18px; font-size: 18px; text-align: center; max-width: 88%;
  border: 2px solid var(--gold); transition: opacity .2s, transform .25s cubic-bezier(.34,1.56,.64,1); }
.table-toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* the wheel overlay */
.wheel-ov { position: fixed; inset: 0; z-index: 500; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: radial-gradient(circle at 50% 45%, rgba(42,15,92,.55), rgba(10,3,24,.82)); animation: ovIn .25s ease-out; }
@keyframes ovIn { from { opacity: 0; } }
.wheel-box { position: relative; width: min(88vw, 400px, 62dvh); aspect-ratio: 1; animation: boxIn .35s cubic-bezier(.3,1.4,.5,1); }
@keyframes boxIn { from { transform: scale(.4); } }
.wheel-box > canvas, .wheel-box > .w-rim, .wheel-box > .w-bulbs { position: absolute; inset: 0; width: 100%; height: 100%; }
#wheelCanvas { border-radius: 50%; }
.w-bulbs { mix-blend-mode: screen; opacity: 0; }
.wheel-ov.spinning .w-bulbs { animation: bulbs .24s steps(1) infinite; } .wheel-ov.spinning .w-bulbs.b { animation-delay: .12s; }
.wheel-ov:not(.spinning) .w-bulbs { animation: bulbs .9s steps(1) infinite; } .wheel-ov:not(.spinning) .w-bulbs.b { animation-delay: .45s; }
.w-hub { position: absolute; left: 37.5%; top: 37.5%; width: 25%; height: 25%; }
.w-hub img { position: absolute; inset: 0; width: 100%; height: 100%; }
.w-hub .w-logo { left: 18%; top: 18%; width: 64%; height: 64%; object-fit: contain; border-radius: 50%; background: #fff; }
.w-hub .w-logo:not([src]) { display: none; }
.w-pointer { position: absolute; left: 50%; top: -7%; width: 13.3%; height: auto; transform: translateX(-50%); transform-origin: 50% 30%; z-index: 3; }
.w-pointer.tick { animation: flap .1s ease-out; }
@keyframes flap { 50% { transform: translateX(-50%) rotate(-14deg); } }
.wheel-result { min-height: 46px; font-size: clamp(22px, 7vw, 32px); font-weight: 800; color: #fff; text-align: center; text-shadow: 0 3px 0 rgba(0,0,0,.4), 0 0 18px rgba(255,201,60,.6); padding: 0 12px; }
.wheel-result.bad { color: #fb7185; }
.wheel-result.good { color: var(--gold); animation: resPop .4s cubic-bezier(.3,1.6,.5,1); }
@keyframes resPop { from { transform: scale(.5); } }

/* effects: coins and confetti thrown by code */
.fxp { position: fixed; z-index: 550; pointer-events: none; left: 0; top: 0; }
.fxp.coin { width: 34px; height: 34px; background: url(../asset/game/coin.webp) 0 0 / 800% 100% no-repeat; animation: coinSpin .5s steps(8, jump-none) infinite; }
@keyframes coinSpin { to { background-position-x: 100%; } }
.fxp.conf { width: 14px; height: 14px; background: url(../asset/game/confetti-pieces.webp) 0 0 / 800% 100% no-repeat; }

/* end screen */
.win-pts { font-size: 14px; color: var(--muted); }
.win-rank li .tot { font-weight: 800; color: var(--violet); font-variant-numeric: tabular-nums; }
.win-why { margin: -4px 0 0; color: var(--muted); font-size: 14px; }
.win-box { padding-top: 60px; margin-top: 50px; }

/* short phones: everything on one screen */
@media (max-height: 740px) {
  #gameView { gap: 4px; }
  .host { width: 56px; height: 56px; }
  .clue-bar { min-height: 52px; }
  .clue-box { padding: 5px 10px; } .clue-box .clue { font-size: 13.5px; }
  .act { min-height: 46px; } .kbd button { height: 35px; font-size: 16px; }
  .plate .bank { font-size: 17px; }
}
@media (max-height: 660px) {
  body.in-game .platform-strip { display: none; }
  .round-line { display: none; }
}
@media (prefers-reduced-motion: reduce) { .host, .bf-bulbs, .w-bulbs, .act.on, .peek { animation: none !important; } }
/* four at the table: smaller avatar and name so the names fit (Nov 10 2026) */
.players[style*="--n: 4"] .plate { padding: 5px 3px 6px; }
.players[style*="--n: 4"] .who { gap: 3px; }
.players[style*="--n: 4"] .av > :first-child, .players[style*="--n: 4"] .bot-av { width: 18px !important; height: 18px !important; font-size: 11px; }
.players[style*="--n: 4"] .who b { font-size: 11px; }
.players[style*="--n: 4"] .bank { font-size: 17px; }
