/* 德州扑克 - 样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* —— 桌布 / 主色 —— */
  --felt: #0f5132;
  --felt-dark: #082818;
  --felt-light: #187a4b;
  --gold: #f5c518;
  --gold-dark: #b28e08;
  --bg: #0a0a0f;
  --panel: rgba(20, 22, 34, 0.92);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #fff;
  --muted: #94a3b8;
  --card-white: #f8fafc;
  --card-rim: rgba(0, 0, 0, 0.06);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);

  /* —— 4 色花色（默认配色，覆盖于 body[data-deck="two-color"] 下） —— */
  --suit-spade:    #0f172a;   /* 黑桃 — 近黑深蓝 */
  --suit-heart:    #dc2626;   /* 红心 — 鲜红 */
  --suit-club:     #058a3f;   /* 梅花 — WePoker 风格深绿 */
  --suit-diamond:  #2161d8;   /* 方块 — 钴蓝 */

  /* legacy 兼容 */
  --red: var(--suit-heart);
  --blue: var(--suit-diamond);
}

/* —— 2 色花色：红黑（传统）—— */
body[data-deck="two-color"] {
  --suit-spade:   #0f172a;
  --suit-heart:   #dc2626;
  --suit-club:    #0f172a;
  --suit-diamond: #dc2626;
}

/* —— 主题：经典绿（默认）—— 直接用 :root —— */
/* 主题：午夜蓝 */
body[data-theme="midnight"] {
  --felt:        #0c2240;
  --felt-dark:   #050d1d;
  --felt-light:  #1b3b6f;
  --gold:        #6ec1ff;     /* 主色调改为冰蓝点缀（保留 var 名兼容） */
  --gold-dark:   #285178;
  --bg:          #04060d;
  --panel:       rgba(14, 22, 42, 0.92);
}
/* 主题：黑金 */
body[data-theme="blackgold"] {
  --felt:        #1a1815;
  --felt-dark:   #0a0907;
  --felt-light:  #2c2820;
  --gold:        #d4a017;
  --gold-dark:   #6b4e00;
  --bg:          #050402;
  --panel:       rgba(22, 18, 12, 0.92);
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

#app { position: relative; width: 100vw; height: 100dvh; }

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

/* ── 大厅 ───────────────────────────── */

#lobby {
  background:
    radial-gradient(ellipse at 30% 20%, rgba(99,102,241,0.15), transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(245,197,24,0.08), transparent 50%),
    #0a0a0f;
  padding: 1.5rem;
}

.lobby-card {
  width: min(560px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.lobby-title {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(120deg, var(--gold), #fff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-align: center;
  letter-spacing: 0.05em;
}

.lobby-subtitle {
  color: var(--muted);
  text-align: center;
  margin-top: 0.35rem;
  font-size: 0.95rem;
}

.lobby-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  margin: 1.5rem 0 1.25rem;
  background: rgba(0,0,0,0.3);
  border-radius: 10px;
  padding: 0.35rem;
}

.lobby-tab {
  padding: 0.6rem 0.3rem;
  background: transparent;
  color: var(--muted);
  border: none;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.lobby-tab.active {
  background: var(--gold);
  color: #0a0a0f;
}

.lobby-tab:hover:not(.active) { color: #fff; }

.field-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}

.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field.full-row { grid-column: 1 / -1; }

.field label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.field input, .field select {
  background: rgba(0,0,0,0.45);
  border: 1px solid var(--panel-border);
  color: var(--text);
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
}

.field input:focus, .field select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245,197,24,0.15);
}

#humanNamesWrap { grid-column: 1 / -1; }
#onlineFields .field:nth-child(2) { grid-column: 1 / -1; }
.online-hint small { color: var(--muted); font-size: 0.78rem; line-height: 1.4; display: block; }

.lobby-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.25rem;
}

.btn-primary, .btn-secondary {
  padding: 0.8rem 2rem;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #0a0a0f;
  box-shadow: 0 6px 20px rgba(245,197,24,0.25);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(245,197,24,0.35); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: 1px solid var(--panel-border);
}

.btn-secondary:hover { background: rgba(255,255,255,0.14); }

.lobby-footer { margin-top: 1rem; text-align: center; }
.hint { color: var(--muted); font-size: 0.8rem; }

/* ── 等待房间 ───────────────────────── */

.room-code-box {
  background: rgba(0,0,0,0.35);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  position: relative;
}
.room-code-label { font-size: 0.8rem; color: var(--muted); }
.room-code {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.4em;
  color: var(--gold);
  font-family: 'JetBrains Mono', monospace;
  padding-left: 0.4em;
}
.btn-copy {
  position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%);
  padding: 0.4rem 0.75rem;
  background: rgba(255,255,255,0.1);
  color: #fff; border: none; border-radius: 6px; cursor: pointer;
  font-size: 0.8rem;
}
.btn-copy:hover { background: rgba(255,255,255,0.2); }

.waiting-players {
  display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center;
  min-height: 2.5rem; margin: 0.75rem 0;
}
.waiting-player {
  background: rgba(99,102,241,0.2);
  color: #fff;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
  border: 1px solid rgba(99,102,241,0.4);
}
.waiting-player.host { background: rgba(245,197,24,0.2); border-color: rgba(245,197,24,0.5); }

/* ── 隐私屏 ─────────────────────────── */

.privacy {
  background: #000;
  z-index: 100;
}
.privacy-card { text-align: center; max-width: 400px; padding: 2rem; }
.privacy-icon { font-size: 4rem; margin-bottom: 1rem; }
.privacy-card h2 { font-size: 1.8rem; margin-bottom: 0.5rem; }
.privacy-card p { color: var(--muted); margin-bottom: 1.5rem; }

/* ── 牌桌 ───────────────────────────── */

#table {
  background: radial-gradient(ellipse at center, #0a2a18 0%, #020907 100%);
  overflow: hidden;
}

.table-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, color-mix(in srgb, var(--felt-light) 60%, transparent) 0%, transparent 60%),
    repeating-radial-gradient(circle at 50% 50%, transparent 0, transparent 40px, rgba(255,255,255,0.01) 40px, rgba(255,255,255,0.01) 42px);
  pointer-events: none;
  transition: background 380ms ease;
}
.table-oval {
  transition: background 380ms ease, border-color 380ms ease;
}

.table-oval {
  position: relative;
  width: min(92vw, 1100px);
  height: min(62vh, 640px);
  background:
    radial-gradient(ellipse at center, var(--felt-light) 0%, var(--felt) 55%, var(--felt-dark) 100%);
  border-radius: 48% / 48%;
  border: 10px solid #2d1810;
  box-shadow:
    inset 0 0 80px rgba(0,0,0,0.6),
    0 20px 50px rgba(0,0,0,0.6);
  margin-bottom: 2rem;
}

/* 座位环绕 */
.seats { position: absolute; inset: 0; pointer-events: none; }

.seat {
  position: absolute;
  width: 130px;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: auto;
  transition: transform 0.25s;
}

.seat-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4b5563, #1f2937);
  border: 3px solid rgba(255,255,255,0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  position: relative;
}

.seat.active .seat-avatar {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245,197,24,0.35), 0 4px 18px rgba(245,197,24,0.4);
  animation: pulse-gold 1.4s ease-in-out infinite;
}

@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 0 3px rgba(245,197,24,0.3), 0 4px 18px rgba(245,197,24,0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(245,197,24,0.1), 0 4px 22px rgba(245,197,24,0.6); }
}

.seat.folded .seat-avatar { opacity: 0.35; filter: grayscale(0.8); }
.seat.winner .seat-avatar {
  border-color: var(--gold);
  animation: winner-bounce 0.6s ease;
}
@keyframes winner-bounce {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.18); }
}

.seat-name {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seat-stack {
  font-size: 0.78rem;
  color: var(--gold);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  margin-top: 0.1rem;
}

.seat-bet {
  position: absolute;
  left: 50%;
  top: 78%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.65);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.seat-bet.show { opacity: 1; }

.seat-cards {
  display: flex;
  gap: 3px;
  justify-content: center;
  margin-top: 0.35rem;
  min-height: 50px;
}

.seat-tag {
  position: absolute;
  left: 50%;
  top: -14px;
  transform: translateX(-50%);
  display: flex;
  gap: 3px;
}

.badge-dealer, .badge-sb, .badge-bb {
  width: 22px; height: 22px;
  border-radius: 50%;
  font-size: 0.68rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0a0a0f;
}
.badge-dealer { background: #fff; }
.badge-sb { background: #60a5fa; color: #fff; }
.badge-bb { background: #f87171; color: #fff; }

.seat-action-hint {
  position: absolute;
  left: 50%;
  bottom: -28px;
  transform: translateX(-50%);
  font-size: 0.72rem;
  background: rgba(0,0,0,0.8);
  color: var(--gold);
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
}
.seat-action-hint.show { opacity: 1; }

/* ── 扑克牌（参考 WePoker 4-色高阶配色） ──────────────────
 * 设计要点：
 *   - 每个花色用独立 CSS 变量（--suit-X），可由主题或 deck-mode 覆盖
 *   - 角标点数 + 花色竖排（鲜明 + 紧凑），主体居中放大花色
 *   - 卡面有微微 paper-grain 渐变 + 内描边，不再是纯白
 *   - 脸牌（J/Q/K/A）金色内框做加重强调
 */
.card {
  width: 48px; height: 66px;
  border-radius: 7px;
  background:
    /* 微纸纹斜光 */
    linear-gradient(135deg, rgba(255,255,255,0) 35%, rgba(0,0,0,0.04) 100%),
    linear-gradient(180deg, #ffffff 0%, #fafbfc 60%, #eef0f3 100%);
  color: #0a0a0f;
  font-family: 'PingFang SC', 'Outfit', system-ui, sans-serif;
  font-weight: 900;
  position: relative;
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 0 0 0.5px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  flex: 0 0 auto;
  flex-shrink: 0;             /* 防御：在任何 flex 容器里都不允许被压扁 */
  min-width: 0;
  min-height: 0;
}

/* 每花色着色（覆盖默认 #0a0a0f） */
.card.suit-s { color: var(--suit-spade); }
.card.suit-h { color: var(--suit-heart); }
.card.suit-c { color: var(--suit-club); }
.card.suit-d { color: var(--suit-diamond); }

/* legacy: .red 类仍然可用（旧代码路径），等价于红心色 */
.card.red:not([class*="suit-"]) { color: var(--suit-heart); }

/* 左上角：点数（大）+ 花色（小） */
.card .card-corner {
  position: absolute;
  top: 5px;                  /* 留足头部空间，杜绝 cap-height 顶到 overflow */
  left: 6px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
  z-index: 2;
}
.card .corner-rank {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;          /* 让 cap-height 在文本框内有上方喘息 */
}
.card .corner-suit {
  font-size: 0.9rem;
  margin-top: 1px;
  line-height: 1;
}

/* 主体：位于卡片下半部，绝对不与左上角重叠 */
.card .card-main {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  top: 45%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  pointer-events: none;
}
.card .main-suit {
  font-size: 1.6rem;
  line-height: 1;
}

/* J / Q / K / A：保留 .face class 用于金边视觉，但不再渲染中央花体字母
 *   —— 与 WePoker 一致，脸牌 = 数字牌一样的中央大花色 + 角标字母
 *   不再用 Playfair Display（未加载，浏览器 fallback 到 Georgia 的 cap-height
 *   过高会顶出 .card 的 overflow:hidden）；统一用系统 stack，保证字形度量一致 */
.card .corner-rank { line-height: 1.05; }     /* 给字形上下各留 2.5% 喘息 */
.card.face .corner-rank { font-weight: 900; }  /* 脸牌仅靠粗细 + 金边区分 */

/* 所有 face 牌显示金色细边框，A 更显眼 */
.card:not(.back)::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 5px;
  pointer-events: none;
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.card.face::before {
  border: 1px solid rgba(245, 197, 24, 0.55);
  box-shadow: inset 0 0 8px rgba(245, 197, 24, 0.1);
}
.card.face-a::before {
  border: 1.5px solid rgba(245, 197, 24, 0.8);
  box-shadow: inset 0 0 12px rgba(245, 197, 24, 0.18);
}

/* ── 社区牌（桌面中央，最大） ── */
.community-cards .card { width: 62px; height: 88px; border-radius: 8px; }
.community-cards .card .corner-rank { font-size: 1.45rem; }
.community-cards .card .corner-suit { font-size: 1.1rem; }
.community-cards .card .main-suit { font-size: 2.2rem; }

/* ── 座位底牌 ── */
.seat-cards .card { width: 36px; height: 50px; border-radius: 5px; }
.seat-cards .card .corner-rank { font-size: 0.9rem; }
.seat-cards .card .corner-suit { font-size: 0.7rem; }
.seat-cards .card .main-suit { font-size: 1.2rem; }

/* ── 操作条底牌 mini ── */
.hole-cards-mini .card { width: 60px; height: 84px; border-radius: 8px; }
.hole-cards-mini .card .corner-rank { font-size: 1.4rem; }
.hole-cards-mini .card .corner-suit { font-size: 1.05rem; }
.hole-cards-mini .card .main-suit { font-size: 2.1rem; }

/* ── 结算弹窗内卡片（基础尺寸；底部 .hand-result-card 内有覆盖） ── */
/* 故意留空：实际尺寸由后续 .result-cards-wrap / .result-board-cards 规则决定 */

/* ── 牌背：双层（外深底 + 内菱形/网格 pattern + 金边） ── */
.card.back {
  background:
    /* 中央菱形交叉网格 */
    radial-gradient(circle at 50% 50%, rgba(245,197,24,0.18) 0%, transparent 55%),
    repeating-linear-gradient(45deg,  rgba(255,255,255,0.06) 0 6px, transparent 6px 12px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,0.06) 0 6px, transparent 6px 12px),
    linear-gradient(135deg, #1e3a8a 0%, #1e40af 60%, #0f1f5a 100%);
  color: transparent;
  border: 1px solid rgba(255,255,255,0.1);
}
.card.back::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(245, 197, 24, 0.5);
  border-radius: 4px;
  box-shadow: inset 0 0 6px rgba(0,0,0,0.5);
}
/* 主题：午夜蓝 — 卡背改更冷的青色 */
body[data-theme="midnight"] .card.back {
  background:
    radial-gradient(circle at 50% 50%, rgba(110,193,255,0.2) 0%, transparent 55%),
    repeating-linear-gradient(45deg,  rgba(255,255,255,0.06) 0 6px, transparent 6px 12px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,0.06) 0 6px, transparent 6px 12px),
    linear-gradient(135deg, #0d1d3a 0%, #1b3b6f 60%, #050d1d 100%);
}
body[data-theme="midnight"] .card.back::before {
  border-color: rgba(110, 193, 255, 0.5);
}
/* 主题：黑金 — 黑底金菱形 */
body[data-theme="blackgold"] .card.back {
  background:
    radial-gradient(circle at 50% 50%, rgba(212,160,23,0.32) 0%, transparent 55%),
    repeating-linear-gradient(45deg,  rgba(212,160,23,0.10) 0 6px, transparent 6px 12px),
    repeating-linear-gradient(-45deg, rgba(212,160,23,0.10) 0 6px, transparent 6px 12px),
    linear-gradient(135deg, #14110b 0%, #2c2820 50%, #0a0907 100%);
}
body[data-theme="blackgold"] .card.back::before {
  border-color: rgba(212, 160, 23, 0.6);
}

.card.deal-in { animation: deal-in 0.35s ease both; }
@keyframes deal-in {
  0% { transform: translateY(-200px) rotate(-30deg); opacity: 0; }
  100% { transform: translateY(0) rotate(0); opacity: 1; }
}

.card.flip { animation: flip 0.4s ease both; }
@keyframes flip {
  0% { transform: rotateY(180deg); }
  100% { transform: rotateY(0deg); }
}

.card.highlight {
  box-shadow: 0 0 0 2px var(--gold), 0 0 16px rgba(245,197,24,0.6);
}

/* ── 眯牌（squint）·  正面卡片之上盖一层"背面"，长按掀起 ── */
.card.squintable {
  perspective: 600px;            /* 给翻盖一些 3D 透视 */
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.card.squintable .card-back-cover {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: repeating-linear-gradient(45deg, #1e3a8a 0 6px, #1e40af 6px 12px);
  border: 1px solid rgba(255,255,255,0.1);
  z-index: 5;
  transform-origin: bottom center;
  transition: transform 220ms cubic-bezier(.2,.8,.2,1), box-shadow 220ms ease;
  will-change: transform;
  pointer-events: none; /* 不挡指针，让长按事件落到 .card 本体 */
}
.card.squintable .card-back-cover::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 3px;
}
.card.squintable.squint-active .card-back-cover {
  /* 翻盖：从底边向上掀起（rotateX 让顶边远离观察者，露出下面的正牌） */
  transform: translateY(-6%) rotateX(118deg) translateZ(2px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.45);
}
.card.squintable.squint-active {
  /* 揭起的同时给整张牌一点点上抬 */
  transform: translateY(-3px);
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.45),
    0 0 0 1px var(--gold, #f5c518),
    0 0 14px rgba(245,197,24,0.35);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

/* 顶部工具栏图标按钮被激活时（眯牌模式开） */
.icon-btn.active {
  box-shadow: 0 0 0 1px var(--gold, #f5c518), 0 0 10px rgba(245,197,24,0.4);
}

/* ── 主题 / 牌色 设置弹窗 ── */
.settings-wrap { position: relative; }
.settings-popup {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--panel, rgba(20,22,34,0.96));
  border: 1px solid var(--panel-border, rgba(255,255,255,0.12));
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.45);
  padding: 12px;
  z-index: 50;
  display: none;
}
.settings-popup.open { display: block; }
.settings-section { padding: 4px 4px 10px; }
.settings-section + .settings-section { border-top: 1px solid rgba(255,255,255,0.06); padding-top: 10px; }
.settings-title {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--muted, #94a3b8);
  margin-bottom: 6px;
  text-transform: uppercase;
}
.settings-radios { display: flex; flex-direction: column; gap: 4px; }
.settings-radio {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.92rem;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 120ms ease;
}
.settings-radio:hover { background: rgba(255,255,255,0.05); }
.settings-radio input[type="radio"] {
  appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.35);
  position: relative;
  cursor: pointer;
}
.settings-radio input[type="radio"]:checked {
  border-color: var(--gold, #f5c518);
}
.settings-radio input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: var(--gold, #f5c518);
  border-radius: 50%;
}

/* ── 提前行动（pre-action）pill bar ── */
.pre-action-bar {
  position: absolute;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(15, 18, 28, 0.85);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  z-index: 10;
}
.pre-action-bar .pre-action-label {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--muted, #94a3b8);
  margin-right: 4px;
}
.pre-pill {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: #cbd5e1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 160ms ease;
}
.pre-pill:hover { background: rgba(255,255,255,0.10); }
.pre-pill.armed {
  color: #0a0a0f;
  background: var(--gold, #f5c518);
  border-color: var(--gold-dark, #b28e08);
  box-shadow: 0 0 0 1px var(--gold), 0 0 12px rgba(245,197,24,0.4);
}

/* ── 行动倒计时圆环（贴在 active 座位上） ── */
.seat .countdown-ring {
  position: absolute;
  top: calc(0.42rem + 41px);
  left: 50%;
  transform: translate(-50%, -50%);
  width: 98px;
  height: 98px;
  pointer-events: none;
  z-index: 6;
  filter: drop-shadow(0 0 6px rgba(0,0,0,0.4));
}
.seat .countdown-ring .countdown-bg {
  stroke: rgba(255,255,255,0.12);
  stroke-width: 3;
}
.seat .countdown-ring .countdown-bar {
  stroke-width: 3.4;
  transition: stroke-dashoffset 80ms linear, stroke 240ms ease;
}

/* 公共牌区 */
.board {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.pot-info { text-align: center; }
.pot-label { font-size: 0.72rem; color: rgba(255,255,255,0.6); letter-spacing: 0.15em; }
.pot-amount {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--gold);
  font-family: 'JetBrains Mono', monospace;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

.community-cards {
  display: flex;
  gap: 0.5rem;
  min-height: 76px;
}
/* 注意：.community-cards .card 的具体尺寸见上方卡片块 */

.stage-info {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* 荷官播报 */
.dealer-log {
  position: absolute;
  bottom: -56px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.88rem;
  color: #e5e7eb;
  background: rgba(0,0,0,0.55);
  padding: 0.45rem 1rem;
  border-radius: 8px;
  white-space: nowrap;
  max-width: 80vw;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transition: opacity 0.25s;
}
.dealer-log.show { opacity: 1; }

/* ── 操作条 ─────────────────────────── */

.action-bar {
  position: fixed;
  bottom: 0;
  left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.96) 0%, rgba(0,0,0,0.85) 60%, rgba(0,0,0,0.35) 100%);
  border-top: 1px solid var(--panel-border);
  padding: 0.65rem 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  z-index: 20;
  backdrop-filter: blur(6px);
}

.hud-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  max-width: 640px;
}

.hole-cards-mini {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
}

.hud-side {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 180px;
  flex: 1;
  max-width: 260px;
}

.hand-hint {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold);
  background: rgba(245,197,24,0.08);
  border: 1px solid rgba(245,197,24,0.25);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.equity-meter { display: flex; flex-direction: column; gap: 0.2rem; }
.equity-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--muted);
}
.equity-label .equity-value {
  font-weight: 800;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
}
.equity-bar {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
}
.equity-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(.2,.8,.2,1), background 0.25s;
  background: linear-gradient(90deg, #64748b, #94a3b8);
}
.equity-fill.tier-poor  { background: linear-gradient(90deg, #b91c1c, #ef4444); }
.equity-fill.tier-fair  { background: linear-gradient(90deg, #b45309, #f59e0b); }
.equity-fill.tier-good  { background: linear-gradient(90deg, #15803d, #22c55e); }
.equity-fill.tier-great { background: linear-gradient(90deg, #facc15, #fde047); box-shadow: 0 0 12px rgba(250,204,21,0.45); }

/* 圆形操作按钮 */
.action-buttons-circle {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.circle-btn {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: none;
  color: #fff;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0;
  box-shadow: 0 6px 18px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.18);
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
  position: relative;
}
.circle-btn::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid transparent;
  pointer-events: none;
}
.circle-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  filter: brightness(1.12);
  box-shadow: 0 10px 22px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.25);
}
.circle-btn:active:not(:disabled) { transform: translateY(-1px); }
.circle-btn:disabled { opacity: 0.3; cursor: not-allowed; filter: saturate(0.5); }
.circle-btn.slot-hidden {
  visibility: hidden;
  pointer-events: none;
}

.circle-btn-label { font-size: 0.88rem; letter-spacing: 0.04em; }
.circle-btn-amount { font-size: 0.72rem; opacity: 0.92; font-family: 'JetBrains Mono', monospace; }

.circle-raise {
  width: 96px; height: 96px;
  background: radial-gradient(circle at 30% 25%, #60a5fa 0%, #2563eb 50%, #1e3a8a 100%);
}
.circle-raise .circle-btn-label { font-size: 1.05rem; }
.circle-raise::after { border-color: rgba(96,165,250,0.45); }

.circle-fold  { background: radial-gradient(circle at 30% 25%, #fca5a5 0%, #dc2626 50%, #7f1d1d 100%); }
.circle-fold::after { border-color: rgba(252,165,165,0.4); }

.circle-check { background: radial-gradient(circle at 30% 25%, #c7d2fe 0%, #6366f1 50%, #312e81 100%); }
.circle-check::after { border-color: rgba(199,210,254,0.4); }

.circle-call  { background: radial-gradient(circle at 30% 25%, #86efac 0%, #16a34a 50%, #14532d 100%); }
.circle-call::after { border-color: rgba(134,239,172,0.4); }

.circle-allin { background: radial-gradient(circle at 30% 25%, #fde68a 0%, #eab308 45%, #78350f 100%); }
.circle-allin::after { border-color: rgba(253,230,138,0.5); }

/* 加注滑块 + 底池预设圆泡 */
.raise-slider {
  width: min(560px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.raise-slider input[type=range] {
  width: 100%;
  accent-color: var(--gold);
}

.raise-presets-circle {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 640px;
}
.chip-preset {
  min-width: 58px;
  height: 28px;
  padding: 0 0.7rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.chip-preset:hover {
  background: rgba(245,197,24,0.18);
  border-color: rgba(245,197,24,0.45);
  transform: translateY(-1px);
}

/* 座位上方行动胶囊 */
.seat-capsule {
  position: absolute;
  left: 50%;
  top: -36px;
  transform: translateX(-50%);
  padding: 0.18rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  color: #fff;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,0.45);
  letter-spacing: 0.02em;
  animation: capsuleIn 0.28s cubic-bezier(.2,.8,.2,1);
  z-index: 4;
}
.seat-capsule.cap-fold  { background: linear-gradient(135deg, #7f1d1d, #dc2626); opacity: 0.9; }
.seat-capsule.cap-check { background: linear-gradient(135deg, #312e81, #6366f1); }
.seat-capsule.cap-call  { background: linear-gradient(135deg, #14532d, #16a34a); }
.seat-capsule.cap-raise { background: linear-gradient(135deg, #1e3a8a, #2563eb); border: 1px solid rgba(96,165,250,0.55); }
.seat-capsule.cap-allin { background: linear-gradient(135deg, #78350f, #eab308); color: #1a0f00; }

@keyframes capsuleIn {
  from { opacity: 0; transform: translate(-50%, -8px) scale(0.85); }
  to   { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

/* ── 顶栏 & 聊天 ────────────────────── */

.top-bar {
  position: fixed;
  top: 4rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 30;
}

.icon-btn {
  width: 44px; height: 44px;
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--panel-border);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.icon-btn:hover { background: rgba(0,0,0,0.85); }

.chat-panel {
  position: fixed;
  right: 0; top: 0;
  width: min(340px, 90vw);
  height: 100dvh;
  background: var(--panel);
  border-left: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  z-index: 40;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  backdrop-filter: blur(12px);
}

.chat-panel.open { transform: translateX(0); }

.chat-header {
  padding: 1rem;
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
}

.chat-close {
  background: transparent; border: none; color: #fff;
  font-size: 1.5rem; cursor: pointer; line-height: 1;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.chat-msg {
  background: rgba(255,255,255,0.05);
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.3;
  word-break: break-word;
}
.chat-msg .sender {
  font-weight: 700;
  color: var(--gold);
  margin-right: 0.35rem;
  font-size: 0.82rem;
}
.chat-msg.system {
  color: var(--muted);
  text-align: center;
  background: transparent;
  font-size: 0.82rem;
  font-style: italic;
}

.chat-emojis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.25rem;
  padding: 0.5rem;
  border-top: 1px solid var(--panel-border);
}

.emo {
  background: rgba(255,255,255,0.06);
  border: none;
  border-radius: 8px;
  padding: 0.45rem;
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s;
}
.emo:hover { background: rgba(255,255,255,0.18); transform: scale(1.15); }

.chat-input-row {
  display: flex;
  gap: 0.4rem;
  padding: 0.6rem;
  border-top: 1px solid var(--panel-border);
}

.chat-input-row input {
  flex: 1;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--panel-border);
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  outline: none;
  font-family: inherit;
}

.chat-input-row button {
  background: var(--gold);
  color: #0a0a0f;
  border: none;
  border-radius: 8px;
  padding: 0 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

/* ── 表情飘浮 ───────────────────────── */

.floating-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
}

.float-emo {
  position: absolute;
  font-size: 2.2rem;
  animation: float-up 1.8s ease-out forwards;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}
@keyframes float-up {
  0% { transform: translate(-50%, 0) scale(0.4); opacity: 0; }
  20% { transform: translate(-50%, -20px) scale(1.3); opacity: 1; }
  100% { transform: translate(-50%, -140px) scale(1); opacity: 0; }
}

/* ── 动作飘字（加注/跟注/弃牌） ──────── */
.action-float {
  position: absolute;
  transform: translate(-50%, 0);
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  backdrop-filter: blur(6px);
  animation: action-float-anim 1.3s ease-out forwards;
  pointer-events: none;
}
.action-float.kind-fold {
  background: rgba(71, 85, 105, 0.9);
  border-color: rgba(148, 163, 184, 0.4);
}
.action-float.kind-check {
  background: rgba(37, 99, 235, 0.9);
  border-color: rgba(96, 165, 250, 0.5);
}
.action-float.kind-call {
  background: rgba(14, 165, 233, 0.92);
  border-color: rgba(125, 211, 252, 0.5);
}
.action-float.kind-raise {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  border-color: rgba(253, 224, 71, 0.6);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.action-float.kind-allin {
  background: linear-gradient(135deg, #ef4444, #7f1d1d);
  border-color: rgba(252, 165, 165, 0.7);
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.5);
  font-weight: 800;
}
@keyframes action-float-anim {
  0%   { opacity: 0; transform: translate(-50%, 16px) scale(0.6); }
  15%  { opacity: 1; transform: translate(-50%, -4px) scale(1.08); }
  40%  { opacity: 1; transform: translate(-50%, -14px) scale(1.0); }
  100% { opacity: 0; transform: translate(-50%, -44px) scale(0.95); }
}

/* ── 飞行筹码 ────────────────────────── */
.flying-chip {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 30% 30%, #fef3c7, #f5c518 55%, #b28e08);
  border: 2px dashed rgba(255, 255, 255, 0.55);
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.25),
    0 6px 14px rgba(245, 197, 24, 0.5);
  animation: chip-fly 0.7s cubic-bezier(0.55, 0.085, 0.68, 0.53) forwards;
  pointer-events: none;
}
@keyframes chip-fly {
  0%   { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
  15%  { opacity: 1; }
  70%  { transform: translate(calc(-50% + var(--dx) * 0.85), calc(-50% + var(--dy) * 0.85 - 26px)) scale(1.05); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.7); opacity: 0; }
}

/* ── 彩带撒花（赢家） ─────────────────── */
.confetti {
  position: absolute;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  transform: translate(-50%, -50%);
  animation: confetti-burst 1.2s cubic-bezier(0.2, 0.6, 0.3, 1) forwards;
  pointer-events: none;
}
@keyframes confetti-burst {
  0%   { opacity: 1; transform: translate(-50%, -50%) rotate(0) scale(0.4); }
  25%  { opacity: 1; }
  100% {
    opacity: 0;
    transform:
      translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 120px))
      rotate(var(--rot))
      scale(1);
  }
}

/* ── 阶段横幅（翻牌/转牌/河牌） ──────── */
.stage-banner {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 900;
  letter-spacing: 0.5em;
  padding-left: 0.5em;
  background: linear-gradient(120deg, var(--gold), #fff 40%, var(--gold) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 6px 24px rgba(245, 197, 24, 0.35);
  opacity: 0;
  pointer-events: none;
  z-index: 70;
  transition: opacity 0.25s, transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.4), filter 0.25s;
  filter: blur(6px);
}
.stage-banner.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  filter: blur(0);
}
.stage-banner.hide {
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.3);
  filter: blur(8px);
}

/* ── 底池数字增长高亮 ────────────────── */
.pot-amount.pot-growing {
  color: #fde68a;
  text-shadow: 0 0 16px rgba(245, 197, 24, 0.7), 0 1px 4px rgba(0, 0, 0, 0.6);
  transition: color 0.3s, text-shadow 0.3s;
}

/* ── 活跃玩家增强光环 ────────────────── */
.seat.active {
  z-index: 10;
}
.seat.active .seat-avatar {
  box-shadow:
    0 0 0 3px var(--gold),
    0 0 24px rgba(245, 197, 24, 0.7),
    0 0 42px rgba(245, 197, 24, 0.35);
  animation: pulse-gold 1.6s ease-in-out infinite;
}
.seat.active::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px solid rgba(245, 197, 24, 0.55);
  transform: translate(-50%, -50%);
  animation: active-ring 1.6s ease-out infinite;
  pointer-events: none;
}
@keyframes active-ring {
  0%   { opacity: 0.8; transform: translate(-50%, -50%) scale(0.6); }
  80%  { opacity: 0; transform: translate(-50%, -50%) scale(1.4); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
}

/* ── 赢家高亮 & 弹跳 ────────────────── */
.seat.winner .seat-avatar {
  box-shadow:
    0 0 0 3px var(--gold),
    0 0 30px rgba(245, 197, 24, 0.9),
    0 0 60px rgba(245, 197, 24, 0.5);
  animation: winner-bounce 0.8s ease-in-out 2;
}
.seat.winner .seat-cards .card {
  box-shadow: 0 0 0 2px var(--gold), 0 0 14px rgba(245, 197, 24, 0.55);
}

/* ── 表毡微光（环境氛围） ────────────── */
.table-oval::before {
  content: "";
  position: absolute;
  inset: 5%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.04), transparent 60%);
  pointer-events: none;
  animation: felt-shimmer 6s ease-in-out infinite;
}
@keyframes felt-shimmer {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.9; }
}

/* ── 结算弹窗 ───────────────────────── */

.hand-result, .game-over {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* 三段式结算 modal：
 *   ┌──────────────────────┐
 *   │ 标题 (固定顶部)       │ flex 0 0 auto
 *   ├──────────────────────┤
 *   │ 公共牌 (sticky 在中段)│
 *   │ 玩家行 1              │ flex 1 1 auto, overflow-y: auto
 *   │ 玩家行 2              │
 *   │ ...                   │
 *   ├──────────────────────┤
 *   │ 下一手 (固定底部)     │ flex 0 0 auto
 *   └──────────────────────┘
 */
.hand-result-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 0;                       /* 内部三段各自负责 padding */
  min-width: min(560px, 94vw);
  max-width: 720px;
  max-height: 88vh;
  overflow: hidden;                 /* card 自身不滚 */
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

/* 头部容器：标题 + 公共牌一体不滚动 */
.hand-result-card .hand-result-header {
  flex: 0 0 auto;
  background: var(--panel);
  padding: 1.4rem 1.8rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.hand-result-card .hand-result-header h3 {
  text-align: center;
  font-size: 1.35rem;
  color: var(--gold);
  margin: 0 0 1rem;
  padding: 0;
}
.hand-result-card .hand-result-header #handResultBoard:empty { display: none; }
/* uncontested 场景下没有公共牌，调整 padding-bottom */
.hand-result-card .hand-result-header:has(#handResultBoard:empty) {
  padding-bottom: 0.4rem;
}

/* 中段：唯一可滚的容器 */
.hand-result-card #handResultBody {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem 1.8rem 0.8rem;
  display: flex;
  flex-direction: column;
}

/* 下一手按钮：固定在 modal 底部 */
.hand-result-card #nextHandBtn {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.75rem 1.6rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  border-radius: 0 0 16px 16px;
  width: 100%;
}

.winner-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: rgba(245,197,24,0.08);
  border: 1px solid rgba(245,197,24,0.25);
  border-radius: 10px;
  margin-bottom: 0.5rem;
}
.winner-row .winner-name { font-weight: 700; flex: 1; }
.winner-row .winner-amount { color: var(--gold); font-family: 'JetBrains Mono', monospace; font-weight: 700; }
.winner-row .winner-rank { color: var(--muted); font-size: 0.85rem; margin-top: 0.15rem; }

.showdown-list { margin-bottom: 1rem; }
.showdown-row {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.5rem; font-size: 0.85rem; color: var(--muted);
}
.showdown-row .cards-row { display: flex; gap: 2px; }
.showdown-row .card { width: 24px; height: 34px; font-size: 0.55rem; }

/* 公共牌展示条 — 现在挂在 header 里，与标题一体，不需 sticky */
.result-board {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.8rem;
  background: linear-gradient(180deg, rgba(34,197,94,0.18), rgba(34,197,94,0.08));
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 10px;
  overflow: visible;
}
.result-board-label { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.result-board-cards { display: flex; gap: 10px; }
.result-board-cards .card {
  width: 50px; height: 70px;
  border-radius: 7px;
}
.result-board-cards .card .corner-rank { font-size: 1.15rem; }
.result-board-cards .card .corner-suit { font-size: 0.85rem; }
.result-board-cards .card .main-suit { font-size: 1.65rem; }

/* 玩家结算行：横向布局（信息 | 底牌 → 最佳 5 张）
 * 用 min-height 而不是 padding 来撑行高 — 让 cards 有足够空间不被压扁 */
.result-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;     /* 横向略宽，纵向收紧 */
  min-height: 88px;              /* 64 卡 + 上下各 12 ≈ 88；min-height 决定行高，与 padding 解耦 */
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  margin-bottom: 0.7rem;
  transition: border-color 0.2s;
  overflow: visible;
}
.result-row.winner {
  background: rgba(245, 197, 24, 0.1);
  border-color: rgba(245, 197, 24, 0.4);
  box-shadow: 0 0 12px -2px rgba(245, 197, 24, 0.25);
}
/* 玩家自己的行：青蓝色边框 + 淡蓝色背景，与金色 winner 区分 */
.result-row.self:not(.winner) {
  background: rgba(56, 189, 248, 0.10);
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 10px -2px rgba(56, 189, 248, 0.30);
}
/* 既是赢家又是自己 → 同时挂 winner + self；金边为主，加一圈青蓝外光 */
.result-row.winner.self {
  box-shadow:
    0 0 12px -2px rgba(245, 197, 24, 0.35),
    0 0 0 2px rgba(56, 189, 248, 0.55) inset;
}
.result-row.self .result-name::before {
  content: "你 · ";
  color: rgb(56, 189, 248);
  font-weight: 800;
}
.result-row.folded { opacity: 0.6; }

.result-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 80px;
  flex: 0 0 auto;
}
.result-name { font-weight: 700; color: var(--text-main, #f0f0f0); font-size: 0.95rem; }
.result-rank { color: var(--gold); font-size: 0.8rem; font-weight: 600; }
.result-row.folded .result-rank { color: var(--muted); }

.result-delta {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  font-weight: 700;
}
/* 中国股市配色：红涨绿跌 */
.result-delta.gain { color: #ef4444; }
.result-delta.loss { color: #22c55e; }
.result-delta.flat { color: var(--muted); }

.result-cards-wrap {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 0.85rem;             /* 拉开 holes 和 best5 之间的空间 */
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: visible;       /* 让 highlight 卡的 -3px translate 不被裁 */
}
.result-holes, .result-best { display: flex; gap: 8px; flex: 0 0 auto; }
.result-cards-wrap .card {
  width: 46px; height: 64px;
  border-radius: 6px;
}
.result-cards-wrap .card .corner-rank { font-size: 1.05rem; }
.result-cards-wrap .card .corner-suit { font-size: 0.8rem; }
.result-cards-wrap .card .main-suit { font-size: 1.5rem; }
.result-sep { color: var(--muted); font-size: 0.95rem; padding: 0 0.2rem; }
/* 高亮最佳牌：金色边框 + 上浮 */
.result-cards-wrap .card.highlight {
  box-shadow: 0 0 0 2px var(--gold), 0 0 12px rgba(245, 197, 24, 0.55);
  transform: translateY(-3px);
}

/* showdown-list（紧凑摘要列）也补尺寸 */
.showdown-row .card {
  width: 36px; height: 50px;
  border-radius: 5px;
}
.showdown-row .card .corner-rank { font-size: 0.85rem; }
.showdown-row .card .corner-suit { font-size: 0.65rem; }
.showdown-row .card .main-suit { font-size: 1.15rem; }

@media (max-width: 600px) {
  .hand-result-card { padding: 1.2rem 1rem; }
  .result-cards-wrap { width: 100%; }
  .result-row { flex-wrap: nowrap; }
  .result-cards-wrap .card { width: 38px; height: 54px; }
  .result-cards-wrap .card .corner-rank { font-size: 0.9rem; }
  .result-cards-wrap .card .corner-suit { font-size: 0.7rem; }
  .result-cards-wrap .card .main-suit { font-size: 1.3rem; }
  .result-board-cards .card { width: 42px; height: 60px; }
  .result-board-cards .card .corner-rank { font-size: 1rem; }
  .result-board-cards .card .corner-suit { font-size: 0.75rem; }
  .result-board-cards .card .main-suit { font-size: 1.4rem; }
}
.game-over-summary {
  text-align: center;
  font-size: 1.1rem;
  color: var(--gold);
  margin-bottom: 1rem;
}
.game-over-ranks { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 1rem; }
.rank-row {
  padding: 0.4rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
}

/* ── 响应式 ─────────────────────────── */

@media (max-width: 720px) {
  .lobby-tabs { grid-template-columns: repeat(2, 1fr); }
  .table-oval { height: min(55vh, 520px); border-width: 7px; }
  .seat { width: 100px; }
  .seat-avatar { width: 44px; height: 44px; font-size: 1.2rem; }
  .community-cards .card { width: 52px; height: 74px; }
  .community-cards .card .corner-rank { font-size: 1.2rem; }
  .community-cards .card .corner-suit { font-size: 0.95rem; }
  .community-cards .card .main-suit { font-size: 2rem; }
  .pot-amount { font-size: 1.25rem; }
  .circle-btn { width: 62px; height: 62px; }
  .circle-btn-label { font-size: 0.78rem; }
  .circle-btn-amount { font-size: 0.62rem; }
  .circle-raise { width: 82px; height: 82px; }
  .circle-raise .circle-btn-label { font-size: 0.92rem; }
  .hole-cards-mini .card { width: 52px; height: 74px; }
  .hole-cards-mini .card .corner-rank { font-size: 1.2rem; }
  .hole-cards-mini .card .corner-suit { font-size: 0.95rem; }
  .hole-cards-mini .card .main-suit { font-size: 2rem; }
  .hud-top { gap: 0.5rem; }
  .hud-side { min-width: 140px; }
  .top-bar { top: 4rem; }
  .chat-panel { width: 100vw; }
}

/* ── 牌局历史弹窗 ───────────────────── */

.history-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);          /* 加深 backdrop 遮住底层 seat 胶囊 */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;                           /* 拉高 z-index，确保盖过任何 in-game 元素 */
  backdrop-filter: blur(10px);            /* 加重 blur */
  -webkit-backdrop-filter: blur(10px);
}
.history-card {
  width: min(720px, 94vw);
  max-height: 86vh;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 1.25rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow);
}
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.history-header h3 {
  font-size: 1.1rem;
  background: linear-gradient(120deg, var(--gold), #fff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.history-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: none;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
}
.history-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 60vh;
  padding-right: 0.25rem;
}
.history-empty {
  color: var(--muted);
  text-align: center;
  padding: 2rem 0;
}
.history-entry {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.history-entry:hover { background: rgba(245,197,24,0.06); border-color: rgba(245,197,24,0.22); }
.history-entry-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.history-entry-winner {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-entry-hand {
  color: var(--gold);
  font-weight: 700;
}
.history-entry-winner {
  font-weight: 700;
  color: #fff;
}
.history-entry-board {
  display: flex;
  gap: 3px;
  margin-top: 0.4rem;
  align-items: center;
}
.history-entry-board .card { width: 26px; height: 36px; border-radius: 4px; }
.history-entry-board .card .corner-rank { font-size: 0.95rem; }
.history-entry-board .card .corner-suit { font-size: 0.7rem; }
.history-entry-board .card .main-suit { font-size: 1.25rem; }
.history-entry-delta {
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.history-entry-delta .gain { color: #ef4444; }
.history-entry-delta .loss { color: #22c55e; }
.history-entry-detail {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
/* 公共牌条 — 与结算 modal 一致 */
.history-detail-board {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.65rem;
  background: linear-gradient(180deg, rgba(34,197,94,0.18), rgba(34,197,94,0.08));
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 8px;
}
.history-detail-board-label { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.history-detail-board-cards { display: flex; gap: 6px; }
.history-detail-board-cards .card {
  width: 36px; height: 50px; border-radius: 5px;
}
.history-detail-board-cards .card .corner-rank { font-size: 0.85rem; }
.history-detail-board-cards .card .corner-suit { font-size: 0.65rem; }
.history-detail-board-cards .card .main-suit { font-size: 1.15rem; }

/* 玩家行 — 与结算 modal 一致：信息列 + 底牌 → 最佳 5 张 */
.history-detail-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.65rem 0.7rem;
  min-height: 64px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: visible;
}
.history-detail-row.winner {
  background: rgba(245, 197, 24, 0.10);
  border-color: rgba(245, 197, 24, 0.4);
  box-shadow: 0 0 10px -2px rgba(245, 197, 24, 0.25);
}
.history-detail-row.self:not(.winner) {
  background: rgba(56, 189, 248, 0.10);
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 8px -2px rgba(56, 189, 248, 0.30);
}
.history-detail-row.winner.self {
  box-shadow:
    0 0 12px -2px rgba(245, 197, 24, 0.35),
    0 0 0 2px rgba(56, 189, 248, 0.55) inset;
}
.history-detail-row.self .history-detail-name::before {
  content: "你 · ";
  color: rgb(56, 189, 248);
  font-weight: 800;
}
.history-detail-row.folded { opacity: 0.55; }

.history-detail-info {
  display: flex; flex-direction: column;
  gap: 2px; min-width: 80px; flex: 0 0 auto;
}
.history-detail-name { font-weight: 700; font-size: 0.92rem; color: var(--text-main, #f0f0f0); }
.history-detail-rank { font-size: 0.78rem; color: var(--gold); font-weight: 600; }
.history-detail-row.folded .history-detail-rank { color: var(--muted); }
.history-detail-delta {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  font-weight: 700;
}
.history-detail-delta.gain { color: #ef4444; }
.history-detail-delta.loss { color: #22c55e; }
.history-detail-delta.flat { color: var(--muted); }

.history-detail-cards {
  display: flex; align-items: center;
  gap: 0.65rem;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: visible;
}
.history-detail-holes,
.history-detail-best { display: flex; gap: 5px; flex: 0 0 auto; }
.history-detail-cards .card {
  width: 36px; height: 50px; border-radius: 5px;
}
.history-detail-cards .card .corner-rank { font-size: 0.85rem; }
.history-detail-cards .card .corner-suit { font-size: 0.65rem; }
.history-detail-cards .card .main-suit { font-size: 1.15rem; }
.history-detail-cards .card.highlight {
  box-shadow: 0 0 0 1.5px var(--gold), 0 0 8px rgba(245,197,24,0.45);
  transform: translateY(-2px);
}
.history-detail-sep { color: var(--muted); font-size: 0.85rem; padding: 0 2px; }
.history-footer {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--panel-border);
  padding-top: 0.6rem;
}

.history-tabs {
  display: flex;
  gap: 0.4rem;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 0.4rem;
}
.history-tab {
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.history-tab:hover { color: #fff; }
.history-tab.active {
  color: var(--gold);
  background: rgba(245,197,24,0.1);
}

/* ── 战绩统计 ───────────────────────── */
.history-stats {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding-right: 0.25rem;
  max-height: 60vh;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.stats-cell {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
}
.stats-label {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.stats-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--gold);
  font-family: 'JetBrains Mono', monospace;
}
.stats-ms-title {
  font-size: 0.9rem;
  color: #fff;
  margin-top: 0.4rem;
  font-weight: 700;
}
.stats-ms-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.stats-ms-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 0.78rem;
  color: var(--muted);
}
.stats-ms-chip.unlocked {
  background: rgba(245,197,24,0.12);
  border-color: rgba(245,197,24,0.4);
  color: #fff;
}
.stats-ms-chip .icon { font-size: 1rem; }

@media (max-width: 560px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── 断线重连 Toast ───────────────────── */
.reconnect-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.45);
  z-index: 250;
  opacity: 0;
  transition: opacity 0.2s, transform 0.25s cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
}
.reconnect-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.reconnect-toast.warn {
  background: linear-gradient(135deg, #7f1d1d, #dc2626);
  color: #fff;
}
.reconnect-toast.success {
  background: linear-gradient(135deg, #166534, #22c55e);
  color: #fff;
}

/* ── 里程碑 Toast ───────────────────── */
.milestone-toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-14px) scale(0.92);
  background: linear-gradient(135deg, #78350f 0%, #eab308 45%, #fde68a 100%);
  color: #1a0f00;
  padding: 0.7rem 1.2rem;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.5), 0 0 22px rgba(245,197,24,0.5);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.25s, transform 0.28s cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
  min-width: 220px;
}
.milestone-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}
.milestone-icon { font-size: 1.8rem; line-height: 1; }
.milestone-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.75;
}
.milestone-name {
  font-size: 1.05rem;
  font-weight: 800;
}

/* ── Toy 3D poker visual refresh ─────────────────────────
 * 以图片资产承担质感：亮绿毡、厚筹码、奶油圆角牌。
 * 现有 DOM/class 保持不变，避免影响游戏状态和事件绑定。
 */
:root {
  --felt: #2f9d30;
  --felt-dark: #14651d;
  --felt-light: #75c943;
  --gold: #ffd45d;
  --gold-dark: #c78319;
  --bg: #102a12;
  --panel: rgba(35, 97, 38, 0.72);
  --panel-border: rgba(255, 243, 201, 0.36);
  --muted: #d9e8c4;
  --card-white: #fff2cf;
  --shadow: 0 24px 58px rgba(23, 61, 18, 0.34);
  --toy-cream: #fff0c8;
  --toy-cream-hi: #fff8df;
  --toy-ink: #254018;
  --toy-red: #f04438;
  --toy-blue: #229ce3;
  --toy-green: #55bf38;
  --toy-purple: #ab4ddc;
  --toy-felt-image: url("assets/felt-toy-3d.webp");
}

body[data-theme="midnight"],
body[data-theme="blackgold"] {
  --panel: rgba(33, 86, 36, 0.74);
  --panel-border: rgba(255, 243, 201, 0.34);
}

#lobby,
#waitingRoom,
.privacy {
  background:
    radial-gradient(ellipse at 50% 8%, rgba(255, 246, 194, 0.42), transparent 30%),
    linear-gradient(rgba(30, 111, 34, 0.26), rgba(20, 78, 24, 0.76)),
    var(--toy-felt-image) center / cover no-repeat,
    #2f8d2f;
  padding: clamp(0.75rem, 1.7vw, 1.35rem);
}

.lobby-card,
.privacy-card,
.history-card,
.hand-result-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 248, 222, 0.30), rgba(55, 123, 42, 0.72)),
    rgba(39, 105, 42, 0.78);
  border: 2px solid rgba(255, 245, 207, 0.46);
  border-radius: 24px;
  box-shadow:
    0 26px 62px rgba(17, 62, 20, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    inset 0 -18px 34px rgba(34, 77, 18, 0.26);
  backdrop-filter: blur(18px) saturate(1.1);
}

.lobby-card {
  width: min(620px, 100%);
  padding-top: clamp(12.8rem, 22vw, 14.7rem);
  overflow: visible;
}

.lobby-card .lobby-actions {
  margin-top: 0.8rem;
}

.lobby-card #startBtn {
  padding: 0.58rem 1.9rem;
  min-height: 42px;
}

.lobby-hero-art {
  position: absolute;
  top: -28px;
  left: 50%;
  width: min(270px, 62vw);
  transform: translateX(-50%);
  filter: drop-shadow(0 22px 22px rgba(29, 71, 20, 0.36));
  pointer-events: none;
  user-select: none;
  z-index: 2;
}

.lobby-title {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, #fff9dc 0%, #ffd45d 52%, #f09d28 100%);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 0 4px 12px rgba(69, 57, 10, 0.22);
  letter-spacing: 0.03em;
}

.lobby-subtitle,
.hint,
.field label,
.online-hint small {
  color: #e7f2d3;
}

.lobby-tabs {
  background: rgba(42, 112, 38, 0.48);
  border: 1px solid rgba(255, 246, 211, 0.22);
  box-shadow: inset 0 2px 8px rgba(24, 72, 19, 0.26);
}

.lobby-tab {
  color: #e6f3cf;
  border-radius: 12px;
}

.lobby-tab.active {
  background:
    radial-gradient(circle at 32% 18%, #fff3b8, #ffd45d 42%, #e49b24 82%);
  color: #3b2c08;
  box-shadow:
    0 8px 16px rgba(119, 82, 10, 0.26),
    inset 0 2px 1px rgba(255, 255, 255, 0.48),
    inset 0 -4px 8px rgba(140, 82, 0, 0.22);
}

.field input,
.field select,
.chat-input-row input {
  background: rgba(255, 247, 219, 0.18);
  border: 1.5px solid rgba(255, 245, 211, 0.34);
  color: #fff8e1;
  border-radius: 13px;
  box-shadow:
    inset 0 2px 6px rgba(28, 84, 23, 0.22),
    0 1px 0 rgba(255, 255, 255, 0.18);
}

.field input::placeholder,
.chat-input-row input::placeholder {
  color: rgba(255, 248, 225, 0.62);
}

.btn-primary,
.btn-secondary,
.btn-copy,
.chat-input-row button {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  box-shadow:
    0 10px 0 rgba(111, 70, 8, 0.24),
    0 18px 28px rgba(29, 79, 20, 0.28),
    inset 0 2px 1px rgba(255, 255, 255, 0.46),
    inset 0 -6px 12px rgba(118, 75, 0, 0.24);
}

.btn-primary,
.chat-input-row button {
  background: radial-gradient(circle at 28% 16%, #fff4bd, #ffd45d 42%, #ec9c24 88%);
  color: #422b00;
}

.btn-secondary,
.btn-copy {
  background: rgba(255, 240, 200, 0.20);
  color: #fff7d5;
}

#table {
  background:
    radial-gradient(ellipse at 50% 14%, rgba(255, 244, 183, 0.36), transparent 34%),
    linear-gradient(rgba(39, 142, 48, 0.18), rgba(17, 74, 20, 0.68)),
    var(--toy-felt-image) center / cover no-repeat,
    #237922;
}

.table-bg {
  background:
    radial-gradient(ellipse at 50% 46%, rgba(255, 249, 206, 0.20), transparent 24%),
    radial-gradient(ellipse at 50% 72%, rgba(29, 78, 23, 0.34), transparent 46%);
  opacity: 0.98;
}

.table-oval {
  width: min(93vw, 1120px);
  height: min(63vh, 650px);
  background:
    url("assets/casino-ui/table-frame.webp") center / 100% 100% no-repeat;
  border: 0;
  border-radius: 0;
  box-shadow:
    0 44px 54px rgba(13, 47, 14, 0.46),
    0 18px 24px rgba(255, 208, 88, 0.08);
  margin-bottom: clamp(5rem, 11vh, 8rem);
}

.table-oval::before {
  inset: 18% 10% 17%;
  border-radius: 48% / 45%;
  background:
    radial-gradient(ellipse at 44% 34%, rgba(255, 255, 225, 0.22), transparent 34%),
    linear-gradient(180deg, rgba(56, 184, 63, 0.20), rgba(22, 104, 27, 0.06));
  animation: felt-shimmer 7s ease-in-out infinite;
  mix-blend-mode: screen;
}

.table-oval::after {
  content: none;
  position: absolute;
  inset: -15px;
  border-radius: inherit;
  border: 8px solid rgba(255, 217, 136, 0.42);
  box-shadow:
    inset 0 5px 0 rgba(255, 255, 255, 0.30),
    inset 0 -9px 0 rgba(70, 38, 16, 0.26);
  pointer-events: none;
}

.board {
  gap: 0.92rem;
  min-width: min(560px, 54vw);
  padding: 0.95rem 1.25rem 1.05rem;
  border-radius: 34px;
  background:
    radial-gradient(ellipse at 50% 34%, rgba(255, 248, 206, 0.18), transparent 45%),
    rgba(31, 113, 34, 0.26);
  border: 1px solid rgba(255, 246, 218, 0.12);
  box-shadow:
    inset 0 2px 18px rgba(12, 75, 15, 0.24),
    0 16px 24px rgba(33, 83, 18, 0.18);
}

.pot-info {
  position: relative;
  min-width: 168px;
  padding: 0.48rem 1.2rem 0.58rem;
  margin-bottom: clamp(1.95rem, 3.4vw, 2.85rem);
  border-radius: 999px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 247, 183, 0.24), transparent 48%),
    linear-gradient(180deg, rgba(39, 45, 20, 0.92), rgba(15, 34, 15, 0.92));
  border: 2px solid rgba(244, 194, 73, 0.66);
  box-shadow:
    0 9px 0 rgba(65, 34, 8, 0.30),
    0 18px 26px rgba(18, 57, 14, 0.28),
    inset 0 1px 0 rgba(255, 234, 157, 0.30),
    inset 0 -7px 12px rgba(0, 0, 0, 0.24);
  z-index: 4;
}

.pot-info::before {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% - 0.2rem);
  width: clamp(168px, 16vw, 226px);
  height: clamp(78px, 7.8vw, 108px);
  transform: translateX(-50%);
  background: url("assets/casino-ui/pot-chips.webp") center / contain no-repeat;
  filter:
    drop-shadow(0 14px 13px rgba(16, 45, 10, 0.34))
    drop-shadow(0 0 10px rgba(255, 209, 84, 0.15));
  pointer-events: none;
  z-index: -1;
}

.pot-label {
  position: relative;
  z-index: 2;
  color: rgba(255, 239, 173, 0.88);
  font-size: 0.86rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.42);
}

.pot-amount {
  position: relative;
  z-index: 2;
  color: #ffd84a;
  font-size: 2.05rem;
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", "PingFang SC", system-ui, sans-serif;
  font-weight: 950;
  letter-spacing: 0.03em;
  text-shadow:
    0 2px 0 rgba(81, 43, 0, 0.78),
    0 0 10px rgba(255, 218, 77, 0.30);
}

.stage-info {
  color: rgba(255, 249, 220, 0.86);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-shadow: 0 2px 5px rgba(24, 73, 14, 0.52);
}

.seat {
  width: 162px;
  padding: 0.42rem 0.55rem 0.55rem;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 242, 202, 0.24), rgba(26, 97, 34, 0.30));
  box-shadow:
    0 15px 22px rgba(27, 76, 17, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.seat-avatar {
  width: 82px;
  height: 82px;
  border: 0;
  box-shadow:
    0 8px 0 rgba(52, 52, 35, 0.14),
    0 14px 22px rgba(24, 71, 16, 0.32),
    0 0 0 3px rgba(255, 212, 93, 0.38),
    inset 0 2px 4px rgba(255, 255, 255, 0.34),
    inset 0 -8px 12px rgba(0, 0, 0, 0.18);
}

.seat-avatar.has-portrait {
  background: rgba(255, 240, 190, 0.22) !important;
  padding: 0;
  overflow: hidden;
}

.seat-avatar.has-portrait img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
  transform: none;
  pointer-events: none;
}

.seat-name {
  color: #fff9df;
  font-size: 1.04rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 5px rgba(32, 70, 13, 0.56);
}

.seat-stack,
.seat-bet,
.seat-action-hint,
.seat-capsule {
  border: 1px solid rgba(255, 246, 218, 0.42);
  box-shadow:
    0 6px 0 rgba(37, 83, 14, 0.20),
    0 10px 16px rgba(23, 71, 15, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.seat-stack {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  margin-top: 0.2rem;
  padding: 0.16rem 0.58rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff2b7, #f0b83d 62%, #c7811c);
  color: #3b2800;
  font-size: 0.86rem;
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", "PingFang SC", system-ui, sans-serif;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.40);
}

.seat-bet {
  background: radial-gradient(circle at 26% 18%, #fff9c8, #ffd45d 45%, #ce8218 92%);
  color: #422b00;
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", "PingFang SC", system-ui, sans-serif;
  font-size: 0.88rem;
  font-weight: 950;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.38);
}

.badge-dealer,
.badge-sb,
.badge-bb {
  width: 26px;
  height: 26px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 5px 9px rgba(24, 61, 12, 0.24), inset 0 2px 2px rgba(255, 255, 255, 0.32);
}

.card {
  border-radius: 12px;
  background:
    radial-gradient(circle at 22% 16%, rgba(255, 255, 255, 0.95), transparent 26%),
    linear-gradient(135deg, rgba(255,255,255,0) 36%, rgba(202, 149, 71, 0.10) 100%),
    linear-gradient(180deg, var(--toy-cream-hi) 0%, var(--toy-cream) 58%, #efd9ab 100%);
  color: #243125;
  box-shadow:
    0 9px 0 rgba(116, 88, 54, 0.18),
    0 14px 20px rgba(28, 69, 16, 0.28),
    inset 0 2px 1px rgba(255,255,255,0.86),
    inset 0 -4px 8px rgba(170, 126, 63, 0.15),
    0 0 0 1px rgba(107, 79, 40, 0.18);
}

.card:not(.back)::before {
  inset: 3px;
  border-radius: 9px;
  border: 1.5px solid rgba(136, 94, 43, 0.15);
}

.card.face::before,
.card.face-a::before {
  border-color: rgba(255, 190, 65, 0.76);
  box-shadow: inset 0 0 10px rgba(255, 212, 93, 0.18);
}

.card .corner-rank {
  letter-spacing: 0;
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", "PingFang SC", system-ui, sans-serif;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.34);
}

.card .main-suit {
  filter: drop-shadow(0 3px 0 rgba(78, 55, 35, 0.12));
}

.card .corner-suit,
.card .main-suit {
  display: block;
  color: transparent;
  text-shadow: none;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.card .corner-suit {
  width: 0.86em;
  height: 0.86em;
  margin: 0.03em auto 0;
}

.card .main-suit {
  width: 1.46em;
  height: 1.46em;
}

.card.suit-s .corner-suit,
.card.suit-s .main-suit {
  background-image: url("assets/suit-spade.webp");
}

.card.suit-h .corner-suit,
.card.suit-h .main-suit {
  background-image: url("assets/suit-heart.webp");
}

.card.suit-c .corner-suit,
.card.suit-c .main-suit {
  background-image: url("assets/suit-club.webp");
}

.card.suit-d .corner-suit,
.card.suit-d .main-suit {
  background-image: url("assets/suit-diamond.webp");
}

.card.face {
  background:
    radial-gradient(circle at 28% 18%, rgba(255,255,255,0.95), transparent 26%),
    linear-gradient(150deg, transparent 0 31%, rgba(255, 212, 93, 0.26) 32% 34%, transparent 35% 100%),
    radial-gradient(ellipse at 50% 70%, rgba(255, 212, 93, 0.20), transparent 36%),
    linear-gradient(180deg, #fff8df 0%, #fff0c8 54%, #eacb94 100%);
}

.card.face .card-main {
  left: 50%;
  right: auto;
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 72%;
}

.card.face .card-main::before {
  content: attr(data-face);
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 1em;
  text-align: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.08em;
  font-weight: 900;
  line-height: 1;
  color: rgba(174, 94, 15, 0.66);
  text-shadow:
    0 1px 0 rgba(255,255,255,0.58),
    0 4px 10px rgba(135, 80, 16, 0.22),
    0 0 13px rgba(255, 212, 93, 0.30);
  z-index: 0;
}

.card.face .card-main::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 66%;
  width: 1.18em;
  height: 0.38em;
  transform: translateX(-50%);
  border-radius: 999px;
  background:
    radial-gradient(circle at 24% 45%, rgba(255,255,255,0.82) 0 10%, transparent 11%),
    radial-gradient(circle at 50% 34%, rgba(255,255,255,0.72) 0 9%, transparent 10%),
    radial-gradient(circle at 76% 45%, rgba(255,255,255,0.82) 0 10%, transparent 11%),
    linear-gradient(180deg, rgba(255, 220, 112, 0.90), rgba(188, 115, 22, 0.72));
  box-shadow:
    0 3px 5px rgba(115, 71, 16, 0.16),
    inset 0 1px 0 rgba(255,255,255,0.55);
  opacity: 0.75;
  z-index: 0;
}

.card.face .main-suit {
  position: relative;
  z-index: 1;
  transform: translateY(0.48em) scale(0.86);
  filter:
    drop-shadow(0 4px 0 rgba(78, 55, 35, 0.12))
    drop-shadow(0 0 8px rgba(255, 212, 93, 0.28));
}

.card.face-a .card-main::before { content: "A"; }
.card.face-k .card-main::before { content: "K"; }
.card.face-q .card-main::before { content: "Q"; }
.card.face-j .card-main::before { content: "J"; }

.community-cards {
  gap: clamp(0.55rem, 1.15vw, 0.86rem);
  min-height: 116px;
  padding: 0.48rem 0.4rem 0.25rem;
}

.community-cards .card,
.hole-cards-mini .card {
  border-radius: 14px;
}

.community-cards .card {
  width: 78px;
  height: 110px;
  border-radius: 16px;
}

.community-cards .card.back {
  opacity: 0.34 !important;
}

.community-cards .card .corner-rank { font-size: 1.65rem; }
.community-cards .card .corner-suit { font-size: 1.25rem; }
.community-cards .card .main-suit { font-size: 2.55rem; }

.seat-cards .card {
  border-radius: 9px;
}

.card.back,
.card.squintable .card-back-cover {
  background:
    url("assets/card-back-red.webp") center / 100% 100% no-repeat,
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.28) 0 20%, transparent 21% 100%),
    repeating-conic-gradient(from 0deg, rgba(255,255,255,0.72) 0 9deg, transparent 9deg 23deg),
    radial-gradient(circle at 28% 18%, rgba(255,255,255,0.62), transparent 24%),
    linear-gradient(135deg, #e64034 0%, #b9262e 48%, #7f1722 100%);
  border: 2px solid rgba(255, 246, 219, 0.58);
}

body[data-theme="blackgold"] .card.back,
body[data-theme="blackgold"] .card.squintable .card-back-cover {
  background:
    url("assets/card-back-purple.webp") center / 100% 100% no-repeat,
    linear-gradient(135deg, #14110b 0%, #2c2820 50%, #0a0907 100%);
}

body[data-theme="midnight"] .card.back,
body[data-theme="midnight"] .card.squintable .card-back-cover {
  background:
    url("assets/card-back-blue.webp") center / 100% 100% no-repeat,
    linear-gradient(135deg, #0d1d3a 0%, #1b3b6f 60%, #050d1d 100%);
}

.card.back::before,
.card.squintable .card-back-cover::before {
  inset: 5px;
  border-radius: 8px;
  border: 2px solid rgba(255, 246, 219, 0.62);
  box-shadow: inset 0 0 10px rgba(18, 69, 129, 0.28);
}

.card.highlight {
  box-shadow:
    0 0 0 3px #ffd45d,
    0 16px 24px rgba(29, 73, 16, 0.34),
    0 0 22px rgba(255, 212, 93, 0.62);
}

.action-bar {
  min-height: clamp(176px, 23vh, 224px);
  background:
    linear-gradient(180deg, rgba(36, 76, 25, 0.10), rgba(8, 19, 9, 0.62));
  border-top: 0;
  box-shadow:
    0 -30px 48px rgba(18, 55, 14, 0.30);
  padding-bottom: calc(1.55rem + env(safe-area-inset-bottom));
  backdrop-filter: blur(18px) saturate(1.1);
}

.action-bar::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(-0.1rem + env(safe-area-inset-bottom));
  width: min(1120px, 102vw);
  height: min(210px, 26vw);
  transform: translateX(-50%);
  background: url("assets/casino-ui/action-tray-tight.webp") center bottom / 100% 100% no-repeat;
  filter:
    drop-shadow(0 -10px 22px rgba(24, 51, 12, 0.22))
    drop-shadow(0 10px 18px rgba(0, 0, 0, 0.30));
  pointer-events: none;
  z-index: 0;
}

.action-bar > * {
  position: relative;
  z-index: 1;
}

.hud-top {
  padding: 0.46rem 0.86rem;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(76, 45, 24, 0.68), rgba(25, 17, 11, 0.70));
  border: 1px solid rgba(255, 209, 88, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 238, 170, 0.26),
    0 8px 16px rgba(0, 0, 0, 0.18);
}

.action-buttons-circle {
  margin-top: -0.18rem;
  gap: clamp(0.72rem, 1.35vw, 1rem);
}

.raise-presets-circle {
  transform: translateY(-0.14rem);
  max-width: min(760px, 94vw);
  gap: clamp(0.34rem, 0.55vw, 0.52rem);
}

.hand-hint {
  color: #493100;
  font-size: 0.94rem;
  background: linear-gradient(180deg, #fff4c2, #f4c455);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 6px 0 rgba(69, 106, 16, 0.14), inset 0 2px 0 rgba(255, 255, 255, 0.40);
}

.equity-label {
  color: #f2f9de;
}

.equity-bar {
  height: 10px;
  background: rgba(14, 78, 19, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.20);
  box-shadow: inset 0 2px 5px rgba(18, 72, 14, 0.28);
}

.circle-btn {
  width: 82px;
  height: 82px;
  border: 4px solid rgba(255, 246, 218, 0.82);
  box-shadow:
    0 12px 0 rgba(44, 74, 18, 0.26),
    0 22px 30px rgba(18, 71, 14, 0.34),
    inset 0 4px 2px rgba(255, 255, 255, 0.42),
    inset 0 -12px 16px rgba(37, 47, 12, 0.24);
  overflow: hidden;
}

.circle-raise {
  width: 106px;
  height: 106px;
}

.circle-btn-label { font-size: 1.02rem; }
.circle-btn-amount { font-size: 0.86rem; }

.circle-btn-label,
.circle-btn-amount {
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", "PingFang SC", system-ui, sans-serif;
  font-weight: 950;
  letter-spacing: 0.02em;
}

.circle-btn:hover:not(:disabled) {
  transform: translateY(-5px);
  color: #fff;
  box-shadow:
    0 14px 0 rgba(44, 74, 18, 0.20),
    0 25px 30px rgba(18, 71, 14, 0.34),
    inset 0 4px 2px rgba(255, 255, 255, 0.48),
    inset 0 -10px 14px rgba(37, 47, 12, 0.20);
}

.circle-raise:hover:not(:disabled) {
  color: #432b00;
}

.circle-btn:hover:not(:disabled) .circle-btn-label,
.circle-btn:hover:not(:disabled) .circle-btn-amount {
  color: inherit;
  text-shadow:
    0 2px 3px rgba(25, 10, 0, 0.52),
    0 0 2px rgba(32, 16, 0, 0.44),
    0 0 10px rgba(255,255,255,0.40);
}

.circle-fold  { background: radial-gradient(circle at 28% 18%, #ffcfbf 0%, #f0473a 48%, #b62324 100%); }
.circle-check { background: radial-gradient(circle at 28% 18%, #d7f0ff 0%, #229ce3 48%, #0b67b4 100%); }
.circle-call  { background: radial-gradient(circle at 28% 18%, #def8b9 0%, #55bf38 48%, #248f2b 100%); }
.circle-raise { background: radial-gradient(circle at 28% 18%, #fff3b8 0%, #ffd45d 42%, #d69018 100%); color: #432b00; }
.circle-allin { background: radial-gradient(circle at 28% 18%, #f5d2ff 0%, #ab4ddc 45%, #6e2aa3 100%); }

.circle-call,
.circle-call:hover:not(:disabled) {
  color: #143f10;
}

.circle-raise,
.circle-raise:hover:not(:disabled) {
  color: #432b00;
}

.circle-fold,
.circle-check,
.circle-allin,
.circle-fold:hover:not(:disabled),
.circle-check:hover:not(:disabled),
.circle-allin:hover:not(:disabled) {
  color: #fffaf0;
}

.circle-fold:hover:not(:disabled) {
  background: radial-gradient(circle at 28% 18%, #ffb39f 0%, #d92b27 48%, #7c1518 100%);
}

.circle-check:hover:not(:disabled) {
  background: radial-gradient(circle at 28% 18%, #bce6ff 0%, #087fcb 48%, #064d91 100%);
}

.circle-allin:hover:not(:disabled) {
  background: radial-gradient(circle at 28% 18%, #edb5ff 0%, #9132cf 45%, #541c86 100%);
}

.circle-btn::after {
  inset: 8px;
  border: 2px solid rgba(255, 255, 255, 0.34);
  background:
    radial-gradient(circle at 32% 18%, rgba(255,255,255,0.42), transparent 22%),
    repeating-conic-gradient(from 0deg, rgba(255,255,255,0.24) 0 7deg, transparent 7deg 22deg);
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.06) inset,
    inset 0 -4px 8px rgba(0,0,0,0.08);
  pointer-events: none;
}

.circle-btn::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.28);
  box-shadow:
    inset 0 2px 3px rgba(255,255,255,0.22),
    inset 0 -4px 8px rgba(0,0,0,0.10);
  pointer-events: none;
}

.circle-btn-label,
.circle-btn-amount {
  position: relative;
  z-index: 1;
  text-shadow:
    0 2px 0 rgba(42, 21, 0, 0.34),
    0 0 3px rgba(255, 255, 255, 0.30);
}

.circle-fold {
  box-shadow:
    0 12px 0 rgba(109, 28, 25, 0.32),
    0 22px 30px rgba(18, 71, 14, 0.34),
    inset 0 4px 2px rgba(255, 255, 255, 0.42),
    inset 0 -12px 16px rgba(72, 0, 0, 0.18);
}

.circle-call {
  box-shadow:
    0 12px 0 rgba(31, 107, 36, 0.34),
    0 22px 30px rgba(18, 71, 14, 0.34),
    inset 0 4px 2px rgba(255, 255, 255, 0.42),
    inset 0 -12px 16px rgba(0, 68, 22, 0.18);
}

.circle-raise {
  box-shadow:
    0 14px 0 rgba(144, 94, 12, 0.34),
    0 26px 34px rgba(18, 71, 14, 0.38),
    0 0 26px rgba(255, 212, 93, 0.34),
    inset 0 5px 3px rgba(255, 255, 255, 0.48),
    inset 0 -14px 18px rgba(118, 75, 0, 0.20);
}

.chip-preset {
  min-width: 86px;
  height: 44px;
  color: #241600;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 250, 214, 0.96) 0 35%, transparent 36%),
    radial-gradient(circle at 28% 18%, rgba(255,255,255,0.62), transparent 23%),
    repeating-conic-gradient(from 0deg, rgba(255,255,255,0.74) 0 8deg, transparent 8deg 22deg),
    radial-gradient(circle, #fff1b1 0 45%, #f0b83d 46% 66%, #bd7718 67% 100%);
  border: 2px dashed rgba(255, 255, 255, 0.74);
  box-shadow:
    0 7px 0 rgba(48, 83, 16, 0.20),
    0 12px 18px rgba(18, 71, 14, 0.24),
    inset 0 2px 2px rgba(255, 255, 255, 0.42);
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", "PingFang SC", system-ui, sans-serif;
  font-weight: 950;
  font-size: 1rem;
  letter-spacing: 0;
  -webkit-text-stroke: 0.25px rgba(55, 31, 0, 0.58);
  text-shadow:
    0 1px 0 rgba(255,255,255,0.92),
    0 0 2px rgba(93, 54, 0, 0.42),
    0 2px 3px rgba(77, 40, 0, 0.18);
}

.chip-preset:hover,
.chip-preset:focus-visible {
  color: #2d1b00;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 253, 231, 0.98) 0 36%, transparent 37%),
    radial-gradient(circle at 28% 18%, rgba(255,255,255,0.78), transparent 24%),
    repeating-conic-gradient(from 0deg, rgba(255,255,255,0.82) 0 8deg, transparent 8deg 22deg),
    radial-gradient(circle, #fff8d1 0 45%, #ffd45d 46% 66%, #c98916 67% 100%);
  border-color: rgba(255,255,255,0.92);
  text-shadow:
    0 1px 0 rgba(255,255,255,0.72),
    0 0 3px rgba(75, 37, 0, 0.34);
}

.raise-slider input[type=range] {
  accent-color: #ffd45d;
  filter: drop-shadow(0 4px 4px rgba(26, 78, 15, 0.24));
}

.pre-action-bar,
.dealer-log,
.settings-popup,
.chat-panel {
  background:
    linear-gradient(180deg, rgba(255, 247, 219, 0.20), rgba(42, 112, 39, 0.74)),
    rgba(42, 112, 39, 0.78);
  border: 1.5px solid rgba(255, 246, 218, 0.34);
  box-shadow:
    0 18px 36px rgba(21, 67, 15, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.top-bar {
  top: 0.7rem;
  right: 1rem;
  flex-direction: row;
  align-items: center;
  gap: 0.42rem;
  padding: 0.34rem 0.46rem;
  border-radius: 999px;
  background:
    url("assets/casino-ui/hud-sprite.webp") 50% 9% / 960px auto no-repeat,
    linear-gradient(180deg, rgba(73, 49, 28, 0.94), rgba(26, 18, 12, 0.94));
  border: 1px solid rgba(255, 205, 82, 0.56);
  box-shadow:
    0 9px 0 rgba(41, 22, 7, 0.34),
    0 16px 24px rgba(16, 42, 12, 0.24),
    inset 0 1px 0 rgba(255, 232, 161, 0.24);
  backdrop-filter: blur(10px) saturate(1.1);
}

.settings-wrap {
  display: inline-flex;
}

.pre-pill,
.settings-radio,
.history-tab,
.stats-cell,
.history-entry,
.history-detail-row,
.result-row,
.winner-row,
.room-code-box {
  border-radius: 16px;
  border-color: rgba(255, 246, 218, 0.24);
}

.pre-pill.armed,
.history-tab.active,
.stats-ms-chip.unlocked {
  background: linear-gradient(180deg, #fff2b7, #f0b83d);
  color: #402900;
}

.icon-btn {
  width: 48px;
  height: 48px;
  background:
    radial-gradient(circle at 34% 18%, rgba(255,255,255,0.28), transparent 28%),
    url("assets/casino-ui/hud-sprite.webp") 82% 42% / 720px auto no-repeat,
    linear-gradient(180deg, rgba(76, 48, 25, 0.96), rgba(31, 19, 12, 0.96));
  border: 2px solid rgba(255, 196, 69, 0.78);
  color: #ffe9a6;
  box-shadow:
    0 7px 0 rgba(42, 22, 8, 0.44),
    0 14px 22px rgba(19, 44, 13, 0.28),
    inset 0 2px 1px rgba(255, 232, 161, 0.24);
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.38),
    0 0 8px rgba(255, 224, 122, 0.22);
}

.icon-btn:hover {
  background:
    radial-gradient(circle at 34% 18%, rgba(255,255,255,0.34), transparent 28%),
    url("assets/casino-ui/hud-sprite.webp") 82% 42% / 720px auto no-repeat,
    linear-gradient(180deg, rgba(106, 65, 29, 0.98), rgba(46, 27, 14, 0.98));
  border-color: rgba(255, 221, 117, 0.95);
}

.seat-capsule.cap-fold  { background: radial-gradient(circle at 30% 18%, #ffd4c8, #ef4c42 55%, #b72a29); }
.seat-capsule.cap-check { background: radial-gradient(circle at 30% 18%, #d8f2ff, #229ce3 55%, #126bb7); }
.seat-capsule.cap-call  { background: radial-gradient(circle at 30% 18%, #e5ffc2, #55bf38 55%, #248f2b); color: #173d0f; }
.seat-capsule.cap-raise { background: radial-gradient(circle at 30% 18%, #fff2b7, #f0b83d 55%, #bf7718); color: #402900; }
.seat-capsule.cap-allin { background: radial-gradient(circle at 30% 18%, #f7d2ff, #ab4ddc 55%, #742ca4); }

.flying-chip {
  width: 34px;
  height: 34px;
  background:
    url("assets/chip-set-fancy.webp") 50% 50% / 265% auto no-repeat,
    radial-gradient(circle at 28% 18%, rgba(255,255,255,0.64), transparent 24%),
    radial-gradient(circle, #fff1b1 0 42%, #ffd45d 43% 62%, #b97918 63% 100%);
  border: 0;
  box-shadow:
    0 12px 14px rgba(32, 72, 14, 0.34),
    0 0 10px rgba(255, 212, 93, 0.18);
  filter: saturate(1.08) contrast(1.02);
}

.flying-chip.chip-red {
  background-position: 29% 53%;
}

.flying-chip.chip-blue {
  background-position: 63% 52%;
}

.flying-chip.chip-green {
  background-position: 50% 34%;
}

.flying-chip.chip-gold {
  background-position: 50% 65%;
}

.stage-banner {
  background: linear-gradient(180deg, #fff9d4 0%, #ffd45d 50%, #e79621 100%);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow:
    0 10px 0 rgba(69, 89, 10, 0.16),
    0 18px 28px rgba(20, 72, 15, 0.28);
}

.hand-result,
.game-over,
.history-modal {
  background:
    linear-gradient(rgba(22, 84, 24, 0.74), rgba(13, 48, 15, 0.86)),
    var(--toy-felt-image) center / cover no-repeat;
}

.hand-result-card {
  --result-art-gutter: clamp(7rem, 18vw, 13rem);
  isolation: isolate;
  padding-left: var(--result-art-gutter);
  overflow: visible;
}

.hand-result-card .hand-result-header {
  background: transparent;
  border-bottom: 0;
  padding: 1.35rem 1.8rem 1rem;
}

.hand-result-card .hand-result-header h3 {
  display: inline-flex;
  align-self: center;
  justify-content: center;
  width: 100%;
  margin-bottom: 0.85rem;
  background: transparent;
  text-shadow:
    0 2px 0 rgba(64, 45, 0, 0.26),
    0 0 12px rgba(255, 212, 93, 0.28);
}

.hand-result-card .hand-result-header:has(#handResultBoard:empty) {
  padding-bottom: 0.95rem;
}

.hand-result-card #nextHandBtn {
  align-self: stretch;
  width: calc(100% + var(--result-art-gutter));
  min-height: 58px;
  margin: 0 0 0 calc(var(--result-art-gutter) * -1);
  border-radius: 0 0 22px 22px;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  font-size: 1.08rem;
  font-weight: 950;
}

.result-moment-art {
  position: absolute;
  left: -42px;
  top: 50%;
  width: clamp(180px, 25vw, 300px);
  aspect-ratio: 1;
  transform: translateY(-50%);
  background: center / contain no-repeat;
  opacity: 1;
  filter:
    saturate(1.08)
    contrast(1.04)
    drop-shadow(0 22px 22px rgba(22, 66, 14, 0.42))
    drop-shadow(0 0 24px rgba(255, 212, 93, 0.22));
  pointer-events: none;
  z-index: 1;
}

.result-moment-art.is-winner {
  background-image:
    url("assets/winner-closeup.webp"),
    url("assets/effect-winner-ring.webp");
  opacity: 1;
}

.result-moment-art.is-loser {
  background-image: url("assets/loser-closeup.webp");
  opacity: 1;
}

.hand-result-card .hand-result-header,
.hand-result-card #handResultBody,
.hand-result-card #nextHandBtn {
  position: relative;
  z-index: 2;
}

.result-row.winner {
  position: relative;
}

.result-row.winner::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 86px;
  height: 86px;
  transform: translateY(-50%);
  background: url("assets/effect-card-spark.webp") center / contain no-repeat;
  opacity: 0.32;
  pointer-events: none;
}

.result-name {
  font-size: 1.05rem;
  font-weight: 950;
  color: #fff8dd;
}

.result-rank {
  font-size: 0.96rem;
  font-weight: 850;
  color: rgba(255, 247, 218, 0.88);
}

.result-delta {
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", "PingFang SC", system-ui, sans-serif;
  font-size: 1.14rem;
  font-weight: 950;
  letter-spacing: 0.02em;
}

.result-row.winner .result-delta {
  color: #ffd45d;
  font-size: 1.28rem;
  text-shadow:
    0 2px 0 rgba(82, 50, 6, 0.34),
    0 0 12px rgba(255, 212, 93, 0.36);
}

.result-board,
.history-detail-board {
  background:
    radial-gradient(ellipse at 50% 18%, rgba(255, 246, 210, 0.35), transparent 46%),
    linear-gradient(180deg, rgba(84, 145, 47, 0.62), rgba(31, 103, 35, 0.60)),
    var(--toy-felt-image) center / cover no-repeat;
  border: 1px solid rgba(255, 212, 93, 0.34);
  box-shadow:
    0 6px 0 rgba(93, 61, 22, 0.18),
    inset 0 1px 0 rgba(255,255,255,0.25),
    0 10px 18px rgba(23, 77, 18, 0.18);
}

.history-stats::before {
  content: "";
  align-self: center;
  width: min(320px, 82%);
  height: 72px;
  margin-bottom: -0.2rem;
  background: url("assets/achievement-medals.webp") center / contain no-repeat;
  filter: drop-shadow(0 10px 12px rgba(26, 78, 15, 0.22));
  opacity: 0.88;
  pointer-events: none;
}

@media (max-width: 720px) {
  .lobby-card {
    padding-top: clamp(11.8rem, 48vw, 13.4rem);
    border-radius: 20px;
  }

  .lobby-hero-art {
    top: -24px;
    width: min(238px, 64vw);
  }

  .table-oval {
    height: min(52vh, 500px);
    box-shadow:
      0 28px 34px rgba(18, 57, 14, 0.40),
      0 12px 16px rgba(255, 208, 88, 0.08);
    margin-bottom: 7.4rem;
  }

  .seat {
    width: 108px;
    padding: 0.24rem 0.28rem 0.34rem;
    border-radius: 20px;
  }

  .seat-avatar {
    width: 54px;
    height: 54px;
    border-width: 3px;
  }

  .seat .countdown-ring {
    top: calc(0.24rem + 27px);
    width: 68px;
    height: 68px;
  }

  .seat-stack {
    min-width: 58px;
    font-size: 0.68rem;
  }

  .board {
    gap: 0.48rem;
    padding: 0.54rem 0.58rem 0.68rem;
  }

  .pot-info {
    min-width: 112px;
    padding: 0.3rem 0.68rem;
    margin-bottom: 1.72rem;
  }

  .pot-info::before {
    width: 130px;
    height: 66px;
    top: calc(100% - 0.1rem);
  }

  .community-cards {
    min-height: 78px;
    gap: 0.32rem;
    padding-top: 0.36rem;
  }

  .action-bar {
    gap: 0.42rem;
    min-height: 164px;
    padding: 0.52rem 0.62rem calc(1rem + env(safe-area-inset-bottom));
  }

  .action-bar::before {
    width: 112vw;
    height: 150px;
    background-size: 100% auto;
  }

  .hud-top {
    max-width: 96vw;
    padding: 0.28rem 0.44rem;
  }

  .chip-preset {
    min-width: 64px;
    height: 32px;
    padding: 0 0.54rem;
    font-size: 0.78rem;
  }

  .icon-btn {
    width: 42px;
    height: 42px;
  }

  .top-bar {
    top: 0.55rem;
    right: 0.55rem;
    gap: 0.24rem;
    padding: 0.24rem 0.28rem;
  }

  .hand-result-card {
    --result-art-gutter: 1rem;
    padding-left: 1rem;
    padding-top: 6.8rem;
    overflow: visible;
  }

  .result-moment-art {
    left: 50%;
    right: auto;
    top: -76px;
    width: min(188px, 56vw);
    transform: none;
    translate: -50% 0;
    opacity: 0.88;
    z-index: 3;
  }

  .circle-btn::before {
    inset: 14px;
  }
}

@media (max-width: 420px) {
  .field-group {
    grid-template-columns: 1fr;
  }

  .circle-btn {
    width: 58px;
    height: 58px;
    border-width: 2px;
  }

  .circle-btn-label { font-size: 0.82rem; }
  .circle-btn-amount { font-size: 0.68rem; }

  .circle-raise {
    width: 76px;
    height: 76px;
  }

  .action-buttons-circle {
    gap: 0.48rem;
  }
}

/* ── Casino asset fit pass: reduce stacked panels and align controls to image edges ── */
.board {
  background:
    radial-gradient(ellipse at 50% 42%, rgba(255, 248, 206, 0.12), transparent 52%),
    rgba(31, 113, 34, 0.10);
  border-color: rgba(255, 246, 218, 0.06);
  box-shadow: inset 0 1px 14px rgba(12, 75, 15, 0.15);
}

.pot-info {
  margin-bottom: clamp(2.35rem, 3.6vw, 3.05rem);
}

.pot-info::before {
  top: calc(100% - 1.42rem);
  z-index: 1;
}

.pot-info > * {
  position: relative;
  z-index: 2;
}

.community-cards {
  padding-top: 0.55rem;
}

.action-bar {
  min-height: clamp(210px, 25vh, 270px);
  justify-content: flex-end;
  gap: clamp(0.4rem, 0.9vh, 0.75rem);
  padding: 0.95rem 1rem calc(1.35rem + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(31, 89, 24, 0), rgba(5, 23, 8, 0.72) 38%, rgba(4, 13, 5, 0.92));
}

.action-bar::before {
  width: min(1060px, 94vw);
  height: clamp(132px, 18.5vw, 208px);
  bottom: calc(0.35rem + env(safe-area-inset-bottom));
  background-size: contain;
}

.hud-top {
  transform: translateY(0.15rem);
}

.raise-presets-circle {
  max-width: min(760px, 90vw);
  transform: translateY(0.08rem);
}

.raise-slider {
  width: min(560px, 64vw);
}

.action-buttons-circle {
  transform: translateY(0.12rem);
}

/* ── Betting tray alignment: seat controls into the illustrated panel ── */
@media (min-width: 721px) {
  .action-bar {
    min-height: clamp(246px, 27vh, 304px);
    padding: 0.74rem 1rem calc(1.1rem + env(safe-area-inset-bottom));
  }

  .action-bar::before {
    width: min(1120px, 96vw);
    height: clamp(172px, 20.2vw, 232px);
    bottom: calc(0.22rem + env(safe-area-inset-bottom));
  }

  .hud-top {
    margin-bottom: auto;
    transform: translateY(0.05rem);
  }

  .raise-presets-circle {
    position: absolute;
    left: 50%;
    bottom: calc(7.55rem + env(safe-area-inset-bottom));
    width: min(650px, 52vw);
    max-width: none;
    transform: translateX(-50%);
    z-index: 3;
  }

  .chip-preset {
    min-width: 76px;
    height: 38px;
    padding: 0 0.54rem;
    font-size: 0.88rem;
    box-shadow:
      0 5px 0 rgba(72, 45, 9, 0.28),
      0 10px 14px rgba(18, 71, 14, 0.20),
      inset 0 2px 2px rgba(255, 255, 255, 0.42);
  }

  .raise-slider {
    position: absolute;
    left: calc(50% + 180px);
    bottom: calc(5.1rem + env(safe-area-inset-bottom));
    width: min(338px, 24vw);
    height: 30px;
    justify-content: center;
    z-index: 4;
  }

  .raise-slider input[type=range] {
    height: 28px;
    margin: 0;
    filter:
      drop-shadow(0 3px 2px rgba(18, 8, 2, 0.30))
      drop-shadow(0 0 5px rgba(255, 212, 93, 0.16));
  }

  .raise-slider input[type=range]::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 216, 102, 0.92), rgba(143, 80, 17, 0.92));
    box-shadow:
      inset 0 1px 1px rgba(255,255,255,0.34),
      0 1px 0 rgba(0,0,0,0.28);
  }

  .raise-slider input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 34px;
    height: 34px;
    margin-top: -13px;
    border-radius: 50%;
    border: 2px solid rgba(255, 244, 204, 0.88);
    background:
      radial-gradient(circle at 32% 20%, #fff5bf, #ffd45d 44%, #b87416 100%);
    box-shadow:
      0 5px 0 rgba(83, 45, 8, 0.32),
      0 9px 12px rgba(0,0,0,0.30),
      inset 0 2px 1px rgba(255,255,255,0.55);
  }

  .action-buttons-circle {
    position: absolute;
    left: 50%;
    bottom: calc(1.25rem + env(safe-area-inset-bottom));
    width: min(640px, 48vw);
    transform: translateX(-50%);
    gap: clamp(0.56rem, 0.95vw, 0.86rem);
    z-index: 3;
  }

  .circle-btn {
    width: 76px;
    height: 76px;
    border-width: 3px;
  }

  .circle-raise {
    width: 100px;
    height: 100px;
    margin-inline: 0.08rem;
  }

  .circle-btn:hover:not(:disabled) {
    transform: translateY(-3px);
  }
}

.top-bar {
  background:
    linear-gradient(180deg, rgba(73, 49, 28, 0.86), rgba(26, 18, 12, 0.90));
}

.icon-btn {
  background:
    radial-gradient(circle at 34% 18%, rgba(255,255,255,0.28), transparent 28%),
    url("assets/casino-ui/hud-sprite.webp") 82% 42% / 720px auto no-repeat,
    linear-gradient(180deg, rgba(76, 48, 25, 0.96), rgba(31, 19, 12, 0.96));
}

@media (max-width: 720px) {
  .table-oval {
    width: min(97vw, 540px);
    height: min(51vh, 490px);
    margin-bottom: 9.2rem;
  }

  .board {
    gap: 0.34rem;
    min-width: min(430px, 88vw);
    padding: 0.36rem 0.42rem 0.5rem;
    background:
      radial-gradient(ellipse at 50% 45%, rgba(255, 248, 206, 0.09), transparent 54%),
      rgba(31, 113, 34, 0.05);
    border-color: transparent;
    box-shadow: none;
  }

  .pot-info {
    min-width: 108px;
    padding: 0.28rem 0.7rem 0.42rem;
    margin-bottom: 1.95rem;
  }

  .pot-info::before {
    top: calc(100% - 1.4rem);
    width: 126px;
    height: 64px;
  }

  .community-cards {
    min-height: 80px;
    padding-top: 0.42rem;
  }

  .top-bar {
    top: 0.55rem;
    right: 0.55rem;
    display: grid;
    grid-template-columns: repeat(3, 42px);
    gap: 0.18rem;
    padding: 0.22rem;
    border-radius: 18px;
    background:
      linear-gradient(180deg, rgba(67, 43, 23, 0.72), rgba(25, 16, 10, 0.78));
  }

  .settings-wrap {
    display: inline-flex;
    position: relative;
    width: 42px;
    height: 42px;
  }

  .icon-btn {
    width: 42px;
    height: 42px;
    border-width: 1.5px;
    box-shadow:
      0 4px 0 rgba(42, 22, 8, 0.42),
      0 8px 14px rgba(19, 44, 13, 0.24),
      inset 0 1px 1px rgba(255, 232, 161, 0.22);
  }

  .settings-wrap .icon-btn {
    width: 100%;
    height: 100%;
  }

  .settings-popup {
    right: 0;
    top: calc(100% + 0.5rem);
  }

  .action-bar {
    min-height: 214px;
    gap: 0.32rem;
    padding: 0.5rem 0.54rem calc(0.82rem + env(safe-area-inset-bottom));
  }

  .action-bar::before {
    width: 100vw;
    height: 118px;
    bottom: calc(0.22rem + env(safe-area-inset-bottom));
  }

  .hud-top {
    max-width: min(420px, 94vw);
    transform: none;
  }

  .raise-presets-circle {
    max-width: min(500px, 94vw);
    gap: 0.22rem;
    transform: none;
  }

  .chip-preset {
    min-width: 58px;
    height: 31px;
    padding: 0 0.42rem;
    font-size: 0.72rem;
    border-width: 1.5px;
  }

  .raise-slider {
    width: min(420px, 86vw);
  }

  .action-buttons-circle {
    gap: 0.48rem;
    transform: translateY(0.08rem);
  }
}

@media (max-width: 420px) {
  .top-bar {
    grid-template-columns: repeat(3, 38px);
  }

  .icon-btn {
    width: 38px;
    height: 38px;
  }

  .settings-wrap {
    width: 38px;
    height: 38px;
  }

  .pot-info {
    margin-bottom: 1.72rem;
  }

  .pot-info::before {
    top: calc(100% - 1.28rem);
    width: 112px;
    height: 56px;
  }

  .raise-presets-circle {
    max-width: min(390px, 96vw);
  }

  .chip-preset {
    min-width: 50px;
    height: 29px;
    padding: 0 0.32rem;
    font-size: 0.68rem;
  }
}

/* ── Image asset betting controls ─────────────────────── */
.action-buttons-circle {
  display: grid;
  grid-template-columns: repeat(4, var(--bet-btn-size, 112px));
  align-items: center;
  justify-content: center;
  gap: var(--bet-btn-gap, 48px);
}

.circle-btn,
.circle-btn:hover:not(:disabled),
.circle-btn:active:not(:disabled) {
  width: var(--bet-btn-size, 112px);
  height: var(--bet-btn-size, 112px);
  border: 0;
  border-radius: 50%;
  background-color: transparent;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  box-shadow: none;
  filter: drop-shadow(0 14px 12px rgba(21, 45, 10, 0.28));
  transform: none;
  overflow: visible;
}

.circle-btn::before,
.circle-btn::after {
  content: none;
}

.circle-btn:disabled {
  opacity: 0.48;
  filter: grayscale(0.25) drop-shadow(0 10px 10px rgba(21, 45, 10, 0.20));
}

.circle-fold { background-image: url("assets/bet-btn-fold-metal.webp"); }
.circle-call { background-image: url("assets/bet-btn-call-metal.webp"); }
.circle-raise { background-image: url("assets/bet-btn-raise-metal.webp"); }
.circle-allin { background-image: url("assets/bet-btn-allin-metal.webp"); }

.circle-btn-label {
  display: none;
}

.circle-btn-amount {
  position: absolute;
  left: 50%;
  bottom: 23%;
  transform: translateX(-50%);
  min-width: 46%;
  max-width: 58%;
  color: #fff6c9;
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", "PingFang SC", system-ui, sans-serif;
  font-size: clamp(0.78rem, 1.25vw, 1.08rem);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
  text-shadow:
    0 2px 0 rgba(61, 30, 0, 0.72),
    0 0 7px rgba(255, 218, 97, 0.42);
  z-index: 2;
  pointer-events: none;
}

.circle-call .circle-btn-amount {
  color: #f9ffe1;
  text-shadow:
    0 2px 0 rgba(0, 51, 16, 0.74),
    0 0 7px rgba(165, 255, 118, 0.36);
}

.raise-presets-circle {
  display: grid;
  grid-template-columns: repeat(6, var(--bet-preset-w, 86px));
  justify-content: center;
  gap: var(--bet-preset-gap, 14px);
}

.chip-preset,
.chip-preset:hover,
.chip-preset:focus-visible {
  width: var(--bet-preset-w, 86px);
  min-width: 0;
  height: var(--bet-preset-h, 58px);
  padding: 0;
  border: 0;
  border-radius: 0;
  color: transparent;
  -webkit-text-stroke: 0;
  text-shadow: none;
  background-color: transparent;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  box-shadow: none;
  filter: drop-shadow(0 7px 7px rgba(27, 49, 13, 0.20));
}

.chip-preset[data-preset="min"] { background-image: url("assets/bet-preset-min-metal.webp"); }
.chip-preset[data-preset="pot-third"] { background-image: url("assets/bet-preset-pot-third-metal.webp"); }
.chip-preset[data-preset="pot-half"] { background-image: url("assets/bet-preset-pot-half-metal.webp"); }
.chip-preset[data-preset="pot-two-third"] { background-image: url("assets/bet-preset-pot-two-third-metal.webp"); }
.chip-preset[data-preset="pot"] { background-image: url("assets/bet-preset-pot-metal.webp"); }
.chip-preset[data-preset="pot-onepointtwo"] { background-image: url("assets/bet-preset-pot-onepointtwo-metal.webp"); }

.raise-slider {
  position: relative;
  height: var(--bet-slider-h, 44px);
}

.raise-slider-visual,
.raise-slider-track,
.raise-slider-fill,
.raise-slider-knob {
  position: absolute;
  pointer-events: none;
}

.raise-slider-visual {
  inset: 0;
}

.raise-slider-track {
  left: 0;
  right: 0;
  top: 50%;
  height: 100%;
  transform: translateY(-50%);
  background: url("assets/bet-slider-track-metal.webp") center / 100% 100% no-repeat;
}

.raise-slider-fill {
  left: 5.5%;
  top: 50%;
  width: 0%;
  max-width: 89%;
  height: 34%;
  transform: translateY(-50%);
  background: url("assets/bet-slider-fill-metal.webp") left center / 100% 100% no-repeat;
  overflow: hidden;
}

.raise-slider-knob {
  left: 0%;
  top: 50%;
  width: clamp(34px, 4.1vw, 52px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: url("assets/bet-slider-knob-metal.webp") center / contain no-repeat;
  filter: drop-shadow(0 9px 8px rgba(20, 10, 2, 0.32));
}

.raise-slider input[type=range] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  opacity: 0;
  background: transparent;
  accent-color: transparent;
  cursor: pointer;
  z-index: 2;
}

.raise-slider input[type=range]::-webkit-slider-runnable-track,
.raise-slider input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.raise-slider input[type=range]::-moz-range-track,
.raise-slider input[type=range]::-moz-range-progress,
.raise-slider input[type=range]::-moz-range-thumb {
  background: transparent;
  border: 0;
  box-shadow: none;
}

@media (min-width: 721px) {
  .action-buttons-circle {
    --bet-btn-size: 112px;
    --bet-btn-gap: clamp(34px, 3.7vw, 58px);
    left: 50%;
    width: min(860px, 62vw);
    bottom: calc(0.95rem + env(safe-area-inset-bottom));
  }

  .circle-raise {
    width: var(--bet-btn-size);
    height: var(--bet-btn-size);
    margin: 0;
  }

  .raise-presets-circle {
    --bet-preset-w: 88px;
    --bet-preset-h: 60px;
    --bet-preset-gap: clamp(10px, 1.05vw, 16px);
    width: min(720px, 54vw);
    bottom: calc(7.65rem + env(safe-area-inset-bottom));
  }

  .raise-slider {
    left: calc(50% + 185px);
    width: min(346px, 25vw);
    height: 44px;
    bottom: calc(5.05rem + env(safe-area-inset-bottom));
  }
}

@media (max-width: 720px) {
  .action-buttons-circle {
    --bet-btn-size: 74px;
    --bet-btn-gap: 8px;
    grid-template-columns: repeat(4, var(--bet-btn-size));
    width: min(360px, 96vw);
  }

  .raise-presets-circle {
    --bet-preset-w: 58px;
    --bet-preset-h: 40px;
    --bet-preset-gap: 2px;
    grid-template-columns: repeat(6, var(--bet-preset-w));
    width: min(376px, 98vw);
  }

  .raise-slider {
    height: 34px;
  }

  .circle-btn-amount {
    bottom: 22%;
    font-size: 0.74rem;
  }
}

/* ── Metal betting console final alignment ────────────── */
.action-bar {
  min-height: clamp(254px, 30vw, 374px);
  padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(24, 88, 24, 0), rgba(5, 25, 8, 0.54) 42%, rgba(3, 12, 5, 0.90));
}

.action-bar::before {
  width: min(1240px, 98vw);
  height: clamp(210px, 27vw, 334px);
  bottom: calc(0.15rem + env(safe-area-inset-bottom));
  background: url("assets/bet-control-tray-metal.webp") center bottom / contain no-repeat;
  filter:
    drop-shadow(0 -14px 24px rgba(255, 209, 88, 0.12))
    drop-shadow(0 22px 22px rgba(0, 0, 0, 0.42));
}

.circle-btn,
.circle-btn:hover:not(:disabled),
.circle-btn:focus-visible,
.circle-btn:active:not(:disabled) {
  background-color: transparent;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  box-shadow: none;
}

.circle-fold,
.circle-fold:hover:not(:disabled),
.circle-fold:focus-visible,
.circle-fold:active:not(:disabled) {
  background-image: url("assets/bet-btn-fold-metal.webp");
}

.circle-call,
.circle-call:hover:not(:disabled),
.circle-call:focus-visible,
.circle-call:active:not(:disabled) {
  background-image: url("assets/bet-btn-call-metal.webp");
}

.circle-raise,
.circle-raise:hover:not(:disabled),
.circle-raise:focus-visible,
.circle-raise:active:not(:disabled) {
  background-image: url("assets/bet-btn-raise-metal.webp");
}

.circle-allin,
.circle-allin:hover:not(:disabled),
.circle-allin:focus-visible,
.circle-allin:active:not(:disabled) {
  background-image: url("assets/bet-btn-allin-metal.webp");
}

.circle-btn:hover:not(:disabled) {
  filter:
    brightness(1.08)
    saturate(1.04)
    drop-shadow(0 16px 12px rgba(20, 10, 2, 0.34))
    drop-shadow(0 0 14px rgba(255, 218, 97, 0.24));
  transform: translateY(-2px);
}

.circle-btn-amount {
  display: none;
}

@media (min-width: 721px) {
  .hud-top {
    position: absolute;
    left: 50%;
    top: calc(0.72rem + env(safe-area-inset-bottom));
    width: min(520px, 42vw);
    max-width: none;
    min-height: 76px;
    padding: 0.42rem 0.8rem;
    transform: translateX(-50%);
    z-index: 5;
  }

  .hole-cards-mini {
    transform: scale(0.88);
    transform-origin: center;
  }

  .action-buttons-circle {
    --bet-btn-size: clamp(106px, 8.2vw, 124px);
    --bet-btn-gap: clamp(66px, 5.8vw, 88px);
    width: auto;
    bottom: calc(clamp(3.45rem, 5.7vw, 4.9rem) + env(safe-area-inset-bottom));
    transform: translateX(-51.5%);
  }

  .circle-raise {
    width: var(--bet-btn-size);
    height: var(--bet-btn-size);
  }

  .raise-presets-circle {
    --bet-preset-w: clamp(66px, 5.9vw, 86px);
    --bet-preset-h: clamp(44px, 4vw, 58px);
    --bet-preset-gap: clamp(10px, 1.15vw, 17px);
    position: absolute;
    left: calc(50% - clamp(146px, 18vw, 238px));
    bottom: calc(clamp(9.75rem, 13.85vw, 14.4rem) + env(safe-area-inset-bottom));
    width: auto;
    transform: translateX(-50%);
  }

  .raise-slider {
    position: absolute;
    left: calc(50% + clamp(88px, 11.4vw, 154px));
    width: clamp(250px, 28vw, 384px);
    height: clamp(32px, 3.65vw, 46px);
    bottom: calc(clamp(9.9rem, 13.65vw, 14.1rem) + env(safe-area-inset-bottom));
  }
}

@media (max-width: 720px) {
  .action-bar {
    min-height: 214px;
  }

  .action-bar::before {
    width: 104vw;
    height: 142px;
    bottom: calc(0.18rem + env(safe-area-inset-bottom));
  }

  .action-buttons-circle {
    bottom: calc(1.75rem + env(safe-area-inset-bottom));
  }

  .circle-btn-amount {
    display: none;
  }
}

/* ── Stable betting console coordinate system ───────────
   All betting controls are anchored to the panel artwork, so resizing the
   browser scales one coordinate system instead of moving each control alone. */
.action-bar {
  --console-w: min(980px, 78vw);
  --console-h: clamp(205px, 17.2vw, 245px);
  min-height: calc(var(--console-h) + clamp(40px, 4.5vw, 62px));
  padding: 0;
  gap: 0;
  background:
    linear-gradient(180deg, rgba(24, 88, 24, 0), rgba(5, 25, 8, 0.50) 36%, rgba(3, 12, 5, 0.92));
}

.action-bar::before {
  content: none;
}

.bet-console {
  position: absolute;
  left: 50%;
  bottom: calc(0.18rem + env(safe-area-inset-bottom));
  width: var(--console-w);
  height: var(--console-h);
  transform: translateX(-50%);
  background: none;
  z-index: 2;
}

.bet-console::before {
  --console-border-x: clamp(44px, calc(var(--console-w) * 0.072), 70px);
  --console-border-y: clamp(34px, calc(var(--console-h) * 0.18), 46px);
  content: "";
  position: absolute;
  inset: 0;
  border-style: solid;
  border-width: var(--console-border-y) var(--console-border-x);
  border-image-source: url("assets/bet-control-tray-metal.webp");
  border-image-slice: 132 152 126 152 fill;
  border-image-width: var(--console-border-y) var(--console-border-x);
  border-image-repeat: stretch;
  filter:
    drop-shadow(0 -10px 18px rgba(255, 209, 88, 0.10))
    drop-shadow(0 18px 18px rgba(0, 0, 0, 0.40));
  pointer-events: none;
  z-index: 0;
}

.bet-console > * {
  position: absolute;
  z-index: 2;
}

.hud-top {
  position: absolute;
  left: 50%;
  bottom: calc(var(--console-h) - clamp(3px, 0.4vw, 8px) + env(safe-area-inset-bottom));
  width: min(520px, 42vw);
  min-height: clamp(58px, 6.2vw, 78px);
  max-width: none;
  padding: 0.38rem 0.78rem;
  transform: translateX(-50%);
  z-index: 5;
}

.hole-cards-mini {
  transform: scale(0.88);
  transform-origin: center;
}

.bet-console .raise-presets-circle {
  --bet-preset-w: clamp(48px, calc(var(--console-w) * 0.058), 60px);
  --bet-preset-h: calc(var(--bet-preset-w) * 0.674);
  --bet-preset-gap: calc(var(--console-w) * 0.013);
  left: 8.6%;
  top: 18.8%;
  width: 44.2%;
  height: var(--bet-preset-h);
  display: grid;
  grid-template-columns: repeat(6, var(--bet-preset-w));
  justify-content: start;
  gap: var(--bet-preset-gap);
  transform: none;
}

.bet-console .raise-slider {
  left: 58%;
  top: 21.8%;
  width: 32%;
  height: 12%;
  transform: none;
}

.bet-console .action-buttons-circle {
  --bet-btn-size: clamp(76px, calc(var(--console-w) * 0.086), 88px);
  --bet-btn-gap: calc(var(--console-w) * 0.133);
  left: 16.7%;
  top: 55.8%;
  width: auto;
  height: var(--bet-btn-size);
  display: grid;
  grid-template-columns: repeat(4, var(--bet-btn-size));
  gap: var(--bet-btn-gap);
  justify-content: start;
  transform: none;
}

.bet-console .circle-btn,
.bet-console .circle-btn:hover:not(:disabled),
.bet-console .circle-btn:active:not(:disabled) {
  width: var(--bet-btn-size);
  height: var(--bet-btn-size);
}

.circle-btn-amount {
  display: none;
}

.raise-value-badge {
  left: 58%;
  top: 36.6%;
  min-width: 14.5%;
  padding: 0.28rem 0.76rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 232, 151, 0.74);
  background:
    linear-gradient(180deg, rgba(255, 244, 191, 0.95), rgba(217, 151, 34, 0.92));
  color: #4c2b00;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.52),
    0 5px 10px rgba(0, 0, 0, 0.20);
  font-size: clamp(0.68rem, calc(var(--console-w) * 0.011), 0.82rem);
  font-weight: 950;
  line-height: 1;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.52);
  white-space: nowrap;
}

.bet-history-panel {
  position: fixed;
  left: clamp(0.8rem, 2vw, 1.5rem);
  top: clamp(5.2rem, 10vh, 7.2rem);
  width: clamp(178px, 16.5vw, 236px);
  max-height: min(46vh, 430px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(244, 199, 94, 0.36);
  background:
    linear-gradient(180deg, rgba(55, 38, 20, 0.82), rgba(17, 14, 10, 0.76)),
    radial-gradient(circle at 50% 0%, rgba(255, 218, 97, 0.18), transparent 42%);
  box-shadow:
    inset 0 1px 0 rgba(255, 238, 177, 0.22),
    0 14px 24px rgba(0, 0, 0, 0.26);
  color: #fff4c9;
  z-index: 13;
  pointer-events: auto;
  backdrop-filter: blur(12px) saturate(1.12);
}

.bet-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.72rem 0.82rem 0.52rem;
  border-bottom: 1px solid rgba(255, 218, 97, 0.18);
}

.bet-history-title {
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0;
}

.bet-history-subtitle {
  margin-top: 0.12rem;
  color: rgba(255, 244, 201, 0.68);
  font-size: 0.68rem;
  white-space: nowrap;
}

.bet-history-list {
  min-height: 58px;
  overflow-y: auto;
  padding: 0.48rem 0.5rem 0.58rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 211, 99, 0.44) transparent;
}

.bet-history-empty {
  padding: 0.48rem 0.38rem;
  color: rgba(255, 244, 201, 0.54);
  font-size: 0.72rem;
  text-align: center;
}

.bet-history-stage {
  margin: 0.34rem 0 0.22rem;
  color: rgba(255, 231, 156, 0.66);
  font-size: 0.66rem;
  font-weight: 800;
  text-align: center;
}

.bet-history-stage::before,
.bet-history-stage::after {
  content: "";
  display: inline-block;
  width: 18px;
  height: 1px;
  margin: 0 0.38rem 0.18rem;
  background: rgba(255, 218, 97, 0.26);
}

.bet-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.42rem;
  margin-top: 0.28rem;
  padding: 0.34rem 0.42rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.20);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.72rem;
}

.bet-history-player {
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 250, 232, 0.88);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bet-history-action {
  color: #ffe28f;
  font-weight: 900;
  white-space: nowrap;
}

.bet-history-row.action-fold .bet-history-action {
  color: #ffb3a8;
}

.bet-history-row.action-check .bet-history-action {
  color: #d9e7ff;
}

.bet-history-row.action-call .bet-history-action {
  color: #baf6a7;
}

.bet-history-row.action-raise,
.bet-history-row.action-allin {
  border-color: rgba(255, 210, 88, 0.18);
  background: rgba(84, 54, 10, 0.24);
}

@media (max-width: 720px) {
  .action-bar {
    --console-w: min(430px, 104vw);
    --console-h: 132px;
    min-height: calc(var(--console-h) + 38px);
  }

  .hud-top {
    bottom: calc(var(--console-h) - 4px + env(safe-area-inset-bottom));
    width: min(380px, 88vw);
    min-height: 54px;
  }

  .bet-console .raise-presets-circle {
    --bet-preset-w: clamp(28px, calc(var(--console-w) * 0.058), 34px);
    --bet-preset-gap: calc(var(--console-w) * 0.006);
    left: 7.2%;
    top: 18.8%;
  }

  .bet-console .raise-slider {
    left: 57.6%;
    top: 22.8%;
    width: 32.6%;
    height: 11%;
  }

  .bet-console .action-buttons-circle {
    --bet-btn-size: clamp(42px, calc(var(--console-w) * 0.086), 52px);
    --bet-btn-gap: calc(var(--console-w) * 0.071);
    left: 15.1%;
    top: 57%;
  }

  .raise-value-badge {
    left: 57.6%;
    top: 37%;
    min-width: 20%;
    padding: 0.16rem 0.36rem;
    font-size: 0.58rem;
  }

  .bet-history-panel {
    left: 0.7rem;
    right: 0.7rem;
    top: auto;
    bottom: calc(var(--console-h) + 3.25rem + env(safe-area-inset-bottom));
    width: auto;
    max-height: 118px;
    border-radius: 12px;
  }

  .bet-history-head {
    padding: 0.46rem 0.62rem 0.34rem;
  }

  .bet-history-title {
    font-size: 0.78rem;
  }

  .bet-history-subtitle {
    font-size: 0.62rem;
  }

  .bet-history-list {
    display: flex;
    gap: 0.36rem;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.36rem 0.52rem 0.46rem;
  }

  .bet-history-row {
    flex: 0 0 auto;
    min-width: 118px;
    margin-top: 0;
  }

  .bet-history-stage {
    flex: 0 0 auto;
    align-self: center;
    margin: 0 0.1rem;
  }

  .bet-history-stage::before,
  .bet-history-stage::after {
    display: none;
  }
}

/* ── Premium top-right toolbar ────────────────────────── */
.top-bar {
  top: clamp(0.7rem, 1.7vw, 1.15rem);
  right: clamp(0.75rem, 1.8vw, 1.4rem);
  display: grid;
  grid-template-columns: repeat(6, 42px);
  gap: 5px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 212, 94, 0.56);
  background:
    linear-gradient(180deg, rgba(78, 50, 25, 0.92), rgba(24, 15, 9, 0.94)),
    radial-gradient(circle at 50% 0%, rgba(255, 225, 126, 0.22), transparent 58%);
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 178, 0.26),
    inset 0 -2px 8px rgba(0, 0, 0, 0.36),
    0 10px 18px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(10px) saturate(1.12);
}

.settings-wrap {
  position: relative;
  width: 42px;
  height: 42px;
}

.icon-btn,
.settings-wrap .icon-btn {
  position: relative;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 231, 158, 0.54);
  border-radius: 50%;
  color: #fff2b7;
  background:
    radial-gradient(circle at 34% 20%, rgba(255, 255, 255, 0.42), transparent 23%),
    linear-gradient(180deg, rgba(107, 72, 34, 0.98), rgba(37, 23, 13, 0.98));
  box-shadow:
    inset 0 2px 2px rgba(255, 245, 190, 0.30),
    inset 0 -6px 10px rgba(0, 0, 0, 0.38),
    0 3px 0 rgba(86, 48, 8, 0.66),
    0 7px 10px rgba(0, 0, 0, 0.30);
  font-size: 0;
  overflow: hidden;
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}

.icon-btn::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px solid rgba(255, 214, 91, 0.72);
  box-shadow: inset 0 0 0 1px rgba(60, 33, 5, 0.56);
  pointer-events: none;
}

.icon-btn:hover,
.icon-btn:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.12) saturate(1.05);
  outline: none;
}

.icon-btn:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.42),
    inset 0 -2px 6px rgba(255, 232, 159, 0.18),
    0 2px 0 rgba(86, 48, 8, 0.56);
}

.icon-btn.active {
  color: #fff7cf;
  background:
    radial-gradient(circle at 34% 20%, rgba(255, 255, 255, 0.50), transparent 24%),
    linear-gradient(180deg, rgba(167, 117, 39, 0.98), rgba(86, 52, 10, 0.98));
  box-shadow:
    inset 0 2px 2px rgba(255, 249, 210, 0.38),
    inset 0 -6px 10px rgba(0, 0, 0, 0.34),
    0 0 12px rgba(255, 213, 91, 0.24),
    0 3px 0 rgba(86, 48, 8, 0.66);
}

.toolbar-icon {
  position: relative;
  width: 20px;
  height: 20px;
  display: block;
  background: currentColor;
  filter:
    drop-shadow(0 1px 0 rgba(76, 36, 0, 0.80))
    drop-shadow(0 0 3px rgba(255, 230, 142, 0.22));
  mask: var(--icon-mask) center / contain no-repeat;
  -webkit-mask: var(--icon-mask) center / contain no-repeat;
  z-index: 1;
}

.icon-chat {
  --icon-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M21%2015a4%204%200%200%201-4%204H8l-5%203V7a4%204%200%200%201%204-4h10a4%204%200%200%201%204%204z'%20fill='none'%20stroke='black'%20stroke-width='2.4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3C/svg%3E");
}

.icon-history {
  --icon-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M8%206h11M8%2012h11M8%2018h8M4%206h.01M4%2012h.01M4%2018h.01'%20fill='none'%20stroke='black'%20stroke-width='3'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3C/svg%3E");
}

.icon-eye {
  --icon-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M2%2012s4-7%2010-7%2010%207%2010%207-4%207-10%207S2%2012%202%2012z'%20fill='none'%20stroke='black'%20stroke-width='2.4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3Ccircle%20cx='12'%20cy='12'%20r='3'%20fill='none'%20stroke='black'%20stroke-width='2.4'/%3E%3C/svg%3E");
}

.icon-sound {
  --icon-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M11%205%206%209H3v6h3l5%204V5zM15%209a5%205%200%200%201%200%206M18%207a8%208%200%200%201%200%2010'%20fill='none'%20stroke='black'%20stroke-width='2.4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3C/svg%3E");
}

.icon-settings {
  --icon-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M12%208a4%204%200%201%200%200%208%204%204%200%200%200%200-8zM4%2012h2M18%2012h2M12%204v2M12%2018v2M6.3%206.3l1.4%201.4M16.3%2016.3l1.4%201.4M17.7%206.3l-1.4%201.4M7.7%2016.3l-1.4%201.4'%20fill='none'%20stroke='black'%20stroke-width='2.4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3C/svg%3E");
}

.icon-exit {
  --icon-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M10%204H5v16h5M14%208l4%204-4%204M8%2012h10'%20fill='none'%20stroke='black'%20stroke-width='2.4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3C/svg%3E");
}

.icon-btn.muted {
  color: rgba(255, 226, 153, 0.62);
}

.icon-btn.muted::after {
  content: "";
  position: absolute;
  left: 20px;
  top: 9px;
  width: 3px;
  height: 25px;
  border-radius: 999px;
  background: #ffb09b;
  transform: rotate(-42deg);
  box-shadow: 0 0 4px rgba(88, 14, 0, 0.42);
  z-index: 2;
}

.settings-popup {
  top: calc(100% + 0.62rem);
  right: 0;
}

@media (max-width: 720px) {
  .top-bar {
    top: 0.7rem;
    right: 0.65rem;
    grid-template-columns: repeat(3, 36px);
    gap: 4px;
    padding: 5px;
    border-radius: 18px;
  }

  .settings-wrap,
  .icon-btn,
  .settings-wrap .icon-btn {
    width: 36px;
    height: 36px;
  }

  .toolbar-icon {
    width: 18px;
    height: 18px;
  }
}

/* ── Stable interaction backgrounds ─────────────────────
   Keep asset-backed buttons pinned to the same image in every interaction
   state. Hover/click feedback should come from filter and shadow only. */
.bet-console .circle-btn {
  --circle-btn-bg: none;
  background: var(--circle-btn-bg) center / contain no-repeat !important;
  background-color: transparent !important;
}

.bet-console .circle-fold { --circle-btn-bg: url("assets/bet-btn-fold-metal.webp"); }
.bet-console .circle-call { --circle-btn-bg: url("assets/bet-btn-call-metal.webp"); }
.bet-console .circle-raise { --circle-btn-bg: url("assets/bet-btn-raise-metal.webp"); }
.bet-console .circle-allin { --circle-btn-bg: url("assets/bet-btn-allin-metal.webp"); }

.bet-console .circle-btn:hover:not(:disabled),
.bet-console .circle-btn:focus-visible,
.bet-console .circle-btn:active:not(:disabled) {
  background: var(--circle-btn-bg) center / contain no-repeat !important;
  background-color: transparent !important;
  box-shadow: none !important;
}

.bet-console .circle-btn:hover:not(:disabled),
.bet-console .circle-btn:focus-visible {
  filter:
    brightness(1.08)
    saturate(1.04)
    drop-shadow(0 16px 12px rgba(20, 10, 2, 0.34))
    drop-shadow(0 0 14px rgba(255, 218, 97, 0.24));
  transform: translateY(-2px);
}

.bet-console .circle-btn:active:not(:disabled) {
  filter:
    brightness(0.98)
    saturate(1.02)
    drop-shadow(0 10px 9px rgba(20, 10, 2, 0.30));
  transform: translateY(0);
}

.top-bar .icon-btn,
.top-bar .settings-wrap .icon-btn {
  --toolbar-btn-bg:
    radial-gradient(circle at 34% 20%, rgba(255, 255, 255, 0.42), transparent 23%),
    linear-gradient(180deg, rgba(107, 72, 34, 0.98), rgba(37, 23, 13, 0.98));
  background: var(--toolbar-btn-bg) !important;
  background-color: transparent !important;
}

.top-bar .icon-btn:hover,
.top-bar .icon-btn:focus-visible,
.top-bar .icon-btn:active,
.top-bar .icon-btn.active {
  background: var(--toolbar-btn-bg) !important;
  background-color: transparent !important;
}

.top-bar .icon-btn:hover,
.top-bar .icon-btn:focus-visible {
  color: #fff7cf;
  filter: brightness(1.12) saturate(1.05);
  transform: translateY(-1px);
}

.top-bar .icon-btn:active {
  filter: brightness(0.96) saturate(1.02);
  transform: translateY(1px);
}

.top-bar .icon-btn.active {
  color: #fff7cf;
  filter:
    brightness(1.14)
    saturate(1.12)
    drop-shadow(0 0 8px rgba(255, 213, 91, 0.18));
}
