/* Crazy Eights. Mobile first (390 px inside Pantry's iframe), landscape TV at /screen.
   Theme colours arrive as CSS variables from client/theme.ts; these are the classic defaults. */
:root {
  --table: #1b5e3b; --table-alt: #0f3d26; --table-ink: #f5f1e6; --accent: #f2c14e;
  --face: #fffdf7; --edge: #d8d1c2; --ink: #1a1a1f; --red: #b3122a; --back: #1f3a6e; --back-alt: #b3122a;
  --s4-S: #1a1a1f; --s4-H: #b3122a; --s4-D: #1d4f9e; --s4-C: #1c6a38;
  --back-art: none; --table-art: none; --motif-art: none;
  --panel: #fffdf8; --panel-ink: #1f1d1a; --muted: #6b665d; --line: #e4ddcf; --danger: #c0392b; --good: #1e8449;
  --radius: 14px; --cw: 64px; --step: 0px;
  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
.dark { --panel: #1e2023; --panel-ink: #f1efe9; --muted: #a8a39a; --line: #34373c; color-scheme: dark; }
.large-text { font-size: 118%; --cw: 72px; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); color: var(--table-ink); -webkit-tap-highlight-color: transparent; overflow-x: hidden;
  background: var(--table-art) repeat, radial-gradient(ellipse at 50% 35%, var(--table), var(--table-alt)) fixed;
  background-size: 200px 200px, cover;
}
button { font: inherit; color: inherit; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: color-mix(in srgb, currentColor 65%, transparent); }
.small { font-size: .85em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------ basics */
.loading, .notice, .gather { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; padding: 1.5rem; text-align: center; }
.spinner { width: 28px; height: 28px; border: 3px solid color-mix(in srgb, var(--table-ink) 30%, transparent); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.logo { display: inline-flex; align-items: center; gap: .45rem; font-weight: 800; letter-spacing: .01em; }
.logo > span { display: inline-grid; place-items: center; width: 1.6em; height: 2.1em; border-radius: .3em; background: var(--face); color: var(--red); font-weight: 900; box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.logo.big { font-size: 1.8rem; }
.gather h1 { margin: .4rem 0 0; }
.gather-rules { margin-top: 1rem; background: color-mix(in srgb, var(--table-alt) 70%, transparent); border-radius: var(--radius); padding: .6rem 1.2rem; text-align: left; max-width: 26rem; }
.gather-rules h2 { font-size: 1rem; margin: .4rem 0; }
.gather-rules li { margin: .3rem 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 1.1rem; border-radius: 999px; border: 0; cursor: pointer; font-weight: 700;
  background: var(--accent); color: #1b1b1b; box-shadow: 0 3px 0 rgba(0,0,0,.25); transition: transform .08s; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.btn.big { min-height: 52px; font-size: 1.08rem; padding: 0 1.4rem; }
.btn.ghost { background: color-mix(in srgb, var(--table-ink) 14%, transparent); color: var(--table-ink); box-shadow: none; }
.sheet .btn.ghost { background: color-mix(in srgb, var(--panel-ink) 8%, transparent); color: var(--panel-ink); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.jump { animation: pulse 0.9s ease-in-out infinite; }
.btn.small { min-height: 40px; font-size: .9rem; padding: 0 .8rem; }
.btn.lobby { margin: 1rem auto 0; display: flex; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: color-mix(in srgb, var(--table-ink) 12%, transparent); color: var(--table-ink); font-size: 1.2rem; cursor: pointer; }
.chip { border: 0; border-radius: 999px; padding: .35rem .75rem; min-height: 36px; background: color-mix(in srgb, var(--table-ink) 14%, transparent); color: inherit; cursor: pointer; font-weight: 700; }
.chip.on { background: var(--accent); color: #1b1b1b; }
.sheet .chip { background: color-mix(in srgb, var(--panel-ink) 10%, transparent); }
.sheet .chip.on { background: var(--accent); color: #1b1b1b; }

/* ------------------------------------------------------------ cards */
.card { --w: var(--cw); position: relative; width: var(--w); height: calc(var(--w) * 1.4); flex: none; border-radius: calc(var(--w) * .12); padding: 0; border: 1px solid var(--edge);
  background: var(--face); color: var(--ink); box-shadow: 0 2px 4px rgba(0,0,0,.25); user-select: none; font-family: var(--font); overflow: hidden; }
.card.face::before { content: ""; position: absolute; inset: 22% 18%; background: var(--motif-art) center / contain no-repeat; opacity: .14; pointer-events: none; }
.card.red { color: var(--red); }
.four-color .card.s-S, .four-color .suit-badge.s-S, .four-color .suit-btn.s-S { color: var(--s4-S); }
.four-color .card.s-H, .four-color .suit-badge.s-H, .four-color .suit-btn.s-H { color: var(--s4-H); }
.four-color .card.s-D, .four-color .suit-badge.s-D, .four-color .suit-btn.s-D { color: var(--s4-D); }
.four-color .card.s-C, .four-color .suit-badge.s-C, .four-color .suit-btn.s-C { color: var(--s4-C); }
.card .corner { position: absolute; display: flex; flex-direction: column; align-items: center; line-height: .95; font-size: calc(var(--w) * .26); }
.card .corner b { font-weight: 800; letter-spacing: -.04em; }
.card .corner i { font-style: normal; font-size: .9em; }
.card .tl { top: 5%; left: 7%; }
.card .br { bottom: 5%; right: 7%; transform: rotate(180deg); }
.card .centre { position: absolute; inset: 0; display: grid; place-items: center; }
.card .pip { font-size: calc(var(--w) * .55); line-height: 1; }
.card.court .centre, .card.wild .centre { grid-template-rows: auto auto; align-content: center; }
.card .big-rank { font-weight: 900; font-size: calc(var(--w) * .44); line-height: .9; }
.card.court .pip, .card.wild .pip { font-size: calc(var(--w) * .3); }
.card.wild { background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--accent) 28%, var(--face)) 0 34%, var(--face) 35%); }
.card .badge, .badge.inline { position: absolute; right: 4%; top: 4%; min-width: 1.6em; padding: 0 .25em; border-radius: 999px; background: #1b1b1b; color: #fff; font-weight: 800; font-size: calc(var(--w) * .2); line-height: 1.4; text-align: center; }
.badge.inline { position: static; display: inline-block; font-size: .85rem; }
.card.back { background: var(--back-art) center / cover no-repeat, linear-gradient(135deg, var(--back), var(--back-alt)); border: 3px solid var(--face); }
.card.xs { --w: 22px; border-radius: 3px; box-shadow: none; }
.card.xs .corner.br, .card.xs .centre, .card.xs .badge, .card.xs::before { display: none; }
.card.xs .corner { font-size: 9px; top: 1px; left: 2px; }
.card.sm { --w: 46px; }
.card.lg { --w: 92px; }
.card.xl { --w: 150px; }
.no-anim *, .no-anim *::before { animation: none !important; transition: none !important; }

/* ------------------------------------------------------------ phone layout */
.phone { display: grid; grid-template-rows: auto auto auto 1fr auto auto auto auto auto; min-height: 100dvh; max-width: 640px; margin: 0 auto; padding: 0 0 env(safe-area-inset-bottom); }
.topbar { display: flex; align-items: center; gap: .4rem; padding: .5rem .6rem .3rem; }
.tb-left { flex: 1; min-width: 0; }
.tb-title { font-weight: 800; }
.tb-sub { font-size: .8rem; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score-chip { white-space: nowrap; }
.conn-banner { background: var(--danger); color: #fff; text-align: center; padding: .3rem; font-weight: 700; }

.players { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .2rem; padding: .2rem .5rem .4rem; }
.dir-label { font-size: 1.2rem; margin-right: .1rem; }
.dir { opacity: .6; font-weight: 800; }
.pchip { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .5rem .2rem .2rem; border-radius: 999px; background: color-mix(in srgb, var(--table-alt) 75%, transparent); font-size: .85rem; border: 2px solid transparent; max-width: 100%; }
.pchip.current { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.pchip.me .pc-name { font-weight: 800; }
.pchip.away { opacity: .6; }
.pchip.victim { border-color: var(--danger); }
.pc-name { max-width: 7.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-count { display: inline-flex; align-items: center; gap: .2rem; font-weight: 800; }
.pc-wait { font-size: .7rem; opacity: .8; }
.mini-card { display: inline-block; width: 9px; height: 13px; border-radius: 2px; background: linear-gradient(135deg, var(--back), var(--back-alt)); border: 1px solid var(--face); }
.avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; font-weight: 800; flex: none; font-size: .95rem; }
.avatar.sm { width: 26px; height: 26px; font-size: .9rem; }
.avatar.lg { width: 48px; height: 48px; font-size: 1.5rem; }
.avatar.team { background: var(--face) !important; color: var(--ink); }
.team-tag { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 4px; background: var(--face); color: var(--ink); font-size: .8rem; box-shadow: inset 0 0 0 2px var(--team); }
.team-tag.s-H, .team-tag.s-D { color: var(--red); }

.table-area { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .55rem; padding: .3rem .6rem; min-height: 220px; }
.event-pill, .penalty-pill { border: 0; border-radius: 999px; padding: .3rem .9rem; font-weight: 700; font-size: .9rem; cursor: pointer; }
.event-pill { background: color-mix(in srgb, var(--accent) 85%, #fff); color: #1b1b1b; }
.penalty-pill { background: var(--danger); color: #fff; animation: pulse 1.2s ease-in-out infinite; }
.penalty-pill.big { font-size: 1.6rem; padding: .5rem 1.4rem; }
.piles { display: flex; gap: 1.6rem; align-items: center; justify-content: center; }
.pile { position: relative; background: none; border: 0; padding: 0; }
.draw-pile { cursor: default; }
.draw-pile.can { cursor: pointer; }
.draw-pile.can .card { box-shadow: 0 0 0 4px var(--accent), 0 6px 14px rgba(0,0,0,.35); animation: pulse 1.3s ease-in-out infinite; }
.draw-pile .card::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; box-shadow: 3px 3px 0 -1px var(--face), 6px 6px 0 -2px rgba(0,0,0,.2); }
.pile-count { position: absolute; bottom: -.4rem; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.55); color: #fff; border-radius: 999px; padding: 0 .5rem; font-size: .8rem; font-weight: 700; }
.discard .card { box-shadow: 0 6px 16px rgba(0,0,0,.35); }
.card.land { animation: land .35s cubic-bezier(.2,.9,.3,1.2); }
@keyframes land { from { transform: translateY(-40px) rotate(-12deg) scale(1.15); opacity: .4; } to { transform: none; opacity: 1; } }
.active-suit { position: absolute; left: 50%; bottom: -1rem; transform: translateX(-50%); white-space: nowrap; }
.suit-badge { display: inline-flex; align-items: center; gap: .2rem; background: var(--face); color: var(--ink); border-radius: 999px; padding: .15rem .6rem; font-weight: 800; font-size: .85rem; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.suit-badge.red { color: var(--red); }
.suit-badge.big { font-size: 1rem; }
.market { display: flex; align-items: center; gap: .4rem; padding: .3rem .5rem; border-radius: var(--radius); background: color-mix(in srgb, var(--table-alt) 70%, transparent); }
.market-label { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; opacity: .85; }
.market .card.takeable { cursor: pointer; box-shadow: 0 0 0 3px var(--accent); }
.ticker-line { font-size: .82rem; text-align: center; opacity: .9; min-height: 2.4em; }
.ticker-line .big { font-weight: 800; }

.status { margin: .2rem .6rem; padding: .55rem .8rem; border-radius: var(--radius); background: color-mix(in srgb, var(--table-alt) 80%, transparent); font-weight: 700; text-align: center; }
.status.mine { background: var(--accent); color: #1b1b1b; }
.status.danger { background: var(--danger); color: #fff; }
.status.jump { background: #7d3cff; color: #fff; animation: pulse 1s ease-in-out infinite; }
.timer { padding: 0 .6rem; min-height: 6px; }
.timer-bar { position: relative; height: 18px; border-radius: 999px; background: color-mix(in srgb, var(--table-ink) 15%, transparent); overflow: hidden; }
.timer-bar::before { content: ""; position: absolute; inset: 0; width: calc(var(--p) * 100%); background: color-mix(in srgb, var(--accent) 70%, transparent); transition: width .25s linear; }
.timer-bar.low::before { background: var(--danger); }
.timer-bar span { position: relative; display: block; text-align: center; font-size: .72rem; font-weight: 800; line-height: 18px; }
.objective-slot { padding: .3rem .6rem 0; }
.objective { background: color-mix(in srgb, var(--face) 92%, transparent); color: var(--ink); border-radius: var(--radius); padding: .3rem .7rem; font-size: .88rem; }
.objective summary { cursor: pointer; font-weight: 700; min-height: 32px; display: flex; align-items: center; flex-wrap: wrap; }
.objective p { margin: .2rem 0 .4rem; }
.objective.done { box-shadow: inset 0 0 0 2px var(--good); }

.hand { padding: 1.1rem 8px .4rem; overflow: hidden; }
.hand-row { display: flex; justify-content: center; flex-wrap: nowrap; padding-top: 14px; }
.hand-row .card { margin-left: var(--step); transition: transform .12s, box-shadow .12s, filter .12s; cursor: pointer; }
.hand-row .card:first-child { margin-left: 0; }
.hand-row + .hand-row { padding-top: 4px; margin-top: -18px; }
.hand.my-turn .card.idle, .card.idle { filter: saturate(.55) brightness(.82); }
.hand-row .card.legal { transform: translateY(-8px); box-shadow: 0 0 0 2px var(--accent), 0 6px 10px rgba(0,0,0,.3); }
.hand-row .card.selected { transform: translateY(-18px); box-shadow: 0 0 0 4px var(--accent), 0 10px 18px rgba(0,0,0,.4); z-index: 2; }
.hand-row .card.jumpable { box-shadow: 0 0 0 3px #a777ff, 0 0 18px #a777ff; animation: pulse 1s ease-in-out infinite; }
.hand-row .card.drawn { outline: 3px dashed var(--accent); outline-offset: 2px; }
.hand-row .card.dealt { animation: deal .35s ease-out; }
@keyframes deal { from { transform: translateY(60px) scale(.8); opacity: 0; } }
.hand-row .card .order { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); background: var(--accent); color: #1b1b1b; border-radius: 50%; width: 1.6em; height: 1.6em; display: grid; place-items: center; font-weight: 900; }
.action-bar { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: .45rem; justify-content: center; align-items: center; padding: .5rem .6rem calc(.6rem + env(safe-area-inset-bottom)); min-height: 66px;
  background: linear-gradient(transparent, color-mix(in srgb, var(--table-alt) 92%, transparent) 30%); }
.hint { margin: 0; text-align: center; }
@keyframes pulse { 50% { filter: brightness(1.18); } }

.phone.ended .hand, .phone.ended .status, .phone.ended .timer { display: none; }

/* ------------------------------------------------------------ round results and match results */
.round-result, .results { background: var(--panel); color: var(--panel-ink); border-radius: var(--radius); padding: .8rem 1rem; width: 100%; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.round-result h2 { margin: .2rem 0; font-size: 1.25rem; }
.rr-sub { margin: 0 0 .4rem; font-weight: 700; color: var(--good); }
.rr-hands { list-style: none; padding: 0; margin: 0; }
.rr-hands li { display: flex; align-items: center; gap: .4rem; padding: .25rem 0; border-top: 1px solid var(--line); }
.rr-name { width: 5.5rem; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.rr-cards { display: flex; flex-wrap: wrap; gap: 2px; flex: 1; }
.rr-val { font-weight: 800; }
.rr-obj ul { padding-left: 1rem; margin: .2rem 0; }
.rr-obj li.done { color: var(--good); }
.rr-obj h3, .results h3 { font-size: .95rem; margin: .6rem 0 .2rem; }
.res-title { text-align: center; margin: .2rem 0; }
.res-reason { text-align: center; margin: 0 0 .4rem; color: var(--muted); }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: .5rem; margin: .4rem 0 .8rem; }
.pod { display: flex; flex-direction: column; align-items: center; gap: .2rem; min-width: 5rem; }
.pod-name { font-weight: 800; max-width: 7rem; text-align: center; overflow: hidden; text-overflow: ellipsis; }
.pod-score { font-size: 1.2rem; font-weight: 900; }
.pod-step { width: 100%; text-align: center; border-radius: 8px 8px 0 0; background: var(--accent); color: #1b1b1b; font-weight: 900; }
.p1 .pod-step { height: 4.2rem; } .p2 .pod-step { height: 3rem; background: #c9c9c9; } .p3 .pod-step { height: 2.2rem; background: #d9a066; }
.table-scroll { overflow-x: auto; }
table.scores { border-collapse: collapse; width: 100%; font-size: .9rem; }
table.scores th, table.scores td { padding: .3rem .4rem; border-bottom: 1px solid var(--line); text-align: right; }
table.scores th[scope=row], table.scores thead th:first-child { text-align: left; }
table.scores tr.mine { background: color-mix(in srgb, var(--accent) 20%, transparent); }
table.scores .total { font-weight: 900; }

/* ------------------------------------------------------------ sheets and toasts */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--panel); color: var(--panel-ink); width: 100%; max-width: 560px; max-height: 88dvh; overflow: auto; border-radius: 18px 18px 0 0; padding: 0 1rem 1.2rem; animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; background: var(--panel); padding: .6rem 0; }
.sheet-head h2 { margin: 0; font-size: 1.15rem; }
.sheet .icon-btn { background: color-mix(in srgb, var(--panel-ink) 8%, transparent); color: var(--panel-ink); }
.rules dt { font-weight: 800; margin-top: .6rem; }
.rules dd { margin: .1rem 0 0; }
.rules .event-card { background: color-mix(in srgb, var(--accent) 25%, transparent); border-radius: var(--radius); padding: .5rem .8rem; }
.ev-k { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; }
.fx-list { padding-left: 1rem; }
.fx-list li { margin: .3rem 0; }
.issues { background: color-mix(in srgb, var(--danger) 12%, transparent); border-radius: var(--radius); padding: .2rem .8rem; }
.settings { display: flex; flex-direction: column; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 48px; border-bottom: 1px solid var(--line); }
.set-row input[type=checkbox] { width: 24px; height: 24px; accent-color: var(--accent); }
.set-row select { min-height: 40px; border-radius: 10px; padding: 0 .5rem; background: var(--panel); color: var(--panel-ink); border: 1px solid var(--line); }
.host-tools { display: flex; flex-direction: column; gap: .5rem; margin-top: .8rem; }
.host-tools h3 { margin: 0; }
.suit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: .4rem 0; }
.suit-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; min-height: 96px; border-radius: var(--radius); border: 2px solid var(--line); background: var(--face); color: var(--ink); cursor: pointer; font-weight: 800; }
.suit-btn.red { color: var(--red); }
.suit-btn .sg { font-size: 2.4rem; line-height: 1; }
.suit-btn .muted { color: #6b665d; font-weight: 600; }
.fx-choice { display: flex; flex-wrap: wrap; gap: .4rem; margin: .2rem 0 .6rem; }
.toasts { position: fixed; top: .6rem; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: .4rem; width: min(92vw, 420px); pointer-events: none; }
.toast { background: #222; color: #fff; padding: .6rem .9rem; border-radius: 12px; font-weight: 600; box-shadow: 0 6px 18px rgba(0,0,0,.35); transition: opacity .4s, transform .4s; }
.toast.bad { background: var(--danger); }
.toast.good { background: var(--good); }
.toast.out { opacity: 0; transform: translateY(-8px); }

/* ------------------------------------------------------------ particles and bursts (decorative) */
.particles { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.particle { position: absolute; top: -30px; opacity: .55; animation: fall linear forwards; color: var(--table-ink); }
.p-bubbles, .p-sparkles { top: auto; bottom: -30px; animation-name: rise; }
@keyframes fall { to { transform: translate(40px, 110vh) rotate(200deg); } }
@keyframes rise { to { transform: translate(-30px, -110vh); opacity: 0; } }
.phone, .tv, .gather, .notice { position: relative; z-index: 1; }
.burst { position: fixed; pointer-events: none; z-index: 70; }
.burst span { position: absolute; font-size: 1.6rem; animation: burst 1.2s ease-out forwards; }
@keyframes burst { to { transform: translate(var(--dx), var(--dy)) scale(.6); opacity: 0; } }

/* ------------------------------------------------------------ high contrast */
.high-contrast .card { border: 2px solid #000; }
.high-contrast .card.idle { filter: none; opacity: .55; }
.high-contrast .status, .high-contrast .pchip { background: #000; color: #fff; }
.high-contrast .status.mine { background: #ffe14d; color: #000; }

/* ------------------------------------------------------------ TV */
body[data-view=screen] { overflow: hidden; }
.tv { height: 100dvh; display: flex; flex-direction: column; padding: 1.2vw 1.6vw; font-size: clamp(14px, 1.25vw, 30px); }
.tv-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.tv-head { display: flex; align-items: center; gap: 1.5em; }
.tv-head .logo { font-size: 1.5em; }
.tv-match { font-weight: 700; opacity: .9; }
.tv-event { margin-left: auto; background: color-mix(in srgb, var(--accent) 85%, #fff); color: #1b1b1b; padding: .3em .9em; border-radius: 999px; max-width: 45%; }
.tv-main { flex: 1; display: grid; grid-template-columns: minmax(14em, 22%) 1fr minmax(14em, 24%); gap: 1.5vw; min-height: 0; padding-top: 1vw; }
.tv-players { display: flex; flex-direction: column; gap: .5em; overflow: hidden; }
.tv-dir { font-weight: 700; opacity: .8; }
.tv-player { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "av name score" "av cards score"; align-items: center; gap: .1em .6em; padding: .4em .6em; border-radius: var(--radius); background: color-mix(in srgb, var(--table-alt) 75%, transparent); border: 3px solid transparent; }
.tv-player .avatar { grid-area: av; }
.tvp-name { grid-area: name; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: .3em; align-items: center; }
.tvp-cards { grid-area: cards; display: flex; align-items: center; gap: 2px; }
.tvp-cards .mini-card { width: .7em; height: 1em; }
.tvp-cards b { margin-left: .3em; }
.tvp-score { grid-area: score; font-size: 1.5em; font-weight: 900; }
.tv-player.current { border-color: var(--accent); box-shadow: 0 0 0 .3em color-mix(in srgb, var(--accent) 30%, transparent); }
.tv-player.away { opacity: .55; }
.tv-player.victim { border-color: var(--danger); }
.tv-center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1em; min-width: 0; }
.tv-turn { font-size: 2em; font-weight: 900; text-align: center; }
.tv-piles { gap: 4vw; }
.tv .card.xl { --w: clamp(120px, 11vw, 260px); }
.tv .card.md { --w: clamp(56px, 4.5vw, 110px); }
.tv-suit .suit-badge { font-size: 1.4em; }
.tv-hint { opacity: .85; margin: 0; }
.tv-feed { background: color-mix(in srgb, var(--table-alt) 75%, transparent); border-radius: var(--radius); padding: .6em 1em; overflow: hidden; }
.tv-feed h2 { font-size: 1em; margin: 0 0 .4em; opacity: .8; }
.tv-feed ol { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .45em; }
.tv-feed li.big { font-weight: 800; color: var(--accent); }
.tv-clock { position: fixed; right: 1.6vw; bottom: 1.2vw; font-size: 2em; font-weight: 900; opacity: .85; }
.tv .round-result, .tv .results { max-width: 60em; margin: 0 auto; font-size: 1.1em; }
.results.tv { margin-top: 2vh; }
.tv-gather { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 1.6em; text-align: center; }

@media (min-width: 700px) { .phone { --cw: 76px; } .card.lg { --w: 110px; } }
@media (max-width: 360px) { :root { --cw: 56px; } .card.lg { --w: 80px; } }
