@font-face { font-family: 'Fraunces'; src: url(/fonts/fraunces-latin-wght-normal.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Inter'; src: url(/fonts/inter-latin-wght-normal.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
:root {
  --felt: #0e5a3b; --felt-hi: #1b7a51; --felt-lo: #062e1f; --gold: #dcb872; --gold-hi: #f3d9a0; --gold-lo: #9c7a3c;
  --cream: #f7f0e1; --ink: #17191e; --red: #c3263a; --muted: rgba(247, 240, 225, .62); --line: rgba(220, 184, 114, .28);
  --panel: rgba(4, 22, 15, .55); --panel-2: rgba(4, 22, 15, .78);
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif; --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sans); color: var(--cream); background: var(--felt-lo);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.felt {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E"),
    radial-gradient(120% 90% at 50% 38%, var(--felt-hi) 0%, var(--felt) 42%, #0a4630 70%, var(--felt-lo) 100%);
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
.serif { font-family: var(--serif); }

/* ---------- brand ---------- */
.logo { font-family: var(--serif); font-weight: 800; letter-spacing: .14em; color: var(--cream); display: inline-flex; align-items: center; gap: .32em; line-height: 1; font-variation-settings: 'opsz' 144; }
.logo .suits { display: inline-flex; gap: .12em; }
.logo .suits .suit { width: .42em; height: .42em; fill: var(--gold); }
.logo .suits .suit.r { fill: #e0566a; }
.kicker { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); font-weight: 600; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 22px; border-radius: 16px;
  font-weight: 650; font-size: 17px; letter-spacing: .01em; transition: transform .12s var(--ease), background .2s, opacity .2s, box-shadow .2s; user-select: none;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn-gold { background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, #c49a52); color: #2a1d06; box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 6px 18px rgba(0, 0, 0, .35); }
.btn-gold:disabled { background: rgba(220, 184, 114, .22); color: rgba(247, 240, 225, .45); box-shadow: none; }
.btn-ghost { background: rgba(247, 240, 225, .08); border: 1px solid rgba(247, 240, 225, .16); color: var(--cream); }
.btn-ghost:disabled { opacity: .4; }
.btn-red { background: linear-gradient(180deg, #ef5a6c, #c3263a); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 8px 22px rgba(195, 38, 58, .45); }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(247, 240, 225, .08); border: 1px solid rgba(247, 240, 225, .12); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--cream); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- cards ---------- */
.card {
  --cw: 64px; width: var(--cw); height: calc(var(--cw) * 1.4); border-radius: calc(var(--cw) * .1); position: relative; flex: none;
  background: linear-gradient(165deg, #fffefa 0%, #f6f0e3 100%); color: var(--ink); font-family: var(--serif);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .08), 0 calc(var(--cw) * .03) calc(var(--cw) * .08) rgba(0, 0, 0, .28), 0 calc(var(--cw) * .1) calc(var(--cw) * .25) rgba(0, 0, 0, .18);
  user-select: none; -webkit-user-select: none; overflow: hidden;
}
.card.red { color: var(--red); }
.card .suit { fill: currentColor; display: block; }
.card .ix { position: absolute; display: flex; flex-direction: column; align-items: center; line-height: .9; }
.card .ix.tl { top: calc(var(--cw) * .07); left: calc(var(--cw) * .06); width: calc(var(--cw) * .3); }
.card .ix.br { bottom: calc(var(--cw) * .07); right: calc(var(--cw) * .06); width: calc(var(--cw) * .3); transform: rotate(180deg); }
.card .ix b { font-size: calc(var(--cw) * .3); font-weight: 680; letter-spacing: -.06em; font-variation-settings: 'opsz' 72; }
.card .ix .suit { width: calc(var(--cw) * .2); height: calc(var(--cw) * .2); margin-top: calc(var(--cw) * .03); }
.card .pip { position: absolute; inset: 0; display: grid; place-items: center; }
.card .pip .suit { width: calc(var(--cw) * .42); height: calc(var(--cw) * .42); }
.card .pip.ace .suit { width: calc(var(--cw) * .56); height: calc(var(--cw) * .56); }
.card .face {
  position: absolute; inset: calc(var(--cw) * .2) calc(var(--cw) * .2); border-radius: calc(var(--cw) * .05);
  border: 1px solid currentColor; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2%;
  background: repeating-linear-gradient(135deg, transparent 0 4px, rgba(0, 0, 0, .025) 4px 5px);
}
.card .face .fl { font-size: calc(var(--cw) * .44); font-weight: 760; font-style: italic; line-height: 1; }
.card .face .fs { width: calc(var(--cw) * .2); height: calc(var(--cw) * .2); }
.card.joker { background: radial-gradient(120% 90% at 30% 20%, #5a3a93 0%, #2c1a4d 60%, #1b1031 100%); color: var(--gold-hi); }
.card.joker .ix.tl b { font-size: calc(var(--cw) * .14); font-weight: 750; letter-spacing: 0; line-height: 1.02; }
.card.joker .jstar { position: absolute; width: 46%; left: 27%; top: 30%; fill: var(--gold); filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .4)); }
.card.joker .jword { position: absolute; bottom: 9%; width: 100%; text-align: center; font-size: calc(var(--cw) * .14); font-weight: 650; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.card.joker .as { position: absolute; top: 5%; right: 6%; display: flex; align-items: center; gap: 1px; padding: 2px 4px; border-radius: 6px; background: var(--cream); color: var(--ink); font-size: calc(var(--cw) * .17); font-weight: 750; line-height: 1; }
.card.joker .as.red { color: var(--red); }
.card.joker .as .suit { width: calc(var(--cw) * .14); height: calc(var(--cw) * .14); }
.card.back { background: #7a1d2b; }
.card.back .back-art {
  position: absolute; inset: calc(var(--cw) * .07); border-radius: calc(var(--cw) * .06); border: 1px solid rgba(243, 217, 160, .55);
  background:
    radial-gradient(circle at 50% 50%, rgba(243, 217, 160, .9) 0 calc(var(--cw) * .08), transparent calc(var(--cw) * .085)),
    repeating-linear-gradient(45deg, rgba(243, 217, 160, .16) 0 2px, transparent 2px 7px),
    repeating-linear-gradient(-45deg, rgba(243, 217, 160, .16) 0 2px, transparent 2px 7px),
    linear-gradient(160deg, #9b2a3a, #5e1420);
}

/* ---------- shared bits ---------- */
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 750; color: #10140f; flex: none; font-size: 16px; box-shadow: 0 0 0 2px rgba(0, 0, 0, .25); }
.pips { display: inline-flex; gap: 4px; }
.pips i { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 1px rgba(0, 0, 0, .3); }
.pips i.used { background: rgba(247, 240, 225, .16); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; letter-spacing: .04em; background: rgba(247, 240, 225, .1); }
.chip.gold { background: rgba(220, 184, 114, .16); color: var(--gold-hi); }
.toast {
  position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #1b1d22; color: var(--cream); padding: 12px 18px; border-radius: 14px; font-size: 15px; max-width: min(92vw, 520px); text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5); border: 1px solid rgba(255, 255, 255, .08); transition: .25s var(--ease); z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: rgba(239, 90, 108, .5); }

/* ================= LANDING ================= */
.landing { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 22px; text-align: center; gap: 28px; }
.landing .logo { font-size: clamp(64px, 14vw, 132px); }
.landing p.lede { margin: 0; max-width: 560px; font-size: 18px; line-height: 1.55; color: var(--muted); }
.landing .choices { display: grid; gap: 14px; width: min(100%, 720px); grid-template-columns: 1fr; }
@media (min-width: 720px) { .landing .choices { grid-template-columns: 1fr 1fr; } }
.choice { text-align: left; padding: 22px; border-radius: 22px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; transition: transform .2s var(--ease), border-color .2s; text-decoration: none; color: inherit; }
.choice:hover { transform: translateY(-2px); border-color: var(--gold); }
.choice h2 { margin: 0; font-family: var(--serif); font-size: 26px; font-weight: 650; }
.choice span { color: var(--muted); font-size: 15px; line-height: 1.45; }
.fan { position: relative; height: 140px; width: 260px; margin: 0 auto -8px; }
.fan .card { position: absolute; left: 50%; bottom: 0; --cw: 84px; transform-origin: 50% 110%; }
.landing footer { color: rgba(247, 240, 225, .4); font-size: 13px; }

/* ================= TV ================= */
.tv-wrap { position: fixed; inset: 0; overflow: hidden; }
.stage { position: absolute; left: 50%; top: 50%; width: 1920px; height: 1080px; transform-origin: 50% 50%; }
.tv-top { position: absolute; left: 48px; right: 48px; top: 32px; height: 76px; display: flex; align-items: center; justify-content: space-between; }
.tv-top .logo { font-size: 54px; }
.round-info { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.round-info .rt { font-family: var(--serif); font-size: 34px; font-weight: 600; }
.round-info .rt em { font-style: normal; color: var(--gold-hi); }
.round-track { display: flex; gap: 8px; }
.round-track i { width: 34px; height: 6px; border-radius: 3px; background: rgba(247, 240, 225, .14); }
.round-track i.done { background: var(--gold-lo); }
.round-track i.now { background: var(--gold-hi); box-shadow: 0 0 12px rgba(243, 217, 160, .7); }
.joinbox { display: flex; align-items: center; gap: 18px; padding: 10px 12px 10px 22px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
.joinbox .jl { text-align: right; }
.joinbox .jl small { display: block; color: var(--muted); font-size: 15px; }
.joinbox .jl b { font-family: var(--serif); font-size: 36px; letter-spacing: .18em; color: var(--gold-hi); }
.joinbox .qr-sm { width: 64px; height: 64px; background: #fff; border-radius: 8px; padding: 4px; }
.joinbox .qr-sm svg, .qr svg { width: 100%; height: 100%; display: block; }
.tv-mute { position: absolute; right: 48px; bottom: 30px; opacity: .55; }

/* lobby */
.lobby { position: absolute; inset: 140px 96px 80px; display: grid; grid-template-columns: 1fr 640px; gap: 72px; align-items: center; }
.lobby h1 { font-family: var(--serif); font-size: 96px; line-height: .98; margin: 18px 0 22px; font-weight: 650; letter-spacing: -.02em; }
.lobby h1 em { color: var(--gold-hi); font-style: italic; font-weight: 500; }
.lobby .steps { font-size: 28px; line-height: 1.5; color: var(--muted); margin: 0 0 36px; }
.lobby .steps b { color: var(--cream); }
.lobby .codebig { font-family: var(--serif); font-size: 150px; font-weight: 700; letter-spacing: .16em; color: var(--gold-hi); line-height: 1; text-shadow: 0 6px 30px rgba(0, 0, 0, .35); }
.lobby .url { font-size: 30px; color: var(--cream); margin-top: 8px; }
.lobby .qr-card { background: var(--panel); border: 1px solid var(--line); border-radius: 32px; padding: 36px; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.lobby .qr { width: 400px; height: 400px; background: #fff; border-radius: 22px; padding: 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.lobby .qr-card p { margin: 0; font-size: 24px; color: var(--muted); }
.seats { display: flex; flex-wrap: wrap; gap: 14px; min-height: 76px; }
.seat { display: flex; align-items: center; gap: 12px; padding: 10px 20px 10px 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid rgba(247, 240, 225, .1); font-size: 26px; font-weight: 600; animation: pop .45s var(--ease); }
.seat .avatar { width: 50px; height: 50px; font-size: 22px; }
.seat.empty { border: 2px dashed rgba(247, 240, 225, .16); background: none; color: rgba(247, 240, 225, .35); font-weight: 500; padding: 10px 26px; }
.seat .crown { width: 22px; height: 22px; fill: var(--gold); }
.lobby .waiting { margin-top: 26px; font-size: 24px; color: var(--muted); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

/* game table */
.tv-game { position: absolute; inset: 132px 48px 40px; display: grid; grid-template-columns: 500px 1fr; gap: 36px; }
.center-col { display: flex; flex-direction: column; gap: 24px; }
.piles { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 30px; padding: 30px 30px 26px; display: flex; flex-direction: column; gap: 22px; }
.piles-row { display: flex; justify-content: center; gap: 48px; align-items: flex-end; }
.pile { display: flex; flex-direction: column; align-items: center; gap: 14px; position: relative; }
.pile .lbl { font-size: 18px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.pile .lbl b { color: var(--cream); letter-spacing: 0; font-size: 22px; margin-left: 6px; }
.stack { position: relative; width: 150px; height: 210px; }
.stack .card { --cw: 150px; position: absolute; left: 0; top: 0; }
.stack .card:nth-child(1) { transform: translate(-6px, 6px) rotate(-2deg); }
.stack .card:nth-child(2) { transform: translate(-3px, 3px) rotate(1deg); }
.stack.empty { border: 2px dashed rgba(247, 240, 225, .2); border-radius: 15px; }
.discard-slot .card.top { animation: land .5s var(--ease); }
@keyframes land { from { transform: translateY(-60px) rotate(-12deg) scale(1.1); opacity: 0; } to { transform: none; opacity: 1; } }
.ring { position: absolute; inset: -16px; pointer-events: none; }
.ring circle { fill: none; stroke-width: 6; }
.ring .bg { stroke: rgba(247, 240, 225, .1); }
.ring .fg { stroke: var(--gold-hi); stroke-linecap: round; filter: drop-shadow(0 0 8px rgba(243, 217, 160, .7)); }
.sham-tag { position: absolute; top: -24px; left: 50%; transform: translateX(-50%); padding: 6px 16px; border-radius: 999px; background: var(--gold); color: #2a1d06; font-weight: 800; font-size: 18px; letter-spacing: .14em; white-space: nowrap; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }
.turn-card { border-radius: 30px; padding: 26px 30px; background: var(--panel); border: 1px solid var(--line); display: flex; gap: 20px; align-items: center; }
.turn-card .avatar { width: 76px; height: 76px; font-size: 34px; }
.turn-card .who { font-family: var(--serif); font-size: 44px; font-weight: 650; line-height: 1.05; }
.turn-card .what { font-size: 24px; color: var(--muted); margin-top: 6px; }
.req-card { border-radius: 24px; padding: 20px 26px; background: rgba(4, 22, 15, .35); border: 1px solid rgba(247, 240, 225, .08); }
.req-card .kicker { font-size: 15px; }
.req-card .req { font-family: var(--serif); font-size: 38px; margin-top: 6px; font-weight: 600; }
.req-card .req-help { font-size: 19px; color: var(--muted); margin-top: 6px; line-height: 1.4; }

.zones { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-content: start; overflow: hidden; }
.zones.n3, .zones.n4 { grid-template-rows: repeat(2, minmax(0, 1fr)); }
.zones.n5, .zones.n6 { grid-template-rows: repeat(3, minmax(0, 1fr)); }
.zones.n7, .zones.n8 { grid-template-rows: repeat(4, minmax(0, 1fr)); gap: 14px; }
.zone { position: relative; border-radius: 26px; background: var(--panel); border: 1px solid rgba(247, 240, 225, .08); padding: 18px 22px; display: flex; flex-direction: column; gap: 14px; min-height: 0; transition: border-color .3s, box-shadow .3s, background .3s; }
.zone.cur { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(220, 184, 114, .45), 0 0 40px rgba(220, 184, 114, .18); background: rgba(10, 40, 28, .72); }
.zone.out { opacity: .4; }
.zone-h { display: flex; align-items: center; gap: 14px; }
.zone-h .avatar { width: 46px; height: 46px; font-size: 20px; }
.zone-h .nm { font-size: 27px; font-weight: 650; display: flex; align-items: center; gap: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zone-h .nm .tag { font-size: 13px; padding: 3px 9px; border-radius: 999px; background: rgba(247, 240, 225, .12); font-weight: 700; letter-spacing: .08em; color: var(--muted); }
.zone-h .nm .tag.laid { background: rgba(139, 195, 74, .18); color: #b9e486; }
.zone-h .nm .tag.off { background: rgba(239, 90, 108, .18); color: #ff9aa6; }
.zone-h .sp { flex: 1; }
.zone-h .hand-ct { display: flex; align-items: center; gap: 10px; font-size: 26px; font-weight: 700; }
.minifan { position: relative; width: 52px; height: 42px; }
.minifan .card { --cw: 28px; position: absolute; bottom: 0; left: 12px; transform-origin: 50% 120%; }
.zone-h .score { text-align: right; min-width: 92px; }
.zone-h .score small { display: block; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.zone-h .score b { font-family: var(--serif); font-size: 32px; font-weight: 650; }
.melds { display: flex; flex-wrap: wrap; gap: 14px 22px; align-content: flex-start; overflow: hidden; flex: 1; min-height: 0; }
.melds .none { color: rgba(247, 240, 225, .3); font-size: 20px; font-style: italic; font-family: var(--serif); align-self: center; }
.meld { display: flex; flex-direction: column; gap: 4px; }
.meld .ml { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.meld .mc { display: flex; }
.meld .mc .card { --cw: var(--mw, 62px); }
.meld .mc .card + .card { margin-left: calc(var(--mw, 62px) * -.62); }
.meld.fresh .mc { animation: pop .5s var(--ease); }
.zones.n5 .meld, .zones.n6 .meld { --mw: 54px; }
.zones.n7 .meld, .zones.n8 .meld { --mw: 44px; }
.zones.n7 .zone-h .avatar, .zones.n8 .zone-h .avatar { width: 36px; height: 36px; font-size: 16px; }
.zones.n7 .zone, .zones.n8 .zone { padding: 12px 18px; gap: 8px; }

/* overlays */
.overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(2, 14, 9, .62); backdrop-filter: blur(6px); z-index: 20; animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; } }
.board { width: 1320px; background: linear-gradient(180deg, rgba(14, 50, 35, .97), rgba(6, 30, 20, .97)); border: 1px solid var(--line); border-radius: 36px; padding: 48px 56px; box-shadow: 0 40px 120px rgba(0, 0, 0, .55); }
.board h2 { font-family: var(--serif); font-size: 64px; margin: 8px 0 6px; font-weight: 650; }
.board h2 em { color: var(--gold-hi); font-style: italic; font-weight: 500; }
.board .sub { font-size: 24px; color: var(--muted); margin-bottom: 30px; }
.sb { width: 100%; border-collapse: collapse; font-size: 24px; }
.sb th { font-size: 14px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; text-align: center; padding: 0 8px 12px; }
.sb th:first-child, .sb td:first-child { text-align: left; }
.sb td { padding: 14px 8px; border-top: 1px solid rgba(247, 240, 225, .08); text-align: center; font-variant-numeric: tabular-nums; }
.sb td.tot { font-family: var(--serif); font-size: 34px; font-weight: 700; color: var(--gold-hi); }
.sb td.now { color: var(--cream); font-weight: 700; }
.sb td .pn { display: flex; align-items: center; gap: 14px; font-weight: 650; }
.sb tr.lead td .pn::after { content: 'Leader'; font-size: 12px; padding: 3px 8px; border-radius: 999px; background: rgba(220, 184, 114, .2); color: var(--gold-hi); letter-spacing: .1em; text-transform: uppercase; }
.sb .zero { color: #b9e486; }
.leftover { display: flex; margin-left: 10px; }
.leftover .card { --cw: 30px; }
.leftover .card + .card { margin-left: -18px; }
.board .next { margin-top: 30px; font-size: 22px; color: var(--muted); display: flex; align-items: center; gap: 12px; }
.winner-hero { display: flex; align-items: center; gap: 28px; margin-bottom: 30px; }
.winner-hero .avatar { width: 120px; height: 120px; font-size: 56px; box-shadow: 0 0 0 6px rgba(220, 184, 114, .5), 0 0 60px rgba(220, 184, 114, .45); }
.burst { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 30; }
.burst .b { font-family: var(--serif); font-weight: 900; font-size: 240px; letter-spacing: .06em; color: var(--gold-hi); text-shadow: 0 10px 0 #7a5a20, 0 30px 80px rgba(0, 0, 0, .55); animation: burst 1.6s var(--ease) forwards; text-align: center; line-height: .9; }
.burst .b small { display: block; font-family: var(--sans); font-size: 44px; font-weight: 700; letter-spacing: .02em; color: var(--cream); text-shadow: 0 4px 20px rgba(0, 0, 0, .6); margin-top: 18px; }
@keyframes burst { 0% { transform: scale(.3) rotate(-8deg); opacity: 0; } 18% { transform: scale(1.08) rotate(2deg); opacity: 1; } 30% { transform: scale(1) rotate(0); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(1.04); } }
.conn-warn { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); background: #3a1418; color: #ffb3bd; padding: 8px 18px; border-radius: 999px; font-size: 18px; z-index: 50; }
.start-cta { position: absolute; inset: 0; display: grid; place-items: center; z-index: 40; }

/* ================= PHONE ================= */
.phone { min-height: 100%; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; padding-top: env(safe-area-inset-top); }
.ph-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px 8px; }
.ph-top .logo { font-size: 22px; letter-spacing: .12em; }
.ph-top .sp { flex: 1; }
.ph-top .rd { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.ph-top .rd small { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.ph-top .rd b { font-size: 15px; font-weight: 700; color: var(--gold-hi); }
.ph-top .icon-btn { width: 40px; height: 40px; }
.status {
  margin: 0 12px; padding: 12px 16px; border-radius: 16px; display: flex; align-items: center; gap: 12px; min-height: 58px;
  background: var(--panel); border: 1px solid rgba(247, 240, 225, .08); transition: background .3s, border-color .3s;
}
.status.mine { background: linear-gradient(180deg, rgba(220, 184, 114, .24), rgba(220, 184, 114, .12)); border-color: rgba(220, 184, 114, .6); }
.status.alert { background: linear-gradient(180deg, rgba(239, 90, 108, .28), rgba(239, 90, 108, .14)); border-color: rgba(239, 90, 108, .6); }
.status .avatar { width: 32px; height: 32px; font-size: 14px; }
.status .tx { flex: 1; min-width: 0; }
.status .tx b { display: block; font-size: 16px; font-weight: 700; }
.status .tx span { display: block; font-size: 13.5px; color: var(--muted); margin-top: 2px; line-height: 1.3; }
.status .cd { font-family: var(--serif); font-size: 24px; font-weight: 700; color: var(--gold-hi); min-width: 28px; text-align: right; }
.ph-table { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 12px 6px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.ph-piles { display: flex; gap: 12px; align-items: stretch; }
.ph-pile { flex: 1; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: var(--panel); border: 1px solid rgba(247, 240, 225, .08); text-align: left; min-height: 92px; position: relative; transition: border-color .2s, background .2s, transform .12s; }
.ph-pile:active:not(:disabled) { transform: scale(.98); }
.ph-pile .card { --cw: 50px; }
.ph-pile .pl { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.ph-pile .pv { font-size: 15px; font-weight: 700; margin-top: 3px; }
.ph-pile.hot { border-color: var(--gold); background: rgba(220, 184, 114, .14); box-shadow: 0 0 0 1px rgba(220, 184, 114, .4), 0 0 24px rgba(220, 184, 114, .18); }
.ph-pile .empty-slot { width: 50px; height: 70px; border-radius: 6px; border: 1.5px dashed rgba(247, 240, 225, .25); }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; margin: 6px 2px 0; }
.sec-h h3 { margin: 0; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.sec-h span { font-size: 12px; color: var(--muted); }
.pmelds { display: flex; flex-direction: column; gap: 8px; }
.pm-owner { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; color: var(--muted); margin: 4px 2px 0; }
.pm-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pmeld { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 14px; background: rgba(4, 22, 15, .5); border: 1px solid rgba(247, 240, 225, .08); transition: border-color .2s, background .2s, transform .12s; }
.pmeld .mc { display: flex; }
.pmeld .mc .card { --cw: 34px; }
.pmeld .mc .card + .card { margin-left: -21px; }
.pmeld.target { border-color: var(--gold); background: rgba(220, 184, 114, .14); animation: breathe 1.6s ease-in-out infinite; }
.pmeld.nofit { opacity: .45; }
.pmeld:active { transform: scale(.98); }
@keyframes breathe { 50% { box-shadow: 0 0 0 3px rgba(220, 184, 114, .25); } }
.ph-empty { color: rgba(247, 240, 225, .4); font-size: 14px; font-style: italic; font-family: var(--serif); padding: 4px 2px; }
.others { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.others::-webkit-scrollbar { display: none; }
.other { flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-radius: 999px; background: rgba(4, 22, 15, .45); font-size: 13px; font-weight: 600; border: 1px solid transparent; }
.other.cur { border-color: var(--gold); }
.other .avatar { width: 26px; height: 26px; font-size: 12px; }
.other b { font-weight: 800; color: var(--gold-hi); }
.other.off { opacity: .5; }

.staging { margin: 0 12px; display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: none; }
.staging:empty { display: none; }
.sgroup { flex: none; display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: 14px; background: rgba(4, 22, 15, .6); border: 1px solid rgba(139, 195, 74, .5); position: relative; }
.sgroup.bad { border-color: rgba(239, 90, 108, .6); }
.sgroup .mc { display: flex; }
.sgroup .mc .card { --cw: 32px; }
.sgroup .mc .card + .card { margin-left: -20px; }
.sgroup .st { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #b9e486; }
.sgroup.bad .st { color: #ff9aa6; }
.sgroup .st button { padding: 2px 7px; border-radius: 6px; background: rgba(247, 240, 225, .12); font-size: 11px; font-weight: 700; color: var(--cream); letter-spacing: .04em; }
.sgroup .x { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; background: #2a2d33; display: grid; place-items: center; font-size: 15px; line-height: 1; border: 1px solid rgba(255, 255, 255, .15); }

.hand-wrap { padding: 6px 12px 0; }
.hand-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.hand-bar .hl { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.hand-bar .hl b { color: var(--cream); letter-spacing: 0; font-size: 14px; }
.hand-bar .sp { flex: 1; }
.toggle { height: 34px; padding: 0 12px; border-radius: 10px; font-size: 13px; font-weight: 700; background: rgba(247, 240, 225, .07); border: 1px solid rgba(247, 240, 225, .12); color: var(--muted); display: inline-flex; align-items: center; gap: 6px; transition: .15s; }
.toggle[aria-pressed="true"] { background: rgba(220, 184, 114, .2); border-color: rgba(220, 184, 114, .7); color: var(--gold-hi); }
.toggle svg { width: 13px; height: 13px; fill: currentColor; }
.hand { position: relative; height: 200px; touch-action: pan-y; }
.hand .card { --cw: 62px; position: absolute; left: 0; top: 0; transition: transform .38s var(--ease), box-shadow .2s, opacity .3s; will-change: transform; cursor: pointer; }
.hand .card.sel { box-shadow: 0 0 0 3px var(--gold-hi), 0 12px 26px rgba(0, 0, 0, .45); }
.hand .card.dragging { transition: none; z-index: 60 !important; box-shadow: 0 0 0 3px var(--gold-hi), 0 22px 40px rgba(0, 0, 0, .55); }
.hand .card.new { animation: drawin .55s var(--ease); }
@keyframes drawin { from { opacity: 0; filter: brightness(1.4); } }
.hand-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-family: var(--serif); font-style: italic; }
.hint { min-height: 20px; font-size: 13px; color: var(--muted); text-align: center; padding: 0 16px; margin: 2px 0 6px; }
.actions { display: flex; gap: 10px; padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(4, 22, 15, 0), rgba(4, 22, 15, .65) 30%); }
.actions .btn { flex: 1; min-height: 58px; padding: 0 10px; font-size: 16px; }
.actions .btn.wide { flex: 2; }
.actions .btn.sm { flex: .8; }
.sham-btn { font-family: var(--serif); font-size: 26px !important; font-weight: 900 !important; letter-spacing: .12em; animation: shamPulse 1.1s ease-in-out infinite; }
@keyframes shamPulse { 50% { box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 8px 34px rgba(239, 90, 108, .85); } }

/* phone join / lobby */
.ph-center { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 24px 22px calc(24px + env(safe-area-inset-bottom)); gap: 18px; overflow-y: auto; }
.ph-center .logo { font-size: 58px; justify-content: center; }
.ph-center .tag { text-align: center; color: var(--muted); margin: -6px 0 10px; font-size: 15px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.field input { height: 60px; border-radius: 16px; border: 1px solid rgba(247, 240, 225, .18); background: rgba(4, 22, 15, .55); color: var(--cream); font: inherit; font-size: 20px; padding: 0 18px; outline: none; transition: border-color .2s; }
.field input:focus { border-color: var(--gold); }
.field input.code { font-family: var(--serif); letter-spacing: .4em; text-transform: uppercase; font-size: 30px; font-weight: 700; text-align: center; }
.err-line { color: #ff9aa6; font-size: 14px; min-height: 20px; text-align: center; }
.plist { display: flex; flex-direction: column; gap: 8px; }
.prow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--panel); font-weight: 600; }
.prow .avatar { width: 34px; height: 34px; font-size: 15px; }
.prow .me { margin-left: auto; font-size: 12px; color: var(--gold-hi); letter-spacing: .08em; text-transform: uppercase; }
.ph-hero { text-align: center; }
.ph-hero h2 { font-family: var(--serif); font-size: 32px; margin: 6px 0 4px; font-weight: 650; }
.ph-hero p { margin: 0; color: var(--muted); }
.sheet-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 80; display: flex; align-items: flex-end; animation: fade .2s ease; }
.sheet { width: 100%; background: #10261b; border-top: 1px solid var(--line); border-radius: 26px 26px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; animation: up .3s var(--ease); }
@keyframes up { from { transform: translateY(100%); } }
.sheet h3 { margin: 0; font-family: var(--serif); font-size: 26px; font-weight: 650; }
.sheet p { margin: 0; color: var(--muted); line-height: 1.45; }
.sheet .row { display: flex; gap: 10px; }
.sheet .row .btn { flex: 1; }
.sheet .bigcard { display: flex; justify-content: center; padding: 6px 0; }
.sheet .bigcard .card { --cw: 92px; }
.mini-sb { width: 100%; border-collapse: collapse; }
.mini-sb td { padding: 10px 6px; border-top: 1px solid rgba(247, 240, 225, .08); font-variant-numeric: tabular-nums; }
.mini-sb td:last-child { text-align: right; font-family: var(--serif); font-weight: 700; font-size: 20px; color: var(--gold-hi); }
.mini-sb td.r { text-align: right; color: var(--muted); }
.offline-pill { position: fixed; top: calc(8px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); background: #3a1418; color: #ffb3bd; padding: 6px 14px; border-radius: 999px; font-size: 13px; z-index: 90; }
.discard-slot .card.top.still { animation: none; }
.ring { inset: auto; left: -16px; top: -16px; }
.burst .rays { position: absolute; width: 1400px; height: 1400px; border-radius: 50%; background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--pc, #dcb872) 38%, transparent) 0 8deg, transparent 8deg 20deg); mask-image: radial-gradient(circle, #000 18%, transparent 62%); animation: rays 1.6s var(--ease) forwards; }
@keyframes rays { 0% { transform: scale(.2) rotate(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: scale(1.1) rotate(40deg); opacity: 0; } }
.burst .b small { display: flex; align-items: center; justify-content: center; gap: 16px; }
.burst .who-dot { width: 34px; height: 34px; border-radius: 50%; background: var(--pc); box-shadow: 0 0 0 4px rgba(0,0,0,.25), 0 0 30px var(--pc); }
.sound-cta { position: absolute; right: 108px; bottom: 30px; display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); color: var(--gold-hi); font-size: 18px; font-weight: 600; }
.sound-cta svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.ph-table > * { flex: none; }
.pile { gap: 30px; }
.sham-tag { top: -20px; z-index: 2; }
.leftover .card { --cw: 40px; }
.leftover .card + .card { margin-left: -22px; }
.sb tr.win td .pn::after { content: 'Winner'; }
.burst::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, rgba(2, 14, 9, .7) 0%, rgba(2, 14, 9, .35) 35%, transparent 65%); animation: fade .25s ease, fadeout 1.6s ease forwards; }
@keyframes fadeout { 80% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- inputs: typable on iOS Safari and Android ---------- */
.field input, input[type="text"] {
  user-select: text !important;
  -webkit-user-select: text !important;
  -webkit-user-modify: read-write;
  touch-action: manipulation;
  pointer-events: auto;
  -webkit-text-fill-color: var(--cream);
  caret-color: var(--gold-hi);
}
.field input:-webkit-autofill,
.field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--cream) !important;
  box-shadow: 0 0 0 1000px #10261b inset;
  transition: background-color 9999s ease-out;
}
.phone { min-height: 100%; min-height: 100dvh; height: auto; overflow: auto; -webkit-overflow-scrolling: touch; }
.phone.in-game { height: 100dvh; height: 100svh; overflow: hidden; display: flex; flex-direction: column; }
.phone.in-game .ph-table { -webkit-overflow-scrolling: touch; }

/* host lobby */
.host-card { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 18px 16px 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.host-card .qr { width: 164px; height: 164px; background: #fff; border-radius: 16px; padding: 12px; }
.host-card .qr svg { width: 100%; height: 100%; display: block; }
.host-code { font-family: var(--serif); font-size: 44px; font-weight: 700; letter-spacing: .18em; color: var(--gold-hi); line-height: 1; }
.host-actions { display: flex; gap: 8px; width: 100%; }
.host-actions .btn { flex: 1; min-height: 48px; font-size: 15px; }
.tv-opt { text-align: center; font-size: 13px; color: var(--muted); line-height: 1.45; margin: 0; }
.tv-opt a { color: var(--gold-hi); }
.prow .kick { margin-left: auto; width: 32px; height: 32px; border-radius: 50%; background: rgba(247,240,225,.08); font-size: 18px; line-height: 1; color: var(--muted); }
.sound-banner { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border-radius: 12px; background: rgba(220,184,114,.14); border: 1px solid rgba(220,184,114,.4); color: var(--gold-hi); font-weight: 650; font-size: 15px; }

/* in-game table: scores, log, less cramped */
.other .sc { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.other b.count { color: var(--gold-hi); }
.myscore { text-align: right; margin-right: 6px; }
.myscore small { display: block; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.myscore b { font-family: var(--serif); font-size: 18px; font-weight: 700; color: var(--gold-hi); }

.burst.phone-burst { position: fixed; inset: 0; z-index: 70; }
.burst.phone-burst .b { font-size: 96px; }
.burst.phone-burst .b small { font-size: 22px; }

button.logo-home { cursor: pointer; background: none; border: 0; padding: 0; color: inherit; font: inherit; font-family: var(--serif); letter-spacing: inherit; }
.logo-home:active { transform: scale(.97); opacity: .85; }
.sheet .btn-red { width: auto; }
