/* Pop! — the card game of Rede POP. White page; art from pop/design/v1 (Codex), exported by build-game.py into asset/game/. */
: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: url(../asset/game/btn-round.webp) center / 100% 100% no-repeat; border: 0; 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; }
.ico { width: 32px; height: 32px; flex: 0 0 32px; background: url(../asset/game/icons.webp) calc(var(--i) * 20%) 0 / 600% 100% no-repeat; }
.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); }
/* Popi peeking over the panel */
.peek-host { margin-top: 64px; }
.peek { position: absolute; right: 18px; top: -86px; width: 90px; height: 90px; background: url(../asset/game/mascot-peek.webp) 0 0 / 1200% 100% no-repeat;
  animation: peek 2.4s steps(12, jump-none) infinite; pointer-events: none; }
@keyframes peek { to { background-position-x: 100%; } }
@media (prefers-reduced-motion: reduce) { .peek { animation: none; background-position-x: 45.45%; } .hero-logo { animation: none; } }

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

/* ---------- cards (one component for the hand, the pile, the legend, overlays) ---------- */
.pc { --w: 62px; --c: var(--r); position: relative; width: var(--w); aspect-ratio: 2 / 3; flex: 0 0 auto; border-radius: calc(var(--w) * .12);
  background: url(../asset/game/card-faces.webp) 0 0 / 500% 100% no-repeat; filter: drop-shadow(0 3px 4px rgba(30,27,75,.22)); user-select: none; }
.pc.c-b { --c: var(--b); background-position-x: 25%; }
.pc.c-g { --c: var(--g); background-position-x: 50%; }
.pc.c-y { --c: var(--y); background-position-x: 75%; }
.pc.c-w { --c: var(--w); background-position-x: 100%; }
.pc .ctr { position: absolute; left: 16.7%; right: 16.7%; top: 21%; bottom: 21%; display: flex; align-items: center; justify-content: center;
  font-style: normal; font-weight: 800; font-size: calc(var(--w) * .52); line-height: 1; color: var(--c);
  -webkit-text-stroke: calc(var(--w) * .012) rgba(0,0,0,.25); text-shadow: 0 calc(var(--w) * .02) 0 rgba(0,0,0,.18); }
.pc.c-y .ctr { color: #e0a800; }
.pc .ctr.sym::before { content: ''; width: 64%; aspect-ratio: 1; border-radius: 50%; background: var(--c); box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.pc .ctr.sym::after { content: ''; position: absolute; width: 52%; aspect-ratio: 1; background: url(../asset/game/card-symbols.webp) calc(var(--s) * 25%) 0 / 500% 100% no-repeat; }
.pc .crn { position: absolute; font-style: normal; font-weight: 800; color: #fff; font-size: calc(var(--w) * .2); line-height: 1;
  text-shadow: 0 1px 0 rgba(0,0,0,.35); }
.pc .crn.tl { left: 11%; top: 7%; }
.pc .crn.br { right: 11%; bottom: 7%; transform: rotate(180deg); }
.pc.c-w .medal { position: absolute; left: 30%; top: 30%; width: 40%; aspect-ratio: 1; border-radius: 50%; object-fit: contain; background: #fff; padding: 4%; }
.pc.c-w .d4sym { position: absolute; left: 30%; top: 36%; width: 40%; aspect-ratio: 1; background: url(../asset/game/card-symbols.webp) 100% 0 / 500% 100% no-repeat; }
.pc.back { background: url(../asset/game/card-back.webp) center / 100% 100% no-repeat; }

/* ---------- 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; left: -15px; top: -15px; width: 78px; height: 78px; background: url(../asset/game/turn-ring.webp) 0 0 / 1200% 100% no-repeat;
  animation: ring 1s steps(12, jump-none) infinite; pointer-events: none; display: none; }
.opp.turn .ring { display: block; }
@keyframes ring { to { background-position-x: 100%; } }
.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: 11px; height: 16px; border-radius: 2px; background: url(../asset/game/card-back.webp) center / 100% 100%; }
.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); } }

.table-wrap { position: relative; width: 100%; display: flex; justify-content: center; }
.table { position: relative; width: min(100%, 360px, 44dvh); aspect-ratio: 1; background: url(../asset/game/table.webp) center / 100% 100% no-repeat; }
.table-medal { position: absolute; left: 44.5%; top: 4%; width: 11%; aspect-ratio: 1; border-radius: 50%; object-fit: contain; background: #fff; padding: 1.2%; }
.table-medal:not([src]) { visibility: hidden; }
.dir-ring { position: absolute; left: 17%; top: 17%; width: 66%; aspect-ratio: 1; background: url(../asset/game/direction-ring.webp) center / 100% 100% no-repeat;
  animation: spin 14s linear infinite; opacity: .85; pointer-events: none; }
.dir-ring.ccw { animation-direction: reverse; transform: scaleX(-1); }
@keyframes spin { to { rotate: 360deg; } }
.deck { position: absolute; left: 27%; top: 36%; width: 20.4%; aspect-ratio: 340 / 500; border: 0; padding: 0;
  background: url(../asset/game/deck-stack.webp) center / 100% 100% no-repeat; transition: transform .15s; }
.deck:active { transform: scale(.94); }
.deck.can { animation: deckPulse 1.2s ease-in-out infinite; }
@keyframes deckPulse { 50% { filter: drop-shadow(0 0 10px #fde047) brightness(1.08); } }
.deck-medal { position: absolute; left: 24.5%; top: 31.6%; width: 44%; aspect-ratio: 1; border-radius: 50%; object-fit: contain; background: #fff; padding: 6%; }
.deck-medal:not([src]) { visibility: hidden; }
.deck-n { position: absolute; left: 50%; bottom: -16px; transform: translateX(-50%); font-size: 12px; font-weight: 800; color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.6); white-space: nowrap; }
.pile { position: absolute; left: 53%; top: 34%; width: 22%; aspect-ratio: 2 / 3; }
.pile .pc { position: absolute; left: 0; top: 0; width: 100%; }
.pile .pc.fly { transition: transform .35s cubic-bezier(.2,.8,.3,1); }
.color-chip { position: absolute; left: 50%; top: 77%; transform: translateX(-50%); padding: 2px 10px; border-radius: 999px; color: #fff; font-weight: 800; font-size: 12px;
  border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); white-space: nowrap; }
.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); }

.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; }
.pop-btn { flex: 0 0 auto; width: 74px; height: 74px; border: 0; background: url(../asset/game/btn-pop.webp) 0 0 / 200% 100% no-repeat; transition: transform .1s; }
.pop-btn:active { background-position-x: 100%; transform: scale(.93); }
.pop-btn.dim { filter: grayscale(.85) opacity(.55); }
.pop-btn.hot { animation: popHot .7s ease-in-out infinite; }
@keyframes popHot { 50% { transform: scale(1.12) rotate(-4deg); } }
.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; }
.picker-box { background: #fff; border-radius: 26px; padding: 16px; text-align: center; box-shadow: 0 16px 40px rgba(30,27,75,.3); }
.picker-box p { margin: 0 0 8px; font-weight: 800; font-size: 19px; }
.picker { position: relative; width: min(260px, 72vw); aspect-ratio: 1; background: url(../asset/game/color-picker.webp) center / 100% 100% no-repeat;
  display: grid; grid-template-columns: 1fr 1fr; border-radius: 50%; overflow: hidden; }
.picker button { border: 0; background: transparent; }
.picker button:active { background: rgba(255,255,255,.25); }
.twin-cards { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.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(../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) {
  .table { width: min(100%, 320px, 37dvh); }
}
@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; }
  .table { width: min(100%, 300px, 33dvh); }
  .status { font-size: 15px; min-height: 20px; }
  .hand { height: 98px; }
  .actions .act { max-width: 150px; }
  .pop-btn { width: 62px; height: 62px; }
}

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

/* podium: a finished player keeps their seat in the row with their medal */
.opp.placed .n { color: #b45309; font-size: 13px; }
.opp.placed .av > :first-child { box-shadow: 0 0 0 2.5px #fff, 0 0 0 4.5px #f5b301; border-radius: 50%; }
