:root {
  --page: #101412;
  --page-soft: #171d1a;
  --panel: #f4f6f5;
  --paper: #ffffff;
  --ink: #17201d;
  --muted: #69756f;
  --line: #dce3df;
  --table: #0d6048;
  --table-deep: #084b39;
  --table-line: #b89a52;
  --gold: #d0a84f;
  --gold-dark: #8b6824;
  --red: #b33c45;
  --red-soft: #f4dfe1;
  --green: #127456;
  --green-soft: #dcefe8;
  --cream: #fffdf7;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background: var(--page);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-width: 0; min-height: 100%; }
body { background: var(--page); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.entry-screen { min-height: 100vh; color: #f6f8f7; background: var(--page); }
.entry-header {
  height: 64px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid #29312d;
}
.mini-brand, .live-brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.mini-brand strong { font-size: 15px; letter-spacing: 0; }
.mini-mark {
  width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 36px;
  border-radius: 6px; background: var(--gold); color: #14201b; font-weight: 900;
}
.icon-link, .icon-button {
  width: 36px; height: 36px; display: inline-grid; place-items: center; border: 1px solid #37413c;
  border-radius: 5px; background: transparent; color: inherit; text-decoration: none; cursor: pointer;
}
.icon-link:hover, .icon-button:hover { background: rgba(255,255,255,.07); }
.admin-button.is-authenticated { border-color: #4baf86; color: #c8f0df; }
.entry-main { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 38px 24px; }
.entry-panel { width: min(620px, 100%); }
.entry-title { text-align: center; }
.eyebrow { display: block; color: var(--gold); font-size: 11px; font-weight: 800; letter-spacing: 0; }
.entry-title h1 { margin: 10px 0 12px; font-size: 34px; line-height: 1.2; letter-spacing: 0; }
.safety-line { display: flex; justify-content: center; align-items: center; gap: 7px; color: #aeb8b3; font-size: 11px; }
.safety-line span { width: 7px; height: 7px; border-radius: 50%; background: #4bc393; }
.entry-form { margin: 30px auto 0; width: min(430px, 100%); }
.form-field { display: grid; gap: 8px; }
.form-field span { color: #b8c1bd; font-size: 11px; font-weight: 650; }
input[type="text"], input[type="password"] {
  width: 100%; height: 44px; padding: 0 13px; border: 1px solid #45514b; border-radius: 6px;
  outline: none; background: #171d1a; color: #fff; font-size: 13px; text-transform: none;
}
input[type="text"]:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(208,168,79,.14); }
input::placeholder { color: #77817c; }
.entry-actions { margin-top: 14px; }
.game-type-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 18px 0 2px; padding: 0; border: 0; }
.game-type-picker legend { width: 100%; margin-bottom: 8px; color: #b8c1bd; font-size: 11px; font-weight: 650; }
.game-type-picker label { position: relative; cursor: pointer; }
.game-type-picker input { position: absolute; opacity: 0; pointer-events: none; }
.game-type-picker span { min-height: 62px; display: grid; align-content: center; gap: 3px; padding: 10px 12px; border: 1px solid #45514b; border-radius: 6px; background: #171d1a; transition: border-color 150ms ease, background 150ms ease; }
.game-type-picker b { color: #f4f6f5; font-size: 13px; }
.game-type-picker small { color: #8f9a94; font-size: 9px; }
.game-type-picker input:checked + span { border-color: var(--gold); background: rgba(208,168,79,.12); box-shadow: 0 0 0 3px rgba(208,168,79,.09); }
.primary-command, .secondary-command, .action-button, .chip-button {
  height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 800;
}
.primary-command { width: 100%; background: var(--gold); color: #15201b; }
.primary-command:hover, .action-button.primary:hover { background: #ddba65; }
.primary-command:disabled, .secondary-command:disabled, .action-button:disabled, .chip-button:disabled { opacity: .45; cursor: not-allowed; }
.join-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0; color: #74807a; font-size: 10px; }
.join-divider::before, .join-divider::after { content: ""; height: 1px; flex: 1; background: #303936; }
.join-row { display: grid; grid-template-columns: minmax(0, 1fr) 92px; gap: 8px; }
#roomCodeInput { text-transform: uppercase; font-weight: 800; }
.secondary-command { background: transparent; border-color: #59655f; color: #fff; }
.secondary-command:hover { background: rgba(255,255,255,.06); }
.entry-status { min-height: 17px; margin: 12px 0 0; text-align: center; color: #88938e; font-size: 10px; }
.entry-status.error { color: #ef9299; }
.rule-strip { margin-top: 36px; padding-top: 18px; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid #303936; }
.rule-strip span { padding: 0 10px; border-right: 1px solid #303936; color: #87928d; text-align: center; font-size: 9px; }
.rule-strip span:last-child { border-right: 0; }
.rule-strip b { display: block; margin-bottom: 4px; color: #e7ebE9; font-size: 12px; }

/* 牌桌入口使用真实牌面资源填充两侧桌布，中央操作保持清晰可读。 */
.entry-main {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 48%, rgba(21,128,93,.28) 0%, rgba(10,75,56,.24) 34%, transparent 64%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.012) 0 1px, transparent 1px 5px);
}
.entry-main::before {
  content: "";
  position: absolute;
  inset: 8% 5%;
  border: 1px solid rgba(224,194,112,.19);
  border-radius: 50%;
  box-shadow: inset 0 0 0 34px rgba(3,40,29,.13), 0 0 0 1px rgba(144,211,180,.07);
  pointer-events: none;
}
.entry-panel { position: relative; z-index: 2; }
.entry-table-scene { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.entry-card-fan {
  position: absolute;
  width: 272px;
  height: 224px;
  opacity: .96;
  filter: drop-shadow(0 20px 19px rgba(0,0,0,.38));
}
.entry-card-fan img {
  position: absolute;
  width: 128px;
  height: 186px;
  object-fit: fill;
  border-radius: 7px;
  background: #fffdf7;
  box-shadow: 0 2px 0 rgba(255,255,255,.32);
}
.entry-card-fan-left { left: clamp(24px, 11vw, 180px); top: 50%; transform: translateY(-47%); }
.entry-card-fan-left img:nth-child(1) { left: 2px; top: 28px; transform: rotate(-20deg); }
.entry-card-fan-left img:nth-child(2) { left: 76px; top: 4px; transform: rotate(-4deg); }
.entry-card-fan-left img:nth-child(3) { left: 143px; top: 31px; transform: rotate(16deg); }
.entry-card-fan-right { right: clamp(24px, 11vw, 180px); top: 50%; transform: translateY(-47%) scaleX(-1); }
.entry-card-fan-right img:nth-child(1) { left: 2px; top: 28px; transform: rotate(-20deg); }
.entry-card-fan-right img:nth-child(2) { left: 76px; top: 4px; transform: rotate(-4deg); }
.entry-card-fan-right img:nth-child(3) { left: 143px; top: 31px; transform: rotate(16deg); }
.entry-chip-stack { position: absolute; width: 60px; height: 74px; filter: drop-shadow(0 10px 10px rgba(0,0,0,.34)); }
.entry-chip-stack i {
  position: absolute;
  left: 0;
  width: 60px;
  height: 22px;
  border: 3px solid #f5d782;
  border-radius: 50%;
  background: repeating-linear-gradient(90deg, #b82f38 0 8px, #f6e5a7 8px 13px, #b82f38 13px 21px);
  box-shadow: inset 0 0 0 3px #af2430, 0 3px 0 #671622;
}
.entry-chip-stack i:nth-child(1) { top: 0; }
.entry-chip-stack i:nth-child(2) { top: 14px; }
.entry-chip-stack i:nth-child(3) { top: 28px; }
.entry-chip-stack i:nth-child(4) { top: 42px; }
.entry-chip-stack-left { left: clamp(68px, 9vw, 148px); bottom: 13%; transform: rotate(-13deg); }
.entry-chip-stack-right { right: clamp(68px, 9vw, 148px); top: 13%; transform: rotate(13deg); }

@media (max-width: 1100px) {
  .entry-card-fan { width: 210px; height: 170px; opacity: .42; }
  .entry-card-fan img { width: 98px; height: 142px; }
  .entry-card-fan-left { left: -22px; }
  .entry-card-fan-right { right: -22px; }
  .entry-card-fan-left img:nth-child(2), .entry-card-fan-right img:nth-child(2) { left: 54px; }
  .entry-card-fan-left img:nth-child(3), .entry-card-fan-right img:nth-child(3) { left: 108px; }
  .entry-chip-stack { opacity: .48; }
}
@media (max-width: 700px) {
  .entry-main::before { inset: 5% -28%; }
  .entry-card-fan { opacity: .16; transform: none; }
  .entry-card-fan-left { left: -86px; top: 3%; }
  .entry-card-fan-right { right: -86px; top: auto; bottom: -17%; }
  .entry-chip-stack { display: none; }
}

.game-screen { min-height: 100vh; background: var(--panel); }
.live-header {
  height: 64px; padding: 0 20px; display: grid; grid-template-columns: minmax(175px, 1fr) auto auto minmax(140px, 1fr);
  align-items: center; gap: 18px; background: var(--page); color: #fff; border-bottom: 1px solid #29312d;
}
.live-brand strong { display: block; font-size: 14px; letter-spacing: 0; }
.live-brand small { display: block; margin-top: 3px; color: #87928d; font-size: 9px; }
.live-brand small i { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: #d2a44a; }
.live-brand small.online i { background: #47bb8d; }
.room-cluster, .round-cluster { display: flex; align-items: center; gap: 9px; }
.room-label { color: #7e8984; font-size: 9px; }
.room-code { height: 34px; padding: 0 10px; display: flex; align-items: center; gap: 9px; border: 1px solid #3b4641; border-radius: 5px; background: #181f1c; color: #fff; cursor: pointer; }
.room-code span { font-size: 14px; font-weight: 900; font-variant-numeric: tabular-nums; }
.room-code i { color: #89948f; font-size: 9px; font-style: normal; }
.phase-badge { padding: 5px 8px; border-radius: 4px; background: #2b3531; color: #d9dfdc; font-size: 9px; font-weight: 800; }
.round-cluster strong { font-size: 11px; font-variant-numeric: tabular-nums; }
.live-actions { justify-self: end; display: flex; gap: 7px; }
.live-actions .icon-button { color: #dce2df; }

.game-layout { min-height: calc(100vh - 64px); display: grid; grid-template-columns: minmax(700px, 1fr) 300px; }
.table-column { min-width: 0; padding: 18px; background: #e7ebe9; }
.table-surface {
  position: relative; height: clamp(500px, calc(100vh - 220px), 665px); min-height: 500px; overflow: hidden; border: 2px solid var(--table-line); border-radius: 8px;
  background-color: var(--table); box-shadow: inset 0 0 0 8px var(--table-deep), 0 10px 26px rgba(15,30,23,.13);
}
.table-surface::before {
  content: ""; position: absolute; inset: 38px; border: 1px solid rgba(255,255,255,.13); border-radius: 8px; pointer-events: none;
}
.table-stamp { position: absolute; left: 26px; top: 22px; color: rgba(255,255,255,.48); z-index: 2; }
.table-stamp span { display: block; font-size: 8px; font-weight: 800; }
.table-stamp b { display: block; margin-top: 2px; font-size: 11px; }
.table-center {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); width: 240px; min-height: 128px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 3;
  border: 1px solid rgba(255,255,255,.2); border-radius: 8px; background: rgba(5,41,30,.48); color: #fff;
}
.table-center > span { color: #bcd1c8; font-size: 10px; }
.table-center > strong { margin-top: 6px; color: #fff3d3; font-size: 28px; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.table-center > small { margin-top: 5px; color: #a7bdb4; font-size: 9px; }
.countdown-ring {
  position: absolute; right: -15px; top: -15px; width: 42px; height: 42px; display: grid; place-items: center;
  border: 3px solid var(--gold); border-radius: 50%; background: var(--page); color: #fff; font-size: 12px; font-weight: 900;
}
.seat-map { position: absolute; inset: 0; z-index: 4; }
.seat {
  position: absolute; width: 168px; height: 112px; padding: 9px; transform: translate(-50%, -50%);
  border: 1px solid rgba(255,255,255,.18); border-radius: 7px; background: rgba(8,27,21,.91); color: #fff;
  box-shadow: 0 6px 15px rgba(5,20,15,.2); transition: border-color 160ms ease, opacity 160ms ease;
}
.seat[data-seat="0"] { left: 50%; top: 13%; }
.seat[data-seat="1"] { left: 73%; top: 15%; }
.seat[data-seat="2"] { left: 88%; top: 37%; }
.seat[data-seat="3"] { left: 82%; top: 68%; }
.seat[data-seat="4"] { left: 61%; top: 84%; }
.seat[data-seat="5"] { left: 39%; top: 84%; }
.seat[data-seat="6"] { left: 18%; top: 68%; }
.seat[data-seat="7"] { left: 12%; top: 37%; }
.seat[data-seat="8"] { left: 27%; top: 15%; }
.seat.empty { display: grid; place-items: center; border-style: dashed; background: rgba(7,44,32,.43); color: rgba(255,255,255,.42); box-shadow: none; }
.seat.is-me { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(208,168,79,.18), 0 7px 16px rgba(4,20,14,.25); }
.seat.offline { opacity: .55; }
.seat.winner { border-color: #68d4a7; }
.seat.loser { border-color: #d57077; }
.seat-head { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 7px; }
.seat-avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #d9e1dd; color: #1c2a25; font-size: 11px; font-weight: 900; }
.seat.is-banker .seat-avatar { background: var(--gold); }
.seat-name { min-width: 0; }
.seat-name strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.seat-name small { display: block; margin-top: 2px; color: #93a49c; font-size: 8px; }
.seat-credit { text-align: right; font-size: 10px; font-weight: 800; font-variant-numeric: tabular-nums; }
.seat-credit small { display: block; margin-top: 2px; color: #82938b; font-size: 7px; font-weight: 500; }
.seat-state { height: 19px; margin-top: 6px; display: flex; align-items: center; justify-content: space-between; gap: 5px; font-size: 8px; }
.bet-pill { padding: 3px 6px; border-radius: 8px; background: #f0d074; color: #18211d; font-weight: 900; }
.result-pill { font-weight: 900; }
.result-pill.positive { color: #70dbac; }
.result-pill.negative { color: #ef858b; }
.mini-hand { height: 38px; display: flex; align-items: flex-end; justify-content: center; padding-top: 2px; }
.mini-card {
  position: relative; width: 25px; height: 36px; flex: 0 0 25px; padding: 3px; border: 1px solid #cdd3d0;
  border-radius: 3px; background: var(--cream); color: #202725; box-shadow: 0 2px 4px rgba(0,0,0,.18); font-size: 8px; font-weight: 900;
  animation: deal-card 260ms ease both;
}
.mini-card + .mini-card { margin-left: -4px; }
.mini-card.red { color: var(--red); }
.mini-card i { position: absolute; right: 3px; bottom: 2px; font-size: 11px; font-style: normal; }
.mini-card.back { border-color: #e1d5bb; background-color: #8f2632; color: transparent; }
.mini-card.back::after { content: "牛"; position: absolute; inset: 3px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.55); color: #f6e7c5; font-size: 9px; }
.mini-card:nth-child(2) { animation-delay: 50ms; }
.mini-card:nth-child(3) { animation-delay: 100ms; }
.mini-card:nth-child(4) { animation-delay: 150ms; }
.mini-card:nth-child(5) { animation-delay: 200ms; }
@keyframes deal-card { from { opacity: 0; transform: translateY(-12px) scale(.88); } to { opacity: 1; transform: none; } }

/* 金花开牌后的三张牌需要在九人桌上保持点数与花色可辨。 */
.game-jinhua .seat.has-hand .mini-hand { height: 48px; }
.game-jinhua .seat.has-hand .mini-card { width: 31px; height: 45px; flex-basis: 31px; padding: 4px; font-size: 10px; }
.game-jinhua .seat.has-hand .mini-card + .mini-card { margin-left: -4px; }
.game-jinhua .seat.has-hand .mini-card i { right: 4px; bottom: 3px; font-size: 13px; }
.game-jinhua .seat.has-hand .mini-card.back::after { font-size: 11px; }

.action-dock {
  min-height: 88px; margin-top: 12px; padding: 14px 16px; display: grid; grid-template-columns: 205px minmax(0, 1fr) auto;
  align-items: center; gap: 16px; border: 1px solid #ced7d2; border-radius: 7px; background: var(--paper); box-shadow: 0 6px 18px rgba(28,43,36,.06);
}
.action-context span { display: block; color: var(--green); font-size: 9px; font-weight: 800; }
.action-context strong { display: block; margin-top: 3px; font-size: 13px; letter-spacing: 0; }
.action-context small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.bet-controls { min-width: 0; }
.chip-options { display: flex; justify-content: center; gap: 7px; }
.chip-button {
  width: 48px; height: 48px; flex: 0 0 48px; border-radius: 50%; border: 4px dashed rgba(255,255,255,.75);
  outline: 2px solid #b68634; background: #cf9e43; color: #1d241f; font-size: 10px; font-variant-numeric: tabular-nums;
}
.chip-button.active { background: var(--green); outline-color: var(--green); color: #fff; }
.host-controls { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.action-button.delay-button { min-width: 42px; width: 42px; padding: 0; font-size: 18px; }
.action-dock.is-jinhua-controls { grid-template-columns: 205px minmax(0, 1fr); grid-template-rows: auto auto; }
.action-dock.is-jinhua-controls .action-context { grid-column: 1; grid-row: 1 / span 2; }
.action-dock.is-jinhua-controls .bet-controls { grid-column: 2; grid-row: 1; justify-self: start; }
.action-dock.is-jinhua-controls .host-controls { grid-column: 2; grid-row: 2; justify-content: flex-start; flex-wrap: wrap; }
.compare-select { width: 142px; height: 38px; padding: 0 9px; border: 1px solid #cbd4d0; border-radius: 5px; background: #fff; color: var(--ink); font-size: 11px; }
.action-button { min-width: 112px; padding: 0 14px; background: #fff; border-color: #cbd4d0; }
.action-button.primary { background: var(--green); color: #fff; border-color: var(--green); }
.action-button.danger { color: var(--red); }
.waiting-state { justify-self: end; color: var(--muted); font-size: 10px; }

.lab-sidebar { min-width: 0; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--paper); }
.side-section { padding: 18px; border-bottom: 1px solid var(--line); }
.scoreboard-section { flex: 0 0 auto; }
.history-section { flex: 1 1 auto; min-height: 230px; }
.side-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.side-heading h2 { margin: 0; font-size: 13px; letter-spacing: 0; }
.side-heading p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.text-button { padding: 4px 0; border: 0; background: transparent; color: var(--green); cursor: pointer; font-size: 9px; font-weight: 800; }
.score-list { margin-top: 13px; display: grid; gap: 4px; }
.score-row { min-height: 38px; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 8px; border-bottom: 1px solid #eef1ef; }
.score-row:last-child { border-bottom: 0; }
.score-rank { color: #8a9690; font-size: 9px; }
.score-person { min-width: 0; }
.score-person strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.score-person small { color: var(--muted); font-size: 8px; }
.score-value { display: grid; justify-items: end; gap: 2px; text-align: right; font-size: 10px; font-weight: 900; font-variant-numeric: tabular-nums; }
.score-value strong { font: inherit; }
.score-value small { font-size: 8px; font-weight: 900; }
.score-value small.positive { color: #36ad79; }
.score-value small.negative { color: #da5c65; }
.history-list { max-height: 360px; margin-top: 12px; overflow-y: auto; }
.history-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid #edf1ef; }
.history-round { color: var(--muted); font-size: 8px; }
.history-main { min-width: 0; }
.history-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.history-main small { color: var(--muted); font-size: 8px; }
.history-delta { font-size: 9px; font-weight: 900; font-variant-numeric: tabular-nums; }
.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }
.side-empty { min-height: 130px; display: grid; place-items: center; color: #96a09b; font-size: 10px; }
.lab-footer { margin-top: auto; padding: 12px 18px; display: flex; justify-content: space-between; gap: 12px; color: #8b9690; font-size: 8px; }

.toast { position: fixed; left: 50%; bottom: 22px; z-index: 50; transform: translateX(-50%); max-width: min(420px, calc(100vw - 30px)); padding: 10px 14px; border-radius: 6px; background: #17201d; color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.25); font-size: 11px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 18px; background: rgba(8,13,11,.72); }
.admin-modal { width: min(420px, 100%); max-height: calc(100vh - 36px); overflow-y: auto; border: 1px solid #3b4641; border-radius: 8px; background: #171d1a; color: #fff; box-shadow: 0 20px 55px rgba(0,0,0,.38); }
.modal-header { height: 72px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #303936; }
.modal-header span { display: block; color: var(--gold); font-size: 8px; font-weight: 800; }
.modal-header h2 { margin: 4px 0 0; font-size: 16px; letter-spacing: 0; }
.modal-close { width: 32px; height: 32px; border: 1px solid #46514c; border-radius: 5px; background: transparent; color: #fff; cursor: pointer; font-size: 18px; }
.admin-login-view, .admin-control-view { padding: 20px 18px 18px; }
.admin-field { display: grid; gap: 7px; margin-bottom: 13px; }
.admin-field > span { color: #b4beb9; font-size: 10px; font-weight: 650; }
.admin-field input, .admin-field select { width: 100%; height: 40px; padding: 0 11px; border: 1px solid #45514b; border-radius: 5px; outline: none; background: #101512; color: #fff; font-size: 12px; }
.admin-field input:focus, .admin-field select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(208,168,79,.14); }
.admin-submit { width: 100%; }
.admin-status { min-height: 15px; margin: 10px 0 0; text-align: center; color: #84908a; font-size: 9px; }
.admin-status.error { color: #ef9299; }
.admin-account { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 8px; margin-bottom: 17px; padding-bottom: 14px; border-bottom: 1px solid #303936; }
.admin-account span { color: #84908a; font-size: 9px; }
.admin-account strong { font-size: 11px; }
.admin-account button { border: 0; background: transparent; color: var(--gold); cursor: pointer; font-size: 9px; }
.control-pending { margin: 2px 0 14px; padding: 10px; border-left: 3px solid var(--gold); background: #202824; color: #cbd3cf; font-size: 10px; }

.credit-body { padding: 18px; }
.credit-balance {
  min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 14px; border: 1px solid #4b4237; border-radius: 6px; background: #101512;
}
.credit-balance span { color: #a9b4ae; font-size: 10px; }
.credit-balance strong { color: #f4cf68; font-size: 24px; font-variant-numeric: tabular-nums; }
.credit-options { margin-top: 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.credit-options button {
  min-width: 0; min-height: 72px; display: grid; place-items: center; align-content: center; gap: 4px;
  border: 1px solid #b98238; border-radius: 6px; background: #6f3e29; color: #ffe7a2; cursor: pointer;
}
.credit-options button:hover { background: #875035; }
.credit-options button:disabled { opacity: .45; cursor: wait; }
.credit-options strong { font-size: 15px; }
.credit-options span { color: #d4b980; font-size: 9px; }
.credit-note { margin: 12px 0 0; text-align: center; color: #7f8b85; font-size: 9px; }

@media (max-width: 1180px) {
  .game-layout { grid-template-columns: 1fr; }
  .lab-sidebar { display: grid; grid-template-columns: 1fr 1fr; border-left: 0; border-top: 1px solid var(--line); }
  .side-section { border-right: 1px solid var(--line); }
  .lab-footer { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  .live-header { height: auto; min-height: 60px; padding: 8px 12px; grid-template-columns: minmax(145px, 1fr) auto auto; gap: 9px; }
  .room-cluster { grid-row: 2; grid-column: 1 / 3; }
  .round-cluster { grid-row: 2; grid-column: 3; justify-self: end; }
  .live-actions { grid-column: 3; grid-row: 1; }
  .game-layout { min-height: calc(100vh - 102px); }
  .table-column { padding: 10px; }
  .table-surface { height: auto; min-height: auto; padding: 68px 9px 12px; overflow: visible; }
  .table-surface::before { inset: 7px; }
  .table-stamp { left: 19px; top: 17px; }
  .table-center { left: 50%; top: 12px; transform: translateX(-50%); width: 175px; min-height: 46px; z-index: 6; }
  .table-center > span { font-size: 8px; }
  .table-center > strong { margin-top: 1px; font-size: 15px; }
  .table-center > small { display: none; }
  .countdown-ring { right: -10px; top: -8px; width: 32px; height: 32px; font-size: 10px; }
  .seat-map { position: relative; inset: auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .seat { position: relative; inset: auto !important; width: auto; height: 132px; padding: 7px; transform: none; }
  .seat.empty { min-width: 0; }
  .seat-head { grid-template-columns: 24px minmax(0, 1fr); gap: 5px; }
  .seat-avatar { width: 24px; height: 24px; font-size: 9px; }
  .seat-credit { grid-column: 1 / -1; display: flex; justify-content: space-between; margin-top: 1px; font-size: 8px; }
  .seat-credit small { margin: 0; }
  .seat-state { margin-top: 3px; }
  .mini-card { width: 21px; height: 32px; flex-basis: 21px; font-size: 7px; }
  .mini-card + .mini-card { margin-left: -5px; }
  .mini-card i { font-size: 9px; }
  .action-dock { grid-template-columns: 1fr; gap: 11px; padding: 13px; }
  .action-context { text-align: center; }
  .host-controls { justify-content: center; flex-wrap: wrap; }
  .waiting-state { justify-self: center; }
  .chip-options { overflow-x: auto; justify-content: flex-start; padding: 3px 2px; }
  .lab-sidebar { display: block; }
  .side-section { border-right: 0; }
  .history-list { max-height: 300px; }
}

@media (max-width: 430px) {
  .entry-header { padding: 0 16px; }
  .entry-main { padding: 26px 16px; }
  .entry-title h1 { font-size: 28px; }
  .rule-strip { grid-template-columns: 1fr 1fr; gap: 14px 0; }
  .rule-strip span:nth-child(2) { border-right: 0; }
  .mini-brand strong { font-size: 13px; }
  .live-brand strong { font-size: 12px; }
  .live-header { grid-template-columns: minmax(130px, 1fr) auto auto; }
  .live-actions { gap: 4px; }
  .live-actions .icon-button { width: 32px; height: 32px; }
  .room-code { height: 30px; }
  .seat-map { gap: 4px; }
  .seat { height: 126px; padding: 6px; }
  .seat-name strong { font-size: 9px; }
  .seat-name small { font-size: 7px; }
  .bet-pill { padding: 2px 4px; }
  .mini-card { width: 18px; height: 28px; flex-basis: 18px; font-size: 6px; }
  .mini-card + .mini-card { margin-left: -5px; }
  .mini-card i { font-size: 8px; }
  .action-button { min-width: 104px; }
}

/* Immersive live table */
.game-screen {
  position: fixed;
  inset: 0;
  height: 100svh;
  min-height: 620px;
  overflow: hidden;
  color: #fff;
  background-color: #170f1d;
  background-image:
    repeating-linear-gradient(135deg, rgba(255,255,255,.015) 0 1px, transparent 1px 5px),
    radial-gradient(ellipse at 50% 0%, #38243a 0%, #211426 48%, #130c18 100%);
}

.live-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 30;
  height: 154px;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
}

.room-hud {
  position: absolute;
  top: 18px;
  left: 24px;
  width: 210px;
  display: grid;
  gap: 7px;
  padding: 12px 14px;
  border-left: 3px solid #d7a94f;
  background: rgba(25,13,30,.78);
  box-shadow: 0 10px 30px rgba(0,0,0,.16);
  pointer-events: auto;
}

.room-cluster { justify-content: flex-start; gap: 7px; }
.room-label { color: #dac9aa; font-size: 11px; font-weight: 800; }
.room-code {
  height: 26px;
  padding: 0;
  gap: 7px;
  border: 0;
  background: transparent;
}
.room-code span { color: #fff6db; font-size: 20px; }
.room-code i { color: #c6aa73; font-size: 9px; }
.live-brand { gap: 7px; }
.live-brand .mini-mark {
  width: 25px;
  height: 25px;
  flex-basis: 25px;
  border-radius: 50%;
  border: 2px solid #f5d279;
  background: #7d3b27;
  color: #ffe8a8;
  font-size: 12px;
  box-shadow: inset 0 0 0 2px #b66b36;
}
.live-brand strong { font-size: 11px; }
.live-brand small { margin-top: 1px; color: #bfae9d; }
.round-cluster { justify-content: flex-start; gap: 7px; }
.phase-badge {
  padding: 4px 7px;
  border: 1px solid rgba(241,202,107,.45);
  background: rgba(123,64,40,.78);
  color: #ffe5a1;
}
.round-cluster strong { color: #fff; font-size: 11px; }
.round-cluster small { color: #c4b8b0; font-size: 9px; }

.live-actions {
  position: absolute;
  top: 20px;
  right: 24px;
  display: flex;
  gap: 10px;
  pointer-events: auto;
}
.live-actions .icon-button {
  width: 46px;
  height: 46px;
  border: 3px solid #d7a94f;
  border-radius: 50%;
  background: rgba(42,22,50,.9);
  color: #f8d976;
  box-shadow: inset 0 0 0 2px rgba(255,232,151,.18), 0 6px 15px rgba(0,0,0,.24);
  font-size: 18px;
}
.live-actions .icon-button:hover { background: #55305b; }
.live-actions .icon-button:disabled { opacity: .38; cursor: not-allowed; }
.panel-button { font-size: 20px !important; }
.cart-button { font-size: 17px !important; }

.game-layout { min-height: 100%; display: block; }
.table-column {
  position: absolute;
  inset: 0;
  min-width: 0;
  padding: 0;
  background: transparent;
}
.table-surface {
  position: absolute;
  inset: 14px 1.3vw 12px;
  height: auto;
  min-height: 0;
  overflow: hidden;
  border: 9px solid #7b4429;
  border-radius: 44px 44px 12px 12px;
  outline: 3px solid #d1a466;
  outline-offset: -5px;
  background-color: #0b744e;
  background-image:
    radial-gradient(ellipse at 50% 48%, transparent 0 27%, rgba(92,211,160,.18) 27.2% 27.5%, transparent 27.7% 42%, rgba(92,211,160,.14) 42.2% 42.5%, transparent 42.7%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, rgba(0,0,0,.018) 1px 3px),
    radial-gradient(ellipse at 50% 40%, #13875d 0%, #0a704c 56%, #07553b 100%);
  box-shadow:
    inset 0 0 0 5px #42251c,
    inset 0 0 70px rgba(0,0,0,.34),
    0 18px 45px rgba(0,0,0,.38);
}
.table-surface::before {
  content: "";
  position: absolute;
  z-index: 2;
  left: -8%;
  top: -35%;
  width: 116%;
  height: 55%;
  border: 20px solid #9b6038;
  border-radius: 50%;
  background: transparent;
  box-shadow:
    0 0 0 4px #3d2018,
    0 0 0 8px #d1a466,
    inset 0 0 0 4px #4a281c,
    inset 0 -7px 10px rgba(255,216,143,.18),
    0 12px 20px rgba(25,10,13,.32);
  pointer-events: none;
}
.table-surface::after {
  content: "";
  position: absolute;
  inset: 22% 11% 11%;
  z-index: 1;
  border: 1px solid rgba(86,207,160,.22);
  border-radius: 50%;
  background-image: repeating-conic-gradient(from 0deg at 50% 53%, rgba(69,210,159,.18) 0 1deg, transparent 1deg 30deg);
  opacity: .62;
  pointer-events: none;
}
.table-stamp {
  left: 50%;
  top: 51%;
  z-index: 2;
  transform: translate(-50%, -50%);
  color: rgba(1,50,34,.38);
  text-align: center;
}
.table-stamp span { font-size: 14px; }
.table-stamp small {
  display: block;
  margin-top: 6px;
  color: rgba(225,244,235,.72);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0,0,0,.36);
}

.table-center {
  left: 50%;
  top: 44%;
  width: 280px;
  min-height: 92px;
  z-index: 5;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,.45);
}
.table-center > span { color: #c8ded4; font-size: 12px; }
.table-center > strong { margin-top: 4px; color: #ffe5a0; font-size: 30px; }
.table-center > small {
  margin-top: 5px;
  padding: 4px 14px;
  border-radius: 3px;
  background: rgba(3,50,34,.46);
  color: #d5e5de;
  font-size: 10px;
}
.countdown-ring {
  right: 2px;
  top: -3px;
  width: 46px;
  height: 46px;
  border-color: #ffd66f;
  background: #3a1d43;
  color: #ffe6a6;
  box-shadow: 0 0 0 3px rgba(100,46,107,.65);
}

.seat-map { z-index: 6; }
.seat {
  width: clamp(128px, 11.7vw, 170px);
  height: 116px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  filter: drop-shadow(0 5px 6px rgba(0,0,0,.24));
}
.seat[data-position="0"] { left: 50%; top: 86%; }
.seat[data-position="1"] { left: 26%; top: 81%; }
.seat[data-position="2"] { left: 9%; top: 62%; }
.seat[data-position="3"] { left: 10%; top: 36%; }
.seat[data-position="4"] { left: 30%; top: 19%; }
.seat[data-position="5"] { left: 50%; top: 15%; }
.seat[data-position="6"] { left: 70%; top: 19%; }
.seat[data-position="7"] { left: 90%; top: 36%; }
.seat[data-position="8"] { left: 91%; top: 62%; }
.seat-head {
  min-height: 42px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 7px;
  padding: 5px 7px;
  border: 1px solid rgba(237,205,119,.34);
  border-bottom-color: rgba(241,196,79,.76);
  border-radius: 5px;
  background: rgba(4,53,38,.82);
  box-shadow: inset 0 0 18px rgba(0,0,0,.2);
}
.seat-avatar {
  width: 32px;
  height: 32px;
  border: 2px solid #e5c16d;
  border-radius: 5px;
  background: #e9dfc8;
  color: #3f281f;
}
.seat.is-banker .seat-avatar { background: #b74f31; color: #ffe9ad; }
.seat.is-banker .seat-avatar::after {
  content: "庄";
  position: absolute;
  transform: translate(17px, 17px);
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 2px solid #ffe49a;
  border-radius: 50%;
  background: #a72f28;
  color: #fff0b3;
  font-size: 8px;
}
.seat-name strong { color: #fff; font-size: 11px; }
.seat-name small { color: #9fd5bd; }
.seat-credit { color: #f4cf5c; font-size: 11px; }
.seat-credit small { color: #cfbd90; }
.seat-state {
  height: 22px;
  margin-top: 1px;
  padding: 0 5px;
  color: #9dd8ff;
  font-size: 10px;
  font-weight: 900;
  text-shadow: 0 2px 2px #053421;
}
.bet-pill {
  position: relative;
  padding: 3px 7px 3px 19px;
  border: 1px solid #fff0a7;
  border-radius: 12px;
  background: #c99121;
  color: #fff5b0;
  box-shadow: inset 0 0 0 2px #edbd49;
}
.bet-pill::before {
  content: "◆";
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  color: #fff2a2;
  font-size: 9px;
}
.result-pill.positive { color: #8ff2bd; }
.result-pill.negative { color: #ff9fa0; }
.mini-hand { height: 54px; padding-top: 0; align-items: flex-start; }
.mini-card {
  width: 32px;
  height: 50px;
  flex-basis: 32px;
  padding: 0;
  border-color: #d8d2c8;
  border-radius: 3px;
  background: #fffdf6;
  color: #171b1a;
  box-shadow: 0 3px 6px rgba(0,0,0,.36);
  font-size: 12px;
}
.mini-card + .mini-card { margin-left: -8px; }
.mini-card.rank-only {
  display: grid;
  place-items: center;
  background: #fffdf6;
  color: #171b1a;
  font-weight: 800;
  line-height: 1;
}
.mini-card.rank-only b { font-size: 1.35em; }
.mini-card.simple-card {
  padding: 4px;
  background: #fffdf6;
  color: #171b1a;
  font-weight: 800;
  line-height: 1;
}
.mini-card.simple-card b { font-size: 1.15em; }
.mini-card-face,
.focus-card-face {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
}
.mini-card-face { border-radius: 2px; }
.mini-card.back {
  border-color: #f1d894;
  background-color: #7a2031;
  background-image:
    linear-gradient(45deg, transparent 38%, rgba(246,211,125,.36) 40% 48%, transparent 50%),
    linear-gradient(-45deg, transparent 38%, rgba(246,211,125,.28) 40% 48%, transparent 50%);
  background-size: 10px 10px;
}
.mini-card.back::after { inset: 3px; border-color: #f4dca1; color: #fff0bc; font-size: 10px; }
.mini-card.peel-card { overflow: hidden; isolation: isolate; }
.peel-card .card-back {
  position: absolute;
  inset: -1px;
  z-index: 2;
  border: 1px solid #f1d894;
  border-radius: 3px;
  background-color: #7a2031;
  background-image:
    linear-gradient(45deg, transparent 38%, rgba(246,211,125,.42) 40% 48%, transparent 50%),
    linear-gradient(-45deg, transparent 38%, rgba(246,211,125,.32) 40% 48%, transparent 50%);
  background-size: 10px 10px;
  box-shadow: 0 5px 12px rgba(31,11,15,.38);
  color: #fff0bc;
  transform: translate3d(var(--peel-x, 0%), var(--peel-y, 0%), 0) rotate(var(--peel-rotate, 0deg));
  transform-origin: center;
  transition: transform 300ms cubic-bezier(.22,.78,.16,1), box-shadow 220ms ease, opacity 180ms ease;
  will-change: transform;
}
.peel-card .card-back::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(255,232,171,.72);
  border-radius: 1px;
}
.peel-card .card-back b {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
}
.peel-card.is-peelable {
  cursor: grab;
  touch-action: none;
  outline: 2px solid rgba(255,221,126,.7);
  outline-offset: 1px;
}
.peel-card.is-dragging { cursor: grabbing; }
.peel-card.is-dragging .card-back { transition: none; box-shadow: 0 15px 28px rgba(24,8,13,.46); }
.peel-card.is-rebounding .card-back { transition-timing-function: cubic-bezier(.18,1.3,.3,1); }
.peel-card.is-completing .card-back { transition-timing-function: cubic-bezier(.17,.84,.28,1); }
.peel-card.is-open .card-back { pointer-events: none; }
.peel-focus {
  position: fixed;
  inset: 0;
  z-index: 22;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px 18px 104px;
  pointer-events: none;
  background: transparent;
  transition: background-color 180ms ease, backdrop-filter 180ms ease;
}
.peel-focus.is-expanded {
  align-items: center;
  padding: 18px;
  background: rgba(4,18,13,.38);
  backdrop-filter: blur(2px);
}
.peel-stage {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  max-width: calc(100vw - 36px);
  padding: 10px 12px;
  border: 1px solid rgba(255,225,151,.48);
  border-radius: 7px;
  background: rgba(21,13,24,.9);
  box-shadow: 0 12px 32px rgba(0,0,0,.38);
  pointer-events: none;
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.peel-focus.is-expanded .peel-stage {
  padding: 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
.peel-context-hand {
  display: flex;
  align-items: flex-end;
  pointer-events: none;
}
.peel-focus.is-expanded .peel-context-hand { display: none; }
.peek-context-card {
  position: relative;
  width: clamp(50px, 14vw, 66px);
  aspect-ratio: 5 / 7;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid #d6d1c6;
  border-radius: 5px;
  background: #fffef9;
  color: #171b1a;
  box-shadow: 0 4px 10px rgba(0,0,0,.3);
}
.peek-context-card + .peek-context-card { margin-left: -12px; }
.peek-context-card.rank-only {
  display: grid;
  place-items: center;
  background: #fffdf6;
  color: #171b1a;
  font-weight: 800;
}
.peek-context-card.rank-only b { font-size: 1.3em; }
.peek-context-card.simple-card {
  padding: 7px;
  background: #fffdf6;
  color: #171b1a;
  font-weight: 800;
}
.peek-context-card.simple-card.red { color: #b6282f; }
.peek-context-card.simple-card b { display: block; font-size: 1.25em; line-height: 1; }
.peek-context-card.simple-card i {
  position: absolute;
  right: 7px;
  bottom: 5px;
  font-size: 1.05em;
  font-style: normal;
}
.peek-context-card > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: fill;
  opacity: .14;
  filter: saturate(.45) contrast(.8);
}
.peek-card-corner {
  position: absolute;
  left: 6px;
  top: 5px;
  z-index: 2;
  display: grid;
  justify-items: center;
  color: #151817;
  font-family: Georgia, "Times New Roman", serif;
  line-height: .9;
}
.peek-context-card.red .peek-card-corner { color: #b6282f; }
.peek-card-corner b { font-size: 19px; }
.peek-card-corner i { margin-top: 4px; font-size: 15px; font-style: normal; }
.peel-display-button {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 2;
  min-width: 66px;
  height: 40px;
  padding: 0 13px;
  border: 1px solid #f3ce6d;
  border-radius: 6px;
  background: #8a512e;
  color: #fff1bd;
  box-shadow: 0 5px 14px rgba(0,0,0,.34), inset 0 0 0 2px rgba(255,220,118,.15);
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  pointer-events: auto;
}
.focus-card {
  position: relative;
  width: clamp(220px, 21vw, 300px);
  aspect-ratio: 5 / 7;
  display: block;
  overflow: visible;
  border: 2px solid #d6d1c6;
  border-radius: 10px;
  background: #fffef9;
  color: #171b1a;
  box-shadow: 0 18px 42px rgba(0,0,0,.46), 0 0 0 3px rgba(255,231,165,.2);
  font-family: Georgia, "Times New Roman", serif;
  user-select: none;
  pointer-events: auto;
}
.peel-focus:not(.is-expanded) .focus-card {
  width: clamp(70px, 19vw, 92px);
  border-radius: 6px;
  box-shadow: 0 7px 18px rgba(0,0,0,.4), 0 0 0 2px rgba(255,231,165,.16);
}
.peel-focus:not(.is-expanded) .focus-card-face { border-radius: 4px; }
.peel-focus:not(.is-expanded) .focus-card .card-back { border-radius: 6px; background-size: 12px 12px; }
.peel-focus:not(.is-expanded) .focus-card .card-back::before { inset: 5px; border-width: 1px; border-radius: 3px; }
.peel-focus:not(.is-expanded) .focus-card .card-back b { font-size: 18px; }
.focus-card-face { border-radius: 8px; }
.focus-card .card-back { border-radius: 10px; background-size: 18px 18px; }
.focus-card .card-back::before { inset: 8px; border-width: 2px; border-radius: 5px; }
.focus-card .card-back b { font-size: 34px; }
.focus-card.is-peelable { outline-width: 3px; outline-offset: 3px; }
.seat.is-me {
  width: clamp(172px, 15vw, 214px);
  height: 136px;
  z-index: 9;
  box-shadow: none;
  filter: drop-shadow(0 8px 9px rgba(0,0,0,.34));
}
.seat.is-me .seat-head { border-color: #ffe18a; background: rgba(34,57,44,.92); }
.seat.is-me .mini-hand { height: 62px; }
.seat.is-me .mini-card { width: 40px; height: 60px; flex-basis: 40px; font-size: 14px; }
.seat.is-me .mini-card + .mini-card { margin-left: -10px; }
.seat.is-me .mini-card i { font-size: 19px; }
.seat.winner .seat-head { border-color: #8ff0ba; box-shadow: 0 0 18px rgba(82,227,151,.35); }
.seat.loser .seat-head { border-color: rgba(255,139,142,.65); }
.seat.empty {
  width: 108px;
  height: 46px;
  min-width: 0;
  padding: 0;
  border: 1px dashed rgba(255,225,151,.33);
  border-radius: 6px;
  background: rgba(3,55,38,.36);
  color: rgba(225,241,233,.52);
  font-size: 9px;
  filter: none;
}
.seat.empty.banker-seat { border-style: solid; border-color: rgba(255,211,105,.72); background: rgba(92,49,27,.46); color: #ffe6a1; }
.seat-join {
  width: 100%; height: 100%; display: grid; place-items: center; align-content: center; gap: 2px;
  border: 0; border-radius: inherit; background: transparent; color: inherit; cursor: pointer;
}
.seat-join strong { font-size: 10px; }
.seat-join small { color: #e9c873; font-size: 8px; }
.seat-join:hover { background: rgba(255,229,151,.12); color: #fff3ca; }

.action-dock {
  position: absolute;
  left: 50%;
  top: 59%;
  z-index: 12;
  width: min(680px, 56vw);
  min-height: 80px;
  margin: 0;
  padding: 11px 14px;
  transform: translate(-50%, -50%);
  grid-template-columns: 180px minmax(0, 1fr) auto;
  gap: 12px;
  border: 1px solid rgba(244,204,103,.56);
  border-radius: 6px;
  background: rgba(25,14,29,.79);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.24), inset 0 0 24px rgba(117,62,46,.2);
  backdrop-filter: blur(7px);
}
.action-context span { color: #e7bf62; }
.action-context strong { color: #fff; }
.action-context small { color: #beaeb9; }
.chip-options { gap: 8px; }
.chip-button {
  width: 50px;
  height: 50px;
  flex-basis: 50px;
  border: 3px dashed rgba(255,244,184,.82);
  outline: 2px solid #9f5c21;
  background: #d99d25;
  color: #422419;
  box-shadow: inset 0 0 0 3px #f2c34c, 0 4px 7px rgba(0,0,0,.25);
}
.chip-button.active { outline-color: #ffe489; background: #a4382e; color: #fff5bd; }
.action-button {
  min-width: 112px;
  border-color: #c99336;
  background: #7d482d;
  color: #ffe9b1;
}
.action-button.primary {
  border-color: #ffd66a;
  background: #df9200;
  color: #fff;
  box-shadow: inset 0 0 0 2px rgba(255,221,116,.35), 0 4px 0 #80500a;
}
.action-button.primary:hover { background: #f0a518; }
.waiting-state { color: #d6c7ce; }

.lab-sidebar {
  position: fixed;
  z-index: 45;
  top: 82px;
  right: 18px;
  bottom: 18px;
  width: 310px;
  min-width: 0;
  display: flex;
  border: 1px solid #b77b3c;
  border-radius: 7px;
  background: rgba(24,15,28,.96);
  color: #fff;
  box-shadow: 0 18px 45px rgba(0,0,0,.48), inset 0 0 0 2px rgba(237,190,97,.08);
  backdrop-filter: blur(12px);
}
.sidebar-header {
  min-height: 64px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(226,180,90,.25);
}
.sidebar-header span { display: block; color: #b78d53; font-size: 8px; font-weight: 800; }
.sidebar-header strong { display: block; margin-top: 3px; font-size: 14px; }
.panel-close {
  width: 32px;
  height: 32px;
  border: 1px solid #72543c;
  border-radius: 50%;
  background: transparent;
  color: #eed59c;
  cursor: pointer;
  font-size: 18px;
}
.side-section { padding: 15px; border-color: rgba(235,203,132,.16); }
.side-heading h2 { color: #fff; }
.side-heading p, .score-person small, .history-main small, .history-round { color: #a897a5; }
.score-row, .history-row { border-color: rgba(255,255,255,.07); }
.score-value { color: #f4ce69; }
.text-button { color: #f4c661; }
.history-list { max-height: none; }
.side-empty { color: #827683; }
.lab-footer { color: #887d88; }

@media (max-width: 1100px) and (min-width: 901px) {
  .room-hud { width: 190px; }
  .round-cluster small { display: none; }
  .seat { width: 124px; }
  .seat.is-me { width: 172px; }
  .seat[data-position="1"] { left: 25%; }
  .seat[data-position="8"] { left: 92%; }
  .action-dock { width: 610px; }
}

@media (max-width: 900px) {
  .game-screen {
    position: relative;
    height: auto;
    min-height: 100svh;
    overflow: auto;
  }
  .live-header {
    position: relative;
    height: 112px;
    min-height: 112px;
    padding: 0;
    background: #1c1121;
    border-bottom: 1px solid #70462f;
  }
  .room-hud {
    top: 9px;
    left: 10px;
    width: calc(100% - 218px);
    min-width: 145px;
    gap: 4px;
    padding: 7px 9px;
  }
  .room-code span { font-size: 16px; }
  .live-brand .mini-mark { display: none; }
  .live-brand strong { font-size: 10px; }
  .round-cluster { flex-wrap: wrap; }
  .round-cluster small { display: none; }
  .live-actions {
    top: 10px;
    right: 10px;
    width: 194px;
    display: grid;
    grid-template-columns: repeat(3, 34px);
    justify-content: end;
    gap: 5px;
  }
  .live-actions .icon-button { width: 34px; height: 34px; border-width: 2px; font-size: 13px; }
  .game-layout { min-height: 0; }
  .table-column { position: relative; inset: auto; padding: 8px; }
  .table-surface {
    position: relative;
    inset: auto;
    height: auto;
    min-height: 582px;
    padding: 92px 7px 112px;
    overflow: hidden;
    border-width: 7px;
    border-radius: 34px 34px 8px 8px;
  }
  .table-surface::before { top: -17%; height: 26%; border-width: 11px; }
  .table-surface::after { inset: 17% 5% 8%; }
  .table-stamp { top: 54%; }
  .table-stamp span { font-size: 10px; }
  .table-stamp small { margin-top: 3px; font-size: 8px; }
  .table-center {
    left: 50%;
    top: 16px;
    width: 185px;
    min-height: 65px;
    transform: translateX(-50%);
  }
  .table-center > span { font-size: 8px; }
  .table-center > strong { font-size: 18px; }
  .table-center > small { display: block; max-width: 175px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 8px; }
  .countdown-ring { right: -3px; top: -1px; width: 34px; height: 34px; font-size: 9px; }
  .seat-map {
    position: relative;
    inset: auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 5px;
  }
  .seat,
  .seat.is-me,
  .seat.empty {
    position: relative;
    inset: auto !important;
    width: auto;
    min-width: 0;
    height: 116px;
    padding: 0;
    transform: none;
  }
  .seat[data-position="4"] { order: 1; }
  .seat[data-position="5"] { order: 2; }
  .seat[data-position="6"] { order: 3; }
  .seat[data-position="3"] { order: 4; }
  .seat[data-position="7"] { order: 5; }
  .seat[data-position="2"] { order: 6; }
  .seat[data-position="1"] { order: 7; }
  .seat[data-position="0"] { order: 8; }
  .seat[data-position="8"] { order: 9; }
  .seat.empty { display: grid; place-items: center; border-radius: 5px; }
  .seat-head { min-height: 38px; grid-template-columns: 26px minmax(0, 1fr); padding: 4px; gap: 4px; }
  .seat-avatar { width: 25px; height: 25px; font-size: 9px; }
  .seat.is-banker .seat-avatar::after { transform: translate(13px, 13px); width: 15px; height: 15px; font-size: 7px; }
  .seat-name strong { font-size: 9px; }
  .seat-credit { grid-column: 1 / -1; display: flex; justify-content: space-between; font-size: 8px; }
  .seat-credit small { margin: 0; }
  .seat-state { height: 18px; margin: 0; padding: 0 3px; font-size: 8px; }
  .bet-pill { padding: 2px 4px 2px 15px; }
  .mini-hand, .seat.is-me .mini-hand { height: 46px; }
  .mini-card,
  .seat.is-me .mini-card { width: 26px; height: 42px; flex-basis: 26px; font-size: 9px; }
  .mini-card + .mini-card,
  .seat.is-me .mini-card + .mini-card { margin-left: -8px; }
  .mini-card i,
  .seat.is-me .mini-card i { font-size: 12px; }
  .action-dock {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    min-height: 0;
    margin: 8px 0 0;
    padding: 12px;
    transform: none;
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .action-context { text-align: center; }
  .host-controls { justify-content: center; flex-wrap: wrap; }
  .waiting-state { justify-self: center; }
  .chip-options { justify-content: flex-start; overflow-x: auto; padding: 3px; }
  .lab-sidebar {
    top: 8px;
    right: 8px;
    bottom: 8px;
    width: min(340px, calc(100vw - 16px));
  }
}

@media (max-width: 480px) {
  .room-hud { width: calc(100% - 178px); }
  .live-actions { width: 120px; grid-template-columns: repeat(3, 34px); }
  .focus-card { width: min(62vw, 230px); }
  .table-surface { min-height: 548px; padding-inline: 4px; }
  .seat-map { gap: 6px 3px; }
  .seat,
  .seat.is-me,
  .seat.empty { height: 108px; }
  .seat-head { grid-template-columns: 23px minmax(0, 1fr); }
  .seat-avatar { width: 23px; height: 23px; }
  .seat-credit small { display: none; }
  .mini-card,
  .seat.is-me .mini-card { width: 22px; height: 36px; flex-basis: 22px; font-size: 8px; }
  .mini-card i,
  .seat.is-me .mini-card i { font-size: 10px; }
  .chip-button { width: 46px; height: 46px; flex-basis: 46px; }
  .peel-focus { padding: 10px 8px 84px; }
  .peel-focus.is-expanded { padding: 12px; }
  .peel-stage { gap: 5px; max-width: calc(100vw - 16px); padding: 8px; }
  .peek-context-card + .peek-context-card { margin-left: -14px; }
  .peek-card-corner { left: 5px; top: 5px; }
  .peek-card-corner b { font-size: 18px; }
  .peek-card-corner i { font-size: 14px; }
  .peel-display-button {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    min-width: 62px;
    height: 38px;
  }
}

@media (max-width: 700px) {
  .table-surface {
    height: clamp(600px, calc(100svh - 170px), 650px);
    min-height: 600px;
    padding: 0;
  }
  .table-center {
    left: 50%;
    top: 41%;
    width: 142px;
    min-height: 72px;
    transform: translate(-50%, -50%);
  }
  .table-stamp {
    left: 50%;
    top: 52%;
    width: min(190px, 52vw);
    transform: translateX(-50%);
    text-align: center;
  }
  .seat-map {
    position: absolute;
    inset: 0;
    display: block;
  }
  .seat,
  .seat.is-me,
  .seat.empty {
    position: absolute;
    width: clamp(76px, 22.5vw, 88px);
    min-width: 0;
    height: 96px;
    padding: 0;
    transform: translate(-50%, -50%);
  }
  .seat.is-me {
    width: clamp(118px, 34vw, 136px);
    height: 110px;
  }
  .seat[data-position="0"] { left: 50% !important; top: 85% !important; right: auto !important; bottom: auto !important; }
  .seat[data-position="1"] { left: 13% !important; top: 72% !important; right: auto !important; bottom: auto !important; }
  .seat[data-position="2"] { left: 13% !important; top: 50% !important; right: auto !important; bottom: auto !important; }
  .seat[data-position="3"] { left: 18% !important; top: 28% !important; right: auto !important; bottom: auto !important; }
  .seat[data-position="4"] { left: 36% !important; top: 12% !important; right: auto !important; bottom: auto !important; }
  .seat[data-position="5"] { left: 64% !important; top: 12% !important; right: auto !important; bottom: auto !important; }
  .seat[data-position="6"] { left: 82% !important; top: 28% !important; right: auto !important; bottom: auto !important; }
  .seat[data-position="7"] { left: 87% !important; top: 50% !important; right: auto !important; bottom: auto !important; }
  .seat[data-position="8"] { left: 87% !important; top: 72% !important; right: auto !important; bottom: auto !important; }
  .seat.empty {
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  .seat.empty .seat-join,
  .seat.empty > span {
    width: 58px;
    height: 58px;
    justify-self: center;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 2px;
    border: 1px dashed rgba(255,225,151,.48);
    border-radius: 50%;
    background: rgba(3,55,38,.54);
  }
  .seat.empty.banker-seat .seat-join,
  .seat.empty.banker-seat > span {
    border-style: solid;
    border-color: rgba(255,211,105,.78);
    background: rgba(92,49,27,.58);
  }
}

.final-backdrop {
  z-index: 80;
  background: rgba(9, 6, 11, .88);
}
.final-modal {
  width: min(760px, 100%);
  max-height: calc(100svh - 36px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #b77b3c;
  border-radius: 8px;
  background: #171119;
  color: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .58), inset 0 0 0 2px rgba(237, 190, 97, .08);
}
.final-header {
  min-height: 92px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid rgba(226, 180, 90, .25);
}
.final-header span { color: #b78d53; font-size: 9px; font-weight: 800; }
.final-header h2 { margin: 5px 0 0; font-size: 22px; letter-spacing: 0; }
.final-round { display: flex; align-items: baseline; gap: 5px; color: #f4ce69; }
.final-round strong { font-size: 34px; font-variant-numeric: tabular-nums; }
.final-round small { color: #a897a5; font-size: 10px; }
.final-body { min-height: 0; padding: 18px 22px 8px; overflow-y: auto; }
.final-summary { margin: 0 0 12px; color: #a897a5; font-size: 10px; }
.final-result-head,
.final-result-row {
  display: grid;
  grid-template-columns: 42px minmax(120px, 1.4fr) repeat(3, minmax(92px, 1fr));
  align-items: center;
  gap: 10px;
}
.final-result-head { min-height: 30px; color: #8f818f; font-size: 9px; }
.final-result-head span:nth-child(n + 3) { text-align: right; }
.final-result-row { min-height: 54px; border-top: 1px solid rgba(255, 255, 255, .08); }
.final-result-row.is-viewer { background: rgba(244, 206, 105, .06); }
.final-rank { color: #9b8d9a; font-size: 11px; text-align: center; }
.final-player-name { min-width: 0; display: flex; align-items: center; gap: 7px; }
.final-player-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.final-player-name small { padding: 2px 4px; border: 1px solid #70583b; border-radius: 3px; color: #e8c979; font-size: 7px; }
.final-metric { text-align: right; font-variant-numeric: tabular-nums; }
.final-metric::before { display: none; }
.final-metric strong { font-size: 12px; }
.final-footer {
  min-height: 78px;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid rgba(226, 180, 90, .2);
}
.final-footer p { margin: 0; color: #8f818f; font-size: 9px; }
.final-footer .action-button { flex: 0 0 auto; }

@media (max-width: 600px) {
  .final-backdrop { padding: 10px; }
  .final-modal { max-height: calc(100svh - 20px); }
  .final-header { min-height: 76px; padding: 13px 14px; }
  .final-header h2 { font-size: 17px; }
  .final-round strong { font-size: 27px; }
  .final-body { padding: 12px 14px 6px; }
  .final-result-head { display: none; }
  .final-result-row {
    min-height: 76px;
    padding: 9px 0;
    grid-template-columns: 28px repeat(3, minmax(0, 1fr));
    gap: 6px 8px;
  }
  .final-rank { grid-row: 1 / 3; }
  .final-player-name { grid-column: 2 / -1; }
  .final-metric { text-align: left; }
  .final-metric::before { content: attr(data-label); display: block; margin-bottom: 3px; color: #817681; font-size: 7px; }
  .final-metric strong { font-size: 10px; }
  .final-footer { min-height: 68px; padding: 10px 14px; }
  .final-footer p { max-width: 170px; line-height: 1.5; }
  .final-footer .action-button { min-width: 104px; }
}

/* Give every active hand equal visual weight once a round is settled. */
.table-surface.phase-settled .seat.has-hand,
.table-surface.phase-settled .seat.has-hand.is-me {
  width: clamp(184px, 14vw, 220px);
  height: 155px;
  z-index: 11;
}
.table-surface.phase-settled .seat.has-hand .seat-state {
  height: 27px;
  padding: 0 7px;
  color: #fff0a9;
  font-size: 12px;
  text-shadow: 0 2px 4px rgba(0,0,0,.72);
}
.table-surface.phase-settled .seat.has-hand .seat-state > span:first-child {
  font-weight: 900;
}
.table-surface.phase-settled .seat.has-hand .mini-hand,
.table-surface.phase-settled .seat.has-hand.is-me .mini-hand {
  height: 82px;
  align-items: flex-start;
}
.table-surface.phase-settled .seat.has-hand .mini-card,
.table-surface.phase-settled .seat.has-hand.is-me .mini-card {
  width: 50px;
  height: 75px;
  flex-basis: 50px;
  border-radius: 4px;
  box-shadow: 0 5px 11px rgba(0,0,0,.42);
}
.table-surface.phase-settled .seat.has-hand .mini-card + .mini-card,
.table-surface.phase-settled .seat.has-hand.is-me .mini-card + .mini-card {
  margin-left: -12px;
}
.table-surface.phase-settled .seat.has-hand .mini-card-face { border-radius: 3px; }

@media (max-width: 1100px) and (min-width: 701px) {
  .table-surface.phase-settled .seat.has-hand,
  .table-surface.phase-settled .seat.has-hand.is-me {
    width: 176px;
    height: 145px;
  }
  .table-surface.phase-settled .seat.has-hand .mini-hand,
  .table-surface.phase-settled .seat.has-hand.is-me .mini-hand { height: 72px; }
  .table-surface.phase-settled .seat.has-hand .mini-card,
  .table-surface.phase-settled .seat.has-hand.is-me .mini-card {
    width: 42px;
    height: 63px;
    flex-basis: 42px;
  }
  .table-surface.phase-settled .seat.has-hand .mini-card + .mini-card,
  .table-surface.phase-settled .seat.has-hand.is-me .mini-card + .mini-card { margin-left: -10px; }
}

@media (max-width: 700px) {
  .table-surface.phase-settled .seat.has-hand {
    width: clamp(76px, 22.5vw, 88px);
    height: 116px;
  }
  .table-surface.phase-settled .seat.has-hand.is-me {
    width: clamp(118px, 34vw, 136px);
    height: 126px;
  }
  .table-surface.phase-settled .seat.has-hand .seat-state {
    height: 22px;
    padding: 0 3px;
    font-size: 10px;
  }
  .table-surface.phase-settled .seat.has-hand .mini-hand {
    height: 50px;
    overflow: visible;
  }
  .table-surface.phase-settled .seat.has-hand .mini-card {
    width: 28px;
    height: 44px;
    flex-basis: 28px;
  }
  .table-surface.phase-settled .seat.has-hand .mini-card + .mini-card { margin-left: -13px; }
  .table-surface.phase-settled .seat.has-hand.is-me .mini-hand { height: 64px; }
  .table-surface.phase-settled .seat.has-hand.is-me .mini-card {
    width: 38px;
    height: 58px;
    flex-basis: 38px;
  }
  .table-surface.phase-settled .seat.has-hand.is-me .mini-card + .mini-card { margin-left: -14px; }
  .table-surface.phase-settled .seat.has-hand[data-position="3"],
  .table-surface.phase-settled .seat.has-hand[data-position="6"] { top: 31% !important; }
}

/* Table visual refinement: calmer felt, clearer player states, and stronger mobile contrast. */
.game-screen {
  background: #101614;
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.012) 0 1px, transparent 1px 7px);
}

.table-surface {
  border: 7px solid #1d2a27;
  border-radius: 30px 30px 12px 12px;
  outline: 1px solid rgba(223,187,101,.88);
  outline-offset: -9px;
  background-color: #0b704f;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,.012) 0 1px, transparent 1px 4px),
    radial-gradient(ellipse at 50% 48%, #138663 0%, #0b6b4d 54%, #07513b 100%);
  box-shadow: inset 0 0 0 5px #0a3f31, inset 0 0 60px rgba(0,0,0,.24), 0 18px 40px rgba(0,0,0,.32);
}

.table-surface::before {
  left: 5%;
  top: 6%;
  width: 90%;
  height: 84%;
  border: 1px solid rgba(222,239,224,.24);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(4,46,34,.15), inset 0 0 28px rgba(2,37,27,.12);
}

.table-surface::after {
  inset: 18% 12% 13%;
  border-color: rgba(223,194,113,.22);
  background-image: repeating-conic-gradient(from 0deg at 50% 53%, rgba(215,238,225,.13) 0 1deg, transparent 1deg 30deg);
  opacity: .42;
}

.room-hud {
  border: 1px solid rgba(223,187,101,.48);
  border-left: 3px solid #dfbb65;
  border-radius: 8px;
  background: rgba(12,24,21,.92);
  box-shadow: 0 10px 24px rgba(0,0,0,.22);
}

.live-brand .mini-mark {
  border-color: #e2c069;
  background: #195d50;
  color: #fff0bd;
  box-shadow: inset 0 0 0 2px #0d3f36;
}

.live-actions .icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(223,187,101,.68);
  border-radius: 8px;
  background: rgba(12,24,21,.92);
  color: #f5d77c;
  box-shadow: 0 5px 14px rgba(0,0,0,.2);
}

.live-actions .icon-button:hover { background: #1d4138; }

.table-stamp { color: rgba(2,49,36,.5); }
.table-stamp small { color: rgba(234,247,239,.7); }

.table-center > small {
  border: 1px solid rgba(223,239,227,.16);
  background: rgba(4,48,35,.54);
}

.seat { filter: drop-shadow(0 7px 9px rgba(0,0,0,.28)); }

.seat-head {
  border: 1px solid rgba(151,209,183,.42);
  border-top: 2px solid rgba(232,199,112,.76);
  border-bottom-color: rgba(79,155,126,.74);
  border-radius: 7px;
  background: rgba(5,42,31,.92);
  box-shadow: inset 0 -14px 20px rgba(0,0,0,.12);
}

.seat-avatar {
  border-color: #b8d8cb;
  border-radius: 50%;
  background: #d8ebe3;
  color: #16372e;
}

.seat.is-banker .seat-avatar { background: #e2bc59; color: #35270d; border-color: #fff0b4; }
.seat.is-banker .seat-avatar::after { background: #275c51; border-color: #f5d77c; color: #fff3bb; }
.seat.is-me .seat-head { border-color: #f0ce71; background: rgba(15,64,47,.96); box-shadow: 0 0 0 2px rgba(240,206,113,.18), inset 0 -14px 20px rgba(0,0,0,.12); }
.seat.winner .seat-head { border-color: #73ddb1; box-shadow: 0 0 19px rgba(68,210,153,.3), inset 0 -14px 20px rgba(0,0,0,.12); }
.seat.loser .seat-head { border-color: #eb8f92; }

.seat-name small { color: #9bcbb8; }
.seat-credit { color: #ffe092; }
.seat-credit small { color: #b7c9bf; }
.seat-state { color: #b9e7d8; text-shadow: 0 2px 2px #063928; }
.bet-pill { border-color: #ffe49a; background: #ba7d1c; box-shadow: inset 0 0 0 2px #e4b44e; }

.seat.empty {
  border-color: rgba(204,232,219,.34);
  background: rgba(5,59,42,.34);
  color: rgba(224,244,235,.58);
}
.seat.empty.banker-seat { border-color: rgba(240,206,113,.84); background: rgba(75,74,30,.3); color: #ffe9a5; }

.mini-card { border-color: #e8e5da; box-shadow: 0 4px 8px rgba(0,0,0,.34); }
.mini-card.back, .peel-card .card-back { background-color: #184f72; border-color: #c9dfec; }
.mini-card.back { background-image: repeating-linear-gradient(45deg, rgba(232,247,255,.25) 0 1px, transparent 1px 7px); }

/* Shared red-backed deck artwork for dealt and peeled cards. */
.mini-card.back,
.peel-card .card-back {
  border-color: #f3e4d6;
  background-color: #d92f35;
  background-image: url("assets/cards/card-back-red.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}
.mini-card.back::after { display: none; }
.peel-card .card-back::before,
.peel-card .card-back b { display: none; }

/* 金花三张牌统一为清晰的点数与花色，不混用第三张的图像牌面。 */
.game-jinhua .seat.has-hand .mini-hand { height: 68px; align-items: flex-start; }
.game-jinhua .seat.has-hand .mini-card.simple-card {
  width: 42px;
  height: 62px;
  flex-basis: 42px;
  padding: 6px;
  border: 1px solid #d9d7cf;
  border-radius: 4px;
  background: #fffef9;
  box-shadow: 0 4px 9px rgba(0,0,0,.32);
}
.game-jinhua .seat.has-hand .mini-card.simple-card + .mini-card.simple-card { margin-left: -6px; }
.game-jinhua .seat.has-hand .mini-card.simple-card b { font-size: 18px; line-height: 1; }
.game-jinhua .seat.has-hand .mini-card.simple-card i { left: 5px; right: auto; bottom: 4px; font-size: 18px; line-height: 1; }
.game-jinhua .seat.has-hand .mini-card.simple-card { color: #171b1a; }
.game-jinhua .seat.has-hand .mini-card.simple-card.red { color: #c62d35; }

@media (max-width: 700px) {
  .game-jinhua .seat.has-hand .mini-hand { height: 48px; }
  .game-jinhua .seat.has-hand .mini-card.simple-card,
  .game-jinhua .seat.has-hand.is-me .mini-card.simple-card { width: 28px; height: 44px; flex-basis: 28px; padding: 4px; }
  .game-jinhua .seat.has-hand .mini-card.simple-card b { font-size: 12px; }
  .game-jinhua .seat.has-hand .mini-card.simple-card i { left: 3px; right: auto; bottom: 2px; font-size: 12px; }
}

/* A settled hand should be readable from across the table on desktop. */
@media (min-width: 1101px) {
  .table-surface.phase-settled .seat.has-hand,
  .table-surface.phase-settled .seat.has-hand.is-me {
    width: clamp(220px, 16vw, 250px);
    height: 170px;
  }
  .table-surface.phase-settled .seat.has-hand .mini-hand,
  .table-surface.phase-settled .seat.has-hand.is-me .mini-hand { height: 98px; }
  .table-surface.phase-settled .seat.has-hand .mini-card,
  .table-surface.phase-settled .seat.has-hand.is-me .mini-card {
    width: 60px;
    height: 90px;
    flex-basis: 60px;
  }
  .table-surface.phase-settled .seat.has-hand .mini-card + .mini-card,
  .table-surface.phase-settled .seat.has-hand.is-me .mini-card + .mini-card { margin-left: -14px; }
}

@media (max-width: 1100px) and (min-width: 701px) {
  .table-surface.phase-settled .seat.has-hand,
  .table-surface.phase-settled .seat.has-hand.is-me { width: 194px; height: 154px; }
  .table-surface.phase-settled .seat.has-hand .mini-hand,
  .table-surface.phase-settled .seat.has-hand.is-me .mini-hand { height: 80px; }
  .table-surface.phase-settled .seat.has-hand .mini-card,
  .table-surface.phase-settled .seat.has-hand.is-me .mini-card {
    width: 48px;
    height: 72px;
    flex-basis: 48px;
  }
  .table-surface.phase-settled .seat.has-hand .mini-card + .mini-card,
  .table-surface.phase-settled .seat.has-hand.is-me .mini-card + .mini-card { margin-left: -11px; }
}

.action-dock {
  border-color: rgba(223,187,101,.62);
  background: rgba(10,25,21,.9);
  box-shadow: 0 10px 28px rgba(0,0,0,.27), inset 0 1px rgba(224,247,234,.1);
}
.action-context span { color: #f0ce71; }
.action-context small { color: #a9c3b7; }
.chip-button { border-color: #ecdd9a; outline-color: #295d51; background: #d8aa43; color: #20352e; box-shadow: inset 0 0 0 3px #f2cf72, 0 4px 7px rgba(0,0,0,.25); }
.chip-button:nth-child(2n) { background: #5eab8a; color: #102d24; outline-color: #205a49; box-shadow: inset 0 0 0 3px #9cddc2, 0 4px 7px rgba(0,0,0,.25); }
.chip-button:nth-child(3n) { background: #567fc2; color: #f0f6ff; outline-color: #244b86; box-shadow: inset 0 0 0 3px #91b7f0, 0 4px 7px rgba(0,0,0,.25); }
.chip-button.active { outline-color: #fff0a7; background: #b64c52; color: #fff6d6; }
.action-button { border-color: #7bb99f; background: #1d6754; color: #f0fff8; }
.action-button.primary { border-color: #f4d77d; background: #d8a93f; color: #182b25; box-shadow: inset 0 0 0 2px rgba(255,240,176,.42), 0 4px 0 #886b28; }
.action-button.primary:hover { background: #e6bd5b; }

.lab-sidebar { border-color: rgba(223,187,101,.54); background: rgba(12,24,21,.97); }
.panel-close { border-color: #557a6d; color: #e7d48b; }

@media (max-width: 900px) {
  .game-screen { background: #101614; }
  .live-header { background: #101b18; border-bottom-color: #315d50; }
  .table-surface { border-width: 6px; border-radius: 24px 24px 10px 10px; }
  .table-surface::before { left: 5%; top: 8%; width: 90%; height: 83%; border-width: 1px; }
  .live-actions .icon-button { border-radius: 7px; }
  .seat-head { border-radius: 5px; }
  .action-dock { border-radius: 8px; }
}

/* 结算时金花三张牌均用同一套高对比点数与花色，便于全桌辨认。 */
@media (min-width: 701px) {
  .table-surface.game-jinhua.phase-settled .seat.has-hand .mini-card.simple-card,
  .table-surface.game-jinhua.phase-settled .seat.has-hand.is-me .mini-card.simple-card { padding: 8px; background: #fffef9; }
  .table-surface.game-jinhua.phase-settled .seat.has-hand .mini-card.simple-card b { font-size: 22px; line-height: 1; }
  .table-surface.game-jinhua.phase-settled .seat.has-hand .mini-card.simple-card i { right: 7px; bottom: 6px; font-size: 22px; line-height: 1; }
}

@media (max-width: 700px) {
  .action-dock.is-jinhua-controls { grid-template-columns: 1fr; grid-template-rows: auto auto auto; }
  .action-dock.is-jinhua-controls .action-context { grid-column: 1; grid-row: 1; }
  .action-dock.is-jinhua-controls .bet-controls { grid-column: 1; grid-row: 2; justify-self: stretch; }
  .action-dock.is-jinhua-controls .host-controls { grid-column: 1; grid-row: 3; justify-content: center; }
}

/* 实体椭圆牌桌：红木轨道、金色镶边与绿色台呢分层呈现。 */
.table-surface {
  border: 0;
  border-radius: 0;
  outline: 0;
  background-color: #12182c;
  background-image:
    radial-gradient(ellipse at 50% 50%, rgba(54,68,112,.38), transparent 56%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.025) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(-45deg, rgba(0,0,0,.22) 0 1px, transparent 1px 8px);
  box-shadow: inset 0 0 64px rgba(0,0,0,.58), 0 18px 40px rgba(0,0,0,.42);
}
.table-surface::before {
  z-index: 0;
  inset: 5.5% 4.5%;
  width: auto;
  height: auto;
  border: 30px solid transparent;
  border-radius: 50% / 42%;
  background:
    radial-gradient(ellipse at 50% 44%, #0b8d64 0%, #087655 56%, #064c3a 100%) padding-box,
    linear-gradient(180deg, #c47b61 0%, #6e2425 15%, #b65047 48%, #531719 83%, #d18368 100%) border-box;
  background-clip: padding-box, border-box;
  box-shadow:
    0 0 0 4px #38161d,
    0 0 0 8px #d8b463,
    inset 0 0 0 3px rgba(244,221,130,.46),
    inset 0 0 50px rgba(0,0,0,.28),
    0 18px 28px rgba(0,0,0,.46);
}
.table-surface::after {
  z-index: 1;
  inset: 12.5% 10%;
  border: 2px solid rgba(108,229,177,.46);
  border-radius: 50% / 42%;
  background-image: none;
  box-shadow: inset 0 0 32px rgba(2,51,38,.26);
  opacity: 1;
}
.table-stamp { z-index: 3; color: rgba(0,57,40,.46); }
.table-center { z-index: 5; }
.seat-map { z-index: 6; }

@media (max-width: 900px) {
  .table-surface { border: 0; border-radius: 0; }
  .table-surface::before { inset: 5% 2%; border-width: 18px; border-radius: 46% / 34%; }
  .table-surface::after { inset: 10% 7%; border-width: 1px; border-radius: 46% / 34%; }
}
