:root {
  --ink: #18211d;
  --cream: #f3eddf;
  --paper: #fffaf0;
  --felt: #173f34;
  --felt-light: #1d5142;
  --red: #c84634;
  --gold: #d8b56a;
  --muted: #728078;
  --line: rgba(24, 33, 29, 0.16);
  --shadow: 0 22px 60px rgba(20, 29, 25, 0.18);
  --on-ink: white;
  --surface-soft: rgba(255,255,255,.5);
  --surface-faint: rgba(255,255,255,.34);
  --body-copy: #47534d;
  --switch-off: #c6c8c0;
  --special-surface: #fff7df;
  --alone-surface: #fff5d7;
  --on-gold: #18211d;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #edf4f0;
  --cream: #0f1713;
  --paper: #18231e;
  --felt: #164638;
  --felt-light: #1d5b49;
  --red: #f0806f;
  --gold: #e4c276;
  --muted: #a7b4ad;
  --line: rgba(237,244,240,.18);
  --shadow: 0 22px 60px rgba(0,0,0,.42);
  --on-ink: #101713;
  --surface-soft: rgba(255,255,255,.08);
  --surface-faint: rgba(255,255,255,.055);
  --body-copy: #bac5bf;
  --switch-off: #526159;
  --special-surface: #3a3020;
  --alone-surface: #40351f;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
.hidden { display: none !important; }

.welcome {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
  grid-template-rows: 1fr auto;
  padding: clamp(28px, 5vw, 78px);
  overflow: hidden;
}
.welcome-header-actions {
  position: absolute;
  top: clamp(24px, 4vw, 54px);
  right: clamp(24px, 4vw, 54px);
  z-index: 3;
  display: flex;
  gap: 8px;
}
.welcome-header-actions .icon-button {
  width: 42px;
  height: 42px;
  background: var(--surface-faint);
}

.welcome-copy {
  align-self: center;
  width: min(500px, 100%);
  position: relative;
  z-index: 2;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--red);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .18em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }
h1 {
  margin-bottom: 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(66px, 8.5vw, 128px);
  font-weight: 500;
  letter-spacing: -.075em;
  line-height: .8;
}

h1 .pip { color: var(--red); font-size: .43em; vertical-align: .55em; margin-left: .08em; }
.lede { max-width: 430px; color: var(--body-copy); font-family: Georgia, serif; font-size: 21px; line-height: 1.45; }

.name-field { margin: 34px 0 18px; }
.name-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 13px 14px;
  outline: none;
}
input:focus { border-color: var(--felt); box-shadow: 0 0 0 3px rgba(23,63,52,.12); }

.switch-line { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch-line input { position: absolute; opacity: 0; width: 1px; }
.switch {
  width: 42px;
  height: 24px;
  border-radius: 30px;
  background: var(--switch-off);
  padding: 3px;
  transition: .2s;
}
.switch::after {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  transition: .2s;
}
.switch-line input:checked + .switch { background: var(--felt); }
.switch-line input:checked + .switch::after { transform: translateX(18px); }
.switch-line strong, .switch-line small { display: block; }
.switch-line strong { font-size: 13px; }
.switch-line small { color: var(--muted); font-size: 11px; margin-top: 2px; }

.rule-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0 0;
  padding: 0;
  border: 0;
}
.rule-options legend {
  float: none;
  grid-column: 1 / -1;
  width: 100%;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.rule-options .switch-line {
  min-width: 0;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-faint);
}
.rule-options .switch { flex: 0 0 auto; }
.rule-options .switch-line > span:last-child { min-width: 0; }

.welcome-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.privacy-option {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-faint);
}
.privacy-option .switch { flex: 0 0 auto; }
.lobby-privacy-option { margin-bottom: 14px; }
.lobby-finder-button { grid-column: 1 / -1; }
.primary-button, .secondary-button {
  min-height: 62px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  padding: 13px 17px;
  text-align: left;
  transition: transform .16s, box-shadow .16s, background .16s;
}
.primary-button { background: var(--ink); color: var(--on-ink); box-shadow: 0 7px 0 rgba(24,33,29,.13); }
.secondary-button { background: transparent; color: var(--ink); }
.primary-button:hover, .secondary-button:hover { transform: translateY(-2px); }
.secondary-button:hover { background: var(--surface-soft); }
.primary-button span, .secondary-button span { display: block; }
.welcome-actions .primary-button, .welcome-actions .secondary-button {
  display: grid;
  grid-template-columns: 35px 1fr;
  align-items: center;
  column-gap: 10px;
}
.welcome-actions .menu-icon {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font: 500 20px Georgia, serif;
  opacity: .85;
}
.welcome-actions .button-copy strong { display: block; }
.primary-button small, .secondary-button small { display: block; opacity: .65; margin-top: 3px; font-size: 10px; }
.primary-button.full { width: 100%; text-align: center; }

.join-link, .text-button {
  border: 0;
  background: transparent;
  padding: 16px 0 4px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.join-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 13px; }
.join-row input { text-transform: uppercase; letter-spacing: .2em; font-weight: 850; }
.join-row button, .share-row button {
  border: 0; border-radius: 7px; background: var(--red); color: white; padding: 0 20px; font-weight: 800;
}

.welcome-art { position: relative; min-height: 600px; align-self: center; }
.halo {
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  border: 1px solid rgba(24,33,29,.12);
  box-shadow: 0 0 0 70px rgba(255,255,255,.17), 0 0 0 140px rgba(255,255,255,.1);
}
.hero-card {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 208px;
  height: 300px;
  padding: 18px;
  border: 1px solid #d9d1c2;
  border-radius: 13px;
  background: var(--paper);
  color: var(--red);
  box-shadow: var(--shadow);
  font-family: Georgia, serif;
  transform-origin: 50% 110%;
}
.hero-card b { display: block; font-size: 46px; line-height: .9; }
.hero-card span { font-size: 38px; }
.hero-card::after { content: attr(data-suit); position: absolute; inset: 0; display: grid; place-items: center; font-size: 90px; opacity: .14; }
.card-a { transform: translate(-50%,-50%) rotate(-16deg) translateX(-98px); }
.card-b { transform: translate(-50%,-50%) rotate(7deg) translateX(45px); }
.card-c { transform: translate(-50%,-50%) rotate(24deg) translateX(132px); color: var(--ink); }
.welcome-art > p {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  white-space: nowrap;
  color: var(--muted);
  font: italic 17px Georgia, serif;
}
.welcome-art > p i { color: var(--red); }

.welcome footer {
  grid-column: 1/-1;
  display: flex;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 4vw, 54px);
  border-bottom: 1px solid var(--line);
  background: var(--cream);
}
.wordmark { color: var(--ink); text-decoration: none; font: 700 16px Georgia, serif; letter-spacing: .12em; }
.wordmark span { color: var(--red); }
.connection { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.connection i { width: 7px; height: 7px; border-radius: 50%; background: #4ca66b; box-shadow: 0 0 0 3px rgba(76,166,107,.15); }
.lobby-header-actions { display: flex; align-items: center; gap: 8px; }

.wordmark-button {
  border: 0;
  background: transparent;
  padding: 10px 0;
}
.lobby-browser { min-height: 100vh; }
.lobby-directory-card {
  width: min(860px, calc(100% - 36px));
  margin: clamp(45px, 8vh, 100px) auto;
  padding: clamp(26px, 5vw, 54px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.45);
  box-shadow: var(--shadow);
}
.lobby-directory-card h2 {
  margin-bottom: 8px;
  font: 500 clamp(34px, 5vw, 50px) Georgia, serif;
  letter-spacing: -.035em;
}
.lobby-directory-card > p:not(.eyebrow) { color: var(--muted); }
.lobby-directory-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 28px 0 14px;
  color: var(--muted);
  font-size: 12px;
}
.public-lobby-row button {
  border: 0;
  border-radius: 7px;
  background: var(--red);
  color: white;
  padding: 10px 16px;
  font-weight: 800;
}
.public-lobby-row button:disabled {
  cursor: not-allowed;
  background: var(--muted);
  opacity: .62;
}
.public-lobby-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.lobby-full-badge {
  padding: 5px 8px;
  border: 1px solid color-mix(in srgb, var(--red) 35%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--red) 10%, transparent);
  color: var(--red);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.public-lobby-list { display: grid; gap: 10px; }
.public-lobby-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
}
.public-lobby-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--felt);
  color: white;
  font: 700 18px Georgia, serif;
}
.public-lobby-copy strong,
.public-lobby-copy small,
.public-lobby-meta span,
.public-lobby-meta small { display: block; }
.public-lobby-copy small,
.public-lobby-meta small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.public-lobby-meta { min-width: 130px; text-align: right; font-size: 12px; font-weight: 800; }
.lobby-status { color: var(--felt-light); font-weight: 850; }
.lobby-status.in-progress { color: var(--red); }
.empty-lobby-directory {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 48px 20px;
  border: 1px dashed var(--line);
  border-radius: 9px;
  color: var(--muted);
  text-align: center;
}
.empty-lobby-directory > span { color: var(--red); font: 500 34px Georgia, serif; }
.empty-lobby-directory strong { color: var(--ink); }
.empty-lobby-directory small { font-size: 11px; }

.lobby { min-height: 100vh; }
.lobby-card {
  width: min(700px, calc(100% - 36px));
  margin: clamp(45px, 8vh, 100px) auto;
  padding: clamp(26px, 5vw, 54px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.45);
  box-shadow: var(--shadow);
}
.lobby-card h2, .dialog h2 { margin-bottom: 8px; font: 500 clamp(34px, 5vw, 50px) Georgia, serif; letter-spacing: -.035em; }
.lobby-card > p:not(.eyebrow) { color: var(--muted); }
.share-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 28px 0; }
.lobby-seats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 24px; }
.lobby-seat {
  display: flex; align-items: center; gap: 11px; min-height: 59px; padding: 10px 13px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--paper);
}
.lobby-seat .avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--felt); color: white; font: 700 15px Georgia, serif; }
.lobby-seat.empty { color: var(--muted); background: transparent; border-style: dashed; }
.lobby-seat small { display: block; color: var(--muted); margin-top: 2px; }
.switch-line.compact { margin: 0; }
.lobby-rules {
  grid-template-columns: 1fr;
  margin: 24px 0;
}
.lobby-rules .switch-line { align-items: center; padding: 10px 12px; }
.waiting { margin: 25px 0 0 !important; text-align: center; font-style: italic; font-family: Georgia, serif; }

.game { min-height: 100vh; background: var(--cream); }
.gamebar { display: grid; grid-template-columns: 1fr auto 1fr; }
.scoreboard { display: flex; align-items: center; gap: 18px; }
.scoreboard > div { display: flex; align-items: baseline; gap: 8px; }
.scoreboard b { font: 500 30px Georgia, serif; }
.scoreboard span { max-width: 120px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.scoreboard em { color: var(--muted); font: italic 12px Georgia, serif; }
.header-actions { justify-self: end; display: flex; gap: 8px; }
.icon-button { justify-self: end; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink); font-weight: 900; }
.icon-button:hover { border-color: var(--felt); background: var(--surface-soft); }
.theme-icon { display: block; font-size: 17px; line-height: 1; }

.table-wrap { padding: 18px 18px 0; }
.felt {
  /* The table is a fixed game surface. Page themes must not recolor cards or table markers. */
  color-scheme: light;
  --ink: #18211d;
  --cream: #f3eddf;
  --paper: #fffaf0;
  --felt: #173f34;
  --felt-light: #1d5142;
  --red: #c84634;
  --gold: #d8b56a;
  --muted: #728078;
  --line: rgba(24, 33, 29, 0.16);
  --shadow: 0 22px 60px rgba(20, 29, 25, 0.18);
  --on-ink: white;
  --surface-soft: rgba(255,255,255,.5);
  --surface-faint: rgba(255,255,255,.34);
  --body-copy: #47534d;
  --switch-off: #c6c8c0;
  --special-surface: #fff7df;
  --alone-surface: #fff5d7;
  --on-gold: #18211d;
  position: relative;
  height: clamp(635px, 73vh, 760px);
  min-height: 635px;
  max-height: none;
  border: 8px solid #12372e;
  border-radius: 56px 56px 180px 180px;
  overflow: hidden;
  background: var(--felt);
  box-shadow: inset 0 0 90px rgba(0,0,0,.24), 0 15px 35px rgba(24,33,29,.18);
}
.grain {
  position: absolute; inset: 0; opacity: .13;
  background-image: radial-gradient(rgba(255,255,255,.5) .5px, transparent .5px);
  background-size: 7px 7px;
}
.seat { position: absolute; z-index: 4; color: white; text-align: center; }
.seat-top { top: 19px; left: 50%; transform: translateX(-50%); }
.seat-left { left: 20px; top: 45%; transform: translateY(-50%); }
.seat-right { right: 20px; top: 45%; transform: translateY(-50%); }
.seat-bottom { bottom: 9px; left: 50%; width: min(760px, 94%); transform: translateX(-50%); }
.seat.turn-active { z-index: 7; }
.dealer-stamp {
  position: absolute;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(221,199,143,.5);
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 32%, rgba(255,255,255,.06), transparent 34%),
    rgba(8,45,36,.42);
  color: rgba(232,216,173,.88);
  box-shadow:
    inset 0 0 0 3px rgba(6,31,25,.25),
    inset 0 0 14px rgba(0,0,0,.2),
    0 1px 0 rgba(255,255,255,.08);
  font: italic 700 15px/1 Baskerville, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  letter-spacing: -.02em;
  text-shadow: 0 1px 1px rgba(0,0,0,.65);
  transform: rotate(-6deg);
  transition: left .28s ease, right .28s ease, top .28s ease, bottom .28s ease;
}
.dealer-stamp::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px dashed rgba(221,199,143,.27);
  border-radius: inherit;
}
.dealer-stamp.dealer-seat-0 {
  left: calc(50% + 175px);
  bottom: 190px;
}
.dealer-stamp.dealer-seat-1 {
  left: 86px;
  top: calc(45% + 68px);
}
.dealer-stamp.dealer-seat-2 {
  left: calc(50% + 95px);
  top: 74px;
}
.dealer-stamp.dealer-seat-3 {
  right: 86px;
  top: calc(45% + 68px);
}
.dealer-draw {
  position: absolute;
  inset: 72px 90px 82px;
  z-index: 9;
  display: grid;
  grid-template-rows: auto 1fr;
  place-items: center;
  color: white;
  pointer-events: none;
}
.dealer-draw-heading {
  position: relative;
  z-index: 3;
  text-align: center;
  transition: opacity .24s ease;
}
.dealer-draw-heading span,
.dealer-announcement span {
  display: block;
  color: #e8ca80;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .18em;
}
.dealer-draw-heading strong,
.dealer-announcement strong {
  display: block;
  margin-top: 5px;
  font: 500 clamp(24px, 3.5vw, 36px) Georgia, serif;
}
.dealer-draw-heading small {
  display: block;
  margin-top: 5px;
  color: #c5d5cf;
  font-size: 10px;
}
.dealer-card-fan {
  position: relative;
  width: min(520px, 84vw);
  height: 195px;
  align-self: start;
  margin-top: 8px;
}
.dealer-draw-card {
  position: absolute;
  left: 50%;
  bottom: 9px;
  width: 66px;
  height: 96px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  transform:
    translateX(calc(-50% + var(--draw-x)))
    rotate(var(--draw-angle));
  transform-origin: 50% 155%;
  transition: filter .18s ease, translate .18s ease;
  pointer-events: auto;
}
button.dealer-draw-card:hover,
button.dealer-draw-card:focus-visible {
  z-index: 30;
  outline: none;
  filter: brightness(1.16);
  translate: 0 -16px;
}
.draw-card-back {
  display: block;
  width: 100%;
  height: 100%;
  border: 3px solid #efe5cb;
  border-radius: 7px;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.1) 0 2px, transparent 2px 6px),
    radial-gradient(circle, #bf493c 0 2px, transparent 2.5px) 0 0 / 11px 11px,
    #792d29;
  box-shadow: 0 7px 16px rgba(0,0,0,.32), inset 0 0 0 2px #963a31;
}
.dealer-draw-card.selected {
  z-index: 20;
  height: 116px;
  filter: drop-shadow(0 9px 12px rgba(0,0,0,.28));
}
.dealer-draw-card.selected .playing-card {
  width: 66px;
  height: 96px;
  margin: 0;
  padding: 6px;
  transform: none;
}
.dealer-draw-card.selected .card-corner.top { left: 6px; top: 6px; }
.dealer-draw-card.selected .card-corner.bottom { right: 6px; bottom: 6px; }
.dealer-draw-card.selected .card-corner b { font-size: 19px; }
.dealer-draw-card.selected .card-corner i { font-size: 14px; }
.dealer-draw-card.selected .center-pip { font-size: 34px; }
.dealer-draw-card.selected > small {
  display: block;
  max-width: 80px;
  margin-top: 4px;
  overflow: hidden;
  color: white;
  font-size: 8px;
  font-weight: 850;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px black;
  white-space: nowrap;
}
.dealer-draw-card.unavailable { opacity: .28; }
.dealer-announcement {
  position: absolute;
  left: 50%;
  top: 42%;
  z-index: 40;
  width: min(430px, 90%);
  transform: translate(-50%, -50%);
  padding: 20px 24px;
  border: 1px solid rgba(231,204,137,.48);
  border-radius: 12px;
  background: rgba(7,31,25,.92);
  box-shadow: 0 18px 45px rgba(0,0,0,.36);
  text-align: center;
  animation: dealer-announcement-in .42s ease .68s both;
}
.dealer-draw.gathering .dealer-draw-heading { opacity: 0; }
.dealer-draw.gathering .dealer-draw-card {
  animation: dealer-cards-gather .72s cubic-bezier(.7,0,.84,0) forwards;
  pointer-events: none;
}
.dealer-draw.gathering .dealer-draw-card.winner {
  --winner-x: 0px;
  --winner-y: 0px;
  animation: dealer-card-to-seat 1.35s cubic-bezier(.65,0,.8,1) forwards;
}
.dealer-draw.gathering .dealer-draw-card.draw-position-0 { --winner-y: 205px; }
.dealer-draw.gathering .dealer-draw-card.draw-position-1 { --winner-x: -330px; --winner-y: 30px; }
.dealer-draw.gathering .dealer-draw-card.draw-position-2 { --winner-y: -185px; }
.dealer-draw.gathering .dealer-draw-card.draw-position-3 { --winner-x: 330px; --winner-y: 30px; }
.dealer-selected .dealer-stamp { animation: dealer-stamp-arrive .55s ease 1.25s both; }
.phase-dealer-draw .center-board { opacity: .18; }
.player-label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 20px;
  background: rgba(6,26,21,.5);
  font-size: 11px;
  font-weight: 800;
  transition: transform .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.player-label .status-dot { width: 6px; height: 6px; border-radius: 50%; background: #92a99f; }
.player-label.active .status-dot {
  background: #ffd878;
  box-shadow: 0 0 0 4px rgba(255,216,120,.14);
  animation: turn-pulse 1.65s ease-in-out infinite;
}
.seat.turn-active .player-label {
  border-color: rgba(255,216,120,.78);
  background: rgba(8,31,25,.92);
  box-shadow: 0 0 0 4px rgba(255,216,120,.13), 0 9px 22px rgba(3,17,13,.34);
  transform: scale(1.14);
  animation: active-player-pulse 1.6s ease-in-out infinite;
}
.turn-callout {
  position: absolute;
  left: 50%;
  top: -17px;
  transform: translateX(-50%);
  padding: 3px 7px;
  border-radius: 10px;
  background: #ffd878;
  color: #18211d;
  font-size: 7px;
  font-weight: 950;
  letter-spacing: .12em;
  line-height: 1;
  white-space: nowrap;
}
.player-label .dealer { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--gold); color: var(--ink); font-size: 9px; }
.player-label .bidder {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--paper);
  font: normal 12px Georgia, serif;
  box-shadow: 0 0 0 1px rgba(255,255,255,.2);
}
.player-label .bidder.red { color: var(--red); }
.player-label .bidder.black { color: var(--ink); }
.player-label .alone-badge,
.player-label .out-badge {
  padding: 3px 6px;
  border-radius: 10px;
  font: normal 800 7px system-ui;
  letter-spacing: .09em;
}
.player-label .alone-badge { background: var(--gold); color: var(--ink); }
.player-label .out-badge { border: 1px solid rgba(255,255,255,.3); color: #c1d0ca; }
.seat.sitting-out .hand,
.seat.sitting-out .mini-hand { opacity: .48; filter: saturate(.55); }
.inactive-copy {
  padding: 6px 9px;
  border: 1px dashed rgba(255,255,255,.32);
  border-radius: 20px;
  color: #bfd0c9;
  font-size: 9px;
  font-style: italic;
}
.mini-hand {
  display: flex;
  justify-content: center;
  margin-top: 7px;
  transition: transform .2s ease, filter .2s ease;
}
.seat.turn-active .mini-hand {
  filter: brightness(1.16);
  transform: translateY(4px) scale(1.1);
}
.card-back {
  position: relative;
  width: 31px;
  height: 43px;
  margin-left: -8px;
  border: 2px solid #fff3d9;
  border-radius: 4px;
  background:
    linear-gradient(135deg, transparent 45%, rgba(255,255,255,.22) 46% 54%, transparent 55%),
    linear-gradient(45deg, #aa352b 25%, #79251f 25% 50%, #aa352b 50% 75%, #79251f 75%);
  background-size: 8px 8px;
  box-shadow: 0 3px 7px rgba(0,0,0,.32);
}
.card-back::after { content: ""; position: absolute; inset: 2px; border: 1px solid rgba(255,244,218,.7); border-radius: 2px; }
.card-back:first-child { margin-left: 0; }

.hand {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 136px;
  margin-top: 12px;
  transition:
    height .34s cubic-bezier(.2,.78,.2,1),
    margin-top .34s cubic-bezier(.2,.78,.2,1),
    transform .34s cubic-bezier(.2,.78,.2,1),
    gap .34s cubic-bezier(.2,.78,.2,1);
}
.hand::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: min(680px, 96%);
  height: 118px;
  border-radius: 50%;
  opacity: 0;
  transform: translateX(-50%) scale(.92);
  background: radial-gradient(ellipse, rgba(255,216,120,.19), transparent 68%);
  transition: opacity .22s ease, transform .22s ease;
}
.hand .playing-card { z-index: 1; }
.playing-card {
  position: relative;
  width: clamp(70px, 8vw, 98px);
  height: clamp(104px, 12vw, 142px);
  margin-left: clamp(-20px, -1.4vw, -8px);
  border: 1px solid #d7d0c2;
  border-radius: 8px;
  background:
    radial-gradient(circle at 48% 38%, rgba(255,255,255,.96), transparent 58%),
    linear-gradient(150deg, #fffdf6, #f3ead7);
  color: var(--ink);
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,.72),
    inset 0 0 18px rgba(99,72,34,.055),
    0 7px 18px rgba(0,0,0,.3);
  transition:
    width .34s cubic-bezier(.2,.78,.2,1),
    height .34s cubic-bezier(.2,.78,.2,1),
    margin-left .34s cubic-bezier(.2,.78,.2,1),
    transform .18s ease,
    box-shadow .18s ease,
    filter .18s ease,
    opacity .18s ease;
}
.playing-card:first-child { margin-left: 0; }
button.playing-card { padding: 8px; text-align: left; }
button.playing-card:not(:disabled) {
  border-color: rgba(255,216,120,.92);
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,.72),
    inset 0 0 18px rgba(99,72,34,.055),
    0 7px 18px rgba(0,0,0,.3),
    0 0 0 3px rgba(255,216,120,.22),
    0 0 18px rgba(255,216,120,.22);
}
button.playing-card:hover:not(:disabled), button.playing-card.recommended { transform: translateY(-15px); box-shadow: 0 12px 24px rgba(0,0,0,.28); }
button.playing-card:disabled { cursor: default; opacity: .9; filter: saturate(.82); }
button.playing-card:active:not(:disabled) { transform: translateY(-9px) scale(.97); }
.playing-card.red { color: var(--red); }
.card-corner { position: absolute; display: flex; flex-direction: column; align-items: center; line-height: .8; }
.card-corner.top { left: 8px; top: 8px; }
.card-corner.bottom { right: 8px; bottom: 8px; transform: rotate(180deg); }
.card-corner b { font: 700 clamp(20px, 2.6vw, 29px) Georgia, serif; }
.card-corner i { margin-top: 4px; font: normal clamp(15px, 2vw, 21px) Georgia, serif; }
.center-pip {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 400 clamp(35px, 4.4vw, 56px) Georgia, serif;
  text-shadow: 0 1px 0 white;
  opacity: .82;
}
.playing-card.recommended::after {
  content: "BEST"; position: absolute; left: 50%; top: -22px; transform: translateX(-50%);
  padding: 3px 7px; border-radius: 10px; background: var(--gold); color: var(--ink); font: 900 8px system-ui; letter-spacing: .1em;
}
.playing-card.first-blood-card {
  border-color: #efcf7e;
  animation: first-blood-pulse 1.6s ease-in-out infinite;
}
.playing-card.first-blood-card::after {
  content: "FIRST BLOOD";
  position: absolute;
  left: 50%;
  top: -23px;
  transform: translateX(-50%);
  padding: 4px 7px;
  border-radius: 10px;
  background: var(--gold);
  color: var(--ink);
  font: 900 7px system-ui;
  letter-spacing: .08em;
  white-space: nowrap;
}
.playing-card.picked-up-card:disabled {
  border-color: rgba(255,255,255,.92);
  opacity: 1;
  filter: none;
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,.78),
    0 12px 26px rgba(0,0,0,.34),
    0 0 0 4px rgba(255,255,255,.18);
}
.playing-card.picked-up-card::after {
  content: "PICKED UP";
  position: absolute;
  left: 50%;
  top: -23px;
  transform: translateX(-50%);
  padding: 4px 7px;
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: 900 7px system-ui;
  letter-spacing: .08em;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.hand-reordering .hand .playing-card { animation: hand-shift .3s cubic-bezier(.2,.8,.2,1); }
.card-choice .seat-bottom .hand {
  height: calc(clamp(112px, 12.6vw, 150px) + 8px);
  margin-top: 28px;
  gap: clamp(2px, .65vw, 9px);
  transform: translateY(-8px);
}
.card-choice .seat-bottom .hand::before {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}
.card-choice .seat-bottom .playing-card {
  width: clamp(76px, 8.4vw, 104px);
  height: clamp(112px, 12.6vw, 150px);
  margin-left: 0;
}
.card-choice .seat-bottom button.playing-card:not(:disabled) {
  border-color: #ffe39a;
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,.84),
    0 13px 27px rgba(0,0,0,.34),
    0 0 0 4px rgba(255,216,120,.28),
    0 0 24px rgba(255,216,120,.3);
  transform: translateY(-7px);
  animation: playable-card-pulse 1.55s ease-in-out infinite;
}
.card-choice .seat-bottom button.playing-card:hover:not(:disabled) {
  z-index: 9;
  border-color: #fff0ba;
  filter: brightness(1.15) saturate(1.06);
  transform: translateY(-18px) scale(1.025);
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,.95),
    0 18px 32px rgba(0,0,0,.36),
    0 0 0 5px rgba(255,216,120,.34),
    0 0 30px rgba(255,226,151,.38);
  animation: none;
}
.phase-discarding.card-choice .seat-bottom .hand {
  gap: clamp(3px, .8vw, 11px);
}
.phase-discarding.card-choice .seat-bottom button.playing-card:not(:disabled)::after {
  content: "DISCARD";
  position: absolute;
  left: 50%;
  bottom: -21px;
  transform: translateX(-50%);
  padding: 3px 7px;
  border-radius: 10px;
  background: #ffd878;
  color: var(--ink);
  font: 900 7px system-ui;
  letter-spacing: .1em;
}
.hand .playing-card.deal-card-enter {
  animation: deal-card .52s cubic-bezier(.18,.82,.2,1) both;
}
.hand .playing-card.deal-card-enter:nth-child(2) { animation-delay: .06s; }
.hand .playing-card.deal-card-enter:nth-child(3) { animation-delay: .12s; }
.hand .playing-card.deal-card-enter:nth-child(4) { animation-delay: .18s; }
.hand .playing-card.deal-card-enter:nth-child(5) { animation-delay: .24s; }
.mini-hand .card-back.deal-card-back-enter {
  animation: deal-card-back .42s cubic-bezier(.18,.82,.2,1) both;
}
.mini-hand .card-back.deal-card-back-enter:nth-child(2) { animation-delay: .05s; }
.mini-hand .card-back.deal-card-back-enter:nth-child(3) { animation-delay: .1s; }
.mini-hand .card-back.deal-card-back-enter:nth-child(4) { animation-delay: .15s; }
.mini-hand .card-back.deal-card-back-enter:nth-child(5) { animation-delay: .2s; }
.upcard-area .playing-card.deal-upcard-enter {
  animation: turn-upcard .48s cubic-bezier(.18,.82,.2,1) .28s both;
}

.center-board { position: absolute; left: 50%; top: 47%; z-index: 3; width: 360px; transform: translate(-50%,-50%); color: white; text-align: center; }
.round-info span, .round-info b { display: block; }
.round-info span { color: #b7cbc3; font-size: 9px; font-weight: 900; letter-spacing: .18em; }
.round-info b { margin-top: 4px; font: 400 18px Georgia, serif; }
.trick-area { position: relative; width: 235px; height: 190px; margin: 8px auto 0; }
.trick-card { position: absolute; width: 66px; height: 94px; padding: 6px; text-align: left; }
.trick-card .card-corner.top,
.upcard-area .card-corner.top { left: 6px; top: 7px; }
.trick-card .card-corner.bottom,
.upcard-area .card-corner.bottom { right: 6px; bottom: 7px; }
.trick-card .card-corner b,
.upcard-area .card-corner b { font-size: 21px; }
.trick-card .card-corner i,
.upcard-area .card-corner i { font-size: 16px; }
.trick-card .center-pip,
.upcard-area .center-pip { font-size: 38px; }
.trick-card.seat-0 { --play-x: 0; --play-y: 150px; left: 50%; bottom: 0; transform: translateX(-50%); }
.trick-card.seat-1 { --play-x: -150px; --play-y: 0; left: 0; top: 50%; transform: translateY(-50%) rotate(10deg); }
.trick-card.seat-2 { --play-x: 0; --play-y: -135px; left: 50%; top: 0; transform: translateX(-50%); }
.trick-card.seat-3 { --play-x: 150px; --play-y: 0; right: 0; top: 50%; transform: translateY(-50%) rotate(-10deg); }
.trick-card.card-enter { animation: card-play .38s cubic-bezier(.16,.82,.2,1); }
.trick-area.collecting .trick-card {
  z-index: 8;
  opacity: 0;
  scale: .68;
  transition:
    translate .5s cubic-bezier(.7,0,.84,0),
    scale .5s cubic-bezier(.7,0,.84,0),
    opacity .42s ease .08s;
}
.trick-area.collect-to-0 .trick-card { translate: 0 210px; }
.trick-area.collect-to-1 .trick-card { translate: calc(-1 * clamp(180px, 32vw, 440px)) 0; }
.trick-area.collect-to-2 .trick-card { translate: 0 -235px; }
.trick-area.collect-to-3 .trick-card { translate: clamp(180px, 32vw, 440px) 0; }
.upcard-area {
  position: absolute;
  left: 50%;
  top: 68px;
  z-index: 6;
  width: 84px;
  transform: translate(-50%, 0);
  transition: transform .28s cubic-bezier(.2,.8,.2,1);
}
.upcard-area.dealer-seat-0 { transform: translate(-50%, 32px); }
.upcard-area.dealer-seat-1 { transform: translate(calc(-50% - 48px), 12px); }
.upcard-area.dealer-seat-2 { transform: translate(-50%, -25px); }
.upcard-area.dealer-seat-3 { transform: translate(calc(-50% + 48px), 12px); }
.upcard-area .playing-card {
  width: 70px;
  height: 100px;
  margin: 0 auto;
  padding: 6px;
  transform: none;
}
.upcard-area .turned-label {
  display: block;
  margin-top: 7px;
  color: #d0ded8;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .12em;
}
.trick-score { display: flex; justify-content: center; align-items: center; gap: 10px; color: #b7cbc3; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.trick-score b { color: white; font: 500 19px Georgia, serif; }
.trick-score i { width: 1px; height: 20px; background: rgba(255,255,255,.2); }

.play-panel {
  display: grid;
  grid-template-columns: minmax(260px, .75fr) minmax(330px, 1fr) minmax(260px, .75fr);
  gap: 28px;
  align-items: center;
  min-height: 185px;
  padding: 24px clamp(24px, 5vw, 72px);
  transition: background .24s ease, box-shadow .24s ease;
}
.status-line { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.status-line span, .hint-heading span { color: var(--red); font-size: 9px; font-weight: 900; letter-spacing: .15em; }
.status-line h2 { margin: 4px 0 0; font: 500 27px Georgia, serif; }
.my-turn .play-panel {
  background: linear-gradient(180deg, rgba(255,216,120,.18), rgba(255,255,255,0) 72%);
  box-shadow: inset 0 4px 0 rgba(216,181,106,.82);
}
.my-turn .status-line h2 {
  font-size: 32px;
  color: var(--ink);
}
.my-turn .status-line h2::after {
  content: " • YOUR TURN";
  color: var(--red);
  font: 900 8px system-ui;
  letter-spacing: .14em;
  vertical-align: .45em;
  white-space: nowrap;
}
.my-turn.phase-bidding .actions {
  position: relative;
  padding: 8px;
  border: 1px solid rgba(216,181,106,.44);
  border-radius: 12px;
  background: var(--surface-faint);
  animation: action-area-pulse 1.7s ease-in-out infinite;
}
.my-turn.phase-bidding .actions::before {
  content: "YOUR MOVE";
  position: absolute;
  left: 50%;
  top: -11px;
  transform: translateX(-50%);
  padding: 4px 9px;
  border-radius: 20px;
  background: var(--gold);
  color: #18211d;
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .13em;
}
.my-turn.phase-bidding .actions.entering {
  animation: action-menu-enter .34s cubic-bezier(.2,.9,.25,1.2);
}
.my-turn.phase-bidding .action-button {
  min-height: 50px;
  transform: scale(1.03);
}
.phase-bid-two.my-turn .actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: min(540px, 100%);
  margin: 0 auto;
  padding: 14px;
  border: 1px solid rgba(216,181,106,.42);
  border-radius: 14px;
  background: var(--surface-faint);
  box-shadow: 0 10px 24px rgba(24,33,29,.08);
  animation: none;
}
.phase-bid-two.my-turn .action-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 54px;
  padding: 12px 10px;
  transform: none;
  white-space: nowrap;
}
.phase-bid-two.my-turn .action-button[data-action="pass"],
.phase-bid-two.my-turn .action-button[data-action="farm"],
.phase-bid-two.my-turn .action-button[data-action="throwIn"] {
  grid-column: 1 / -1;
  justify-self: center;
}
.phase-bid-two.my-turn .action-button[data-action="pass"] {
  width: min(180px, 58%);
}
.phase-bid-two.my-turn .action-button[data-action="farm"],
.phase-bid-two.my-turn .action-button[data-action="throwIn"] {
  width: min(280px, 82%);
}
@media (min-width: 901px) {
  .phase-bid-two .play-panel {
    grid-template-columns: minmax(280px, .72fr) minmax(520px, 1.28fr);
    grid-template-rows: auto auto;
    gap: 8px 40px;
  }
  .phase-bid-two .status-line {
    grid-column: 1;
    grid-row: 1;
  }
  .phase-bid-two .play-panel > p {
    grid-column: 1;
    grid-row: 2;
    margin-bottom: 0;
  }
  .phase-bid-two .actions {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
  .phase-bid-two .hint-box {
    grid-column: 1 / -1;
  }
}
.dealer-chip { padding: 5px 8px; border: 1px solid var(--line); border-radius: 20px; color: var(--muted) !important; white-space: nowrap; }
.play-panel > p { color: var(--muted); line-height: 1.5; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.action-button {
  min-width: 96px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft);
  padding: 12px 14px; color: var(--ink); font-weight: 800; transition: .15s;
}
.action-button:hover { border-color: var(--gold); background: var(--paper); transform: translateY(-3px); box-shadow: 0 8px 18px rgba(13,26,21,.16); }
.action-button.primary { background: var(--ink); color: var(--on-ink); }
.action-button.special { border-color: var(--gold); background: var(--special-surface); }
.action-button.alone { border-color: var(--gold); background: var(--alone-surface); color: var(--ink); }
.action-button .suit-symbol { color: var(--red); font-size: 18px; vertical-align: -1px; margin-right: 4px; }
.action-button .suit-symbol.black { color: var(--ink); }
.action-button.primary:not(.alone) .suit-symbol.black {
  -webkit-text-stroke: 2px rgba(255,255,255,.96);
  paint-order: stroke fill;
  text-shadow: 0 1px 0 rgba(255,255,255,.96);
}
.action-button .solo-mark { margin-left: 7px; color: #a07822; font-size: 11px; }
.action-button .action-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 7px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 13px;
  vertical-align: -2px;
}
.hint-box { padding: 14px 16px; border-left: 3px solid var(--gold); background: rgba(216,181,106,.12); }
.hint-heading { display: flex; justify-content: space-between; }
.hint-heading b { color: var(--muted); font-size: 9px; }
.hint-box p { margin: 8px 0 0; color: var(--body-copy); font: italic 13px/1.45 Georgia, serif; }
.hint-box .text-button { padding: 7px 0 0; }

.dialog-backdrop { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: rgba(13,26,21,.7); backdrop-filter: blur(5px); }
.dialog { position: relative; width: min(520px, 100%); padding: 38px; border-radius: 11px; background: var(--paper); box-shadow: var(--shadow); }
.dialog > p:not(.eyebrow) { color: var(--muted); line-height: 1.55; }
.dialog-close { position: absolute; right: 18px; top: 15px; border: 0; background: transparent; font-size: 28px; color: var(--muted); }
.rules { width: min(700px, 100%); }
.rules-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px; }
.rules-grid p { color: var(--muted); font-size: 13px; line-height: 1.5; }
.rules-grid b { color: var(--ink); }
.settings-dialog { width: min(560px, 100%); }
.settings-tabs {
  display: flex;
  gap: 4px;
  margin-top: 24px;
  padding: 4px;
  border-radius: 9px;
  background: rgba(24,33,29,.07);
}
.settings-tab {
  flex: 1;
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}
.settings-tab:hover { color: var(--ink); }
.settings-tab:focus-visible { outline: 3px solid rgba(23,63,52,.18); }
.settings-tab.active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(24,33,29,.1);
}
.settings-panel { padding-top: 22px; }
.settings-panel > p { color: var(--muted); line-height: 1.55; }
.settings-panel .setting-row:first-of-type { margin-top: 22px; }
.ai-levels { display: grid; clear: both; gap: 8px; }
.ai-levels label { position: relative; cursor: pointer; }
.ai-levels input { position: absolute; width: 1px; opacity: 0; }
.ai-levels span {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  transition: .16s ease;
}
.ai-levels b { font-size: 13px; }
.ai-levels small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.ai-levels input:checked + span {
  border-color: var(--felt);
  box-shadow: inset 4px 0 0 var(--felt), 0 4px 12px rgba(23,63,52,.1);
}
.ai-levels input:focus-visible + span { outline: 3px solid rgba(23,63,52,.18); }
.ai-levels input:disabled + span { cursor: not-allowed; opacity: .62; }
.game-over-dialog { width: min(520px, 100%); text-align: center; }
.game-over-dialog h2 { margin-top: 7px; }
.game-over-actions { display: grid; gap: 10px; margin-top: 26px; }
.game-over-actions button { width: 100%; min-height: 52px; }
.game-over-waiting { display: block; margin-top: 18px; color: var(--muted); }
.changelog-status { margin: 8px 0 0; }
.changelog-release + .changelog-release {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.changelog-release time {
  display: block;
  color: var(--red);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.changelog-release ul {
  margin: 12px 0 0;
  padding-left: 20px;
}
.changelog-release li {
  padding-left: 3px;
  color: var(--body-copy);
  font-size: 13px;
  line-height: 1.55;
}
.changelog-release li + li { margin-top: 7px; }
.setting-row {
  margin: 26px 0 0;
  padding: 22px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}
.setting-row legend {
  float: left;
  width: 100%;
  margin-bottom: 11px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.setting-switch {
  clear: both;
  min-height: 54px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}
.setting-switch > span:last-child { min-width: 0; }
.segmented-control { clear: both; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.segmented-control label { cursor: pointer; }
.segmented-control input { position: absolute; width: 1px; opacity: 0; pointer-events: none; }
.segmented-control span {
  display: block;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  transition: .16s;
}
.segmented-control input:checked + span {
  border-color: var(--felt);
  background: var(--felt);
  color: white;
  box-shadow: 0 5px 12px rgba(23,63,52,.2);
}
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translate(-50%,20px);
  padding: 10px 16px; border-radius: 40px; background: var(--ink); color: var(--on-ink); font-size: 12px;
  opacity: 0; pointer-events: none; transition: .2s;
}
.toast.show { opacity: 1; transform: translate(-50%,0); }
.round-toast {
  position: fixed;
  left: 50%;
  bottom: max(18px, calc(env(safe-area-inset-bottom) + 10px));
  z-index: 45;
  width: min(440px, calc(100% - 28px));
  overflow: hidden;
  transform: translate(-50%, 18px);
  padding: 14px 17px 16px;
  border: 1px solid rgba(24,33,29,.12);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 12px 34px rgba(13,26,21,.28);
  animation: round-toast-in .24s ease-out forwards;
  pointer-events: none;
}
.round-toast.during-next-deal {
  bottom: max(26px, calc(env(safe-area-inset-bottom) + 18px));
  box-shadow: 0 16px 40px rgba(13,26,21,.32), 0 0 0 4px rgba(216,181,106,.14);
}
.round-toast.during-next-deal:not(.game-complete)::after {
  animation: round-toast-deal-overlap 1.4s linear forwards;
}
.round-toast p {
  margin: 0 0 4px;
  color: var(--red);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .16em;
}
.round-toast strong {
  display: block;
  font: 500 21px Georgia, serif;
}
.round-toast span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.round-toast:not(.game-complete)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  transform-origin: left;
  background: var(--gold);
  animation: round-toast-progress 2s linear forwards;
}

@keyframes card-play {
  from { opacity: 0; translate: var(--play-x) var(--play-y); scale: .78; }
  to { opacity: 1; translate: 0 0; scale: 1; }
}

@keyframes dealer-cards-gather {
  0% { opacity: 1; }
  72% { opacity: 1; transform: translateX(-50%) rotate(0deg) scale(.82); }
  100% { opacity: 0; transform: translateX(-50%) rotate(0deg) scale(.65); }
}

@keyframes dealer-card-to-seat {
  0% { opacity: 1; }
  46% { opacity: 1; transform: translateX(-50%) translateY(0) rotate(0deg) scale(.88); }
  100% {
    opacity: 0;
    transform:
      translateX(calc(-50% + var(--winner-x)))
      translateY(var(--winner-y))
      rotate(0deg)
      scale(.52);
  }
}

@keyframes dealer-announcement-in {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 12px)) scale(.96); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes dealer-stamp-arrive {
  from { opacity: 0; scale: .5; }
  to { opacity: 1; scale: 1; }
}

@keyframes round-toast-in {
  from { opacity: 0; transform: translate(-50%, 18px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes round-toast-progress {
  from { scale: 1 1; }
  to { scale: 0 1; }
}

@keyframes round-toast-deal-overlap {
  from { scale: 1 1; }
  to { scale: 0 1; }
}

@keyframes deal-card {
  from { translate: 0 55px; scale: .84; }
  to { translate: 0 0; scale: 1; }
}

@keyframes deal-card-back {
  from { translate: 0 -16px; scale: .8; }
  to { translate: 0 0; scale: 1; }
}

@keyframes turn-upcard {
  from { transform: rotateY(88deg) scale(.9); }
  to { transform: rotateY(0) scale(1); }
}

@keyframes hand-shift {
  from { opacity: .72; translate: 0 10px; scale: .96; }
  to { opacity: 1; translate: 0 0; scale: 1; }
}

@keyframes first-blood-pulse {
  0%, 100% { box-shadow: inset 0 0 0 2px rgba(255,255,255,.72), 0 7px 18px rgba(0,0,0,.3), 0 0 0 0 rgba(239,207,126,.38); }
  50% { box-shadow: inset 0 0 0 2px rgba(255,255,255,.72), 0 11px 24px rgba(0,0,0,.28), 0 0 0 7px rgba(239,207,126,0); }
}

@keyframes turn-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255,216,120,.1); }
  50% { box-shadow: 0 0 0 6px rgba(255,216,120,.2); }
}

@keyframes active-player-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255,216,120,.13), 0 9px 22px rgba(3,17,13,.34); }
  50% { box-shadow: 0 0 0 8px rgba(255,216,120,.23), 0 11px 27px rgba(3,17,13,.38); }
}

@keyframes playable-card-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.08); }
}

@keyframes action-area-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(216,181,106,.14); }
  50% { box-shadow: 0 0 0 6px rgba(216,181,106,.27); }
}

@keyframes action-menu-enter {
  0% { opacity: .35; transform: translateY(14px) scale(.97); }
  68% { opacity: 1; transform: translateY(-4px) scale(1.01); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .trick-card.card-enter,
  .hand-reordering .hand .playing-card,
  .deal-card-enter,
  .deal-card-back-enter,
  .deal-upcard-enter,
  .playing-card.first-blood-card,
  .card-choice .seat-bottom button.playing-card:not(:disabled),
  .seat.turn-active .player-label,
  .my-turn.phase-bidding .actions,
  .my-turn.phase-bidding .actions.entering,
  .player-label.active .status-dot,
  .round-toast,
  .round-toast::after,
  .dealer-draw-card,
  .dealer-announcement,
  .dealer-selected .dealer-stamp { animation: none; }
  .trick-area.collecting .trick-card { transition-duration: .08s; }
}

@media (max-width: 900px) {
  .welcome { grid-template-columns: 1fr; }
  .welcome-copy { margin: auto; }
  .welcome-art { display: none; }
  .welcome footer { margin-top: 50px; }
  .felt { height: clamp(590px, 76vh, 690px); min-height: 590px; }
  .play-panel { grid-template-columns: 1fr 1fr; }
  .phase-bid-two .actions { grid-column: 1 / -1; }
  .hint-box { grid-column: 1/-1; }
  .rule-options { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
  body { min-width: 0; }
  .welcome {
    padding:
      max(24px, env(safe-area-inset-top))
      max(16px, env(safe-area-inset-right))
      max(28px, env(safe-area-inset-bottom))
      max(16px, env(safe-area-inset-left));
    overflow: visible;
  }
  .welcome-header-actions {
    top: max(14px, env(safe-area-inset-top));
    right: max(14px, env(safe-area-inset-right));
  }
  h1 { font-size: clamp(56px, 19vw, 76px); }
  .lede { font-size: 18px; }
  .name-field { margin-top: 26px; }
  .rule-options .switch-line { min-height: 68px; padding: 12px 11px; }
  .welcome-actions { grid-template-columns: 1fr; }
  .lobby-finder-button { grid-column: auto; }
  .welcome footer { align-items: start; gap: 12px; flex-direction: column; }
  .topbar {
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }
  .lobby-card {
    width: calc(100% - 24px);
    margin: 24px auto max(24px, env(safe-area-inset-bottom));
    padding: 24px 18px;
  }
  .lobby-directory-card {
    width: calc(100% - 24px);
    margin: 24px auto max(24px, env(safe-area-inset-bottom));
    padding: 24px 18px;
  }
  .public-lobby-row { grid-template-columns: auto minmax(0, 1fr); }
  .public-lobby-meta { text-align: left; }
  .public-lobby-action { grid-column: 1 / -1; }
  .public-lobby-action button { min-height: 44px; flex: 1; }
  .lobby-card h2, .dialog h2 { font-size: clamp(31px, 10vw, 42px); }
  .share-row { grid-template-columns: 1fr; margin: 22px 0; }
  .share-row button { min-height: 46px; }
  .lobby-seats { grid-template-columns: 1fr; }
  .game { min-height: 100svh; }
  .gamebar {
    position: sticky;
    top: 0;
    z-index: 20;
    grid-template-columns: minmax(0, 1fr) auto;
    height: 66px;
  }
  .gamebar .wordmark { display: none; }
  .scoreboard { min-width: 0; justify-content: center; gap: 7px; }
  .scoreboard > div { min-width: 0; gap: 5px; }
  .scoreboard span {
    display: block;
    max-width: 76px;
    overflow: hidden;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .scoreboard b { font-size: 25px; }
  .scoreboard em { font-size: 10px; }
  .header-actions { gap: 6px; }
  .icon-button { width: 42px; height: 42px; }
  .table-wrap {
    padding: 6px max(5px, env(safe-area-inset-right)) 0 max(5px, env(safe-area-inset-left));
  }
  .felt {
    height: clamp(540px, calc(100svh - 72px), 650px);
    min-height: 540px;
    max-height: none;
    border-width: 5px;
    border-radius: 30px 30px 92px 92px;
  }
  .dealer-draw { inset: 74px 4px 116px; }
  .dealer-card-fan { width: min(350px, 96vw); height: 175px; }
  .dealer-draw-card {
    width: 54px;
    height: 80px;
    transform: translateX(calc(-50% + var(--draw-x))) rotate(var(--draw-angle));
  }
  .dealer-draw-card.selected { height: 98px; }
  .dealer-draw-card.selected .playing-card { width: 54px; height: 80px; }
  .dealer-draw-card.selected .center-pip { font-size: 28px; }
  .dealer-draw.gathering .dealer-draw-card.draw-position-0 { --winner-y: 190px; }
  .dealer-draw.gathering .dealer-draw-card.draw-position-1 { --winner-x: -155px; --winner-y: 24px; }
  .dealer-draw.gathering .dealer-draw-card.draw-position-2 { --winner-y: -150px; }
  .dealer-draw.gathering .dealer-draw-card.draw-position-3 { --winner-x: 155px; --winner-y: 24px; }
  .seat-left { left: 5px; top: 42%; }
  .seat-right { right: 5px; top: 42%; }
  .seat-top { top: 9px; }
  .dealer-stamp {
    width: 46px;
    height: 46px;
    font-size: 12px;
  }
  .dealer-stamp.dealer-seat-0 {
    left: calc(50% + 92px);
    bottom: 153px;
  }
  .dealer-stamp.dealer-seat-1 {
    left: 51px;
    top: calc(42% + 52px);
  }
  .dealer-stamp.dealer-seat-2 {
    left: calc(50% + 64px);
    top: 61px;
  }
  .dealer-stamp.dealer-seat-3 {
    right: 51px;
    top: calc(42% + 52px);
  }
  .seat-left .player-label,
  .seat-right .player-label { max-width: 82px; }
  .seat-left .player-label > span,
  .seat-right .player-label > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .player-label { gap: 4px; max-width: 180px; padding: 5px 7px; font-size: 9px; }
  .mini-hand .card-back { width: 21px; height: 31px; margin-left: -9px; }
  .center-board {
    width: min(252px, calc(100% - 86px));
    top: 43%;
  }
  .round-info b { font-size: 16px; }
  .trick-area { width: 210px; max-width: 100%; height: 178px; }
  .trick-card { width: 68px; height: 98px; }
  .upcard-area {
    left: 50%;
    top: 65px;
  }
  .upcard-area .playing-card { width: 70px; height: 100px; }
  .playing-card {
    width: clamp(61px, 18vw, 72px);
    height: clamp(93px, 27vw, 108px);
    margin-left: clamp(-18px, -4vw, -13px);
  }
  .card-corner.top { left: 6px; top: 7px; }
  .card-corner.bottom { right: 6px; bottom: 7px; }
  .card-corner b { font-size: 21px; }
  .card-corner i { font-size: 16px; }
  .center-pip { font-size: 38px; }
  .hand { height: 114px; margin-top: 8px; }
  .seat-bottom { bottom: 10px; width: calc(100% - 18px); }
  .card-choice .seat-bottom .hand {
    height: 126px;
    margin-top: 8px;
    gap: 0;
    transform: translateY(-6px);
  }
  .card-choice .seat-bottom .playing-card {
    width: clamp(57px, 17vw, 68px);
    height: clamp(88px, 25vw, 104px);
    margin-left: -5px;
  }
  .card-choice .seat-bottom .playing-card:first-child { margin-left: 0; }
  .phase-playing button.playing-card:disabled {
    opacity: .58;
    filter: saturate(.6);
    transform: translateY(6px) scale(.96);
  }
  .phase-playing button.playing-card.picked-up-card:disabled {
    opacity: 1;
    filter: none;
    transform: none;
  }
  .play-panel {
    grid-template-columns: 1fr;
    gap: 11px;
    min-height: 0;
    padding:
      18px
      max(16px, env(safe-area-inset-right))
      max(28px, calc(env(safe-area-inset-bottom) + 18px))
      max(16px, env(safe-area-inset-left));
  }
  .play-panel > p { margin-bottom: 2px; font-size: 14px; }
  .status-line h2 { font-size: 24px; }
  .my-turn .status-line h2 { font-size: 27px; }
  .dealer-chip {
    max-width: 47%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .actions { align-items: stretch; }
  .action-button { min-width: min(138px, 46%); min-height: 48px; flex: 1 1 138px; }
  .phase-bid-two.my-turn .actions {
    gap: 8px;
    padding: 10px;
  }
  .phase-bid-two.my-turn .action-button {
    min-width: 0;
    min-height: 50px;
    padding: 10px 7px;
    font-size: 12px;
  }
  .phase-bid-two.my-turn .action-button .suit-symbol {
    font-size: 17px;
  }
  .hint-box { grid-column: auto; }
  .rules-grid { grid-template-columns: 1fr; }
  .dialog-backdrop {
    align-items: start;
    overflow-y: auto;
    padding:
      max(12px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }
  .dialog {
    max-height: calc(100svh - 24px);
    overflow-y: auto;
    padding: 30px 22px;
  }
  .dialog-close { width: 44px; height: 44px; right: 6px; top: 5px; }
  .toast {
    bottom: max(14px, calc(env(safe-area-inset-bottom) + 8px));
    width: max-content;
    max-width: calc(100% - 28px);
    text-align: center;
  }
}

@media (max-width: 370px) {
  .gamebar { height: 62px; }
  .scoreboard span { max-width: 58px; }
  .icon-button { width: 38px; height: 38px; }
  .felt {
    height: clamp(520px, calc(100svh - 68px), 600px);
    min-height: 520px;
  }
  .center-board { width: min(230px, calc(100% - 80px)); }
  .trick-area { width: 178px; height: 164px; }
  .trick-card { width: 62px; height: 91px; }
  .playing-card { width: 59px; height: 91px; margin-left: -15px; }
  .hand { height: 97px; }
  .action-button { min-width: 100%; }
}

/* Multiplayer room and spectator controls */
.share-row input { min-width: 0; text-overflow: ellipsis; }
.lobby-identity {
  display: grid;
  grid-template-columns: minmax(150px, .7fr) minmax(260px, 1.3fr);
  align-items: end;
  gap: 18px;
  margin: -8px 0 26px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,255,.38);
}
.lobby-identity label span,
.lobby-identity label small { display: block; }
.lobby-identity label span {
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.lobby-identity label small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.lobby-identity > div { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.lobby-identity button,
.table-button {
  border: 0;
  border-radius: 7px;
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 800;
}
.lobby-identity button { padding: 0 16px; white-space: nowrap; }
.seat-help {
  margin: 0 0 10px !important;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.lobby-seats {
  align-items: stretch;
  margin-bottom: 18px;
}
.partner-team {
  --team-accent: var(--felt);
  position: relative;
  display: grid;
  gap: 9px;
  padding: 11px;
  border: 1px solid color-mix(in srgb, var(--team-accent) 30%, transparent);
  border-top: 4px solid var(--team-accent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--team-accent) 5%, rgba(255,255,255,.4));
}
.partner-team[data-team="Team 2"] { --team-accent: var(--red); }
.partner-team > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 2px;
  color: var(--team-accent);
  text-transform: uppercase;
}
.partner-team > header span {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .13em;
}
.partner-team > header b {
  padding: 4px 7px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--team-accent) 11%, transparent);
  font-size: 8px;
  letter-spacing: .09em;
}
.partner-team .lobby-seat { width: 100%; min-height: 70px; }
.lobby-seat {
  position: relative;
  min-width: 0;
  transition: border-color .16s ease, box-shadow .16s ease, opacity .16s ease, transform .16s ease;
}
.lobby-seat.host-arrangeable { cursor: grab; }
.lobby-seat.host-arrangeable:active { cursor: grabbing; }
.lobby-seat.dragging { opacity: .38; transform: scale(.98); }
.lobby-seat.drop-target {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(216,181,106,.23);
}
.lobby-seat.claimable-open-seat {
  cursor: pointer;
  border-color: var(--gold);
  background: rgba(216,181,106,.1);
  box-shadow: inset 0 0 0 2px rgba(216,181,106,.12);
}
.lobby-seat.claimable-open-seat:hover,
.lobby-seat.claimable-open-seat:focus-visible {
  background: rgba(216,181,106,.18);
  box-shadow: 0 0 0 3px rgba(216,181,106,.22);
  outline: none;
}
.lobby-seat.offline { background: rgba(255,255,255,.42); }
.lobby-seat .drag-grip {
  width: 14px;
  flex: 0 0 auto;
  color: #a4aaa5;
  font-size: 12px;
  letter-spacing: -5px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.lobby-seat .avatar,
.spectator-row .avatar,
.table-member .avatar { flex: 0 0 auto; }
.seat-copy { min-width: 0; flex: 1 1 auto; }
.seat-copy b {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}
.seat-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.host-badge,
.you-badge,
.spectator-badge,
.viewer-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  font-style: normal;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 7px;
  font-weight: 950;
  letter-spacing: .1em;
  line-height: 1;
  text-transform: uppercase;
}
.host-badge { padding: 4px 6px; background: var(--gold); color: var(--on-gold); }
.you-badge { padding: 4px 6px; background: #dce4df; color: #415149; }
.seat-tools { display: flex; flex: 0 0 auto; align-items: center; gap: 5px; }
.kick-button {
  border: 1px solid rgba(200,70,52,.38);
  border-radius: 6px;
  background: rgba(200,70,52,.07);
  color: var(--red);
  padding: 7px 8px;
  font-size: 9px;
  font-weight: 850;
}
.lobby-spectator-panel {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid rgba(216,181,106,.55);
  border-radius: 9px;
  background: rgba(216,181,106,.1);
}
.spectator-badge {
  padding: 6px 8px;
  background: var(--gold);
  color: var(--on-gold);
}
.lobby-spectator-panel strong,
.lobby-spectator-panel small { display: block; }
.lobby-spectator-panel small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.spectator-list {
  margin: 0 0 22px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,255,.28);
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.section-heading b {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e1e3dd;
}
.spectator-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.spectator-row > div { flex: 1 1 auto; }
.spectator-row .avatar,
.table-member .avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #dfe5e1;
  color: var(--felt);
  font: 700 13px Georgia, serif;
}
.spectator-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }

.table-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 10px;
  letter-spacing: .04em;
}
.viewer-badge {
  align-self: center;
  padding: 7px 9px;
  background: var(--gold);
  color: var(--on-gold);
}
.player-label .game-host-badge,
.player-label .ai-badge {
  padding: 3px 5px;
  border-radius: 10px;
  font: normal 900 6px/1 system-ui;
  letter-spacing: .08em;
}
.player-label .game-host-badge { background: var(--gold); color: var(--on-gold); }
.player-label .ai-badge { border: 1px solid rgba(255,255,255,.25); color: #cad9d3; }
.seat.offline-seat .player-label .status-dot { background: #d0695a; }
.board-kick-button {
  display: block;
  min-width: 52px;
  margin: 7px auto 0;
  padding: 5px 10px;
  border: 1px solid rgba(255,219,210,.72);
  border-radius: 20px;
  background: var(--red);
  color: white;
  box-shadow: 0 4px 10px rgba(5,20,15,.28);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.board-kick-button:hover,
.board-kick-button:focus-visible {
  background: #df5542;
  outline: 2px solid rgba(255,255,255,.65);
  outline-offset: 2px;
}

.spectator-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(190px, .75fr) minmax(320px, 1.25fr);
  align-items: center;
  gap: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(216,181,106,.5);
  border-radius: 10px;
  background: linear-gradient(100deg, rgba(216,181,106,.16), rgba(255,255,255,.34));
}
.spectator-panel > div:first-child {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 5px 9px;
}
.spectator-panel strong { font: 500 21px Georgia, serif; }
.spectator-panel small { grid-column: 2; color: var(--muted); font-size: 10px; }
.spectator-join-row {
  display: block;
}
.spectator-join-row input { background: rgba(255,255,255,.72); }
.spectator-mode .felt {
  border-radius: 92px;
  box-shadow: inset 0 0 120px rgba(0,0,0,.2), 0 15px 35px rgba(24,33,29,.18);
}
.spectator-mode .seat-bottom { bottom: 18px; }
.spectator-hand {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 8px;
}
.spectator-hand .playing-card {
  width: 48px;
  height: 70px;
  margin-left: -17px;
  border-radius: 5px;
}
.spectator-hand .playing-card:first-of-type { margin-left: 0; }
.spectator-hand .card-corner.top { left: 4px; top: 4px; }
.spectator-hand .card-corner.bottom { right: 4px; bottom: 4px; }
.spectator-hand .card-corner b { font-size: 14px; }
.spectator-hand .card-corner i { font-size: 10px; }
.spectator-hand .center-pip { font-size: 22px; }
.spectator-mode .seat-left .spectator-hand,
.spectator-mode .seat-right .spectator-hand {
  flex-direction: column;
}
.spectator-mode .seat-left .spectator-hand .playing-card,
.spectator-mode .seat-right .spectator-hand .playing-card {
  margin-top: -42px;
  margin-left: 0;
}
.spectator-mode .seat-left .spectator-hand .card-corner.top,
.spectator-mode .seat-right .spectator-hand .card-corner.top {
  flex-direction: row;
  align-items: baseline;
  gap: 2px;
  line-height: 1;
}
.spectator-mode .seat-left .spectator-hand .card-corner.top i,
.spectator-mode .seat-right .spectator-hand .card-corner.top i { margin-top: 0; }
.spectator-mode .seat-left .spectator-hand .playing-card:first-of-type,
.spectator-mode .seat-right .spectator-hand .playing-card:first-of-type { margin-top: 0; }
.spectator-mode .claimable-ai-seat {
  cursor: pointer;
}
.spectator-mode .claimable-ai-seat .player-label {
  border-color: rgba(255,216,120,.82);
  box-shadow: 0 0 0 4px rgba(255,216,120,.12);
}
.spectator-mode .claimable-ai-seat .spectator-hand {
  filter: drop-shadow(0 0 7px rgba(255,216,120,.28));
}
.spectator-mode .claimable-ai-seat::after {
  content: "CLICK TO JOIN";
  display: block;
  width: max-content;
  margin: 7px auto 0;
  padding: 4px 7px;
  border: 1px solid rgba(255,216,120,.65);
  border-radius: 20px;
  background: rgba(8,31,25,.86);
  color: #ffd878;
  font: 900 7px/1 system-ui;
  letter-spacing: .1em;
}
.spectator-mode .claimable-ai-seat:hover .player-label,
.spectator-mode .claimable-ai-seat:focus-visible .player-label {
  background: rgba(8,31,25,.98);
  box-shadow: 0 0 0 6px rgba(255,216,120,.22);
}
.spectator-mode .claimable-ai-seat:focus-visible { outline: none; }
.spectator-mode .seat.sitting-out .spectator-hand { opacity: .52; }
.spectator-mode .seat.sitting-out .inactive-copy {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 43px;
  transform: translateX(-50%);
  background: rgba(7,31,25,.82);
  white-space: nowrap;
}

.table-dialog { width: min(600px, 100%); }
.table-roster { margin-top: 22px; }
.table-member {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 57px;
  padding: 9px 2px;
  border-top: 1px solid var(--line);
}
.table-member > div { min-width: 0; flex: 1 1 auto; }
.table-member b { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.table-member small {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.table-member.offline { opacity: .72; }
.empty-member { color: var(--muted); }
.spectator-heading { margin-top: 20px; }
.empty-roster { color: var(--muted); font: italic 13px Georgia, serif; }

:root[data-theme="dark"] .halo {
  border-color: var(--line);
  box-shadow: 0 0 0 70px rgba(255,255,255,.045), 0 0 0 140px rgba(255,255,255,.025);
}
:root[data-theme="dark"] .hero-card { border-color: var(--line); }
:root[data-theme="dark"] .lobby-card,
:root[data-theme="dark"] .lobby-directory-card { background: rgba(255,255,255,.035); }
:root[data-theme="dark"] .lobby-identity,
:root[data-theme="dark"] .spectator-list { background: var(--surface-faint); }
:root[data-theme="dark"] .partner-team {
  background: color-mix(in srgb, var(--team-accent) 9%, var(--surface-faint));
}
:root[data-theme="dark"] .lobby-seat.offline { background: var(--surface-faint); }
:root[data-theme="dark"] .you-badge {
  background: #33463c;
  color: var(--ink);
}
:root[data-theme="dark"] .section-heading b,
:root[data-theme="dark"] .spectator-row .avatar,
:root[data-theme="dark"] .table-member .avatar {
  background: var(--surface-soft);
  color: var(--ink);
}
:root[data-theme="dark"] .spectator-panel {
  background: linear-gradient(100deg, rgba(216,181,106,.16), rgba(255,255,255,.055));
}
:root[data-theme="dark"] .spectator-join-row input { background: var(--surface-soft); }
:root[data-theme="dark"] .settings-tabs { background: rgba(0,0,0,.2); }
:root[data-theme="dark"] .action-button.primary:not(.alone) .suit-symbol.black {
  color: var(--on-ink);
  -webkit-text-stroke: 0;
  text-shadow: none;
}

@media (max-width: 900px) {
  .spectator-panel { grid-template-columns: 1fr; }
  .spectator-mode .play-panel { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
  .lobby-identity { grid-template-columns: 1fr; gap: 10px; }
  .lobby-identity > div { grid-template-columns: 1fr; }
  .lobby-identity button { min-height: 42px; }
  .partner-team { padding: 9px; }
  .lobby-seat .drag-grip { width: 12px; }
  .seat-tools { flex-direction: column; align-items: stretch; }
  .viewer-badge { display: none; }
  .table-button { min-height: 42px; padding: 0 10px; }
  .spectator-panel { grid-column: auto; padding: 13px; }
  .spectator-join-row { grid-template-columns: 1fr; }
  .spectator-mode .felt { height: clamp(570px, calc(100svh - 72px), 660px); }
  .spectator-hand .playing-card {
    width: 40px;
    height: 58px;
    margin-left: -18px;
  }
  .spectator-hand .card-corner b { font-size: 12px; }
  .spectator-hand .card-corner i { font-size: 8px; }
  .spectator-hand .center-pip { font-size: 18px; }
  .spectator-mode .seat-left .spectator-hand .playing-card,
  .spectator-mode .seat-right .spectator-hand .playing-card { margin-top: -34px; }
}

@media (max-width: 390px) {
  .lobby-seat .avatar { width: 30px; height: 30px; }
  .kick-button { padding-inline: 6px; }
  .spectator-mode .seat-left { left: 2px; }
  .spectator-mode .seat-right { right: 2px; }
  .spectator-mode .seat-left .ai-badge,
  .spectator-mode .seat-right .ai-badge { display: none; }
}
