:root {
  --felt-1: #23845a;
  --felt-2: #13573a;
  --felt-3: #0a3524;
  --night: #071f16;
  --ink: #f7f2e6;
  --ink-dim: rgba(247, 242, 230, 0.72);
  --ink-faint: rgba(247, 242, 230, 0.45);
  --gold: #eabf55;
  --marigold: #f39c1e;
  --vermilion: #e2492f;
  --plate: rgba(6, 26, 18, 0.62);
  --plate-line: rgba(234, 191, 85, 0.28);

  --card-face: #fffdf6;
  --card-edge: #d8d0bd;
  --card-red: #c4302b;
  --card-black: #1b1b22;
  --back-1: #7a1c2b;
  --back-2: #9c2c3d;

  --card-w: 80px;
  --card-h: 114px;
  --trick-w: 72px;
  --trick-h: 103px;
  --radius: 9px;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);

  --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Yatra One', 'Georgia', serif;
  --font-card: 'Georgia', 'Times New Roman', serif;
  color-scheme: dark;
}

@media (max-width: 700px) {
  :root {
    --card-w: 58px;
    --card-h: 84px;
    --trick-w: 52px;
    --trick-h: 75px;
    --radius: 7px;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--night);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
.muted { color: var(--ink-faint); font-weight: 400; }

/* ---------- shared felt background ---------- */
.setup-screen,
.felt {
  background:
    radial-gradient(ellipse at 50% 42%, rgba(255, 255, 255, 0.08), transparent 55%),
    radial-gradient(ellipse at 50% 45%, var(--felt-1) 0%, var(--felt-2) 55%, var(--felt-3) 100%);
}

/* ---------- buttons & inputs ---------- */
.btn {
  appearance: none;
  border: 1px solid var(--plate-line);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:hover { background: rgba(255, 255, 255, 0.12); border-color: var(--gold); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .segmented button:focus-visible, .stepper button:focus-visible, .card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.btn.ghost { border-color: transparent; background: transparent; padding: 6px 10px; color: var(--ink-dim); }
.btn.ghost:hover { color: var(--ink); background: rgba(255, 255, 255, 0.08); }
.btn.primary {
  background: linear-gradient(180deg, #f6b13a, var(--marigold));
  border-color: #ffd27a;
  color: #2a1503;
  box-shadow: 0 6px 18px rgba(243, 156, 30, 0.35);
}
.btn.primary:hover { background: linear-gradient(180deg, #ffc252, #f7a52a); }
.btn.big { width: 100%; padding: 14px 18px; font-size: 17px; }

input[type='text'], select {
  width: 100%;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--plate-line);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--ink);
  font: inherit;
}
input[type='text']:focus, select:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
select { padding: 6px 10px; width: auto; cursor: pointer; }
select option { background: #10291e; }

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--plate-line);
  border-radius: 12px;
}
.segmented button {
  border: 0;
  background: transparent;
  padding: 8px 14px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-dim);
  cursor: pointer;
}
.segmented button[aria-checked='true'] { background: var(--gold); color: #2a1a03; }
.segmented.small button { padding: 6px 10px; font-size: 13px; }

.stepper { display: inline-flex; align-items: center; gap: 4px; background: rgba(0,0,0,.28); border: 1px solid var(--plate-line); border-radius: 12px; padding: 4px; }
.stepper button { width: 36px; height: 36px; border-radius: 9px; border: 0; background: rgba(255,255,255,.08); font-size: 20px; cursor: pointer; }
.stepper button:hover:not(:disabled) { background: rgba(255,255,255,.16); }
.stepper button:disabled { opacity: .35; cursor: default; }
.stepper output { min-width: 40px; text-align: center; font-weight: 700; font-size: 18px; }

/* ---------- setup ---------- */
.setup-screen {
  height: 100%;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 32px 16px 48px;
}
.setup-panel {
  width: 100%;
  max-width: 560px;
  background: var(--plate);
  border: 1px solid var(--plate-line);
  border-radius: 22px;
  padding: 28px 28px 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
}
.setup-head { text-align: center; margin-bottom: 18px; }
.logo {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(48px, 12vw, 72px);
  line-height: 1;
  margin: 0;
  color: var(--gold);
  text-shadow: 0 3px 0 #7a4a06, 0 10px 30px rgba(0, 0, 0, 0.5);
  letter-spacing: 1px;
}
.tagline { margin: 10px auto 0; max-width: 40ch; color: var(--ink-dim); line-height: 1.45; }
#setup-form { display: grid; gap: 18px; }
.field { display: grid; gap: 8px; }
.field-label { font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-dim); }
.field-label .muted { text-transform: none; letter-spacing: 0; }
.hint { margin: 0; font-size: 13px; color: var(--ink-faint); min-height: 1.3em; }
.two-col { grid-template-columns: 1fr auto; align-items: end; gap: 16px; }
@media (max-width: 520px) { .two-col { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; line-height: 1.35; }
.check input { width: 18px; height: 18px; accent-color: var(--marigold); margin-top: 1px; flex: none; }

.opp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.opp-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 6px 6px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
}
.opp-list .opp-name { flex: 1; font-weight: 600; }

.how-to { margin-top: 18px; border-top: 1px solid var(--plate-line); padding-top: 12px; color: var(--ink-dim); line-height: 1.5; }
.how-to summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.how-to ol { padding-left: 20px; }

/* ---------- avatars ---------- */
.avatar {
  --hue: 30;
  width: 40px; height: 40px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 17px;
  color: #fff;
  background: radial-gradient(circle at 35% 30%, hsl(var(--hue) 70% 62%), hsl(var(--hue) 62% 36%));
  border: 2px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.opp-list .avatar { width: 32px; height: 32px; font-size: 14px; }

/* ---------- table layout ---------- */
.table-screen {
  height: 100%;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  position: relative;
  background: var(--felt-3);
}
.hud {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: rgba(4, 20, 14, 0.85);
  border-bottom: 1px solid var(--plate-line);
  z-index: 5;
}
.hud-brand { font-family: var(--font-display); color: var(--gold); font-size: 24px; line-height: 1; }
.hud-info { flex: 1; color: var(--ink-dim); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-actions { display: flex; gap: 2px; }
@media (max-width: 520px) {
  .hud { gap: 6px; padding-left: 10px; padding-right: 6px; }
  .hud-brand { font-size: 20px; }
  .hud-actions .btn.ghost { padding: 6px 7px; font-size: 13px; }
}

.felt { position: relative; overflow: hidden; min-height: 0; }

/* ---------- seats ---------- */
.seats { position: absolute; inset: 0; pointer-events: none; }
.seat {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  pointer-events: auto;
  transition: opacity 0.3s;
}
.seat-plate {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 5px;
  background: var(--plate);
  border: 1px solid var(--plate-line);
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.25s, border-color 0.25s;
  max-width: 170px;
}
.seat-meta { min-width: 0; line-height: 1.15; }
.seat-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat-sub { font-size: 12px; color: var(--ink-dim); white-space: nowrap; }
.seat-sub .count { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.diff-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 1px 6px; border-radius: 6px; background: rgba(255,255,255,.1); color: var(--ink-dim); }
.diff-tag.easy { color: #9fe3b5; }
.diff-tag.medium { color: #ffe08a; }
.diff-tag.hard { color: #ffb37a; }
.diff-tag.expert { color: #ff8e7a; }

.seat-fan { position: relative; height: 34px; width: 64px; }
.seat-fan .mini {
  position: absolute; bottom: 0; left: 50%;
  width: 22px; height: 32px; margin-left: -11px;
  border-radius: 4px;
  transform-origin: 50% 110%;
}
.seat.is-turn .seat-plate {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(234, 191, 85, 0.35), 0 0 28px rgba(234, 191, 85, 0.45);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(234, 191, 85, 0.18), 0 0 34px rgba(234, 191, 85, 0.6); } }
.seat.is-out { opacity: 0.55; }
.seat.is-out .seat-fan { visibility: hidden; }
.seat-badge {
  font-size: 11px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px;
  background: #2f7d55; color: #eafff2; border: 1px solid #6fd09c;
}
.seat-badge.bhabhi { background: var(--vermilion); border-color: #ffb3a3; color: #fff; }
.seat.is-bhabhi { opacity: 1; }
.thinking { display: inline-flex; gap: 2px; margin-left: 2px; vertical-align: middle; }
.thinking i { width: 4px; height: 4px; border-radius: 50%; background: var(--gold); animation: blink 1s infinite; }
.thinking i:nth-child(2) { animation-delay: 0.15s; }
.thinking i:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }

@media (max-width: 700px) {
  .seat-plate { padding: 3px 8px 3px 3px; gap: 6px; max-width: 112px; }
  .seat .avatar { width: 30px; height: 30px; font-size: 13px; border-width: 1.5px; }
  .seat-name { font-size: 12px; }
  .seat-sub { font-size: 11px; }
  .seat .diff-tag { display: none; }
  .seat-fan { height: 22px; width: 44px; }
  .seat-fan .mini { width: 15px; height: 22px; margin-left: -7.5px; border-radius: 3px; }
  .seat-badge { font-size: 9px; padding: 2px 6px; }
}

/* ---------- trick zone ---------- */
.trick-zone {
  position: absolute;
  left: 50%; top: 54%;
  width: min(360px, 74vw); height: min(270px, 42vh);
  transform: translate(-50%, -50%);
}
.rangoli {
  position: absolute; inset: 12% 18%;
  border-radius: 50%;
  border: 2px dashed rgba(234, 191, 85, 0.22);
  box-shadow: inset 0 0 0 10px rgba(234, 191, 85, 0.04), inset 0 0 0 22px rgba(255, 255, 255, 0.025);
}
.rangoli::before, .rangoli::after {
  content: ''; position: absolute; inset: 22%; border-radius: 50%;
  border: 1px solid rgba(234, 191, 85, 0.14);
}
.rangoli::after {
  inset: 38%;
  background: repeating-conic-gradient(rgba(234, 191, 85, 0.12) 0 10deg, transparent 10deg 30deg);
  border: 0;
}
.lead-badge {
  position: absolute; left: 50%; top: -6px; transform: translate(-50%, -100%);
  font-size: 12px; font-weight: 600; color: var(--ink-dim);
  background: var(--plate); border: 1px solid var(--plate-line);
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.lead-badge .sym { font-size: 15px; }
.lead-badge .sym.red { color: #ff7a6b; }
.trick-slot {
  position: absolute;
  width: var(--trick-w); height: var(--trick-h);
  margin-left: calc(var(--trick-w) / -2);
  margin-top: calc(var(--trick-h) / -2);
}
.trick-slot .card { width: 100%; height: 100%; }
.trick-slot.top .card { box-shadow: 0 0 0 3px var(--gold), 0 8px 20px rgba(0, 0, 0, 0.45); }
.trick-slot.thulla .card { box-shadow: 0 0 0 3px var(--vermilion), 0 8px 20px rgba(0, 0, 0, 0.45); }

/* ---------- discard ---------- */
.discard {
  position: absolute; left: 14px; bottom: 12px;
  display: flex; align-items: center; gap: 8px;
  color: var(--ink-dim); font-size: 12px;
}
.discard-stack {
  width: 34px; height: 48px; border-radius: 5px;
  position: relative;
}
.discard-stack.has-cards {
  background: var(--back-1);
  box-shadow: 2px 2px 0 #4d1019, 4px 4px 0 #3a0c13, 0 6px 14px rgba(0,0,0,.4);
  background-image:
    repeating-linear-gradient(45deg, rgba(234,191,85,.22) 0 2px, transparent 2px 7px),
    repeating-linear-gradient(-45deg, rgba(234,191,85,.22) 0 2px, transparent 2px 7px);
  border: 2px solid #f1e3c2;
}
.discard-stack:not(.has-cards) { border: 2px dashed rgba(255,255,255,.18); }
.discard-count { font-weight: 700; font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- banner & toasts ---------- */
.banner {
  position: absolute; left: 50%; top: 54%;
  transform: translate(-50%, -50%);
  pointer-events: none; text-align: center; z-index: 4;
}
.banner .burst {
  font-family: var(--font-display);
  font-size: clamp(40px, 9vw, 64px);
  color: #fff;
  background: var(--vermilion);
  padding: 6px 26px 2px;
  border-radius: 16px;
  border: 3px solid #ffd2c4;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  transform: rotate(-4deg);
  display: inline-block;
  animation: burst 1.1s var(--ease-out) forwards;
}
.banner .burst.gold { background: linear-gradient(180deg, #f6b13a, #d98612); color: #2a1503; border-color: #ffe3a6; }
@keyframes burst {
  0% { transform: rotate(-4deg) scale(0.3); opacity: 0; }
  18% { transform: rotate(-4deg) scale(1.12); opacity: 1; }
  30% { transform: rotate(-4deg) scale(1); }
  80% { opacity: 1; }
  100% { transform: rotate(-4deg) scale(1.05); opacity: 0; }
}
.toasts {
  position: absolute; right: 12px; bottom: 12px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  pointer-events: none; z-index: 4; max-width: 70%;
}
.toast {
  background: var(--plate); border: 1px solid var(--plate-line);
  padding: 7px 12px; border-radius: 12px; font-size: 13px;
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
  animation: toast-in 0.25s var(--ease-out);
}
.toast.good { border-color: #6fd09c; }
.toast.bad { border-color: var(--vermilion); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* ---------- me / hand ---------- */
.me {
  background: linear-gradient(180deg, rgba(4, 20, 14, 0.7), rgba(4, 20, 14, 0.95));
  border-top: 1px solid var(--plate-line);
  padding: 8px 12px max(10px, env(safe-area-inset-bottom));
  z-index: 3;
}
.me-bar { display: flex; align-items: center; gap: 10px; max-width: 1100px; margin: 0 auto; min-height: 40px; }
.me-meta { line-height: 1.2; }
.me-name { font-weight: 700; }
.me-sub { font-size: 12px; color: var(--ink-dim); }
.me.is-turn .me-avatar { box-shadow: 0 0 0 3px var(--gold), 0 0 20px rgba(234,191,85,.6); }
.prompt { margin-left: auto; font-size: 14px; color: var(--ink-dim); text-align: right; }
.prompt.your-turn { color: var(--gold); font-weight: 700; }
.prompt .sym { font-size: 17px; }
.prompt .sym.red { color: #ff7a6b; }
.hand {
  position: relative;
  max-width: 1100px;
  margin: 8px auto 0;
  height: calc(var(--card-h) + 18px);
  transition: height 0.2s;
}
.hand .card { position: absolute; top: 14px; transition: transform 0.14s var(--ease-out), filter 0.2s, opacity 0.2s, left 0.25s var(--ease-out), top 0.25s var(--ease-out); }
.hand.my-turn .card.playable { cursor: pointer; }
.hand.my-turn .card.playable:hover, .hand.my-turn .card.playable:focus-visible { transform: translateY(-14px); z-index: 50; }
.hand.my-turn .card.unplayable { filter: brightness(0.62) saturate(0.6); }
.hand .card.hinted { animation: hint 0.9s ease-in-out 3; }
@keyframes hint { 50% { transform: translateY(-18px); box-shadow: 0 0 0 3px var(--gold), 0 10px 26px rgba(234,191,85,.6); } }
.hand .card.deal-in { animation: deal-in 0.45s var(--ease-out) backwards; }
@keyframes deal-in { from { transform: translateY(-120px) scale(0.6); opacity: 0; } }
.hand-empty { text-align: center; color: var(--ink-dim); padding-top: 32px; font-weight: 600; }

/* ---------- cards ---------- */
.card {
  width: var(--card-w); height: var(--card-h);
  border-radius: var(--radius);
  background: var(--card-face);
  border: 1px solid var(--card-edge);
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 4px 12px rgba(0, 0, 0, 0.35);
  color: var(--card-black);
  font-family: var(--font-card);
  position: relative;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}
button.card { cursor: default; appearance: none; }
.card.red { color: var(--card-red); }
.c-corner {
  position: absolute; display: flex; flex-direction: column; align-items: center;
  line-height: 0.95; font-weight: 700;
}
.c-corner b { font-size: calc(var(--card-w) * 0.24); letter-spacing: -0.04em; }
.c-corner i { font-style: normal; font-size: calc(var(--card-w) * 0.2); }
.c-tl { top: 5%; left: 7%; }
.c-br { bottom: 5%; right: 7%; transform: rotate(180deg); }
.c-center {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: calc(var(--card-w) * 0.46);
  pointer-events: none;
}
.c-center .face {
  display: grid; place-items: center;
  width: 52%; height: 50%;
  border: 1.5px solid currentColor; border-radius: 5px;
  font-size: calc(var(--card-w) * 0.36); font-weight: 700;
  background: linear-gradient(180deg, rgba(234,191,85,.25), rgba(234,191,85,.08));
  line-height: 1;
}
.c-center .face small { display: block; font-size: 0.55em; margin-top: -2px; }
.c-center .ace { font-size: calc(var(--card-w) * 0.62); }
.card.back, .mini {
  background: var(--back-1);
  background-image:
    radial-gradient(circle at 50% 50%, rgba(234,191,85,.35) 0 14%, transparent 15%),
    repeating-linear-gradient(45deg, rgba(234,191,85,.22) 0 2px, transparent 2px 8px),
    repeating-linear-gradient(-45deg, rgba(234,191,85,.22) 0 2px, transparent 2px 8px);
  border: 2px solid #f1e3c2;
  box-shadow: inset 0 0 0 2px var(--back-2), 0 3px 8px rgba(0,0,0,.4);
}
.flying { position: fixed; z-index: 30; pointer-events: none; margin: 0; }

/* ---------- log ---------- */
.log-panel {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: min(340px, 88vw);
  background: rgba(5, 22, 15, 0.96);
  border-left: 1px solid var(--plate-line);
  z-index: 20;
  display: flex; flex-direction: column;
  box-shadow: -20px 0 40px rgba(0,0,0,.4);
}
.log-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 8px 16px; border-bottom: 1px solid var(--plate-line); }
.log-head h2 { margin: 0; font-size: 16px; }
.log { list-style: none; margin: 0; padding: 8px 16px 24px; overflow-y: auto; font-size: 13px; line-height: 1.45; flex: 1; }
.log li { padding: 3px 0; color: var(--ink-dim); }
.log li.k-thulla { color: #ff9b88; font-weight: 600; }
.log li.k-escape { color: #8fe0b0; font-weight: 600; }
.log li.k-round { color: var(--gold); font-weight: 700; margin-top: 8px; }
.log li.k-over { color: var(--gold); font-weight: 700; }
.log .s-red { color: #ff7a6b; }

/* ---------- overlays ---------- */
.overlay {
  position: absolute; inset: 0; z-index: 40;
  display: grid; place-items: center;
  padding: 16px;
  background: rgba(2, 12, 8, 0.62);
  backdrop-filter: blur(3px);
  animation: fade 0.25s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.results-card {
  width: min(460px, 100%);
  max-height: 100%; overflow-y: auto;
  background: linear-gradient(180deg, #123a2a, #0b2a1d);
  border: 1px solid var(--plate-line);
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  animation: pop 0.35s var(--ease-out);
}
@keyframes pop { from { transform: scale(0.92); opacity: 0; } }
.results-kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.results-card h2 { font-family: var(--font-display); font-weight: 400; font-size: 34px; margin: 4px 0 14px; color: var(--gold); line-height: 1.1; }
.standings { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 6px; }
.standings li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: rgba(255,255,255,.05); }
.standings .place { width: 34px; font-weight: 800; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.standings .who { flex: 1; font-weight: 600; }
.standings li.loser { background: rgba(226, 73, 47, 0.2); border: 1px solid rgba(226, 73, 47, 0.6); }
.standings li.loser .place { color: #ffb3a3; }
.standings li.you .who::after { content: ' (you)'; color: var(--ink-faint); font-weight: 400; }
.scoreboard { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 18px; }
.scoreboard caption { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); padding-bottom: 6px; }
.scoreboard th, .scoreboard td { padding: 5px 4px; text-align: left; border-bottom: 1px solid rgba(255,255,255,.07); }
.scoreboard th { color: var(--ink-faint); font-weight: 600; }
.scoreboard td.num, .scoreboard th.num { text-align: right; font-variant-numeric: tabular-nums; }
.results-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.results-actions .btn { flex: 1; padding: 11px 16px; }
.rules-card ol { padding-left: 20px; line-height: 1.55; color: var(--ink-dim); }
.rules-card h2 { font-size: 30px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
.btn:disabled { opacity: 0.4; cursor: default; }
.btn:disabled:hover { background: transparent; color: var(--ink-dim); }
.field > .stepper, .field > .segmented { justify-self: start; }

/* ---------- phone tweaks ---------- */
.hud-info { min-width: 0; }
#diff-all { display: grid; grid-template-columns: repeat(4, 1fr); justify-self: stretch; }
@media (max-width: 700px) {
  .seat { gap: 2px; }
  .seat-fan { display: none; }
  .seat-plate {
    flex-direction: column;
    gap: 2px;
    padding: 4px 6px 5px;
    border-radius: 14px;
    max-width: 76px;
    min-width: 62px;
    text-align: center;
  }
  .seat-meta { max-width: 66px; }
  .seat-name { font-size: 11px; }
  .seat-sub { font-size: 10px; }
  .seat-sub .count { font-size: 12px; }
  .trick-zone { width: min(300px, calc(100vw - 168px)); height: min(250px, 34vh); top: 49%; }
  .lead-badge { top: auto; bottom: -8px; transform: translate(-50%, 100%); }
  .discard { left: 10px; bottom: 8px; }
  .discard-stack { width: 26px; height: 37px; }
  .toasts { right: 8px; bottom: 8px; }
}

/* ---------- mode tabs & online ---------- */
.name-field { margin-bottom: 16px; }
.mode-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  padding: 4px; margin-bottom: 18px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--plate-line);
  border-radius: 14px;
}
.mode-tabs button {
  border: 0; background: transparent; cursor: pointer;
  padding: 10px 8px; border-radius: 10px;
  font-weight: 700; font-size: 14px; color: var(--ink-dim);
}
.mode-tabs button[aria-selected='true'] { background: rgba(234, 191, 85, 0.16); color: var(--gold); box-shadow: inset 0 0 0 1px rgba(234,191,85,.45); }
.mode-tabs button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.online-panel { display: grid; gap: 14px; }
.online-intro { margin: 0; color: var(--ink-dim); line-height: 1.5; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--ink-faint); font-size: 13px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--plate-line); }
.join-row { display: flex; gap: 8px; }
.join-row input {
  flex: 1; min-width: 0;
  text-transform: uppercase; letter-spacing: 0.3em; font-weight: 700; font-size: 20px; text-align: center;
}
.join-row input::placeholder { letter-spacing: 0.2em; color: var(--ink-faint); font-weight: 600; }
.join-row .btn { border-radius: 10px; padding: 0 18px; }
.form-error { margin: 0; min-height: 1.2em; color: #ff9b88; font-size: 14px; font-weight: 600; }

.lobby-head { text-align: center; display: grid; justify-items: center; gap: 8px; margin-bottom: 18px; }
.room-code {
  font-family: var(--font-display);
  font-size: clamp(54px, 16vw, 76px);
  letter-spacing: 0.12em;
  line-height: 1;
  color: var(--gold);
  text-shadow: 0 3px 0 #7a4a06, 0 10px 30px rgba(0, 0, 0, 0.5);
  padding-left: 0.12em;
  user-select: all;
}
.lobby-head .hint { max-width: 44ch; }
.lobby-seats li { min-height: 46px; }
.seat-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tag {
  font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 6px; background: rgba(255,255,255,.1); color: var(--ink-dim);
}
.tag.host { background: rgba(234,191,85,.2); color: var(--gold); }
.tag.you { background: rgba(111,208,156,.18); color: #9fe3b5; }
.tag.offline { background: rgba(226,73,47,.2); color: #ffb3a3; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 0; cursor: pointer;
  background: rgba(255,255,255,.06); color: var(--ink-dim); font-size: 15px; flex: none;
}
.icon-btn:hover { background: rgba(226,73,47,.3); color: #fff; }
.lobby-owner { display: grid; gap: 16px; margin-top: 4px; }
.add-bot { display: grid; grid-template-columns: repeat(4, 1fr); justify-self: stretch; }
.add-bot button { color: var(--ink); }
.add-bot button:hover:not(:disabled) { background: rgba(255,255,255,.1); }
.add-bot button:disabled { opacity: .35; cursor: default; }
.lobby-wait { text-align: center; color: var(--ink-dim); margin: 14px 0 0; line-height: 1.5; }
.lobby-wait:empty { display: none; }
.lobby-foot { display: flex; justify-content: center; margin-top: 12px; }
.btn.primary:disabled { filter: grayscale(0.6); opacity: .55; box-shadow: none; }

.conn-pill {
  position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 60;
  background: var(--vermilion); color: #fff; font-weight: 700; font-size: 13px;
  padding: 6px 14px; border-radius: 999px; box-shadow: 0 6px 20px rgba(0,0,0,.4);
}
.global-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; }

.seat.is-offline .avatar { filter: grayscale(1) brightness(.7); }
.diff-tag.offline { color: #ffb3a3; background: rgba(226,73,47,.2); }
.turn-timer { font-variant-numeric: tabular-nums; color: var(--ink-faint); font-weight: 600; margin-left: 4px; }
.turn-timer.urgent { color: #ff8e7a; }
.results-wait { color: var(--ink-dim); margin: 0 0 14px; }
.hud-room { color: var(--gold); font-weight: 700; letter-spacing: .08em; }
.add-bot button { white-space: nowrap; padding: 8px 4px; }
@media (max-width: 420px) { .add-bot button { font-size: 12.5px; } }
