/* MultiplayerHub: Crazy Eights. One stylesheet for the site pages and the game. */
:root {
  --bg: #f6f5fb; --ink: #17142b; --muted: #5f5a78; --card: #ffffff; --line: #e5e2ef;
  --brand: #5b3df5; --brand-2: #7a5cff; --gold: #ffd34d; --link: #5b3df5;
  --r: #ff4d5e; --y: #ffbf1f; --g: #22c07a; --b: #3d8bff;
  --felt-1: #2a1f66; --felt-2: #110c2e;
  --cw: clamp(58px, 15.5vw, 96px);
  --font: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.big-cards { --cw: clamp(70px, 19vw, 118px); }
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f0d1f; --ink: #ece9fb; --muted: #a8a3c4; --card: #1a1731; --line: #2d2950; --link: #b7a8ff; }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); }
a { color: var(--link); }
@media (prefers-color-scheme: dark) { a { color: #a996ff; } }
img, svg { max-width: 100%; }
button { font: inherit; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- buttons ---------- */
.btn {
  appearance: none; border: 0; border-radius: 12px; padding: 11px 18px; font-weight: 800; font-size: 15px;
  background: #fff; color: #17142b; box-shadow: 0 2px 0 rgba(0,0,0,.18); cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; line-height: 1.2; transition: transform .1s, filter .15s;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, var(--brand-2), var(--brand)); color: #fff; }
.btn.big { padding: 15px 26px; font-size: 17px; border-radius: 14px; }
.btn.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.btn.warn { background: var(--y); color: #2b2100; }
.btn.wa { background: #25d366; color: #052e16; }
.btn.last { background: var(--r); color: #fff; }
.btn.last.armed { background: var(--g); }
.btn.urgent, .catch { animation: pulse .7s infinite alternate; }
.btn.round { width: 44px; height: 44px; padding: 0; border-radius: 50%; font-size: 20px; }
.link { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; padding: 0; }
.chip { border: 0; border-radius: 99px; padding: 6px 12px; font-weight: 700; font-size: 13px; background: rgba(255,255,255,.14); color: inherit; cursor: pointer; }
.chip:hover { background: rgba(255,255,255,.24); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- cards ---------- */
.card {
  --w: var(--cw);
  width: var(--w); height: calc(var(--w) * 1.48); border-radius: calc(var(--w) * .14);
  position: relative; flex: none; overflow: hidden; color: #fff; user-select: none; -webkit-user-select: none;
  background: var(--cc, #444);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.55), 0 2px 0 rgba(0,0,0,.2), 0 6px 14px rgba(0,0,0,.28);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.c-r { --cc: linear-gradient(150deg, #ff8a94, #ff4d5e 55%, #d92c43); }
.c-y { --cc: linear-gradient(150deg, #ffd66a, #ffbf1f 55%, #e89b00); color: #3a2600; }
.c-g { --cc: linear-gradient(150deg, #5fe0a3, #22c07a 55%, #11955c); }
.c-b { --cc: linear-gradient(150deg, #79adff, #3d8bff 55%, #1f63d6); }
.c-w { --cc: linear-gradient(150deg, #4a4270, #231e3d 60%, #15122a); }
.card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(160deg, rgba(255,255,255,.38) 0%, rgba(255,255,255,0) 38%), linear-gradient(0deg, rgba(0,0,0,.12), transparent 30%); }
.card.back::after { background: linear-gradient(160deg, rgba(255,255,255,.22) 0%, transparent 40%); }
.card .pat { position: absolute; right: -18%; bottom: -14%; font-size: calc(var(--w) * 1.25); line-height: 1; opacity: .14; pointer-events: none; }
.card .mid { position: absolute; inset: 0; display: grid; place-items: center; }
.card .mid b { font-size: calc(var(--w) * .62); font-weight: 900; letter-spacing: -.04em; text-shadow: 0 calc(var(--w) * .035) 0 rgba(0,0,0,.22); line-height: 1; }
.c-y .mid b { text-shadow: 0 calc(var(--w) * .035) 0 rgba(255,255,255,.35); }
.card.ul .mid b { text-decoration: underline; text-underline-offset: .08em; text-decoration-thickness: .06em; }
.card .mid svg { width: calc(var(--w) * .62); height: calc(var(--w) * .62); filter: drop-shadow(0 2px 0 rgba(0,0,0,.2)); }
.card .ix { position: absolute; font-weight: 900; font-size: calc(var(--w) * .2); line-height: 1; text-align: center; }
.card .ix i { display: block; font-style: normal; font-size: .7em; margin-top: 2px; opacity: .9; }
.card .ix svg { width: calc(var(--w) * .2); height: calc(var(--w) * .2); }
.card .tl { top: 7%; left: 9%; }
.card .br { bottom: 7%; right: 9%; transform: rotate(180deg); }
.wheel { width: calc(var(--w) * .66); aspect-ratio: 1; border-radius: 28%; transform: rotate(45deg); display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; box-shadow: 0 0 0 calc(var(--w) * .035) rgba(255,255,255,.9); }
.wheel i:nth-child(1) { background: var(--r); } .wheel i:nth-child(2) { background: var(--y); }
.wheel i:nth-child(3) { background: var(--b); } .wheel i:nth-child(4) { background: var(--g); }
.card .mid b.w4 { position: absolute; font-size: calc(var(--w) * .34); background: #17142b; padding: .06em .22em; border-radius: .3em; box-shadow: 0 0 0 2px #fff; }
.card[data-chosen="r"] { box-shadow: inset 0 0 0 4px var(--r), 0 6px 14px rgba(0,0,0,.28); }
.card[data-chosen="y"] { box-shadow: inset 0 0 0 4px var(--y), 0 6px 14px rgba(0,0,0,.28); }
.card[data-chosen="g"] { box-shadow: inset 0 0 0 4px var(--g), 0 6px 14px rgba(0,0,0,.28); }
.card[data-chosen="b"] { box-shadow: inset 0 0 0 4px var(--b), 0 6px 14px rgba(0,0,0,.28); }
.card.back { background: repeating-linear-gradient(45deg, #2f2578 0 7px, #382d8a 7px 14px); display: grid; place-items: center; }
.card.back .logo { font-weight: 900; color: #fff; background: linear-gradient(135deg, var(--r), var(--y) 35%, var(--g) 65%, var(--b)); border-radius: 22%; width: 58%; aspect-ratio: 1; display: grid; place-content: center; text-align: center; font-size: calc(var(--w) * .26); line-height: .9; box-shadow: 0 0 0 3px #fff; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.card.back .logo small { display: block; font-size: .42em; letter-spacing: .08em; }
.card.xs { --w: 28px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.5); }
.card.xs .ix, .card.xs .pat { display: none; }
.ghost-card { position: fixed; z-index: 40; pointer-events: none; }
.ghost-card .card { --w: 40px; }

/* ---------- game shell ---------- */
body.game {
  min-height: 100dvh; color: #f3f1ff; overflow-x: hidden;
  background: radial-gradient(120% 90% at 50% 35%, #3a2b8f 0%, var(--felt-1) 40%, var(--felt-2) 100%) fixed;
}
.g-top { height: 52px; display: flex; align-items: center; gap: 8px; padding: 0 10px; max-width: 1100px; margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; font-weight: 900; letter-spacing: -.01em; }
.brand svg { width: 30px; height: 30px; }
.g-top .spacer { flex: 1; }
@media (max-width: 440px) { .brand-name { display: none; } }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.1); color: #fff; display: grid; place-items: center; cursor: pointer; font-size: 18px; }
.icon-btn:hover { background: rgba(255,255,255,.2); }
.code-btn { border: 0; background: rgba(255,255,255,.12); color: #fff; border-radius: 99px; padding: 8px 12px; font-weight: 700; cursor: pointer; font-size: 14px; }
.code-btn b { letter-spacing: .12em; }
#banner { position: fixed; top: 58px; left: 50%; transform: translateX(-50%); background: var(--y); color: #2b2100; font-weight: 800; padding: 8px 16px; border-radius: 99px; z-index: 80; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.center-msg { min-height: 70dvh; display: grid; place-content: center; text-align: center; gap: 10px; padding: 24px; }
.center-msg h1 { margin: 0; font-size: clamp(26px, 5vw, 40px); }
.center-msg p { margin: 0 auto; max-width: 420px; color: #cfc9f3; }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.spinner { width: 46px; height: 46px; margin: 0 auto 6px; border-radius: 50%; border: 5px solid rgba(255,255,255,.15); border-top-color: var(--gold); animation: spin .8s linear infinite; }

/* ---------- lobby ---------- */
.lobby { max-width: 1000px; margin: 0 auto; padding: 8px 16px 32px; display: grid; gap: 14px; }
@media (min-width: 860px) { .lobby { grid-template-columns: 1fr 1fr; } .lobby .invite, .lobby .startbar { grid-column: 1 / -1; } }
.panel { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 18px; padding: 18px; }
.panel h1 { margin: 0 0 4px; font-size: 24px; }
.panel h2 { margin: 0 0 10px; font-size: 18px; display: flex; gap: 8px; align-items: baseline; }
.panel p { margin: 0 0 12px; color: #d4cff5; }
.panel .muted { color: #b2acd8; font-weight: 600; font-size: 14px; }
.linkbox { display: flex; gap: 8px; }
.linkbox input { flex: 1; min-width: 0; border-radius: 10px; border: 0; padding: 11px 12px; font-size: 15px; background: #fff; color: #17142b; font-family: inherit; }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.plist { list-style: none; padding: 0; margin: 0 0 10px; }
.plist li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.plist li.ghost { opacity: .5; }
.plist .av, .av.sm { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,.7); }
.plist .av.empty { background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); color: #c9c3ee; font-size: 18px; }
.av.sm { width: 28px; height: 28px; display: inline-grid; vertical-align: middle; margin-right: 6px; box-shadow: 0 0 0 1.5px #fff; }
.plist .pn { font-weight: 700; }
.plist em { font-style: normal; color: #b2acd8; font-weight: 600; }
.plist .tags { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.plist .x { border: 0; background: rgba(255,255,255,.1); color: #fff; border-radius: 50%; width: 30px; height: 30px; cursor: pointer; }
.tag { font-size: 11px; font-weight: 800; padding: 3px 7px; border-radius: 99px; background: rgba(255,255,255,.14); white-space: nowrap; }
.tag.host { background: rgba(255,211,77,.22); color: #ffe28a; }
.tag.bot { background: rgba(122,92,255,.35); color: #e3dcff; }
.tag.off { background: rgba(255,255,255,.1); color: #c7c2e6; }
.tag.last { background: var(--r); color: #fff; }
.addbot { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-weight: 700; font-size: 14px; }
.addbot span { margin-right: 4px; color: #d4cff5; }
.presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.preset { text-align: left; padding: 10px; border-radius: 12px; background: rgba(255,255,255,.06); border: 2px solid transparent; color: inherit; cursor: pointer; }
.preset:disabled { cursor: default; }
.preset b { display: block; font-size: 14px; }
.preset small { display: block; font-size: 11.5px; opacity: .75; margin-top: 2px; }
.preset.on { border-color: var(--gold); background: rgba(255,211,77,.12); }
.preset.custom { grid-column: 1 / -1; }
.rule { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.08); gap: 12px; font-weight: 600; }
.rule:last-child { border-bottom: 0; }
.rule select { border-radius: 10px; border: 0; padding: 8px 10px; font: inherit; font-size: 14px; background: #fff; color: #17142b; }
.rule select:disabled { opacity: .85; background: rgba(255,255,255,.15); color: #fff; }
.help { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: rgba(255,255,255,.18); color: #fff; font-size: 11px; text-decoration: none; margin-left: 4px; vertical-align: 1px; }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: rgba(127,120,170,.45); transition: background .15s; }
.switch span::after { content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + span { background: var(--g); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:disabled { cursor: default; }
.switch input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.startbar { text-align: center; padding: 4px 0 12px; }
.startbar .btn.primary:not(:disabled) { padding: 17px 40px; font-size: 19px; animation: glow 1.6s infinite; }
.codetiles { display: inline-flex; gap: 5px; margin: 2px 0 12px; }
.codetiles span { width: 38px; height: 46px; border-radius: 10px; background: #fff; color: #241a6b; font-weight: 900; font-size: 24px; display: grid; place-items: center; box-shadow: 0 3px 0 #b9b0ec; }
.hint { color: #cfc9f3; font-size: 14px; }
.waiting { color: #e3dfff; font-size: 16px; }
.dots { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); margin-right: 6px; animation: pulse .8s infinite alternate; }

/* ---------- table ---------- */
.avatar { width: 100%; height: 100%; display: block; border-radius: 50%; }
.table { display: grid; grid-template-rows: 1fr auto auto; height: calc(100dvh - 52px); max-width: 1100px; margin: 0 auto; }
.stage { position: relative; min-height: 0; margin: 0 8px; }
.felt {
  position: absolute; left: 50%; top: 56%; transform: translate(-50%, -50%);
  width: min(94%, 680px); height: min(74%, 420px); border-radius: 50%;
  max-height: calc(min(94vw, 680px) * 1.02);
  background:
    radial-gradient(ellipse at 50% 40%, rgba(255,255,255,.10), transparent 60%),
    repeating-radial-gradient(circle at 30% 30%, rgba(255,255,255,.018) 0 2px, transparent 2px 5px),
    radial-gradient(ellipse at 50% 50%, #3b2c95 0%, #2a1f72 55%, #1c1452 100%);
  box-shadow: 0 0 0 7px #4b37b8, 0 0 0 9px #7a62ff, 0 0 0 12px #2a1f72, 0 22px 50px rgba(0,0,0,.5), inset 0 0 60px rgba(0,0,0,.45);
  transition: box-shadow .4s;
}
.felt::after { content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; transition: background .4s;
  background: radial-gradient(ellipse at 50% 55%, var(--glow, transparent) 0%, transparent 55%); }
.felt.col-r { --glow: rgba(255,77,94,.28); } .felt.col-y { --glow: rgba(255,191,31,.24); }
.felt.col-g { --glow: rgba(34,192,122,.26); } .felt.col-b { --glow: rgba(61,139,255,.3); }
.dirring { position: absolute; inset: 7%; width: 86%; height: 86%; overflow: visible; pointer-events: none; }
.dirring ellipse { fill: none; stroke: rgba(255,255,255,.22); stroke-width: 1.4; stroke-dasharray: 2 7; stroke-linecap: round; vector-effect: non-scaling-stroke; animation: dirflow 1.6s linear infinite; }
.felt.ccw .dirring ellipse { animation-direction: reverse; }
.dirlabel { position: absolute; right: 9%; top: 12%; font-size: 22px; opacity: .45; font-weight: 700; }
.piles { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: clamp(18px, 7vw, 54px); }
.pile { position: relative; display: grid; justify-items: center; gap: 6px; }
.pile .card { --w: calc(var(--cw) * 1.08); }
.drawpile { border: 0; background: none; padding: 0; color: inherit; cursor: default; display: grid; }
.drawpile .card { grid-area: 1 / 1; }
.drawpile .depth { transform: translate(calc(var(--d) * 2px), calc(var(--d) * 2.5px)); filter: brightness(.75); }
.drawpile .pc { grid-area: 2 / 1; font-size: 11px; font-weight: 800; opacity: .7; margin-top: 6px; }
.drawpile.can { cursor: pointer; }
.drawpile.can .topback { animation: bob 1.4s ease-in-out infinite; box-shadow: 0 0 0 3px var(--gold), 0 0 26px rgba(255,211,77,.65); }
.discard { display: grid; }
.discard .card { grid-area: 1 / 1; }
.discard .under { transform: rotate(var(--tilt)); filter: brightness(.8) saturate(.9); }
.discard .topcard { transform: rotate(-3deg); box-shadow: inset 0 0 0 2px rgba(255,255,255,.6), 0 10px 24px rgba(0,0,0,.45); }
.discard .colortag { grid-area: 2 / 1; margin-top: 6px; }
.colortag { font-size: 12px; font-weight: 900; padding: 3px 10px; border-radius: 99px; color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.colortag.col-r { background: var(--r); } .colortag.col-y { background: var(--y); color: #3a2600; }
.colortag.col-g { background: var(--g); } .colortag.col-b { background: var(--b); }
.pending { position: absolute; left: 50%; top: 4%; transform: translateX(-50%); background: linear-gradient(180deg, #ff6b7a, #e5304a); color: #fff; font-weight: 900; font-size: 24px; padding: 4px 14px 6px; border-radius: 14px; box-shadow: 0 6px 16px rgba(0,0,0,.4); animation: pop .3s; text-align: center; line-height: 1; z-index: 3; }
.pending small { display: block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; opacity: .85; margin-bottom: 2px; }

/* opponents around the table */
.opp { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; width: 88px; z-index: 2; }
.opp .av { width: 54px; height: 54px; border-radius: 50%; position: relative; box-shadow: 0 0 0 3px rgba(255,255,255,.85), 0 6px 14px rgba(0,0,0,.4); transition: box-shadow .2s, transform .2s; }
.opp.turn .av { transform: scale(1.1); box-shadow: 0 0 0 3px var(--gold), 0 0 0 7px rgba(255,211,77,.25), 0 0 26px rgba(255,211,77,.6); }
.opp .cnt { position: absolute; right: -9px; bottom: -5px; min-width: 25px; height: 25px; padding: 0 6px; border-radius: 13px; background: #fff; color: #17142b; font-size: 13px; font-weight: 900; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.opp.one .cnt { background: var(--r); color: #fff; animation: pulse .6s infinite alternate; }
.opp .nm { font-weight: 800; font-size: 13px; margin-top: 6px; max-width: 88px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.opp .tags { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; margin-top: 2px; }
.opp .tag { font-size: 10px; padding: 2px 6px; }
.opp.away { opacity: .62; }
.minihand { position: absolute; top: 2px; left: calc(50% - 30px); height: 22px; width: 0; pointer-events: none; z-index: -1; }
.minihand i { position: absolute; left: -7px; top: 0; width: 14px; height: 20px; border-radius: 3px; background: linear-gradient(135deg, var(--r), var(--y) 40%, var(--g) 70%, var(--b)); box-shadow: 0 0 0 1px rgba(255,255,255,.9), 0 2px 4px rgba(0,0,0,.35); transform-origin: 50% 150%; transform: rotate(calc(-30deg + var(--k) * 9deg)); }
.catch { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--r); color: #fff; border: 0; border-radius: 99px; padding: 6px 12px; font-weight: 900; font-size: 13px; cursor: pointer; z-index: 4; box-shadow: 0 4px 12px rgba(0,0,0,.45); }
.n7 .opp .av, .n8 .opp .av { width: 44px; height: 44px; }
.n7 .opp, .n8 .opp { width: 72px; }

/* timer ring around whoever's turn it is */
.av.timed::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; z-index: -1;
  background: conic-gradient(var(--gold) calc(var(--p, 1) * 360deg), rgba(255,255,255,.12) 0); }
.av.timed.low::before { background: conic-gradient(var(--r) calc(var(--p, 1) * 360deg), rgba(255,255,255,.12) 0); }

.status { text-align: center; padding: 2px 12px; font-size: 15px; min-height: 26px; color: #e9e6ff; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.status b { color: var(--gold); }
.me { position: relative; padding: 0 0 max(8px, env(safe-area-inset-bottom)); background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.3)); }
.mebadge { display: flex; align-items: center; gap: 8px; justify-content: center; font-size: 13px; }
.mebadge .av { width: 30px; height: 30px; border-radius: 50%; position: relative; box-shadow: 0 0 0 2px #fff; }
.mebadge .ring { display: none; }
.mebadge .muted { color: #c9c3ee; font-weight: 600; }
.me.turn .mebadge .av { box-shadow: 0 0 0 2px var(--gold), 0 0 14px rgba(255,211,77,.7); }
.hand { display: flex; justify-content: center; align-items: flex-end; padding: 26px 14px 8px; min-height: calc(var(--cw) * 1.48 + 40px); }
.hand .card { cursor: pointer; transform-origin: 50% 130%; transform: translateY(var(--lift, 0)) rotate(var(--rot, 0)); }
.hand .card + .card { margin-left: var(--ml, -20px); }
.hand.scroll { justify-content: flex-start; overflow-x: auto; scrollbar-width: thin; }
.hand .card.ok { transform: translateY(calc(var(--lift, 0px) - 16px)) rotate(var(--rot, 0)); box-shadow: inset 0 0 0 2px rgba(255,255,255,.85), 0 0 0 3px var(--gold), 0 12px 22px rgba(0,0,0,.4); }
@media (hover: hover) { .hand .card.ok:hover { transform: translateY(calc(var(--lift, 0px) - 28px)) rotate(var(--rot, 0)) scale(1.04); z-index: 50 !important; } }
.hand .card.ok:active { transform: translateY(calc(var(--lift, 0px) - 30px)) rotate(var(--rot, 0)) scale(1.05); }
.my-turn .hand .card.no { filter: saturate(.4) brightness(.62); }
.hand .card.jump { animation: jumpglow .6s infinite alternate; }
.me.turn .hand { background: radial-gradient(60% 80% at 50% 100%, rgba(255,211,77,.2), transparent 70%); }
.actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding: 2px 10px 4px; min-height: 50px; align-items: center; }
.actions .btn.primary { box-shadow: 0 0 0 0 rgba(122,92,255,.6), 0 3px 0 #3a22c9; animation: glow 1.6s infinite; }
.chips { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; padding: 0 10px 4px; }
.rchip { font-size: 11px; font-weight: 700; opacity: .7; border: 1px solid rgba(255,255,255,.25); border-radius: 99px; padding: 2px 8px; }
@media (max-height: 700px) { .opp .tags { display: none; } .chips { display: none; } .mebadge { display: none; } }
@media (max-height: 600px) { .opp .av { width: 40px; height: 40px; } .minihand { display: none; } }
@media (min-width: 900px) { .felt { width: min(80%, 720px); } }
@keyframes dirflow { to { stroke-dashoffset: -18; } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(122,92,255,.55), 0 3px 0 #3a22c9; } 50% { box-shadow: 0 0 0 8px rgba(122,92,255,0), 0 3px 0 #3a22c9; } }

/* ---------- modals ---------- */
.modal { position: fixed; inset: 0; background: rgba(10,8,30,.62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 50; padding: 16px; }
.sheet { background: linear-gradient(180deg, #2c2170, #1b1450); color: #f3f1ff; border: 1px solid rgba(255,255,255,.14); border-radius: 22px; padding: 22px; width: min(440px, 100%); max-height: 92dvh; overflow: auto; position: relative; animation: rise .22s ease-out; box-shadow: 0 24px 70px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.12); }
.sheet.wide { width: min(640px, 100%); }
.sheet.small { width: min(380px, 100%); }
.sheet h2 { margin: 0 0 12px; font-size: 22px; }
.sheet .muted { color: #bdb6e6; }
.sheet .btn.ghost { box-shadow: inset 0 0 0 2px rgba(255,255,255,.3); }
.sheet .btn:not(.primary):not(.wa):not(.warn) { background: rgba(255,255,255,.12); color: #fff; box-shadow: none; }
.close { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; font-size: 15px; }
.colors { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cpick { height: 96px; border: 0; border-radius: 16px; color: #fff; font-weight: 900; font-size: 18px; background: var(--cc); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; box-shadow: 0 3px 0 rgba(0,0,0,.18); }
.cpick.c-y { color: #3a2600; }
.cpick .sh { font-size: 28px; line-height: 1; }
.cpick small { font-size: 11px; font-weight: 700; opacity: .85; }
.targets { display: grid; gap: 8px; }
.target { display: flex; align-items: center; gap: 10px; border: 0; background: rgba(255,255,255,.1); color: #fff; border-radius: 14px; padding: 10px 12px; cursor: pointer; font-weight: 700; text-align: left; }
.target:hover { background: rgba(255,255,255,.18); }
.target b { margin-left: auto; font-size: 13px; color: #c9c3ee; }
.target .av { width: 40px; height: 40px; flex: none; }
.nameform { display: grid; gap: 12px; }
.nameform label { display: grid; gap: 6px; font-weight: 700; }
.nameform input { border: 2px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: #fff; border-radius: 12px; padding: 12px; font: inherit; font-size: 17px; }
.nameform input::placeholder { color: #a9a2d6; }
.nameform input:focus { border-color: var(--gold); outline: none; }
.lbl { margin: 0; font-weight: 700; }
.fine { font-size: 13px; color: #bdb6e6; margin: 0; text-align: center; }
.fine a { color: #c9bbff; }
.avatars { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.avpick { aspect-ratio: 1; border: 0; border-radius: 50%; background: none; cursor: pointer; padding: 0; box-shadow: 0 0 0 2px rgba(255,255,255,.15); transition: transform .12s, box-shadow .12s; }
.avpick:hover { transform: scale(1.08); }
.avpick.on { box-shadow: 0 0 0 3px var(--gold), 0 0 14px rgba(255,211,77,.5); transform: scale(1.1); }
.emotes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.emo { border: 0; background: rgba(255,255,255,.1); color: #fff; border-radius: 12px; padding: 10px 4px; font-size: 22px; cursor: pointer; font-weight: 800; }
.emo:hover { background: rgba(255,255,255,.2); }
.emo:nth-child(n+9) { font-size: 13px; grid-column: span 2; }
.qrbox { display: grid; place-items: center; min-height: 236px; word-break: break-all; background: #fff; border-radius: 16px; padding: 8px; }
.code-big { text-align: center; font-size: 28px; font-weight: 900; letter-spacing: .2em; margin: 8px 0 0; }
.re { text-align: center; }
.re h2 { font-size: 26px; margin-bottom: 2px; }
.score { width: 100%; border-collapse: collapse; margin: 14px 0; text-align: left; font-size: 14px; }
.score th { font-size: 12px; color: #bdb6e6; text-transform: uppercase; letter-spacing: .04em; padding: 6px; border-bottom: 1px solid rgba(255,255,255,.15); }
.score td { padding: 8px 6px; border-bottom: 1px solid rgba(255,255,255,.08); vertical-align: middle; }
.score tr.win td { background: rgba(255,211,77,.14); }
.score td:first-child { white-space: nowrap; font-weight: 700; }
.mini { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; }
.mini .more { font-size: 12px; font-weight: 800; color: #bdb6e6; margin-left: 4px; }
.share-line { font-size: 14px; color: #bdb6e6; }
.re h2::before { content: "🏆"; display: block; font-size: 52px; margin-bottom: 4px; animation: pop .5s; }

/* ---------- feedback ---------- */
#toasts { position: fixed; left: 50%; top: 168px; transform: translateX(-50%); z-index: 90; display: grid; gap: 6px; justify-items: center; width: min(92vw, 420px); pointer-events: none; }
.toast { background: rgba(20,16,50,.94); color: #fff; padding: 10px 14px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.35); animation: rise .2s; text-align: center; transition: opacity .3s, transform .3s; }
.toast.err { background: #b4233a; }
.toast.out { opacity: 0; transform: translateY(6px); }
.burst { position: fixed; transform: translate(-50%, -100%); font-weight: 900; font-size: 24px; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.35); pointer-events: none; animation: burst 1.5s forwards; z-index: 60; white-space: nowrap; }
.burst.last { color: var(--gold); font-size: 30px; }
.burst.hit { color: #ff8a94; font-size: 30px; }
.burst.skip { color: #c9c2ff; }
.burst.jump { color: var(--g); }
.burst.yourturn { font-size: 34px; color: var(--gold); letter-spacing: -.01em; text-shadow: 0 3px 0 rgba(0,0,0,.35), 0 0 30px rgba(255,211,77,.7); transform: translate(-50%, -50%); animation: yourturn 1.2s forwards; }
.burst.emote { font-size: 26px; background: #fff; color: #17142b; border-radius: 16px; padding: 4px 12px; text-shadow: none; box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.confetti { position: fixed; top: 0; width: 8px; height: 14px; z-index: 70; pointer-events: none; border-radius: 2px; }
.ad-slot:empty { display: none; }
.ad-slot { margin: 12px auto; min-height: 100px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.08); } }
.catch { animation-name: catchpulse; }
@keyframes catchpulse { from { transform: translateX(-50%) scale(1); } to { transform: translateX(-50%) scale(1.12); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes burst { 0% { opacity: 0; transform: translate(-50%, -60%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -110%) scale(1.1); } 80% { opacity: 1; transform: translate(-50%, -150%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -180%) scale(1); } }
@keyframes yourturn { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.5); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); } 70% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -70%) scale(1); } }
@keyframes jumpglow { from { box-shadow: 0 0 0 3px var(--g), 0 0 10px var(--g); } to { box-shadow: 0 0 0 3px var(--g), 0 0 26px var(--g); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- site pages ---------- */
body.site { font-size: 17px; line-height: 1.65; }
.site-h { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.site-h .brand { color: var(--ink); font-size: 18px; }
.site-h nav { display: flex; gap: 4px; overflow-x: auto; }
.site-h nav a { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15px; padding: 8px 10px; border-radius: 10px; white-space: nowrap; }
.site-h nav a:hover { background: rgba(91,61,245,.08); }
.site-h nav a.play { background: var(--brand); color: #fff; }
@media (max-width: 640px) { .site-h nav a:not(.play) { display: none; } }
.hero { background: radial-gradient(120% 120% at 15% 0%, #4a36b5 0%, #241a6b 45%, #120c34 100%); color: #fff; padding: 36px 16px 52px; overflow: hidden; }
.hero-in { max-width: 1100px; margin: 0 auto; display: grid; gap: 28px; align-items: center; }
@media (min-width: 860px) { .hero-in { grid-template-columns: 1.1fr .9fr; } }
.hero h1 { font-size: clamp(34px, 6.2vw, 58px); line-height: 1.05; margin: 0 0 14px; letter-spacing: -.02em; }
.hero h1 span { background: linear-gradient(90deg, #ff8a94, #ffd66a, #5fe0a3, #79adff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 19px; color: #ddd8ff; margin: 0 0 22px; max-width: 540px; }
.hero .row { justify-content: flex-start; }
.hero .badges { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 18px; font-size: 14px; color: #cfc9f3; font-weight: 700; }
.fan { position: relative; height: 250px; display: grid; place-items: center; --cw: 104px; }
.fan { animation: float 5s ease-in-out infinite; }
.fan .card { position: absolute; transform-origin: 50% 120%; }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
.hero { position: relative; }
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: radial-gradient(circle at 85% 20%, rgba(255,77,94,.35), transparent 30%), radial-gradient(circle at 70% 90%, rgba(61,139,255,.35), transparent 35%), radial-gradient(circle at 10% 80%, rgba(34,192,122,.25), transparent 30%); }
.hero-in { position: relative; }
.fan .card:nth-child(1) { transform: rotate(-24deg) translateX(-30px); }
.fan .card:nth-child(2) { transform: rotate(-10deg) translateX(-10px); }
.fan .card:nth-child(3) { transform: rotate(4deg) translateX(10px); }
.fan .card:nth-child(4) { transform: rotate(18deg) translateX(30px); }
.fan .card:nth-child(5) { transform: rotate(32deg) translateX(50px); }
@media (max-width: 520px) { .fan { height: 190px; --cw: 80px; } }
.wrap { max-width: 780px; margin: 0 auto; padding: 0 16px; }
.wide-wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.crumbs { font-size: 14px; color: var(--muted); margin: 18px 0 0; }
.crumbs a { color: var(--muted); }
article h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.1; margin: 10px 0 8px; letter-spacing: -.015em; }
article .updated { font-size: 14px; color: var(--muted); margin: 0 0 16px; }
article .intro { font-size: 19px; }
article h2 { font-size: 26px; margin: 1.8em 0 .5em; line-height: 1.2; }
article h3 { font-size: 20px; margin: 1.4em 0 .4em; }
article table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 15px; background: var(--card); border-radius: 12px; overflow: hidden; display: block; overflow-x: auto; }
article th, article td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
article th { background: rgba(91,61,245,.08); font-size: 14px; }
article li { margin: .3em 0; }
.cta-box { background: linear-gradient(135deg, #5b3df5, #8a5cff); color: #fff; border-radius: 18px; padding: 18px 20px; display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 26px 0; }
.cta-box p { margin: 0; font-weight: 700; font-size: 17px; }
.cta-box .btn { background: #fff; color: #3a22c9; }
.faq h2 { margin-top: 1.8em; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; margin: 8px 0; }
.faq summary { font-weight: 800; cursor: pointer; }
.faq details p { margin: .6em 0 0; }
.related { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 16px 0; }
.related a { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; text-decoration: none; color: var(--ink); font-weight: 800; }
.related a span { display: block; font-weight: 500; color: var(--muted); font-size: 14px; margin-top: 4px; }
.related a:hover { border-color: var(--brand); }
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 22px 0; }
.mode { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; text-decoration: none; color: var(--ink); display: block; }
.mode b { font-size: 18px; display: block; }
.mode span { color: var(--muted); font-size: 15px; }
.mode em { display: inline-block; margin-top: 8px; font-style: normal; font-weight: 800; color: var(--link); }
.site-f { margin-top: 64px; background: #14102e; color: #cfcbe6; padding: 36px 16px 28px; font-size: 14px; }
.site-f .cols { max-width: 1100px; margin: 0 auto; display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.site-f h3 { color: #fff; font-size: 15px; margin: 0 0 8px; }
.site-f ul { list-style: none; padding: 0; margin: 0; }
.site-f li { margin: 5px 0; }
.site-f a { color: #cfcbe6; text-decoration: none; }
.site-f a:hover { color: #fff; text-decoration: underline; }
.site-f .legal { max-width: 1100px; margin: 24px auto 0; padding-top: 16px; border-top: 1px solid #2b2650; color: #9e98c2; font-size: 13px; }

body:has(#modal-roundend) #toasts { display: none; }

html:has(body.game) { background: #110c2e; }
body.game { background-attachment: scroll; background-color: #110c2e; }

/* ---------- game feel (juice.js) ---------- */
.spark { position: fixed; width: 9px; height: 9px; border-radius: 2px; pointer-events: none; z-index: 70; box-shadow: 0 0 8px rgba(255,255,255,.5); }
.shock { position: fixed; width: 60px; height: 60px; border-radius: 50%; pointer-events: none; z-index: 69; border: 4px solid var(--sc, #fff); box-shadow: 0 0 18px var(--sc, #fff), inset 0 0 12px var(--sc, #fff); }
.stage { will-change: transform; }

/* ---------- keyboard + screen reader ---------- */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hand .card:focus { outline: none; }
.hand .card:focus-visible { transform: translateY(calc(var(--lift, 0px) - 30px)) rotate(var(--rot, 0)) scale(1.05); z-index: 60 !important; box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--gold), 0 14px 26px rgba(0,0,0,.45); }
.hand .card[aria-disabled="true"]:focus-visible { box-shadow: 0 0 0 4px #fff, 0 0 0 7px #8a84b5; }

/* ---------- settings controls ---------- */
.range { width: 52%; accent-color: var(--gold); height: 28px; cursor: pointer; }

/* ---------- phone notches / safe areas ---------- */
.g-top { height: auto; min-height: 52px; padding-top: env(safe-area-inset-top); padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
.table .me { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }

/* ---------- player chose "Reduce motion" ---------- */
html.calm *, html.calm *::before, html.calm *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
html.calm .spark, html.calm .shock, html.calm .confetti { display: none; }

/* ---------- home hero v2: animated deal, drifting shapes, social proof, 3 steps ---------- */
.hero { padding: 40px 16px 64px; isolation: isolate; }
.floaters { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.fl { position: absolute; font-style: normal; font-size: clamp(28px, 5vw, 56px); opacity: .16; will-change: transform; animation: drift 14s ease-in-out var(--d, 0s) infinite alternate; }
.fl.c-r { color: var(--r); } .fl.c-y { color: var(--y); } .fl.c-g { color: var(--g); } .fl.c-b { color: var(--b); }
@keyframes drift { from { transform: translate(0, 0) rotate(0deg); } to { transform: translate(18px, -26px) rotate(25deg); } }
.hero-in { z-index: 1; }
.kicker { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); font-size: 13px; font-weight: 800; color: #e8e4ff; letter-spacing: .01em; }
.kicker .dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #3ee08f; }
.kicker .dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #3ee08f; animation: live 1.8s ease-out infinite; }
@keyframes live { from { transform: scale(1); opacity: .7; } to { transform: scale(3); opacity: 0; } }
.cta-glow { position: relative; isolation: isolate; }
.cta-glow::before { content: ""; position: absolute; inset: -7px; border-radius: inherit; background: rgba(255,211,77,.2); z-index: -1; animation: ctaglow 2.4s ease-in-out infinite; }
@keyframes ctaglow { 0%, 100% { opacity: 0; transform: scale(.94); } 50% { opacity: 1; transform: scale(1); } }
.hero-social { display: flex; align-items: center; gap: 12px; margin-top: 20px; color: #cfc9f3; font-weight: 700; font-size: 14px; flex-wrap: wrap; }
.havs { display: flex; }
.hav { width: 38px; height: 38px; border-radius: 50%; border: 3px solid #241a6b; margin-left: -10px; background: #fff; overflow: hidden; animation: rise .5s calc(.6s + var(--i) * .08s) both; }
.hav:first-child { margin-left: 0; }
.hav svg { width: 100%; height: 100%; display: block; }
/* Fan: cards deal out from a stack on load, then idle-float. */
.fan-wrap { position: relative; display: grid; place-items: center; }
.fan { animation: float 5s ease-in-out 1.4s infinite; }
.fan .card { animation: deal .7s cubic-bezier(.34,1.56,.64,1) calc(.15s + var(--i) * .11s) backwards; box-shadow: 0 14px 28px rgba(0,0,0,.4); }
.fan .card:nth-child(1) { --to: rotate(-24deg) translateX(-30px); }
.fan .card:nth-child(2) { --to: rotate(-10deg) translateX(-10px); }
.fan .card:nth-child(3) { --to: rotate(4deg) translateX(10px); }
.fan .card:nth-child(4) { --to: rotate(18deg) translateX(30px); }
.fan .card:nth-child(5) { --to: rotate(32deg) translateX(50px); }
.fan .card { transform: var(--to); }
@keyframes deal { from { transform: translateY(60px) rotate(0deg) scale(.85); opacity: 0; } to { transform: var(--to); opacity: 1; } }
@media (hover: hover) {
  .fan-wrap:hover .card { transition: transform .35s cubic-bezier(.34,1.56,.64,1); }
  .fan-wrap:hover .card:nth-child(1) { transform: rotate(-32deg) translateX(-56px) translateY(-6px); }
  .fan-wrap:hover .card:nth-child(2) { transform: rotate(-15deg) translateX(-22px) translateY(-12px); }
  .fan-wrap:hover .card:nth-child(3) { transform: rotate(3deg) translateX(14px) translateY(-14px); }
  .fan-wrap:hover .card:nth-child(4) { transform: rotate(21deg) translateX(50px) translateY(-10px); }
  .fan-wrap:hover .card:nth-child(5) { transform: rotate(38deg) translateX(84px) translateY(-4px); }
}
.fan-shadow { width: 62%; height: 26px; margin-top: -14px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.45), transparent); animation: shadow 5s ease-in-out 1.4s infinite; }
@keyframes shadow { 50% { transform: scaleX(.88); opacity: .7; } }
/* 3 steps strip */
.steps-wrap { max-width: 1100px; margin: -34px auto 0; padding: 0 16px; position: relative; z-index: 2; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; background: var(--card, #fff); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; box-shadow: 0 10px 26px rgba(23,18,58,.12); }
.steps b { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 900; background: linear-gradient(135deg, var(--brand), #8b5cf6); }
.steps li:nth-child(2) b { background: linear-gradient(135deg, #ff8a3d, var(--r)); }
.steps li:nth-child(3) b { background: linear-gradient(135deg, var(--g), #14b8c4); }
.steps strong { display: block; font-size: 16px; }
.steps span { color: var(--muted); font-size: 14px; }
@media (max-width: 520px) { .hero { padding-bottom: 56px; } .steps-wrap { margin-top: -28px; } }
body:has(.modal) .burst, body:has(.modal) .spark, body:has(.modal) .shock { z-index: 40; }

/* ===== audit fixes (game screens) ===== */
/* Card colours: deeper mid/low stops so white ranks, corner indexes and labels reach ~4.2–4.6:1. */
.c-r { --cc: linear-gradient(150deg, #ff7a86, #e5394a 55%, #c21f37); }
.c-g { --cc: linear-gradient(150deg, #3fd893, #0e8a55 55%, #0a6b42); }
.c-b { --cc: linear-gradient(150deg, #6aa6ff, #2b6fe8 55%, #1a55c4); }
.card .ix { text-shadow: 0 1px 1px rgba(0,0,0,.35); }
.colortag.col-r { background: #d22c40; } .colortag.col-g { background: #0e8a55; } .colortag.col-b { background: #2463d6; }
/* No sideways scroll on phones. */
.table { overflow-x: clip; }
/* Direction arrow: bottom-centre of the felt, clear of name tags. */
.dirlabel { right: auto; left: 50%; top: auto; bottom: 4%; transform: translateX(-50%); font-size: 18px; opacity: .6; }
/* Unplayable cards: keep the colour readable, sink them a little instead of turning them muddy. */
.my-turn .hand .card.no { filter: saturate(.7) brightness(.8); transform: translateY(calc(var(--lift, 0px) + 8px)) rotate(var(--rot, 0)); }
.drawpile .pc { opacity: 1; color: #cfc9f3; font-size: 12px; }
.rchip { opacity: 1; color: #cfc9f3; }
.opp .cnt, .pc, .score td, .pending { font-variant-numeric: tabular-nums; }
.opp .nm { background: rgba(12,8,36,.6); padding: 1px 9px; border-radius: 99px; }
.hand .card { box-shadow: inset 0 1px 0 rgba(255,255,255,.45), -4px 10px 20px rgba(0,0,0,.35); }
/* Visible focus in Windows High Contrast too. */
.hand .card:focus-visible { outline: 3px solid transparent; outline-offset: 3px; }
/* Room button never wraps. */
.code-btn { white-space: nowrap; }
@media (max-width: 360px) { .code-btn { font-size: 0; padding: 8px 10px; } .code-btn b { font-size: 14px; } }
/* Bigger touch targets on phones and tablets. */
@media (pointer: coarse) {
  .icon-btn { width: 44px; height: 44px; flex: none; }
  .close { width: 44px; height: 44px; top: 6px; right: 6px; }
  .actions .btn { min-height: 44px; }
  .range { height: 44px; }
  .avpick { min-width: 44px; min-height: 44px; }
  .chip { min-height: 40px; padding-left: 14px; padding-right: 14px; }
  .sheet .fine a, .link { display: inline-block; padding: 10px 4px; }
  .help { position: relative; }
  .help::after { content: ""; position: absolute; inset: -13px; }
}
/* Round-end table: card minis live in a div so the cell stays a real table cell. */
.score td .mini { display: flex; }
/* Landscape phones: smaller cards, two columns (table left, your hand right). */
@media (orientation: landscape) and (max-height: 500px) {
  :root { --cw: clamp(44px, 14dvh, 60px); }
  .table { grid-template-columns: 1.15fr 1fr; grid-template-rows: 1fr auto; column-gap: 6px; }
  .stage { grid-column: 1; grid-row: 1 / -1; }
  .status { grid-column: 2; grid-row: 1; align-self: end; font-size: 13px; min-height: 0; }
  .me { grid-column: 2; grid-row: 2; }
  .hand { padding-top: 14px; min-height: calc(var(--cw) * 1.48 + 18px); }
  .actions { min-height: 44px; }
  .chips, .mebadge { display: none; }
  .felt { width: 92%; }
}

/* ---------- Install app (PWA) + ad label ---------- */
[data-install][hidden] { display: none !important; }
.nav-install { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 800; font-size: 14px; color: inherit; background: rgba(122,92,255,.14); border: 1.5px solid rgba(122,92,255,.45); border-radius: 99px; padding: 7px 13px; cursor: pointer; }
.nav-install:hover { background: rgba(122,92,255,.24); }
.install-bar { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 95; display: flex; align-items: center; gap: 10px; width: min(94vw, 520px); padding: 12px 12px 12px 16px; border-radius: 16px; background: #1d1747; color: #fff; box-shadow: 0 14px 40px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.1); font-weight: 700; font-size: 14px; animation: barin .35s cubic-bezier(.2,.9,.3,1.2); }
.install-bar span { flex: 1; }
.install-bar .btn { padding: 9px 14px; font-size: 14px; white-space: nowrap; }
@keyframes barin { from { transform: translate(-50%, 30px); opacity: 0; } }
html.calm .install-bar { animation: none; }
.install-dlg { max-width: min(92vw, 420px); border: 0; border-radius: 20px; padding: 22px 22px 18px; background: var(--card, #fff); color: var(--ink, #1a1731); box-shadow: 0 24px 60px rgba(0,0,0,.4); }
.install-dlg::backdrop { background: rgba(10,8,30,.6); }
.install-dlg h2 { margin: 0 0 10px; font-size: 20px; }
.install-dlg ol { padding-left: 20px; line-height: 1.7; }
.install-dlg svg { vertical-align: -3px; }
.install-dlg form { text-align: right; margin-top: 8px; }
.ad-label { margin: 0 0 4px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted, #8a85a8); text-align: center; }
@media (max-width: 520px) { .nav-install { padding: 7px 10px; font-size: 0; gap: 0; } .nav-install svg { width: 18px; height: 18px; } }

/* ---------- Hero art + illustrated mode cards ---------- */
.hero-art { display: block; width: 100%; height: auto; border-radius: 22px; aspect-ratio: 3 / 2; object-fit: cover; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
@media (max-width: 859px) { .hero-art { aspect-ratio: 16 / 10; object-position: 82% 45%; } }
@media (min-width: 860px) {
  .hero { min-height: 560px; }
  .hero-in { grid-template-columns: 1fr; position: static; }
  .hero-copy { max-width: 560px; position: relative; z-index: 1; }
  .hero-art { position: absolute; z-index: -1; top: 0; right: 0; height: 100%; width: min(1180px, 74vw); border-radius: 0; box-shadow: none; aspect-ratio: auto; object-fit: cover; object-position: 70% 50%;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 38%); mask-image: linear-gradient(90deg, transparent 0%, #000 38%); }
  .hero-copy { max-width: 520px; }
}
.mc-h { text-align: center; margin: 34px 0 6px; }
.mcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin: 18px 0 8px; }
.mcard { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: 0 8px 24px rgba(20,12,60,.10); transition: transform .2s ease, box-shadow .2s ease; }
.mcard img { width: 100%; height: auto; aspect-ratio: 16 / 11; object-fit: cover; background: #241a6b; }
.mcard .mc-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.mcard b { font-size: 21px; }
.mcard span { color: var(--muted); font-size: 15px; line-height: 1.5; }
.mcard em { font-style: normal; margin-top: auto; align-self: stretch; text-align: center; padding: 12px 16px; }
.mcard:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(20,12,60,.18); }
.mcard:hover img { filter: saturate(1.08); }
.mcard:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
html.calm .mcard, html.calm .mcard:hover { transform: none; transition: none; }
.mc-more { text-align: center; color: var(--muted); font-size: 15px; margin: 6px 0 18px; }

/* ---------- Cards v3, classic deck, stats (card visuals) ---------- */
/* Action cards: cream rim, coloured face, outlined centre symbol, corner shape marks. */
.c-r { --f1: #dc2f45; --f2: #a41330; --dk: #8f1028; }
.c-y { --f1: #ffcb3d; --f2: #f0a000; --dk: #6b4400; color: #3a2600; }
.c-g { --f1: #0d8a55; --f2: #06693f; --dk: #05512f; }
.c-b { --f1: #2c6be6; --f2: #1747b4; --dk: #12388c; }
.c-w { --f1: #302763; --f2: #130f2e; --dk: #1c1640; }
.card { background: var(--rim, #fffaf0); border-radius: calc(var(--w) * .15); color: #fff; box-shadow: 0 1px 0 rgba(0,0,0,.25), 0 6px 14px rgba(0,0,0,.3); }
.card.c-y { color: #3a2600; }
.card::after { display: none; }
.card .face { position: absolute; inset: calc(var(--w) * .052); border-radius: calc(var(--w) * .11); overflow: hidden; background: linear-gradient(155deg, var(--f1), var(--f2)); box-shadow: inset 0 0 0 calc(var(--w) * .014) rgba(0,0,0,.2), inset 0 calc(var(--w) * -.07) calc(var(--w) * .12) rgba(0,0,0,.2); }
.card .face::before { content: ""; position: absolute; inset: calc(var(--w) * .028); border-radius: calc(var(--w) * .085); box-shadow: inset 0 0 0 calc(var(--w) * .011) rgba(255,255,255,.3); pointer-events: none; }
.card.c-y .face::before { box-shadow: inset 0 0 0 calc(var(--w) * .011) rgba(255,255,255,.55); }
.card .face::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(112deg, transparent 0 34%, rgba(255,255,255,.17) 40% 52%, transparent 58%); }
.card .face .pat { position: absolute; right: -26%; bottom: -12%; width: 112%; opacity: .14; pointer-events: none; font-size: 0; line-height: 0; color: inherit; }
.card .face .pat svg { width: 100%; height: auto; display: block; }
.card .face .mid { position: absolute; inset: 0; display: grid; place-items: center; }
.card .face .mid b { font-size: calc(var(--w) * .66); font-weight: 900; letter-spacing: -.05em; line-height: 1; color: #fff; -webkit-text-stroke: calc(var(--w) * .05) rgba(0,0,0,.26); paint-order: stroke fill; text-shadow: 0 calc(var(--w) * .045) 0 rgba(0,0,0,.3); }
.card.c-y .face .mid b { color: #3a2600; -webkit-text-stroke: calc(var(--w) * .05) rgba(255,255,255,.55); text-shadow: 0 calc(var(--w) * .04) 0 rgba(255,255,255,.4); }
.card .face .mid .ico { width: calc(var(--w) * .6); height: calc(var(--w) * .6); filter: drop-shadow(0 calc(var(--w) * .035) 0 rgba(0,0,0,.28)); }
.card .face .mid .ico.d2 { width: calc(var(--w) * .58); height: calc(var(--w) * .75); }
.card .face .mid .wheel { width: calc(var(--w) * .66); height: calc(var(--w) * .66); filter: drop-shadow(0 calc(var(--w) * .04) calc(var(--w) * .03) rgba(0,0,0,.4)); transform: none; border-radius: 0; box-shadow: none; display: block; overflow: visible; }
.card .face .mid .w4wheel { width: calc(var(--w) * .52); height: calc(var(--w) * .52); transform: translateY(-17%); }
.card .face .mid b.w4 { position: absolute; left: 50%; bottom: 17%; transform: translateX(-50%); font-size: calc(var(--w) * .27); letter-spacing: 0; background: #0e0a24; color: #fff; -webkit-text-stroke: 0; text-shadow: none; padding: .06em .3em .1em; border-radius: .42em; box-shadow: 0 0 0 calc(var(--w) * .025) #fff, 0 calc(var(--w) * .04) calc(var(--w) * .05) rgba(0,0,0,.4); white-space: nowrap; }
.card .face .ix { position: absolute; display: flex; flex-direction: column; align-items: center; gap: calc(var(--w) * .02); font-size: calc(var(--w) * .215); line-height: 1; font-weight: 900; text-shadow: 0 1px 1px rgba(0,0,0,.4); width: calc(var(--w) * .26); }
.card.c-y .face .ix { text-shadow: none; }
.card .face .ix b { font-size: 1em; letter-spacing: -.06em; font-weight: 900; }
.card .face .ix i { display: block; font-style: normal; margin: 0; line-height: 0; }
.card .face .ix svg { display: block; width: calc(var(--w) * .17); height: calc(var(--w) * .17); }
.card .face .ix .ico { width: calc(var(--w) * .19); height: calc(var(--w) * .19); }
.card .face .ix .wheel.mini { width: calc(var(--w) * .19); height: calc(var(--w) * .19); }
.card .face .tl { top: calc(var(--w) * .05); left: calc(var(--w) * .035); }
.card .face .br { bottom: calc(var(--w) * .05); right: calc(var(--w) * .035); top: auto; left: auto; transform: rotate(180deg); }
.card.xs .face .ix, .card.xs .face .pat { display: none; }
.card.xs .face .mid b { font-size: 17px; -webkit-text-stroke-width: 1.2px; }
.card.xs .face .mid .ico { width: 17px; height: 17px; }
.card.xs .face .mid .ico.d2 { width: 18px; height: 23px; }
.card.xs .face .mid .wheel { width: 19px; height: 19px; }
.card.xs .face .mid .w4wheel { width: 15px; height: 15px; }
.card.xs .face .mid b.w4 { font-size: 8px; bottom: 11%; }
.card.xs { box-shadow: 0 1px 2px rgba(0,0,0,.35); }
.card[data-chosen="r"] { --rim: #dc2f45; } .card[data-chosen="y"] { --rim: #ffc42e; }
.card[data-chosen="g"] { --rim: #14a463; } .card[data-chosen="b"] { --rim: #2f78ee; }
/* Card back: deep purple lattice with the MHUB mark. */
.card.back { background: #fffaf0; }
.card.back .face { display: grid; place-items: center; background: radial-gradient(circle at 50% 38%, #5a45c9 0, #34279a 55%, #1e1568 100%); }
.card.back .face::before { inset: calc(var(--w) * .03); border-radius: calc(var(--w) * .085); background: repeating-linear-gradient(45deg, rgba(255,255,255,.1) 0 1px, transparent 1px calc(var(--w) * .11)), repeating-linear-gradient(-45deg, rgba(255,255,255,.1) 0 1px, transparent 1px calc(var(--w) * .11)); box-shadow: inset 0 0 0 calc(var(--w) * .012) rgba(255,255,255,.35); }
.card.back .emblem { position: relative; width: 66%; height: auto; filter: drop-shadow(0 2px 3px rgba(0,0,0,.45)); }
.minihand i { background: repeating-linear-gradient(45deg, rgba(255,255,255,.14) 0 1px, transparent 1px 4px), linear-gradient(160deg, #4b3bb8, #20166b); box-shadow: 0 0 0 2px #fffaf0, 0 2px 4px rgba(0,0,0,.4); }

/* Classic 52-card deck. */
.card.cl { background: #fffdf8; box-shadow: inset 0 0 0 1px rgba(20,25,50,.2), 0 1px 0 rgba(0,0,0,.2), 0 6px 14px rgba(0,0,0,.3); --f1: #fffefb; --f2: #f1ece0; }
.card.cl.c-h, .card.cl.c-d { color: #c0112c; }
.card.cl.c-s, .card.cl.c-c { color: #14213d; }
.card.cl .face { inset: 0; border-radius: inherit; background: linear-gradient(160deg, #fffefb, #f4efe4); box-shadow: none; }
.card.cl .face::before { display: none; }
.card.cl .face::after { display: none; }
.card.cl.wild8 .face { box-shadow: inset 0 0 0 calc(var(--w) * .035) #e2b02a, inset 0 0 0 calc(var(--w) * .05) rgba(255,255,255,.7); }
.card.cl .face .mid { inset: 6% 15% 6% 15%; display: block; }
.card.cl .face .mid svg { width: 100%; height: 100%; display: block; overflow: visible; }
.card.cl .face .ix { text-shadow: none; width: calc(var(--w) * .24); font-family: Georgia, "Times New Roman", serif; font-size: calc(var(--w) * .23); }
.card.cl .face .ix b { letter-spacing: -.08em; }
.card.cl .face .ix i svg { width: calc(var(--w) * .18); height: calc(var(--w) * .18); }
.card.cl .face .ix em { display: block; font-style: normal; line-height: 0; color: #d49a00; }
.card.cl .face .ix em svg { width: calc(var(--w) * .13); height: calc(var(--w) * .13); }
.card.cl .face .tl { top: calc(var(--w) * .07); left: calc(var(--w) * .05); }
.card.cl .face .br { bottom: calc(var(--w) * .07); right: calc(var(--w) * .05); }
.card.cl.xs .face .mid { inset: 8% 4%; }
.card.cl.xs .face .mid svg { display: none; }
.card.cl.xs .face .ix { display: flex; font-size: 11px; width: 100%; position: absolute; top: 3px; left: 0; bottom: auto; right: auto; transform: none; }
.card.cl.xs .face .br { display: none; }
.card.cl.xs .face .ix svg { width: 9px; height: 9px; }
.card.cl.xs .face .ix em { display: none; }
.card.cl.xs .face .mid { display: grid; place-items: center; }
.card.cl.xs .face .mid::after { content: ""; }
.colortag.col-h, .colortag.col-d { background: #c0112c; color: #fff; }
.colortag.col-s, .colortag.col-c { background: #14213d; color: #fff; box-shadow: 0 0 0 1.5px rgba(255,255,255,.7), 0 2px 8px rgba(0,0,0,.3); }
.felt.col-h { --glow: rgba(224,51,74,.26); } .felt.col-d { --glow: rgba(255,120,90,.22); }
.felt.col-s { --glow: rgba(120,140,255,.22); } .felt.col-c { --glow: rgba(60,200,150,.2); }

/* Suit picker. */
.spicks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.spick { min-height: 104px; border: 0; border-radius: 16px; background: #fffdf8; color: #14213d; font-weight: 900; font-size: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: pointer; box-shadow: 0 3px 0 rgba(0,0,0,.25); }
.spick.c-h, .spick.c-d { color: #c0112c; }
.spick .sh { width: 40px; height: 40px; }
.spick small { font-size: 12px; font-weight: 700; color: #4b4a63; }
.spick:hover { filter: brightness(.96); }

/* Deck tag, lobby and round end. */
.deck-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; padding: 3px 11px; border-radius: 99px; background: rgba(255,255,255,.14); color: inherit; margin-left: 8px; vertical-align: middle; }
.lobby .deck-tag { background: rgba(122,92,255,.2); }
.re .wins-line { margin: 4px 0 0; font-weight: 800; font-size: 15px; color: #ffe08a; }
.re .so-close { margin: 6px 0 0; font-weight: 900; font-size: 16px; color: #ff9aa5; animation: pop .4s ease-out; }

/* My stats. */
.stats-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.stat { background: rgba(255,255,255,.1); border-radius: 14px; padding: 10px 8px 9px; text-align: center; }
.stat b { display: block; font-size: 30px; line-height: 1.05; font-weight: 900; font-variant-numeric: tabular-nums; }
.stat span { display: block; font-size: 12px; color: #d6d0f5; font-weight: 700; margin-top: 2px; }
.stat.hot b::before { content: "🔥 "; font-size: .7em; }
.stat.hot.cold b::before { content: ""; }
.last10 { display: flex; gap: 4px; margin: 6px 0 2px; }
.last10 i { flex: 1; height: 26px; border-radius: 6px; background: rgba(255,255,255,.12); display: grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 900; }
.last10 i.w { background: #1c9d63; color: #fff; }
.last10 i.l { background: #b8283b; color: #fff; }
.stats-split { width: 100%; border-collapse: collapse; font-size: 14px; margin: 6px 0; }
.stats-split th, .stats-split td { padding: 6px 4px; text-align: left; border-bottom: 1px solid rgba(255,255,255,.12); font-weight: 700; }
.stats-split th { color: #d6d0f5; font-size: 12px; font-weight: 800; }
.stats-split td:not(:first-child), .stats-split th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.stats-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.stats-actions .btn { min-height: 44px; flex: 1 1 120px; }
.btn.danger { background: #b8283b !important; color: #fff !important; }
.open-stats { width: 100%; min-height: 44px; margin: 4px 0; }
@media (max-width: 360px) { .stat b { font-size: 26px; } .sheet { padding: 18px 14px; } }

/* ---------- Hand, motion & input v3 (hand/clicks/animations) ---------- */
/* Hand: every card is absolutely placed by JS (fitHand): one fanned row, or several overlapping rows. */
.hand { display: block; position: relative; width: 100%; padding: 0; min-height: 0; overflow: visible; }
.hand .card {
  --w: var(--hw, var(--cw));
  position: absolute; margin: 0; transform-origin: 50% 60%;
  transform: rotate(var(--rot, 0deg));
  cursor: default; touch-action: manipulation; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none;
}
.hand .card + .card { margin-left: 0; }
.hand .card.ok { cursor: pointer; transform: translateY(calc(-1 * var(--raise, 16px))) rotate(var(--rot, 0deg)); }
.my-turn .hand .card.no { cursor: not-allowed; }
@media (hover: hover) {
  .hand .card.ok:hover { transform: translateY(calc(-1 * var(--raiseh, 28px))) rotate(var(--rot, 0deg)) scale(1.05); z-index: 50 !important; }
}
.hand .card.ok:active { transform: translateY(calc(-1 * var(--raiseh, 28px))) rotate(var(--rot, 0deg)) scale(1.05); }
/* Touch selection: the card comes to the front, rises and grows a little. */
.hand .card.sel, .hand .card.sel:hover, .hand .card.sel:active, .hand .card.sel:focus-visible {
  transform: translateY(-22px) rotate(0deg) scale(1.12); z-index: 90 !important;
  box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--gold), 0 16px 28px rgba(0,0,0,.5);
}
.hand-play { position: absolute; z-index: 100; min-height: 32px; padding: 5px 20px; font-size: 15px; border-radius: 99px; touch-action: manipulation; animation: pop .18s; }
@media (pointer: coarse) { .hand-play { min-height: 44px; padding: 8px 26px; } }

/* No text selection, no double-tap zoom on the table. */
.table { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.table button, .table .hand, .table .drawpile { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.drawpile.can { cursor: pointer; }
.drawpile:not(.can) { cursor: default; }
.drawpile.can .topback { transition: translate .15s, scale .15s; }
@media (hover: hover) { .drawpile.can:hover .topback { translate: 0 -4px; scale: 1.04; } }

/* Whose turn: pulsing ring + highlighted name, and a cue for you. */
.opp.turn .av::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 3px solid var(--gold); pointer-events: none; animation: turnring 1.5s ease-out infinite; }
.opp.turn .nm { background: var(--gold); color: #17142b; text-shadow: none; }
.me.turn .mebadge .av::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 3px solid var(--gold); pointer-events: none; animation: turnring 1.5s ease-out infinite; }
.me.turn .mebadge b { color: var(--gold); }
.table.my-turn .status span { display: inline-block; padding: 1px 12px; border-radius: 99px; background: rgba(255,211,77,.16); box-shadow: 0 0 0 1px rgba(255,211,77,.45); }
.me.cue .hand { animation: handcue 1.1s ease-out 1; }
@keyframes turnring { 0% { transform: scale(.85); opacity: .95; } 100% { transform: scale(1.55); opacity: 0; } }
@keyframes handcue { 0% { box-shadow: inset 0 -40px 40px -20px rgba(255,211,77,.6); } 100% { box-shadow: inset 0 -40px 40px -20px rgba(255,211,77,0); } }

/* Slower floating text so it can be read. */
.burst { animation-duration: 2s; }
.burst.yourturn { animation-duration: 1.7s; }
.site-f .legal a { color: #cfcbe6; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- themes: card backs + tables (src/client/themes.js) ----------
   Built-in themes only change colour tokens. Art themes (from art/themes/) set --back-img / --table-img. */
:root { --bk-1: #5a45c9; --bk-2: #34279a; --bk-3: #1e1568; --tb-1: #3b2c95; --tb-2: #2a1f72; --tb-3: #1c1452; --rim-1: #4b37b8; --rim-2: #7a62ff; --bg-hi: #3a2b8f; }
html[data-theme="ember"] { --bk-1: #ff8a4c; --bk-2: #d2452a; --bk-3: #7a1a10; --tb-1: #7a2e1c; --tb-2: #561d12; --tb-3: #2e0d08; --rim-1: #b8452a; --rim-2: #ff9a62; --bg-hi: #8a3420; --felt-1: #4a170d; --felt-2: #1a0704; }
html[data-theme="jade"] { --bk-1: #3fd6a0; --bk-2: #13906a; --bk-3: #07432f; --tb-1: #17775a; --tb-2: #0e5541; --tb-3: #062e23; --rim-1: #16946d; --rim-2: #5ff0bb; --bg-hi: #137a5c; --felt-1: #0b3f30; --felt-2: #031712; }
html[data-theme="royal"] { --bk-1: #ffe27a; --bk-2: #d9a520; --bk-3: #6e4a05; --tb-1: #3a2a6e; --tb-2: #261a4f; --tb-3: #140d2e; --rim-1: #b8891c; --rim-2: #ffd75e; --bg-hi: #3a2a6e; --felt-1: #1f1545; --felt-2: #0a0619; }
body.game { background: radial-gradient(120% 90% at 50% 35%, var(--bg-hi) 0%, var(--felt-1) 40%, var(--felt-2) 100%) fixed; }
.felt {
  background:
    radial-gradient(ellipse at 50% 40%, rgba(255,255,255,.10), transparent 60%),
    repeating-radial-gradient(circle at 30% 30%, rgba(255,255,255,.018) 0 2px, transparent 2px 5px),
    radial-gradient(ellipse at 50% 50%, var(--tb-1) 0%, var(--tb-2) 55%, var(--tb-3) 100%);
  box-shadow: 0 0 0 7px var(--rim-1), 0 0 0 9px var(--rim-2), 0 0 0 12px var(--tb-2), 0 22px 50px rgba(0,0,0,.5), inset 0 0 60px rgba(0,0,0,.45);
}
.card.back .face { background: radial-gradient(circle at 50% 38%, var(--bk-1) 0, var(--bk-2) 55%, var(--bk-3) 100%); }
.minihand i { background: repeating-linear-gradient(45deg, rgba(255,255,255,.14) 0 1px, transparent 1px 4px), linear-gradient(160deg, var(--bk-2), var(--bk-3)); }
/* Art themes: the image replaces the drawn back / table. */
html.img-back .card.back .face { background: var(--back-img) center / cover no-repeat, var(--bk-3); }
html.img-back .card.back .face::before, html.img-back .card.back .emblem { display: none; }
html.img-back .minihand i { background: var(--back-img) center / cover no-repeat, var(--bk-3); }
html.img-table body.game { background: linear-gradient(rgba(8,5,20,.35), rgba(8,5,20,.55)), var(--table-img) center / cover no-repeat fixed, var(--felt-2); }

/* Theme picker (Settings) */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; margin: 4px 0 14px; }
.thpick { appearance: none; border: 0; background: rgba(255,255,255,.06); color: inherit; border-radius: 12px; padding: 8px 6px; cursor: pointer; display: grid; justify-items: center; gap: 4px; font: inherit; box-shadow: inset 0 0 0 2px transparent; }
.thpick.on { box-shadow: inset 0 0 0 2px var(--gold); background: rgba(255,211,77,.1); }
.thpick.locked .tsw { filter: grayscale(.85) brightness(.6); }
.thpick .tsw { width: 44px; height: 64px; border-radius: 7px; display: grid; place-items: center; font-size: 18px; background-size: cover; background-position: center; box-shadow: 0 0 0 2px #fffaf0, 0 3px 8px rgba(0,0,0,.4); }
.thpick .tname { font-weight: 800; font-size: 12px; }
.thpick small { font-size: 10px; opacity: .75; line-height: 1.2; text-align: center; }
.sw-classic { background: radial-gradient(circle at 50% 38%, #5a45c9 0, #34279a 55%, #1e1568 100%); }
.sw-ember { background: radial-gradient(circle at 50% 38%, #ff8a4c 0, #d2452a 55%, #7a1a10 100%); }
.sw-jade { background: radial-gradient(circle at 50% 38%, #3fd6a0 0, #13906a 55%, #07432f 100%); }
.sw-royal { background: radial-gradient(circle at 50% 38%, #ffe27a 0, #d9a520 55%, #6e4a05 100%); }
.re .unlocked { margin: 8px auto 0; padding: 8px 12px; border-radius: 12px; background: rgba(255,211,77,.14); color: #ffe08a; font-weight: 800; width: fit-content; animation: pop .45s ease-out; }

/* Limited-time theme note on the /play start screen */
.center-msg .season-note { margin: 18px auto 0; max-width: 34em; margin-top: 18px; padding: 8px 14px; border-radius: 12px; background: rgba(255, 215, 106, .12); color: #ffe08a; font-weight: 600; }

/* Daily challenge */
.center-msg .daily-cta { margin-top: 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.daily-btn { border: 1px solid rgba(255, 215, 106, .5); }
.re .daily-card { margin: 10px auto 14px; padding: 12px 16px; max-width: 380px; border-radius: 14px; background: rgba(255, 255, 255, .06); text-align: center; }
.re .daily-card .dres { font-weight: 700; font-size: 1.1rem; margin: 0 0 6px; }
.re .daily-card .drow { font: inherit; font-size: 1.15rem; line-height: 1.35; letter-spacing: 1px; margin: 0 0 8px; white-space: pre-wrap; }
.re .daily-card .dstreak { margin: 0 0 8px; color: #ffe08a; font-weight: 600; }
.re .daily-card .btn { margin: 4px 0; }
.hero-daily { margin: 14px 0 0; }
.hero-daily a { color: #ffe08a; font-weight: 600; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.center-msg .daily-cta .muted { color: rgba(255, 255, 255, .75); max-width: 30em; }
/* Phones: side seats sit near the screen edge, so the table tag says just "bot" (the lobby shows the level). */
@media (max-width: 520px) { .opp .tag .lv { display: none; } }
