/* ============================================================
   单挑德扑 — visual system
   deep felt, brass details, cream cards
   ============================================================ */

:root {
  --bg: #06100b;
  --bg-soft: #0b1912;
  --felt: #145b43;
  --felt-deep: #083326;
  --panel: rgba(8, 22, 16, 0.82);
  --panel-solid: #0a1b14;
  --cream: #f2e8d5;
  --cream-dim: #d9cdb8;
  --gold: #d6b36a;
  --gold-bright: #f2d696;
  --gold-dim: #9b7b45;
  --red: #b94a42;
  --red-soft: #d8675e;
  --text: #f3efe4;
  --muted: #9fb2a7;
  --muted-2: #71877b;
  --line: rgba(214, 179, 106, 0.18);
  --line-soft: rgba(255, 255, 255, 0.07);
  --font-sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
  --font-display: "Baskerville", "Songti SC", "STSong", "Times New Roman", serif;
  --radius: 16px;
  --card-w: 64px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body {
  overflow: hidden;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

::selection { background: rgba(214, 179, 106, 0.35); }

.app-shell {
  position: relative;
  width: 100%;
  height: 100%;
  isolation: isolate;
}

/* ---------- ambient ---------- */

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 15% 0%, rgba(29, 91, 65, 0.3), transparent 42%),
    radial-gradient(ellipse at 88% 100%, rgba(96, 58, 25, 0.24), transparent 45%),
    linear-gradient(150deg, #07130d 0%, #050c08 55%, #0a120d 100%);
}

.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.35;
}
.glow-a { width: 480px; height: 480px; left: -180px; top: 15%; background: #195c42; }
.glow-b { width: 520px; height: 520px; right: -200px; bottom: -180px; background: #6f4a22; opacity: 0.22; }

.ambient-suit {
  position: absolute;
  font-family: Georgia, serif;
  color: transparent;
  -webkit-text-stroke: 1px rgba(214, 179, 106, 0.12);
  line-height: 1;
  user-select: none;
}
.suit-a { font-size: 340px; left: -60px; top: 8%; transform: rotate(-18deg); }
.suit-b { font-size: 220px; right: 8%; top: -70px; color: rgba(185, 74, 66, 0.025); -webkit-text-stroke: 1px rgba(185, 74, 66, 0.09); transform: rotate(12deg); }
.suit-c { font-size: 180px; right: 12%; bottom: 4%; color: rgba(185, 74, 66, 0.02); -webkit-text-stroke: 1px rgba(185, 74, 66, 0.08); transform: rotate(-10deg); }
.suit-d { font-size: 260px; left: 10%; bottom: -100px; transform: rotate(14deg); }

/* ---------- screens ---------- */

.screen {
  position: fixed;
  inset: 0;
  z-index: 1;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.45s ease, transform 0.45s ease, visibility 0.45s;
  overflow: hidden;
}

.screen.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

/* ============================================================
   LOBBY
   ============================================================ */

.lobby-screen {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: max(24px, env(safe-area-inset-top)) clamp(24px, 4.5vw, 64px) max(18px, env(safe-area-inset-bottom));
  background:
    linear-gradient(90deg, rgba(4, 12, 8, 0.25), transparent 30%, transparent 70%, rgba(4, 12, 8, 0.25));
}

.lobby-header {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.mini-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(214, 179, 106, 0.55);
  border-radius: 50%;
  color: var(--gold-bright);
  font-family: Georgia, serif;
  font-size: 22px;
  background: radial-gradient(circle at 35% 25%, rgba(214, 179, 106, 0.2), rgba(6, 16, 11, 0.9));
  box-shadow: 0 0 0 4px rgba(214, 179, 106, 0.04), inset 0 0 18px rgba(214, 179, 106, 0.08);
}

.mini-brand-copy,
.game-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.mini-brand-copy small,
.game-brand-copy small {
  color: var(--muted-2);
  font-size: 8px;
  letter-spacing: 0.28em;
  font-weight: 500;
}

.text-button {
  color: var(--cream-dim);
  font-size: 13px;
  letter-spacing: 0.08em;
  padding: 9px 12px;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}
.text-button:hover { color: var(--gold-bright); background: rgba(214, 179, 106, 0.07); }

.lobby-main {
  width: 100%;
  max-width: 1280px;
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(450px, 0.92fr);
  gap: clamp(36px, 5vw, 78px);
  align-items: center;
  padding: 28px 0;
}

.lobby-hero {
  position: relative;
  padding: 16px 0 22px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 0.26em;
  font-weight: 600;
  margin-bottom: 24px;
}

.eyebrow-line {
  width: 36px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.lobby-hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(48px, 5.6vw, 80px);
  line-height: 1.04;
  letter-spacing: -0.045em;
  color: var(--cream);
  text-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.lobby-hero h1 em {
  font-style: normal;
  white-space: nowrap;
  color: transparent;
  background: linear-gradient(100deg, #f0d69a 0%, #c9a35b 48%, #f6e1a9 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-copy {
  max-width: 480px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
  letter-spacing: 0.02em;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.hero-tags span {
  padding: 6px 12px;
  border: 1px solid rgba(214, 179, 106, 0.18);
  border-radius: 999px;
  font-size: 10px;
  color: var(--cream-dim);
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.02);
}

.hero-hand {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 160px;
  height: 120px;
  opacity: 0.9;
  pointer-events: none;
}

.hero-card {
  position: absolute;
  width: 74px;
  height: 106px;
  border-radius: 9px;
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.45);
}

.hero-card-back {
  right: 54px;
  bottom: 0;
  transform: rotate(-9deg);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 40%),
    repeating-linear-gradient(45deg, #702a2a 0 6px, #5d2020 6px 12px);
  border: 2px solid #e2c789;
}
.hero-card-back::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(242, 214, 150, 0.5);
  border-radius: 5px;
}
.hero-card-back span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(242, 214, 150, 0.8);
  font-size: 30px;
}

.hero-card-front {
  right: 4px;
  bottom: 8px;
  transform: rotate(7deg);
  background: #f5edde;
  color: #18221b;
  border: 1px solid rgba(0, 0, 0, 0.15);
}
.hero-card-front .hero-rank {
  position: absolute;
  top: 7px;
  left: 9px;
  font-family: Georgia, serif;
  font-size: 20px;
  line-height: 1;
}
.hero-card-front .hero-suit {
  position: absolute;
  top: 26px;
  left: 10px;
  font-size: 15px;
  line-height: 1;
}
.hero-card-front b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 36px;
  font-weight: 400;
  opacity: 0.9;
}

/* lobby panel */

.lobby-panel {
  position: relative;
  padding: clamp(22px, 2.4vw, 32px);
  border: 1px solid rgba(214, 179, 106, 0.2);
  border-radius: 20px;
  background:
    linear-gradient(160deg, rgba(22, 51, 38, 0.7), rgba(7, 19, 13, 0.92) 60%),
    var(--panel);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(18px);
}

.lobby-panel::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(214, 179, 106, 0.07);
  border-radius: 15px;
  pointer-events: none;
}

.panel-heading { margin-bottom: 20px; }

.panel-kicker {
  display: block;
  color: var(--gold);
  font-size: 8px;
  letter-spacing: 0.28em;
  margin-bottom: 8px;
}

.panel-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--cream);
}

.difficulty-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.difficulty-card {
  position: relative;
  min-height: 212px;
  padding: 14px 13px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  background: rgba(4, 13, 9, 0.42);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
}

.difficulty-card::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.difficulty-card:hover {
  transform: translateY(-2px);
  border-color: rgba(214, 179, 106, 0.32);
  background: rgba(17, 39, 29, 0.62);
}

.difficulty-card.is-selected {
  border-color: rgba(214, 179, 106, 0.68);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(214, 179, 106, 0.11), transparent 70%),
    rgba(16, 39, 28, 0.82);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25), inset 0 0 0 1px rgba(214, 179, 106, 0.12);
}

.difficulty-card.is-selected::after { opacity: 1; }

.diff-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.diff-index {
  font-family: Georgia, serif;
  font-size: 10px;
  color: var(--muted-2);
  letter-spacing: 0.14em;
}

.diff-bars { display: flex; align-items: flex-end; gap: 2px; height: 12px; }
.diff-bars i {
  display: block;
  width: 3px;
  height: 5px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.11);
}
.diff-bars i:nth-child(2) { height: 8px; }
.diff-bars i:nth-child(3) { height: 11px; }
.difficulty-card[data-difficulty="easy"] .diff-bars i:nth-child(1) { background: #86b198; }
.difficulty-card[data-difficulty="medium"] .diff-bars i:nth-child(-n+2) { background: var(--gold); }
.difficulty-card[data-difficulty="hard"] .diff-bars i:nth-child(-n+3) { background: var(--red-soft); }

.diff-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--cream);
}
.diff-name {
  font-size: 10px;
  color: var(--gold);
  letter-spacing: 0.12em;
}
.diff-desc {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
  flex: 1;
}
.diff-tag {
  display: inline-flex;
  align-self: flex-start;
  margin-top: 4px;
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  font-size: 9px;
  color: var(--muted-2);
  letter-spacing: 0.08em;
}
.difficulty-card.is-selected .diff-tag {
  border-color: rgba(214, 179, 106, 0.25);
  color: var(--cream-dim);
}

.primary-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 9px;
  border: 1px solid #ebd29b;
  background:
    linear-gradient(180deg, #f0d69b 0%, #d4ad64 48%, #b98e49 100%);
  color: #1a241a;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.14em;
  box-shadow: 0 8px 26px rgba(190, 148, 75, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.primary-button:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(190, 148, 75, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.primary-button:active { transform: translateY(0); }
.primary-button:disabled { filter: grayscale(0.5) brightness(0.65); box-shadow: none; }

.start-button {
  width: 100%;
  margin-top: 20px;
  height: 54px;
  font-size: 14px;
}
.button-arrow {
  font-size: 18px;
  font-weight: 400;
  transition: transform 0.2s ease;
}
.start-button:hover .button-arrow { transform: translateX(4px); }

.table-specs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 7px 16px;
  margin-top: 14px;
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0.06em;
}
.table-specs b { color: var(--cream-dim); font-weight: 500; }

.lobby-footer {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0.12em;
}
.footer-mark { color: rgba(214, 179, 106, 0.4); letter-spacing: 0.4em; }

/* ============================================================
   GAME HEADER
   ============================================================ */

.game-screen {
  display: flex;
  flex-direction: column;
  padding: max(16px, env(safe-area-inset-top)) clamp(14px, 2vw, 28px) max(18px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(6, 16, 11, 0.3), rgba(4, 10, 7, 0.7));
}

.game-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.game-brand { display: flex; align-items: center; gap: 10px; }
.brand-mark.small { width: 34px; height: 34px; font-size: 18px; }

.game-meta { display: flex; align-items: center; gap: 8px; }

.meta-chip {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-height: 30px;
  padding: 5px 11px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
}
.meta-chip span { color: var(--muted-2); font-size: 9px; letter-spacing: 0.08em; }
.meta-chip b { color: var(--cream-dim); font-size: 12px; font-weight: 500; letter-spacing: 0.04em; }

.difficulty-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 5px 12px;
  border: 1px solid rgba(214, 179, 106, 0.24);
  border-radius: 999px;
  color: var(--gold-bright);
  font-size: 10px;
  letter-spacing: 0.1em;
  background: rgba(214, 179, 106, 0.055);
}
.difficulty-pill i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(214, 179, 106, 0.8);
}

.header-actions { display: flex; align-items: center; gap: 6px; }

.icon-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.icon-button:hover { color: var(--gold-bright); border-color: rgba(214, 179, 106, 0.28); background: rgba(214, 179, 106, 0.06); }
.icon-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icon-button .icon-sound-off { display: none; }
.icon-button.is-muted .icon-sound-on { display: none; }
.icon-button.is-muted .icon-sound-off { display: block; }
.icon-button.is-muted { color: var(--muted-2); }

.leave-button { margin-left: 3px; font-size: 11px; }

/* ============================================================
   GAME LAYOUT
   ============================================================ */

.game-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 306px;
  gap: 16px;
  padding-top: 14px;
}

.table-area {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.table-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 0;
}

/* ---------- table felt ---------- */

.table-felt {
  position: relative;
  height: 100%;
  max-height: 630px;
  width: auto;
  max-width: 100%;
  aspect-ratio: 1.72 / 1;
  padding: 13px;
  border-radius: 49% / 48%;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.1), transparent 30%),
    linear-gradient(180deg, #4b2f1d 0%, #2a1810 52%, #1a0e09 100%);
  box-shadow:
    0 36px 80px rgba(0, 0, 0, 0.58),
    0 10px 22px rgba(0, 0, 0, 0.4),
    inset 0 0 0 1px rgba(242, 214, 150, 0.18);
}

.table-felt::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: inherit;
  background:
    radial-gradient(ellipse at 50% 37%, rgba(41, 125, 91, 0.38) 0%, transparent 48%),
    radial-gradient(ellipse at 50% 50%, #126b4f 0%, #0c4a37 48%, #072d22 100%);
  box-shadow:
    inset 0 0 0 1px rgba(214, 179, 106, 0.25),
    inset 0 0 80px rgba(0, 0, 0, 0.42);
}

.table-felt::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.felt-weave {
  position: absolute;
  inset: 16px;
  border-radius: inherit;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.035) 0 1px, transparent 1px 9px);
  opacity: 0.8;
  pointer-events: none;
  z-index: 1;
}

.table-watermark {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.55em;
  color: rgba(242, 214, 150, 0.095);
  white-space: nowrap;
  z-index: 1;
  pointer-events: none;
}
.table-watermark span { font-size: 10px; letter-spacing: 0.3em; }

.deck-stack {
  position: absolute;
  right: 7.5%;
  top: 48%;
  width: 34px;
  height: 48px;
  z-index: 2;
  opacity: 0.48;
  transform: rotate(8deg);
  pointer-events: none;
}
.deck-stack i {
  position: absolute;
  inset: 0;
  border-radius: 5px;
  background:
    repeating-linear-gradient(45deg, #6d2626 0 4px, #561d1d 4px 8px);
  border: 1px solid rgba(214, 179, 106, 0.5);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}
.deck-stack i:nth-child(1) { transform: translate(-4px, -4px) rotate(-4deg); }
.deck-stack i:nth-child(2) { transform: translate(-2px, -2px) rotate(-2deg); }

/* ---------- seats ---------- */

.seat {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  width: clamp(260px, 34%, 360px);
  transition: opacity 0.25s ease;
}

.ai-seat { top: 3.3%; }
.player-seat { bottom: 3.8%; }

.seat-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border: 1px solid rgba(214, 179, 106, 0.22);
  border-radius: 15px;
  background:
    linear-gradient(150deg, rgba(22, 45, 34, 0.88), rgba(5, 18, 12, 0.92));
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(10px);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.seat.is-active .seat-inner {
  border-color: rgba(242, 214, 150, 0.72);
  box-shadow:
    0 0 0 1px rgba(242, 214, 150, 0.16),
    0 0 28px rgba(214, 179, 106, 0.2),
    0 12px 30px rgba(0, 0, 0, 0.4);
  transform: translateY(-1px);
}

.seat.is-thinking .ai-avatar {
  animation: avatarPulse 1.15s ease-in-out infinite;
}

.seat.is-winner .seat-inner {
  border-color: rgba(242, 214, 150, 0.9);
  box-shadow: 0 0 0 1px rgba(242, 214, 150, 0.25), 0 0 42px rgba(214, 179, 106, 0.32);
}
.seat.is-folded { opacity: 0.55; }

.seat-cards {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  perspective: 800px;
}

.seat-plate {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(214, 179, 106, 0.28);
  background: radial-gradient(circle at 40% 30%, #1e4332, #091a12);
  overflow: hidden;
}
.avatar svg { width: 27px; height: 27px; fill: none; stroke: var(--cream-dim); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ai-avatar svg { stroke: var(--gold-bright); }
.player-avatar { background: radial-gradient(circle at 40% 30%, #3d3420, #171208); }

.seat-copy { min-width: 0; }
.seat-name-row { display: flex; align-items: center; gap: 5px; }
.seat-name-row strong {
  font-size: 12px;
  letter-spacing: 0.06em;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.seat-badge {
  display: inline-grid;
  place-items: center;
  min-width: 23px;
  height: 15px;
  padding: 0 4px;
  border-radius: 3px;
  font-family: Georgia, serif;
  font-size: 8px;
  letter-spacing: 0.05em;
  color: var(--gold-bright);
  border: 1px solid rgba(214, 179, 106, 0.28);
  background: rgba(214, 179, 106, 0.06);
}
.seat-badge.is-button {
  background: var(--gold);
  color: #142016;
  border-color: var(--gold-bright);
  font-weight: 700;
}
.seat-stack {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  color: var(--gold-bright);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.chip-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px dashed rgba(20, 32, 22, 0.8);
  background: linear-gradient(180deg, #f3d797, #bd914b);
  box-shadow: 0 0 0 1px rgba(242, 214, 150, 0.15);
}

.dealer-chip {
  position: absolute;
  right: -9px;
  top: -9px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #f7e2ac, #c9a35b);
  color: #1b241a;
  font-family: Georgia, serif;
  font-size: 9px;
  font-weight: 700;
  border: 1px solid #fff0c8;
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.45);
  z-index: 2;
}

.seat-bet {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 5px;
  border-radius: 999px;
  background: rgba(4, 15, 10, 0.82);
  border: 1px solid rgba(214, 179, 106, 0.16);
  color: var(--cream-dim);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  z-index: 4;
}
.seat-bet::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(180deg, #eacf91, #b68b47);
  border: 2px dashed rgba(34, 26, 12, 0.55);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.ai-seat .seat-bet { bottom: -27px; }
.player-seat .seat-bet { top: -27px; }

.action-bubble {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  padding: 4px 10px;
  border-radius: 7px;
  background: #f0e6d3;
  color: #1c2a1f;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.35);
  animation: bubbleIn 0.22s ease both;
}
.action-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 7px;
  height: 7px;
  background: #f0e6d3;
  transform: translateX(-50%) rotate(45deg);
}
.ai-seat .action-bubble { top: calc(100% + 7px); }
.ai-seat .action-bubble::after { top: -3px; }
.player-seat .action-bubble { bottom: calc(100% + 7px); }
.player-seat .action-bubble::after { bottom: -3px; }

.action-bubble.is-thinking {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  background: rgba(7, 20, 14, 0.95);
  border: 1px solid rgba(214, 179, 106, 0.2);
}
.action-bubble.is-thinking::after { background: rgba(7, 20, 14, 0.95); }
.thinking-dots { display: inline-flex; gap: 3px; }
.thinking-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  animation: dotBounce 1.1s infinite;
}
.thinking-dots i:nth-child(2) { animation-delay: 0.15s; }
.thinking-dots i:nth-child(3) { animation-delay: 0.3s; }

/* ---------- table center ---------- */

.table-center {
  position: absolute;
  left: 50%;
  top: 47.5%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.pot-display {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 30px;
  padding: 4px 14px 4px 7px;
  border-radius: 999px;
  background: rgba(3, 14, 9, 0.54);
  border: 1px solid rgba(214, 179, 106, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.pot-chips { position: relative; width: 31px; height: 24px; flex: 0 0 auto; }
.pot-chips i {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px dashed rgba(28, 22, 12, 0.55);
  background: linear-gradient(180deg, #efd599, #b88c46);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.pot-chips i:nth-child(2) { left: 5px; bottom: 4px; background: linear-gradient(180deg, #db6a5b, #9d3932); border-color: rgba(40, 14, 10, 0.45); }
.pot-chips i:nth-child(3) { left: 10px; bottom: 8px; background: linear-gradient(180deg, #f0e5cc, #c8b99a); border-color: rgba(54, 45, 28, 0.4); }

.pot-copy { display: flex; align-items: baseline; gap: 8px; }
.pot-copy span { color: var(--muted-2); font-size: 8px; letter-spacing: 0.18em; }
.pot-copy strong {
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  text-shadow: 0 0 18px rgba(214, 179, 106, 0.15);
}

.board {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 0.65vw, 8px);
  min-height: 106px;
}

.street-label {
  color: rgba(242, 232, 213, 0.48);
  font-size: 8px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  min-height: 12px;
}

/* ---------- playing cards ---------- */

.playing-card {
  position: relative;
  width: var(--card-w);
  aspect-ratio: 0.715;
  flex: 0 0 auto;
  perspective: 900px;
  border-radius: 7px;
  transition: transform 0.25s ease, opacity 0.25s ease, filter 0.25s ease;
}

.playing-card.is-empty {
  border: 1px dashed rgba(242, 232, 213, 0.16);
  border-radius: 7px;
  background: rgba(2, 10, 7, 0.18);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.12);
}
.playing-card.is-empty .card-inner { opacity: 0; visibility: hidden; }

.card-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.52s cubic-bezier(0.2, 0.75, 0.25, 1);
  border-radius: 7px;
}
.playing-card.is-face-up .card-inner { transform: rotateY(180deg); }

.card-side {
  position: absolute;
  inset: 0;
  border-radius: 7px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}

.card-back {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 38%),
    repeating-linear-gradient(45deg, #7b2d2d 0 4px, #661f1f 4px 8px);
  border: 2px solid #e7cd92;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(72, 28, 20, 0.55);
}
.card-back::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(244, 218, 158, 0.55);
  border-radius: 4px;
}
.card-back::after {
  content: "♠";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(247, 226, 172, 0.88);
  font-family: Georgia, serif;
  font-size: calc(var(--card-w) * 0.45);
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.card-front {
  transform: rotateY(180deg);
  background:
    radial-gradient(ellipse at 30% 15%, rgba(255, 255, 255, 0.9), transparent 48%),
    linear-gradient(150deg, #fbf6ea, #ece1cc);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.42), inset 0 0 0 1px rgba(103, 82, 47, 0.15);
  color: #18231b;
}
.card-front.is-red { color: #b03d39; }

.card-corner {
  position: absolute;
  left: calc(var(--card-w) * 0.075);
  top: calc(var(--card-w) * 0.045);
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.92;
  font-family: Georgia, "Times New Roman", serif;
}
.card-corner .rank {
  font-size: calc(var(--card-w) * 0.32);
  font-weight: 600;
  letter-spacing: -0.04em;
}
.card-corner .suit { font-size: calc(var(--card-w) * 0.22); margin-top: 1px; }
.card-corner.bottom {
  top: auto;
  left: auto;
  right: calc(var(--card-w) * 0.075);
  bottom: calc(var(--card-w) * 0.045);
  transform: rotate(180deg);
}
.card-pip {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: Georgia, serif;
  font-size: calc(var(--card-w) * 0.52);
  opacity: 0.9;
  transform: translateY(5%);
}
.card-front[data-rank="10"] .card-corner .rank { font-size: calc(var(--card-w) * 0.28); }
.card-front[data-rank="J"] .card-corner .rank,
.card-front[data-rank="Q"] .card-corner .rank,
.card-front[data-rank="K"] .card-corner .rank,
.card-front[data-rank="A"] .card-corner .rank { font-size: calc(var(--card-w) * 0.3); }

.playing-card.is-dealt { animation: dealCard 0.48s cubic-bezier(0.2, 0.8, 0.25, 1) both; }
.playing-card.is-winning {
  z-index: 2;
  box-shadow: 0 0 0 2px var(--gold-bright), 0 0 28px rgba(242, 214, 150, 0.42);
  transform: translateY(-4px);
  border-radius: 7px;
}
.playing-card.is-winning .card-front { border-color: #f6dda2; }
.playing-card.is-dim { opacity: 0.52; filter: saturate(0.7); }

.ai-cards { --card-w: clamp(36px, 3.3vw, 50px); }
.player-cards { --card-w: clamp(55px, 4.9vw, 72px); }
.player-cards .playing-card:nth-child(1) { transform: rotate(-2.4deg) translateY(1px); }
.player-cards .playing-card:nth-child(2) { transform: rotate(2.4deg) translateY(-1px); }
.player-cards .playing-card.is-winning { transform: translateY(-4px); }
.board .playing-card { --card-w: clamp(46px, 5vw, 72px); }

/* ============================================================
   UNDER TABLE + CONTROLS
   ============================================================ */

.under-table {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.table-status {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 32px;
  padding: 0 4px;
}
.status-dot {
  width: 6px;
  height: 6px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--muted-2);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.025);
  flex: 0 0 auto;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}
.status-dot.is-live { background: var(--gold); box-shadow: 0 0 0 4px rgba(214, 179, 106, 0.08), 0 0 12px rgba(214, 179, 106, 0.5); }
.status-dot.is-ai { background: #77a88e; box-shadow: 0 0 0 4px rgba(119, 168, 142, 0.07); }
.status-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.status-copy strong { font-size: 12px; font-weight: 500; letter-spacing: 0.04em; color: var(--cream-dim); }
.status-copy small { font-size: 10px; color: var(--muted-2); letter-spacing: 0.02em; }

.controls {
  min-height: 118px;
  border: 1px solid rgba(214, 179, 106, 0.14);
  border-radius: 15px;
  background:
    linear-gradient(160deg, rgba(19, 39, 29, 0.78), rgba(5, 16, 11, 0.9));
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 13px 15px;
  display: flex;
  align-items: stretch;
}

.controls-grid {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(150px, 0.72fr) minmax(0, 1.6fr);
  gap: 16px;
  align-items: center;
}

.controls-grid.is-simple {
  grid-template-columns: minmax(150px, 0.72fr) minmax(0, 1.6fr);
}
.controls-grid.is-simple .action-row {
  flex-direction: row;
}
.controls-grid.is-simple .action-row .action-btn {
  flex: 1;
  min-width: 0;
}
.controls-grid.is-simple .raise-hint {
  align-self: center;
  padding: 0 4px;
}

.action-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.action-btn {
  position: relative;
  min-height: 45px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  transition: transform 0.15s ease, filter 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
}
.action-btn:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.action-btn:active:not(:disabled) { transform: translateY(0); }
.action-btn:disabled { opacity: 0.35; }

.fold-btn {
  color: #e8b9b3;
  border-color: rgba(185, 74, 66, 0.32);
  background: linear-gradient(180deg, rgba(100, 38, 34, 0.55), rgba(61, 23, 21, 0.72));
}
.fold-btn:hover:not(:disabled) { border-color: rgba(216, 103, 94, 0.55); }

.call-btn {
  color: #162219;
  border-color: #ead29a;
  background: linear-gradient(180deg, #f2e4c6, #d2c1a2);
  font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.call-btn.is-check { background: linear-gradient(180deg, #d8e3d7, #b6c6b6); }
.call-btn:disabled { filter: grayscale(0.4); }

.raise-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(2, 11, 7, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.055);
}

.raise-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.raise-head-label { color: var(--muted-2); font-size: 9px; letter-spacing: 0.12em; }
.raise-head strong {
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.range-wrap { position: relative; width: 100%; height: 18px; display: flex; align-items: center; }

.raise-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--gold) var(--fill, 40%), rgba(255, 255, 255, 0.12) var(--fill, 40%));
  outline: none;
}
.raise-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fae6b2, #c39a50);
  border: 2px solid #4a351b;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}
.raise-slider::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fae6b2, #c39a50);
  border: 2px solid #4a351b;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}
.raise-slider:disabled { opacity: 0.4; }

.raise-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.quick-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.quick-chip {
  height: 22px;
  padding: 0 7px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.04em;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.quick-chip:hover { color: var(--gold-bright); border-color: rgba(214, 179, 106, 0.3); background: rgba(214, 179, 106, 0.06); }
.quick-chip.all-in { color: #e7b2ab; border-color: rgba(185, 74, 66, 0.3); }

.raise-btn {
  min-width: 132px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid #eed69f;
  background: linear-gradient(180deg, #f1d99f, #c9a057);
  color: #192117;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 5px 16px rgba(201, 160, 87, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.raise-btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); }
.raise-btn:disabled { opacity: 0.35; filter: grayscale(0.5); }
.raise-btn .all-in-mark { font-size: 9px; letter-spacing: 0.08em; opacity: 0.7; }

.raise-hint {
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.5;
}

.controls-waiting {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.waiting-orbit {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(214, 179, 106, 0.18);
  display: grid;
  place-items: center;
  color: var(--gold);
  font-family: Georgia, serif;
  position: relative;
}
.waiting-orbit::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid transparent;
  border-top-color: var(--gold);
  animation: spin 1.4s linear infinite;
}
.waiting-copy { display: flex; flex-direction: column; gap: 3px; }
.waiting-copy strong { color: var(--cream-dim); font-size: 12px; font-weight: 500; }
.waiting-copy small { color: var(--muted-2); font-size: 10px; }

.continue-panel {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.continue-copy { display: flex; flex-direction: column; gap: 3px; }
.continue-copy strong { font-size: 13px; font-weight: 500; color: var(--cream-dim); }
.continue-copy small { font-size: 10px; color: var(--muted-2); }
.continue-actions { display: flex; gap: 8px; }

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid rgba(214, 179, 106, 0.24);
  color: var(--cream-dim);
  background: rgba(255, 255, 255, 0.02);
  font-size: 11px;
  letter-spacing: 0.08em;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.ghost-button:hover { color: var(--gold-bright); border-color: rgba(214, 179, 106, 0.48); background: rgba(214, 179, 106, 0.06); }

.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid rgba(216, 103, 94, 0.45);
  background: rgba(130, 45, 39, 0.25);
  color: #edbcb6;
  font-size: 11px;
  letter-spacing: 0.08em;
}
.danger-button:hover { background: rgba(160, 53, 46, 0.4); }

/* ============================================================
   SIDEBAR
   ============================================================ */

.sidebar {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.side-card {
  border: 1px solid rgba(214, 179, 106, 0.13);
  border-radius: 14px;
  background:
    linear-gradient(160deg, rgba(17, 36, 27, 0.62), rgba(5, 15, 10, 0.84));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  padding: 14px;
}

.side-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 11px;
}
.side-heading h2 {
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.17em;
  color: var(--muted);
  text-transform: uppercase;
}
.phase-pill,
.log-hand {
  padding: 3px 7px;
  border: 1px solid rgba(214, 179, 106, 0.16);
  border-radius: 4px;
  color: var(--gold);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
  border-left: 1px solid rgba(255, 255, 255, 0.055);
}
.info-grid > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.055);
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}
.info-grid span { color: var(--muted-2); font-size: 8px; letter-spacing: 0.08em; }
.info-grid b {
  color: var(--cream-dim);
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rank-panel {
  margin-top: 11px;
  padding: 10px 11px;
  border: 1px solid rgba(214, 179, 106, 0.15);
  border-radius: 8px;
  background:
    radial-gradient(ellipse at 100% 0%, rgba(214, 179, 106, 0.08), transparent 55%),
    rgba(4, 15, 10, 0.45);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.rank-label { color: var(--muted-2); font-size: 8px; letter-spacing: 0.14em; }
.rank-panel strong {
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.02em;
  min-height: 26px;
}
.draw-hint { color: var(--gold); font-size: 10px; min-height: 14px; letter-spacing: 0.04em; }
.pot-odds { color: var(--muted-2); font-size: 9px; line-height: 1.55; min-height: 13px; }
.pot-odds b { color: var(--cream-dim); font-weight: 500; }

.log-card {
  flex: 1;
  min-height: 130px;
  display: flex;
  flex-direction: column;
}
.log-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 3px;
  scrollbar-width: thin;
  scrollbar-color: rgba(214, 179, 106, 0.2) transparent;
}
.log-list::-webkit-scrollbar { width: 4px; }
.log-list::-webkit-scrollbar-thumb { background: rgba(214, 179, 106, 0.2); border-radius: 4px; }

.log-entry {
  position: relative;
  display: flex;
  gap: 7px;
  padding: 5px 0 5px 10px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
  letter-spacing: 0.01em;
}
.log-entry::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted-2);
}
.log-entry.type-player { color: #d7e5d9; }
.log-entry.type-player::before { background: #86b198; }
.log-entry.type-ai { color: #e1d2b5; }
.log-entry.type-ai::before { background: var(--gold); }
.log-entry.type-win { color: var(--gold-bright); }
.log-entry.type-win::before { background: var(--gold-bright); box-shadow: 0 0 7px rgba(242, 214, 150, 0.7); }
.log-entry.type-split { color: #b9cdd1; }
.log-entry.type-system { color: var(--muted-2); font-size: 9px; }
.log-entry.type-system::before { background: rgba(255, 255, 255, 0.16); }
.log-entry.type-divider {
  margin: 8px 0 4px;
  padding: 7px 0 4px 0;
  border-top: 1px solid rgba(214, 179, 106, 0.1);
  color: var(--gold-dim);
  font-size: 8px;
  letter-spacing: 0.13em;
}
.log-entry.type-divider::before { display: none; }

/* ============================================================
   RESULT OVERLAY
   ============================================================ */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(20, 57, 41, 0.32), transparent 55%),
    rgba(2, 8, 5, 0.78);
  backdrop-filter: blur(9px);
  animation: fadeIn 0.25s ease both;
}
.overlay[hidden] { display: none; }

.result-card {
  position: relative;
  width: min(446px, 94vw);
  max-height: 92vh;
  overflow-y: auto;
  padding: 30px 32px 26px;
  border: 1px solid rgba(214, 179, 106, 0.38);
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 50% -16%, rgba(214, 179, 106, 0.17), transparent 55%),
    linear-gradient(160deg, #102b1f 0%, #07150e 70%);
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  text-align: center;
  animation: resultIn 0.4s cubic-bezier(0.2, 0.8, 0.25, 1) both;
}
.result-card::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(214, 179, 106, 0.1);
  border-radius: 14px;
  pointer-events: none;
}

.result-kicker { color: var(--gold); font-size: 8px; letter-spacing: 0.28em; margin-bottom: 12px; }
.result-emblem {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(214, 179, 106, 0.5);
  color: var(--gold-bright);
  font-family: Georgia, serif;
  font-size: 24px;
  background: radial-gradient(circle at 35% 25%, rgba(214, 179, 106, 0.2), rgba(6, 16, 11, 0.8));
  box-shadow: 0 0 0 5px rgba(214, 179, 106, 0.045), 0 0 30px rgba(214, 179, 106, 0.08);
}
.result-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 34px;
  letter-spacing: 0.03em;
  color: var(--cream);
}
.result-card > p {
  margin: 8px auto 0;
  max-width: 320px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
}

.result-hands { display: flex; flex-direction: column; gap: 6px; margin: 18px 0 14px; text-align: left; }
.result-hand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.022);
}
.result-hand-row.is-winner {
  border-color: rgba(214, 179, 106, 0.28);
  background: rgba(214, 179, 106, 0.055);
}
.result-hand-owner { color: var(--muted-2); font-size: 9px; letter-spacing: 0.12em; }
.result-hand-name { color: var(--cream-dim); font-size: 12px; font-weight: 500; }
.result-hand-row.is-winner .result-hand-name { color: var(--gold-bright); }

.result-pot-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  padding: 11px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.result-pot-row span { color: var(--muted-2); font-size: 8px; letter-spacing: 0.14em; }
.result-pot-row strong { color: var(--gold-bright); font-family: var(--font-display); font-size: 24px; font-weight: 500; }
.result-pot-row em { font-style: normal; font-size: 9px; color: var(--muted); }
.result-pot-row em.is-positive { color: #8fc6a2; }
.result-pot-row em.is-negative { color: #d68f86; }

.result-actions { display: flex; gap: 8px; margin-top: 16px; }
.result-actions .primary-button { flex: 1; min-height: 44px; font-size: 12px; }
.result-actions .ghost-button { min-height: 44px; }

.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.confetti i {
  position: absolute;
  top: -20px;
  width: 7px;
  height: 11px;
  border-radius: 1px;
  animation: confettiFall linear both;
}

/* ============================================================
   MODALS
   ============================================================ */

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-layer[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 6, 4, 0.8);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease both;
}

.modal {
  position: relative;
  width: min(720px, 94vw);
  max-height: 88vh;
  border: 1px solid rgba(214, 179, 106, 0.3);
  border-radius: 18px;
  background:
    linear-gradient(160deg, #102a1e 0%, #07150e 72%);
  box-shadow: 0 45px 110px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn 0.28s ease both;
}
.modal[hidden] { display: none; }

.modal-header {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 26px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}
.modal-kicker { display: block; color: var(--gold); font-size: 8px; letter-spacing: 0.25em; margin-bottom: 5px; }
.modal-header h2 { margin: 0; font-family: var(--font-display); font-size: 26px; font-weight: 400; color: var(--cream); }
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
  font-size: 21px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.modal-close:hover { color: var(--gold-bright); border-color: rgba(214, 179, 106, 0.4); }

.modal-scroll {
  overflow-y: auto;
  padding: 20px 26px 26px;
  scrollbar-width: thin;
  scrollbar-color: rgba(214, 179, 106, 0.2) transparent;
}

.rule-points {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.rule-points > div {
  display: flex;
  gap: 10px;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.018);
}
.rule-points b {
  flex: 0 0 auto;
  font-family: Georgia, serif;
  font-size: 10px;
  color: var(--gold);
  font-weight: 400;
}
.rule-points span { color: var(--muted); font-size: 10px; line-height: 1.75; }

.ranking-title {
  margin: 24px 0 12px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  color: var(--cream);
}
.hand-ranking {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 9px;
  overflow: hidden;
  counter-reset: ranking;
}
.hand-ranking li {
  counter-increment: ranking;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 11px;
  background: rgba(255, 255, 255, 0.018);
}
.hand-ranking li:nth-child(odd) { background: rgba(255, 255, 255, 0.032); }
.hand-ranking li::before {
  content: counter(ranking, decimal-leading-zero);
  color: var(--gold-dim);
  font-family: Georgia, serif;
  font-size: 8px;
  margin-right: auto;
}
.hand-ranking span { order: 0; color: var(--cream-dim); font-size: 10px; }
.hand-ranking em { color: var(--muted-2); font-style: normal; font-size: 9px; text-align: right; }
.rules-note {
  margin-top: 16px;
  padding: 10px 12px;
  border-left: 2px solid rgba(214, 179, 106, 0.4);
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.75;
  background: rgba(214, 179, 106, 0.03);
}

.confirm-modal {
  width: min(410px, 92vw);
  padding: 30px 30px 24px;
  text-align: center;
  overflow: visible;
}
.confirm-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  border-radius: 50%;
  border: 1px solid rgba(214, 179, 106, 0.4);
  display: grid;
  place-items: center;
  color: var(--gold-bright);
  font-family: Georgia, serif;
  font-size: 20px;
}
.confirm-modal h2 { margin: 0; font-family: var(--font-display); font-size: 27px; font-weight: 400; color: var(--cream); }
.confirm-modal p { color: var(--muted); font-size: 11px; line-height: 1.8; margin: 10px 0 22px; }
.confirm-actions { display: flex; gap: 8px; }
.confirm-actions button { flex: 1; min-height: 42px; }

/* toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 90;
  transform: translate(-50%, 12px);
  padding: 9px 16px;
  border: 1px solid rgba(214, 179, 106, 0.3);
  border-radius: 999px;
  background: rgba(5, 18, 12, 0.94);
  color: var(--cream-dim);
  font-size: 11px;
  letter-spacing: 0.04em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes dealCard {
  0% { opacity: 0; transform: translateY(-34px) scale(0.82) rotate(-5deg); }
  65% { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}
@keyframes bubbleIn {
  from { opacity: 0; transform: translate(-50%, 4px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes avatarPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(214, 179, 106, 0.2); border-color: rgba(214, 179, 106, 0.28); }
  50% { box-shadow: 0 0 0 5px rgba(214, 179, 106, 0.045); border-color: rgba(214, 179, 106, 0.65); }
}
@keyframes dotBounce {
  0%, 70%, 100% { transform: translateY(0); opacity: 0.35; }
  35% { transform: translateY(-3px); opacity: 1; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes resultIn {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes confettiFall {
  0% { opacity: 0; transform: translate3d(0, -10px, 0) rotate(0deg); }
  8% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--drift, 20px), 95vh, 0) rotate(760deg); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1180px) {
  .game-main { grid-template-columns: minmax(0, 1fr) 274px; }
  .sidebar { gap: 10px; }
  .side-card { padding: 12px; }
  .controls-grid { grid-template-columns: minmax(132px, 0.65fr) minmax(0, 1.6fr); gap: 12px; }
}

@media (max-width: 1020px) {
  .game-main { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .table-felt { max-height: 590px; }
  .lobby-main { grid-template-columns: 1fr; gap: 20px; padding: 10px 0 24px; }
  .lobby-hero { padding-bottom: 0; }
  .lobby-hero h1 { font-size: clamp(52px, 9vw, 82px); }
  .hero-copy { max-width: 560px; }
  .hero-hand { right: 8%; bottom: 8px; opacity: 0.7; }
  .lobby-panel { max-width: 620px; width: 100%; margin: 0 auto; }
  .difficulty-card { min-height: 196px; }
}

@media (max-width: 760px) {
  body { overflow: hidden; }
  .game-screen { padding: max(9px, env(safe-area-inset-top)) 8px max(10px, env(safe-area-inset-bottom)); }
  .game-header { gap: 8px; padding-bottom: 8px; }
  .game-brand-copy { font-size: 12px; }
  .game-brand-copy small { display: none; }
  .brand-mark.small { width: 29px; height: 29px; font-size: 16px; }
  .game-meta { gap: 5px; }
  .meta-chip { min-height: 27px; padding: 4px 8px; }
  .meta-chip span { display: none; }
  .meta-chip b { font-size: 10px; }
  .difficulty-pill { min-height: 27px; padding: 4px 9px; font-size: 9px; }
  .icon-button { width: 30px; height: 30px; }
  .icon-button svg { width: 15px; height: 15px; }
  .leave-button { padding: 6px 4px; font-size: 10px; }

  .game-main { padding-top: 7px; }
  .table-stage { padding: 0; }
  .table-felt {
    width: 100%;
    height: 100%;
    max-height: none;
    aspect-ratio: auto;
    border-radius: 38% / 17%;
    padding: 8px;
  }
  .table-felt::before { inset: 7px; border-radius: inherit; }
  .table-felt::after { inset: 3px; }
  .felt-weave { inset: 9px; }
  .table-watermark { font-size: 10px; letter-spacing: 0.34em; opacity: 0.7; }
  .deck-stack { display: none; }

  .seat { width: 91%; }
  .ai-seat { top: 2.5%; }
  .player-seat { bottom: 3%; }
  .seat-inner { padding: 5px 7px; gap: 6px; border-radius: 12px; }
  .avatar { width: 30px; height: 30px; }
  .avatar svg { width: 21px; height: 21px; }
  .seat-name-row strong { font-size: 11px; }
  .seat-stack { font-size: 10px; }
  .seat-badge { height: 13px; min-width: 20px; font-size: 7px; }
  .ai-cards { --card-w: 34px; }
  .player-cards { --card-w: 51px; }
  .board .playing-card { --card-w: clamp(39px, 11.2vw, 51px); }
  .board { gap: 4px; min-height: 76px; }
  .table-center { top: 46.5%; gap: 5px; }
  .pot-display { padding: 3px 10px 3px 6px; gap: 6px; }
  .pot-copy span { display: none; }
  .pot-copy strong { font-size: 17px; }
  .pot-chips { transform: scale(0.82); transform-origin: left center; width: 27px; }
  .street-label { font-size: 7px; }
  .ai-seat .seat-bet { bottom: -22px; }
  .player-seat .seat-bet { top: -22px; }
  .seat-bet { font-size: 9px; padding: 2px 7px 2px 4px; }
  .action-bubble { font-size: 9px; padding: 3px 8px; }
  .dealer-chip { width: 18px; height: 18px; font-size: 8px; }

  .under-table { gap: 5px; }
  .table-status { min-height: 28px; padding: 0 2px; }
  .status-copy strong { font-size: 11px; }
  .status-copy small { font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .controls { min-height: 0; padding: 9px 10px; border-radius: 12px; }
  .controls-grid,
  .controls-grid.is-simple {
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: stretch;
  }
  .action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; order: 2; }
  .action-btn { min-height: 39px; font-size: 11px; }
  .raise-panel { order: 1; padding: 7px 8px; gap: 5px; }
  .raise-head strong { font-size: 16px; }
  .raise-bottom { flex-wrap: wrap; gap: 6px; }
  .quick-row { gap: 3px; }
  .quick-chip { height: 20px; padding: 0 6px; font-size: 8px; }
  .raise-btn { min-height: 36px; min-width: 106px; font-size: 11px; flex: 1; }
  .raise-hint { display: none; }
  .controls-waiting { min-height: 60px; }
  .continue-panel { flex-direction: column; gap: 10px; text-align: center; }
  .continue-actions { width: 100%; }
  .continue-actions button { flex: 1; }

  .result-card { padding: 24px 20px 20px; }
  .result-card h2 { font-size: 28px; }
  .result-actions { flex-direction: column; }
  .result-actions .ghost-button { width: 100%; }

  .rule-points, .hand-ranking { grid-template-columns: 1fr; }
  .modal-header { padding: 18px 18px 13px; }
  .modal-scroll { padding: 16px 18px 20px; }
  .modal-header h2 { font-size: 23px; }
}

@media (max-width: 700px) {
  .lobby-screen { padding: max(16px, env(safe-area-inset-top)) 16px max(12px, env(safe-area-inset-bottom)); }
  .lobby-header { padding-bottom: 8px; }
  .lobby-main { padding: 8px 0 12px; gap: 12px; }
  .lobby-hero { padding-top: 0; }
  .eyebrow { margin-bottom: 12px; font-size: 8px; }
  .lobby-hero h1 { font-size: clamp(38px, 11.5vw, 58px); }
  .hero-copy { font-size: 12px; line-height: 1.75; margin-top: 12px; }
  .hero-tags { margin-top: 12px; }
  .hero-tags span { font-size: 9px; padding: 4px 8px; }
  .hero-hand { display: none; }
  .lobby-panel { padding: 16px 14px; }
  .panel-heading { margin-bottom: 12px; }
  .panel-kicker { margin-bottom: 5px; }
  .panel-heading h2 { font-size: 22px; }
  .difficulty-grid { grid-template-columns: 1fr; gap: 6px; }
  .difficulty-card { min-height: 0; padding: 10px 12px; gap: 4px; }
  .diff-top { margin-bottom: 1px; }
  .diff-title { font-size: 16px; }
  .diff-name { font-size: 9px; }
  .diff-desc { font-size: 10px; line-height: 1.6; }
  .diff-tag { display: none; }
  .start-button { margin-top: 12px; height: 48px; }
  .table-specs { margin-top: 9px; font-size: 8px; gap: 4px 9px; }
  .lobby-footer { font-size: 8px; padding-top: 9px; }
  .footer-mark { display: none; }
}

@media (max-height: 820px) and (min-width: 1021px) {
  .table-felt { max-height: 520px; }
  .controls { min-height: 104px; padding: 10px 12px; }
  .under-table { gap: 5px; }
  .table-status { min-height: 25px; }
  .status-copy small { font-size: 9px; }
  .action-btn { min-height: 39px; }
  .raise-panel { padding: 6px 9px; gap: 4px; }
  .raise-head strong { font-size: 17px; }
  .raise-btn { min-height: 36px; }
  .side-card { padding: 11px; }
}

@media (max-height: 700px) and (min-width: 761px) {
  .game-header { padding-bottom: 7px; }
  .game-main { padding-top: 8px; }
  .table-felt { max-height: 460px; }
  .table-status { min-height: 22px; }
  .status-copy small { display: none; }
  .controls { min-height: 92px; }
  .raise-slider { height: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
