/* Pop Dots! — the domino of Rede POP. Built from pop/src/pop.css (white page, buttons drawn in code); the tiles, the
   table and the turn ring are drawn in CSS too (Codex art from dots/design/v1 can replace the table/mascot later). */
: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(3, 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; }

/* ---------- game ---------- */
#gameView { gap: 6px; position: relative; }
.opps { display: flex; justify-content: center; gap: 4px; width: 100%; min-height: 78px; }
.opp { position: relative; width: 16%; max-width: 76px; display: flex; flex-direction: column; align-items: center; gap: 1px; text-align: center; }
.opp .av { position: relative; width: 48px; height: 48px; border-radius: 50%; }
.opp .av > :first-child { width: 48px !important; height: 48px !important; }
.opp .ring { position: absolute; inset: -5px; border-radius: 50%; border: 3px solid #fbbf24; box-shadow: 0 0 12px rgba(251,191,36,.8); pointer-events: none; display: none;
  animation: ring 1s ease-in-out infinite; }
.opp.turn .ring { display: block; }
@keyframes ring { 50% { transform: scale(1.08); opacity: .7; } }
.opp > b { font-size: 12px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.2; }
.opp .n { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 800; color: var(--muted); }
.opp .n i { width: 8px; height: 15px; border-radius: 2px; background: #fff; border: 1.5px solid #1e3a8a; }
.opp.one .n { color: #dc2626; }
.opp.me > b { color: #db2777; }
.opp.me .av > :first-child { box-shadow: 0 0 0 2.5px #fff, 0 0 0 4.5px #ec4899; border-radius: 50%; }
.opp.off { opacity: .45; }
.opp.left { opacity: .3; filter: grayscale(1); }
.opp .bubble { position: absolute; top: 18px; left: 50%; transform: translate(-50%, -100%); background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 3px 8px; font-size: 13px; font-weight: 700; white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; z-index: 5;
  box-shadow: 0 4px 10px rgba(30,27,75,.15); animation: pop .25s cubic-bezier(.34,1.56,.64,1); }
.opp .bubble.emoji { font-size: 22px; padding: 0 6px; }
.opp .bubble.out { opacity: 0; transition: opacity .3s; }
@keyframes pop { from { transform: translate(-50%, -100%) scale(.3); } to { transform: translate(-50%, -100%) scale(1); } }

.status { font-weight: 800; font-size: 17px; text-align: center; min-height: 24px; line-height: 1.2; }
.status.mine { color: #be185d; animation: statusPulse 1.2s ease-in-out infinite; }
@keyframes statusPulse { 50% { transform: scale(1.05); } }
.timer { width: 100%; max-width: 340px; height: 6px; border-radius: 3px; background: #eef0f6; overflow: hidden; }
.timer i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #f472b6, #a855f7); transition: width .25s linear; }
.timer i.low { background: linear-gradient(90deg, #f87171, #dc2626); }

.hand { position: relative; width: 100%; height: 118px; margin-top: 10px; }
.hand .pc { position: absolute; bottom: 4px; --w: 70px; transition: transform .2s cubic-bezier(.34,1.56,.64,1), left .25s, filter .2s; transform-origin: 50% 100%; }
.hand .pc.dim { filter: brightness(.82) saturate(.7) drop-shadow(0 2px 3px rgba(30,27,75,.18)); }
.hand .pc.ok { cursor: pointer; }
.hand .pc.drawn { box-shadow: 0 0 0 3px #fde047, 0 0 14px #facc15; }
.hand.spect { display: none; }

.actions { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; max-width: 380px; padding-right: 0; }
.actions .act { width: 46%; max-width: 170px; }
.actions .act span { font-size: 17px; }
.watch-badge { background: var(--soft); border-radius: 14px; padding: 8px 12px; font-weight: 700; color: var(--purple); }

/* effects (sprite strips, added by game.js) */
.fx { position: absolute; pointer-events: none; z-index: 20; transform: translate(-50%, -50%); background-repeat: no-repeat; aspect-ratio: 1; }

/* 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; } }

/* short phones: everything must fit above the fold (strip + header + players + table + hand + buttons) */
@media (max-height: 760px) {
}
@media (max-height: 700px) {
  #gameView { gap: 3px; }
  .opps { min-height: 62px; }
  .opp .av, .opp .av > :first-child { width: 40px !important; height: 40px !important; }
  .opp .ring { left: -13px; top: -13px; width: 66px; height: 66px; }
  .status { font-size: 15px; min-height: 20px; }
  .hand { height: 98px; }
  .actions .act { max-width: 150px; }
}

/* 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); }

/* ---------- domino tiles (one component: hand, table, how-to, end screen) ---------- */
/* --s = the short side. A vertical tile is s x 2s; .hz is 2s x s. Pip colours per number, like the logo. */
.dt { --s: 30px; position: relative; display: inline-flex; flex-direction: column; width: var(--s); height: calc(var(--s) * 2); flex: 0 0 auto; box-sizing: border-box;
  background: linear-gradient(180deg, #fff, #f1f3f9); border: max(1.5px, calc(var(--s) * .07)) solid #1e3a8a; border-radius: calc(var(--s) * .2);
  box-shadow: 0 max(1.5px, calc(var(--s) * .08)) 0 #1e3a8a, 0 calc(var(--s) * .14) calc(var(--s) * .2) rgba(30,27,75,.25); user-select: none; }
.dt.hz { flex-direction: row; width: calc(var(--s) * 2); height: var(--s); }
.dt .hf { position: relative; flex: 1; }
.dt .hf + .hf { border-top: max(1px, calc(var(--s) * .05)) solid #94a3b8; }
.dt.hz .hf + .hf { border-top: 0; border-left: max(1px, calc(var(--s) * .05)) solid #94a3b8; }
.dt .hf + .hf::before { content: ''; position: absolute; left: 50%; top: 0; width: calc(var(--s) * .16); height: calc(var(--s) * .16); border-radius: 50%;
  transform: translate(-50%, -50%); background: #f5b301; }
.dt.hz .hf + .hf::before { left: 0; top: 50%; }
.dt .pp { position: absolute; width: 23%; height: 23%; border-radius: 50%; transform: translate(-50%, -50%);
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--pc) 40%, #fff), var(--pc) 60%, color-mix(in srgb, var(--pc) 70%, #000)); }

/* ---------- table ---------- */
/* the table art (Codex): felt inside x 9-91%, y 8.5-91.5%; the platform medallion sits on the top rim at (50%, 4%) */
.table { position: relative; width: 100%; max-width: 420px; height: min(48dvh, 450px); min-height: 240px;
  background: url(../asset/game/table.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 10px 12px rgba(30,27,75,.25)); }
.table-medal { position: absolute; left: 50%; top: 4%; transform: translate(-50%, -50%); width: 10%; aspect-ratio: 1; border-radius: 50%; object-fit: contain;
  background: #fff; padding: 1.2%; z-index: 1; }
.table-medal:not([src]) { visibility: hidden; }
.chain { position: absolute; inset: 0; }
.chain .dt { position: absolute; transform: translate(-50%, -50%); transition: left .3s, top .3s; }
.chain .dt.new { animation: tileIn .35s cubic-bezier(.2,.8,.3,1.3); }
@keyframes tileIn { from { transform: translate(-50%, -50%) scale(1.6); opacity: 0; } }
/* the free ends: Codex's gold ring (8-frame loop) with the number in its clear middle */
.chain .end { position: absolute; transform: translate(-50%, -50%); width: 46px; height: 46px; border: 0; border-radius: 50%; padding: 0; z-index: 3;
  background: url(../asset/game/end-marker.webp) 0 0 / 800% 100% no-repeat; animation: endRing .8s steps(8, jump-none) infinite;
  color: #fff; font: inherit; font-weight: 800; font-size: 16px; display: flex; align-items: center; justify-content: center; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
@keyframes endRing { to { background-position-x: 100%; } }
.chain .end.go { animation: endRing .8s steps(8, jump-none) infinite, endPulse .8s ease-in-out infinite; color: #fde047; font-size: 18px; }
@keyframes endPulse { 50% { transform: translate(-50%, -50%) scale(1.2); } }
.chain .start-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: rgba(255,255,255,.9); font-weight: 800; text-align: center;
  font-size: 15px; width: 80%; }
.boneyard { position: absolute; left: 10.5%; top: 9.5%; height: 32px; border: 0; padding: 0 10px 0 5px; border-radius: 16px; z-index: 2;
  background: rgba(0,0,0,.28); color: #fff; display: flex; align-items: center; gap: 6px; font: inherit; font-weight: 800; font-size: 13px; }
.boneyard::before { content: ''; width: 13px; height: 22px; border-radius: 3px; background: linear-gradient(160deg, #10b981, #1e3a8a); border: 1.5px solid #fff;
  box-shadow: 4px 0 0 -1.5px #1e3a8a, 4px 0 0 0 #fff; margin-right: 4px; }
.bone-medal { width: 20px; height: 20px; border-radius: 50%; background: #fff; object-fit: contain; padding: 2px; }
.bone-medal:not([src]) { display: none; }
.boneyard.can { animation: deckPulse 1.2s ease-in-out infinite; }
@keyframes deckPulse { 50% { filter: drop-shadow(0 0 10px #fde047) brightness(1.1); } }
.table-toast { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.6); opacity: 0; pointer-events: none; z-index: 6;
  background: rgba(30,27,75,.88); color: #fff; font-weight: 800; padding: 8px 16px; border-radius: 16px; font-size: 17px; text-align: center; max-width: 86%;
  transition: opacity .2s, transform .25s cubic-bezier(.34,1.56,.64,1); }
.table-toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* players: pairs get a colour (team 0 pink, team 1 blue) */
.opp .tag { font-size: 10.5px; font-weight: 800; color: #fff; border-radius: 6px; padding: 0 5px; line-height: 1.5; }
.opp.t0 .tag { background: #ec4899; } .opp.t1 .tag { background: #2563eb; }
.opp.t0 .av > :first-child { box-shadow: 0 0 0 2.5px #fff, 0 0 0 4.5px #ec4899; border-radius: 50%; }
.opp.t1 .av > :first-child { box-shadow: 0 0 0 2.5px #fff, 0 0 0 4.5px #2563eb; border-radius: 50%; }
.opp.auto > b::after { content: ' 🤖'; }

/* my hand */
.hand { position: relative; width: 100%; display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-end; gap: 6px; padding: 14px 4px 6px; min-height: 92px; }
.hand .dt { --s: 34px; transition: transform .2s cubic-bezier(.34,1.56,.64,1), filter .2s; cursor: pointer; }
.hand .dt.ok { transform: translateY(-10px); box-shadow: 0 2.7px 0 #1e3a8a, 0 0 0 3px #fde047, 0 10px 16px -4px rgba(245,179,1,.6); }
.hand .dt.dim { filter: brightness(.86) saturate(.6); }
.hand .dt.sel { transform: translateY(-18px) scale(1.06); box-shadow: 0 2.7px 0 #1e3a8a, 0 0 0 4px #f59e0b, 0 14px 22px -6px rgba(245,158,11,.8); }
.hand.many .dt { --s: 27px; }
.hand.spect { display: none; }
.actions { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; max-width: 380px; }
.actions .act { max-width: 260px; }

/* how-to demo line and end-screen hands */
.demo { display: flex; align-items: center; justify-content: center; gap: 3px; padding: 10px 8px; margin-bottom: 8px; border-radius: 16px;
  background: radial-gradient(120% 90% at 50% 40%, #1fa35a, #0d6b37); }
.demo .dt { --s: 20px; }
.win-why { margin: -4px 0 0; color: var(--muted); font-size: 14px; }
.win-hands { width: 100%; display: flex; flex-direction: column; gap: 4px; }
.win-hands .row { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.win-hands .row > b { width: 92px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-hands .row .tiles { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.win-hands .row .tiles .dt { --s: 14px; }
.win-hands .row > i { font-style: normal; font-weight: 800; color: var(--muted); }
@media (max-height: 700px) { .table { height: min(40dvh, 380px); } .hand .dt { --s: 30px; } .hand.many .dt { --s: 25px; } }

/* confetti only for the winners (it sat over the text otherwise) */
.win-box > .fx-confetti { opacity: 0; }
.win-box > .fx-confetti.go { opacity: .85; }

/* lobby art (Codex): section icons, Dodo peeking over "Como jogar", Dodo asleep when no table is live */
.ico { display: inline-block; width: 32px; height: 32px; flex: 0 0 32px; background: url(../asset/game/icons.webp) calc(var(--i) * 20%) 0 / 600% 100% no-repeat; }
.jelly.big .bi .ico { width: 34px; height: 34px; }
.live-empty img { width: 180px; height: auto; display: block; margin: 0 auto 2px; }
.peek-host { margin-top: 64px; }
.peek { position: absolute; left: 18px; top: -86px; width: 90px; height: 90px; background: url(../asset/game/mascot-peek.webp) 0 0 / 1200% 100% no-repeat;
  animation: peek 1.2s steps(12, jump-none) infinite; pointer-events: none; }
@keyframes peek { to { background-position-x: 100%; } }
@media (prefers-reduced-motion: reduce) { .peek, .chain .end { animation: none; } }
