* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--bg); color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
/* felt texture over the whole page background (start screen, lobby, around the table) */
body { position: relative; isolation: isolate; }
body::before, body::after { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; mix-blend-mode: soft-light; opacity: var(--page-tex, .55); }
body::before { background: url(/felt.jpg) 0 0 / 520px 520px; }
body::after { background: url(/felt.jpg) 211px 97px / 810px 810px; transform: scaleX(-1); }
:root { --cwb: clamp(44px, min(8.4vw, 11.6vh), 118px); } /* base card width: everything scales from this */

#app {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
button { font: inherit; color: inherit; }
input, select { font: inherit; }
input { -webkit-user-select: text; user-select: text; }

/* ---------- cards ---------- */
.s0 { --c: var(--suit0); } .s1 { --c: var(--suit1); } .s2 { --c: var(--suit2); } .s3 { --c: var(--suit3); }
.p0 { --pc: var(--pc0); } .p1 { --pc: var(--pc1); } .p2 { --pc: var(--pc2); } .p3 { --pc: var(--pc3); }

.sh { width: 1em; height: 1em; display: block; }
.card {
  --cw: var(--cwb);
  width: var(--cw); height: calc(var(--cw) * 1.4); flex: none; position: relative; isolation: isolate; /* keeps a card's numerals from painting over the card above it */
  border-radius: calc(var(--cw) * .11);
  background: var(--card); color: var(--card-ink);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12), 0 2px 6px rgba(0, 0, 0, .4);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; touch-action: none;
}
.card .num { font-size: calc(var(--cw) * .6); line-height: 1; color: var(--c); position: relative; z-index: 1; }
.card .bg { position: absolute; width: 78%; height: auto; aspect-ratio: 1; fill: var(--c); opacity: .15; }
.card .idx {
  position: absolute; left: 9%; top: 5%; display: flex; flex-direction: column; align-items: center;
  font-size: calc(var(--cw) * .2); line-height: 1; color: var(--c); gap: 2px;
}
.card .idx .sh { font-size: calc(var(--cw) * .2); fill: var(--c); }
.card.back {
  background:
    repeating-linear-gradient(45deg, var(--pc) 0 7px, color-mix(in srgb, var(--pc) 72%, #000) 7px 14px);
  box-shadow: inset 0 0 0 calc(var(--cw) * .06) rgba(255, 255, 255, .85), 0 2px 6px rgba(0, 0, 0, .4);
}
.card.mini { --cw: calc(var(--cwb) * .4); }
.card.mini .idx { display: none; }
.card.mini .num { font-size: calc(var(--cw) * .72); }
.card.cen { --cw: calc(var(--cwb) * .94); box-shadow: 0 0 0 3px var(--ring, transparent), 0 3px 8px rgba(0, 0, 0, .45); }
.card.lifted { opacity: .22; }
.card.hint, .card.hintq:hover { box-shadow: 0 0 0 3px var(--accent), 0 0 16px 4px color-mix(in srgb, var(--accent) 70%, transparent); animation: glow 1.4s ease-in-out infinite; }
.card.shake { animation: shake .34s; }
.card.ghost { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; box-shadow: 0 14px 28px rgba(0, 0, 0, .5); }

@keyframes glow { 50% { box-shadow: 0 0 0 3px var(--accent), 0 0 6px 1px color-mix(in srgb, var(--accent) 50%, transparent); } }
@keyframes shake { 20% { transform: translateX(-7px); } 45% { transform: translateX(7px); } 70% { transform: translateX(-4px); } }
@keyframes pop { 0% { transform: scale(1.18) rotate(-3deg); } 100% { transform: none; } }

/* ---------- home / lobby ---------- */
.home, .lobby {
  margin: auto; width: min(560px, 100%); padding: 20px; display: flex; flex-direction: column; gap: 14px;
  max-height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; text-align: center;
}
.logo { display: flex; justify-content: center; gap: 14px; font-size: 38px; }
.logo .sh { fill: var(--c); }
.home h1 { margin: 0; font-size: 44px; letter-spacing: -.02em; }
.tag { margin: -8px 0 4px; opacity: .75; }
.err, .invite { padding: 10px 14px; border-radius: 12px; background: rgba(255, 255, 255, .12); }
.err { background: #7a1f2b; }
.field { display: flex; flex-direction: column; gap: 6px; text-align: left; font-size: 14px; opacity: .95; }
input, select {
  padding: 12px 14px; border-radius: 12px; border: 2px solid rgba(255, 255, 255, .25);
  background: rgba(0, 0, 0, .25); color: var(--ink); font-size: 18px; min-height: 48px; width: 100%;
}
.btn {
  min-height: 48px; padding: 0 18px; border-radius: 14px; border: 2px solid rgba(255, 255, 255, .3);
  background: rgba(255, 255, 255, .1); font-weight: 700; font-size: 17px; cursor: pointer;
}
.btn.primary { background: var(--btn); color: var(--btn-ink); border-color: transparent; }
.btn.big { min-height: 58px; font-size: 21px; }
.btn.small { min-height: 40px; font-size: 15px; padding: 0 12px; }
.btn.on { background: var(--accent); color: var(--btn-ink); }
.btn:disabled { opacity: .4; }
.joinrow { display: flex; gap: 10px; }
.joinrow input { text-transform: uppercase; letter-spacing: .15em; text-align: center; }
details { text-align: left; background: rgba(0, 0, 0, .2); border-radius: 12px; padding: 10px 14px; }
details summary { cursor: pointer; font-weight: 700; }
details ul { margin: 8px 0 2px; padding-left: 20px; line-height: 1.45; font-size: 15px; }
.themes { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.themes .btn { min-height: 38px; font-size: 14px; padding: 0 12px; }

.code { font-size: 54px; font-weight: 900; letter-spacing: .12em; color: var(--accent); }
.lobby h2 { margin: 0; }
.share { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }
#qr { width: 120px; background: #fff; padding: 6px; border-radius: 10px; }
#qr svg { display: block; width: 100%; height: auto; }
.plist { display: flex; flex-direction: column; gap: 8px; }
.prow {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px;
  background: rgba(0, 0, 0, .25); border-left: 8px solid var(--pc); text-align: left;
}
.prow .nm { flex: 1; font-weight: 700; font-size: 18px; }
.prow .tag2 { font-size: 12px; opacity: .8; padding: 2px 8px; border-radius: 99px; background: rgba(255, 255, 255, .15); }
.prow.off { opacity: .45; }
.row2 { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.settings { display: flex; gap: 10px; }
.settings label { flex: 1; text-align: left; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.note { opacity: .75; font-size: 14px; min-height: 20px; }

/* ---------- game ---------- */
.game { flex: 1; display: flex; flex-direction: column; min-height: 0; touch-action: none; }
.bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 6px 10px; min-height: 48px; }
.barlogo { display: flex; gap: 6px; font-size: 20px; justify-self: start; }
.barlogo .sh { fill: var(--c); }
.barright { display: flex; align-items: center; gap: 10px; justify-self: end; }
.icon { width: 44px; height: 44px; border-radius: 12px; border: 0; background: rgba(255, 255, 255, .12); font-size: 22px; flex: none; }
.scores { display: flex; gap: 8px; justify-content: center; min-width: 0; overflow: hidden; }
.chip { display: flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; background: var(--opp); font-weight: 700; white-space: nowrap; }
.chip.me { outline: 2px solid var(--accent); }
.chip b { font-size: 18px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--pc); display: inline-block; margin-right: 6px; }
.chip .dot { margin: 0; }
.meta { font-size: 13px; opacity: .8; white-space: nowrap; }
.reconnect { background: #8a5a00; color: #fff; text-align: center; padding: 4px; font-size: 14px; }

.opps { display: flex; gap: 8px; padding: 2px 10px 6px; }
.opp { flex: 1; min-width: 0; background: var(--opp); border-radius: 14px; padding: 6px 8px 8px; border-top: 4px solid var(--pc); }
.opp.offline { opacity: .5; }
.oh { display: flex; align-items: center; font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.oh .sc { margin-left: auto; font-size: 15px; }
.oh .pl { margin-left: 8px; opacity: .8; font-weight: 600; }
.orow { display: flex; gap: 6px; align-items: flex-end; }
.oposts { display: flex; gap: 4px; flex: 1; justify-content: center; }
.ob { position: relative; }
.ob i { position: absolute; right: -4px; bottom: -4px; font-style: normal; font-size: 11px; font-weight: 800; background: #000a; color: #fff; padding: 0 5px; border-radius: 8px; }
.ph { width: calc(var(--cwb) * .4); height: calc(var(--cwb) * .56); border-radius: 5px; border: 1px dashed rgba(255, 255, 255, .25); }
.ostock { font-size: 12px; opacity: .8; align-self: center; min-width: 28px; text-align: center; }

.felt {
  flex: 1; min-height: 0; margin: 2px 10px 6px; border-radius: 24px; background: var(--felt);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, .4);
  display: grid; grid-template-columns: repeat(var(--cols, 9), calc(var(--cwb) * .94));
  grid-auto-rows: calc(var(--cwb) * .94 * 1.4); gap: 14px; align-content: center; justify-content: center; padding: 12px; overflow: hidden;
}
.felt { position: relative; isolation: isolate; }
/* felt texture: a seamless grey weave blended over whatever colour the theme sets */
.felt::before, .felt::after { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  mix-blend-mode: soft-light; opacity: var(--felt-tex, .5); }
.felt::before { background: url(/felt.jpg) 0 0 / 520px 520px; }
.felt::after { background: url(/felt.jpg) 211px 97px / 810px 810px; transform: scaleX(-1); }   /* second, mirrored and larger so the tile never visibly repeats */
.felt.over, .post.over { outline: 3px dashed var(--accent); outline-offset: -3px; }
.felt .empty-hint { grid-column: 1 / -1; place-self: center; opacity: .55; font-size: 17px; text-align: center; }
.pile { position: relative; width: calc(var(--cwb) * .94); height: calc(var(--cwb) * .94 * 1.4); border-radius: calc(var(--cwb) * .11); }
.pile.over { outline: 3px solid var(--accent); outline-offset: 3px; }
.pile.pop .card { animation: pop .3s; }
.pile .cnt { position: absolute; right: -6px; bottom: -6px; font-size: 12px; font-weight: 800; background: #000b; color: #fff; padding: 1px 7px; border-radius: 10px; }

.me { padding: 4px 10px 8px; }
.board { display: flex; gap: calc(var(--cwb) * .12); justify-content: center; align-items: flex-start; }
.sep { width: calc(var(--cwb) * .18); flex: none; }
.slot { position: relative; width: var(--cwb); height: calc(var(--cwb) * 1.4); flex: none; border-radius: calc(var(--cwb) * .11); }
.slot.empty { border: 2px dashed rgba(255, 255, 255, .22); }
.slot.empty .empty-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: calc(var(--cwb) * .15); text-align: center; opacity: .7; }
.slot .count { position: absolute; right: -5px; bottom: -6px; font-size: 13px; font-weight: 800; background: #000b; color: #fff; padding: 1px 8px; border-radius: 10px; z-index: 2; pointer-events: none; }
.slot.recycle { border: 2px solid rgba(255, 255, 255, .45); display: flex; align-items: center; justify-content: center; font-size: calc(var(--cwb) * .5); cursor: pointer; }
.slot.stock { cursor: pointer; }
.stackfx { width: var(--cwb); border-radius: calc(var(--cwb) * .11); box-shadow: calc(var(--d) * 1px) calc(var(--d) * 1.6px) 0 rgba(0, 0, 0, .5); }
.post { position: relative; width: var(--cwb); height: calc(var(--cwb) * 1.4 * 1.75); border-radius: calc(var(--cwb) * .11); border: 2px dashed rgba(255, 255, 255, .18); }
.post .card { position: absolute; left: -2px; top: calc(var(--k) * var(--off) - 2px); }
.tools { display: flex; justify-content: center; gap: 10px; margin-top: 4px; }

/* ---------- overlays ---------- */
.cd { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 30vmin; font-weight: 900; color: #fff; text-shadow: 0 6px 30px rgba(0, 0, 0, .6); pointer-events: none; z-index: 40; }
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.panel { background: var(--panel); color: var(--panel-ink); border-radius: 22px; padding: 22px 26px; width: min(560px, 100%); max-height: 90vh; overflow: auto; display: flex; flex-direction: column; gap: 14px; text-align: center; }
.panel h2 { margin: 0; font-size: 26px; }
.panel .btn { border-color: rgba(0, 0, 0, .2); background: rgba(0, 0, 0, .06); }
.panel .btn.primary { background: var(--btn); }
.panel .btn.on { background: var(--panel-ink); color: var(--panel); }
.panel table { width: 100%; border-collapse: collapse; font-size: 17px; }
.panel th { font-size: 12px; opacity: .6; text-align: right; padding: 4px 6px; font-weight: 700; }
.panel th:first-child, .panel td:first-child { text-align: left; }
.panel td { padding: 8px 6px; text-align: right; border-top: 1px solid rgba(0, 0, 0, .1); }
.panel tr.me td:first-child { font-weight: 800; }
.pos { color: #137a3c; font-weight: 700; } .neg { color: #b3261e; font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); background: #000d; color: #fff; padding: 10px 18px; border-radius: 99px; z-index: 200; font-size: 15px; }

@media (max-height: 560px) {
  .opps { padding-bottom: 2px; }
  .felt { margin-bottom: 2px; }
}

/* finished piles: stay in place (so nothing shifts), stamp, fade to a faint check, stop being drop targets */
.pile .chk { position: absolute; left: 50%; top: 50%; width: 46%; transform: translate(-50%, -50%); color: #fff; opacity: 0; pointer-events: none; z-index: 3; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .4)); }
.pile.finishing, .pile.done { outline: 2px dashed rgba(255, 255, 255, .18); outline-offset: -2px; pointer-events: none; }
.pile.done .card { visibility: hidden; }
.pile.done .cnt { display: none; }
.pile.done .chk { opacity: .32; }
.pile.finishing .card { animation: fin-card 1s ease-out var(--ad, 0ms) forwards; }
.pile.finishing .cnt { animation: fin-fade 1s linear var(--ad, 0ms) forwards; }
.pile.finishing .chk { animation: fin-chk 1s ease-out var(--ad, 0ms) forwards; }
@keyframes fin-card { 0% { transform: scale(1.12); opacity: 1; } 14% { transform: scale(.97); } 24%, 50% { transform: scale(1); opacity: 1; } 100% { transform: scale(.88); opacity: 0; } }
@keyframes fin-fade { 0%, 50% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fin-chk { 0%, 30% { opacity: 0; transform: translate(-50%, -50%) scale(.6); } 58% { opacity: .95; transform: translate(-50%, -50%) scale(1.08); } 100% { opacity: .32; transform: translate(-50%, -50%) scale(1); } }
.fx-ring { position: fixed; z-index: 90; width: calc(var(--cwb) * .9); height: calc(var(--cwb) * .9); margin: calc(var(--cwb) * -.45) 0 0 calc(var(--cwb) * -.45); border-radius: 50%; border: 3px solid var(--c); pointer-events: none; animation: fx-ring .6s ease-out forwards; }
@keyframes fx-ring { from { transform: scale(.5); opacity: .85; } to { transform: scale(2.2); opacity: 0; } }
.fx-p { position: fixed; z-index: 91; border-radius: 50%; background: var(--c); pointer-events: none; animation: fx-p var(--t, 700ms) cubic-bezier(.1, .7, .3, 1) forwards; }
.fx-p.gold { background: var(--accent); }
@keyframes fx-p { from { transform: translate(-50%, -50%) scale(1); opacity: 1; } to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pile.finishing .card, .pile.finishing .cnt, .pile.finishing .chk { animation-duration: 1ms; } }

/* ---------- end of round ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } }
.modal.end { background: rgba(4, 12, 9, .62); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fadeIn .25s both; }
.panel.endp { padding: 0; gap: 0; width: min(640px, 100%); border-radius: 28px; overflow: auto; text-align: left; box-shadow: 0 30px 80px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .08); animation: endIn .55s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes endIn { from { transform: translateY(30px) scale(.9); opacity: 0; } }
.end-hero { position: relative; overflow: hidden; padding: 26px 24px 20px; text-align: center; color: #fff; flex: none;
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--pc) 65%, #fff) 0%, var(--pc) 48%, color-mix(in srgb, var(--pc) 58%, #000) 100%); }
.end-hero > * { position: relative; }
.rays { position: absolute !important; left: 50%; top: 50px; width: 560px; height: 560px; margin: -280px 0 0 -280px;
  background: repeating-conic-gradient(rgba(255, 255, 255, .17) 0 8deg, transparent 8deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 0, transparent 66%); mask: radial-gradient(circle, #000 0, transparent 66%); animation: spin 26s linear infinite; pointer-events: none; }
.medal-wrap { width: 82px; height: 82px; margin: 0 auto 8px; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .35)); animation: medalIn .8s cubic-bezier(.2, 1.6, .4, 1) .15s both; }
.medal-wrap svg { width: 100%; height: 100%; }
@keyframes medalIn { from { transform: scale(0) rotate(-45deg); } }
.kicker { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; font-weight: 800; opacity: .85; }
.end-hero h2 { margin: 4px 0; font-size: clamp(24px, 5vw, 34px); letter-spacing: -.01em; text-shadow: 0 2px 10px rgba(0, 0, 0, .3); animation: headIn .5s ease-out .3s both; }
@keyframes headIn { from { transform: translateY(12px); opacity: 0; } }
.end-hero .sub { font-size: 16px; opacity: .96; }
.end-hero .sub b { padding: 1px 9px; border-radius: 99px; background: rgba(255, 255, 255, .24); }
.end-body { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.rrow { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 16px; background: rgba(0, 0, 0, .05); border: 2px solid transparent; animation: rowIn .45s ease-out calc(.4s + var(--i) * .09s) both; }
.rrow.me { background: color-mix(in srgb, var(--pc) 12%, transparent); border-color: color-mix(in srgb, var(--pc) 45%, transparent); }
@keyframes rowIn { from { transform: translateX(-18px); opacity: 0; } }
.rank { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; background: rgba(0, 0, 0, .1); }
.rrow.win .rank { background: linear-gradient(135deg, #ffe27a, #f0a500); color: #3a2800; }
.rtop { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rname { font-weight: 800; font-size: 18px; }
.rname em { font-style: normal; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 99px; background: var(--pc); color: #fff; margin-left: 7px; vertical-align: 2px; }
.rstats { font-size: 13px; opacity: .65; white-space: nowrap; }
.meter { margin-top: 7px; height: 10px; border-radius: 99px; background: rgba(0, 0, 0, .1); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 99px; background: var(--pc); transition: width 1s cubic-bezier(.2, .8, .2, 1) .7s; }
.rscore { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; min-width: 64px; }
.rscore b { font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; }
.delta { font-size: 14px; font-weight: 800; padding: 1px 9px; border-radius: 99px; animation: pop2 .45s cubic-bezier(.2, 1.7, .4, 1) calc(.8s + var(--i) * .09s) both; }
.delta.pos { background: #d8f3e1; color: #0d6b32; }
.delta.neg { background: #fbdcd9; color: #a8221a; }
@keyframes pop2 { from { transform: scale(0); } }
.readies { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.rchip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 99px; background: rgba(0, 0, 0, .07); font-size: 14px; font-weight: 700; }
.rchip.on { background: color-mix(in srgb, var(--pc) 24%, transparent); }
.endfoot { display: flex; flex-direction: column; gap: 8px; }
.panel.endp .note { text-align: center; }
.end-anim.static .panel.endp, .end-anim.static .medal-wrap, .end-anim.static h2, .end-anim.static .rrow, .end-anim.static .delta, .end-anim.static .meter i,
.end-anim.static .trophy-wrap, .end-anim.static .champ, .end-anim.static .pbar, .end-anim.static .champ-sub, .end-anim.static .podium, .end-anim.static .finalbtns { animation: none !important; transition: none !important; }

/* ---------- game won ---------- */
.modal.final { background: radial-gradient(ellipse at 50% 34%, color-mix(in srgb, var(--pc) 44%, #000) 0%, rgba(0, 0, 0, .92) 74%); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); animation: fadeIn .6s both; }
.final-card { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; color: #fff; width: min(760px, 100%); max-height: 100%; overflow: auto; padding: 8px; }
.trophy-wrap { position: relative; width: clamp(110px, 21vh, 190px); aspect-ratio: 1; flex: none; filter: drop-shadow(0 0 36px color-mix(in srgb, var(--pc) 75%, #ffd24a)); animation: trophyIn 1s cubic-bezier(.2, 1.5, .35, 1) .1s both; }
@keyframes trophyIn { from { transform: translateY(60px) scale(.2) rotate(-20deg); opacity: 0; } }
.trophy-wrap svg { position: relative; width: 100%; height: 100%; animation: bob 3.2s ease-in-out 1.2s infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(1.5deg); } }
.rays.big { top: 50%; width: 330%; height: 330%; margin: -165% 0 0 -165%; animation-duration: 34s; }
.modal.final .kicker { margin-top: 6px; color: #ffe9a0; opacity: 1; }
.champ { margin: 2px 0 0; font-size: clamp(42px, 10vw, 92px); font-weight: 900; line-height: 1.02; letter-spacing: -.02em; padding: 0 8px;
  background: linear-gradient(180deg, #fff 0%, #ffeaa3 55%, #ffc83d 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 22px rgba(0, 0, 0, .55)); animation: champIn .8s cubic-bezier(.2, 1.5, .35, 1) .55s both; }
@keyframes champIn { from { transform: scale(.3); opacity: 0; } }
.champ-sub { font-size: 18px; opacity: .9; animation: headIn .5s ease-out 1s both; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 12px; margin-top: 14px; min-height: 170px; animation: headIn .4s ease-out .9s both; }
.pcol { width: clamp(72px, 17vw, 124px); display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.pname { font-weight: 800; font-size: 15px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pname em { font-style: normal; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 99px; background: var(--pc); margin-left: 4px; vertical-align: 2px; }
.pbar { width: 100%; height: var(--h); border-radius: 14px 14px 4px 4px; display: grid; place-items: start center; padding-top: 8px; font-size: 26px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--pc) 80%, #fff), var(--pc)); box-shadow: 0 10px 30px rgba(0, 0, 0, .4); animation: grow 1s cubic-bezier(.2, .9, .2, 1) calc(1.1s + var(--i) * .12s) both; }
.pcol.champ .pbar { background: linear-gradient(180deg, #ffe9a0, #ffc83d 60%, #e09a00); color: #3a2800; box-shadow: 0 0 40px rgba(255, 200, 60, .6), 0 10px 30px rgba(0, 0, 0, .4); }
@keyframes grow { from { height: 0; } }
.finalbtns { margin-top: 18px; animation: headIn .5s ease-out 1.7s both; }
.modal.final .btn { color: #fff; border-color: rgba(255, 255, 255, .4); background: rgba(255, 255, 255, .12); }
.modal.final .btn.primary { background: var(--btn); color: var(--btn-ink); border-color: transparent; }
@media (max-height: 640px) { .podium { min-height: 120px; } .trophy-wrap { width: 90px; } }

.solo { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.15); }
.solo select { text-align: center; }

/* Stuck? button: quiet while you still have a move, loud when you truly don't */
.stuckbtn { transition: opacity .25s, box-shadow .25s; }
.stuckbtn.calm { opacity: .34; }
.stuckbtn.maybe { opacity: .62; }
.stuckbtn.stuck { opacity: 1; box-shadow: 0 0 0 2px var(--accent, #f5c542), 0 0 14px var(--accent, #f5c542); animation: stuckpulse 1.6s ease-in-out infinite; }
.stuckbtn:hover, .stuckbtn:active, .stuckbtn.on { opacity: 1; }
@keyframes stuckpulse { 50% { box-shadow: 0 0 0 2px var(--accent, #f5c542), 0 0 4px var(--accent, #f5c542); } }
.card.whoosh { animation: swoosh .5s ease-out; }
@keyframes swoosh { 0% { transform: translateX(-60px) rotate(-6deg); opacity: 0; filter: blur(4px); } 100% { transform: none; opacity: 1; filter: none; } }
@media (prefers-reduced-motion: reduce) { .stuckbtn.stuck, .card.whoosh { animation: none; } }

.afkt { font-size: 12px; font-weight: 700; color: #ffb74d; margin-left: 6px; }
.rejoin { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
@media (max-width: 600px) { .barlogo { display: none; } .meta { display: none; } .bar { grid-template-columns: 1fr auto; } .barright { grid-column: 2; grid-row: 1; } .scores { grid-column: 1; grid-row: 1; justify-content: flex-start; } }

/* ---------- motion ---------- */
.card.ghost.lift { animation: lift .14s ease-out; }
@keyframes lift { from { filter: brightness(1); } 50% { filter: brightness(1.08); } }
.card.ghost.oppg { transition: transform .09s linear, opacity .12s; opacity: .92; outline: 3px solid var(--ring, #fff); outline-offset: -1px; transform-origin: 0 0; }
.card.ghost.fadeout { opacity: 0; transition: opacity .2s ease-out; }
.opp .pl.bump { display: inline-block; animation: plbump .35s ease-out; }
@keyframes plbump { 40% { transform: scale(1.5); color: var(--accent); } }
@media (prefers-reduced-motion: reduce) { .card.ghost.lift, .opp .pl.bump { animation: none; } }
