*,
*::before,
*::after { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: "Segoe UI", "Arial Hebrew", Arial, sans-serif;
  color: #f6f0e4;
  background:
    radial-gradient(ellipse at 50% 0%, #3a2418 0%, transparent 42%),
    #100d0b;
}

button, input, select { font: inherit; color: inherit; }

button { cursor: pointer; }

.app {
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 18px 28px;
}

.appbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(16, 13, 11, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(224, 195, 106, .18);
}

.appbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.bar-end { display: flex; align-items: center; gap: 10px; }

.wallet-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 10px;
  border-radius: 999px;
  background: linear-gradient(#2a1d12, #1c140d);
  border: 1px solid rgba(224, 195, 106, .45);
  color: #f0d78c;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.wallet-pill small { color: #cbbfa6; font-weight: 600; }

.coin {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #fff8ea 0 34%, transparent 36%),
    repeating-conic-gradient(#c62828 0 30deg, #f4f0e6 30deg 60deg);
  box-shadow: 0 1px 0 #6d1414;
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(224, 195, 106, .35);
  background: #241910;
  font-size: 24px;
  line-height: 1;
}

.icon-btn:hover { background: #2f2216; }

.icon-btn:focus-visible { outline: 2px solid #f0d78c; outline-offset: 2px; }

.burger,
.burger::before,
.burger::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: #f0d78c;
}

.burger { position: relative; }

.burger::before, .burger::after { content: ""; position: absolute; left: 0; }

.burger::before { top: -6px; }

.burger::after { top: 6px; }

.brand { display: flex; align-items: center; gap: 12px; margin-inline-end: auto; }

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f0d78c, #a67c2d);
  color: #2a160c;
  font-size: 26px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25);
}

.brand h1 { margin: 0; font-size: 22px; letter-spacing: .02em; }

.brand p { margin: 2px 0 0; color: #cbbfa6; font-size: 14px; }

.control { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #cbbfa6; }

.control input,
.control select {
  background: #241910;
  border: 1px solid rgba(224, 195, 106, .35);
  border-radius: 10px;
  padding: 8px 10px;
  min-width: 108px;
}

.hand-no {
  min-width: 64px;
  text-align: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(224, 195, 106, .12);
  border: 1px solid rgba(224, 195, 106, .3);
  color: #f0d78c;
  font-weight: 700;
}

.main {
  direction: ltr;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}

.rail {
  padding: 14px;
  border-radius: 220px;
  background:
    radial-gradient(circle at 50% 35%, #7a4a2b, #2a160e 72%);
  box-shadow:
    0 24px 50px rgba(0, 0, 0, .45),
    inset 0 0 0 3px #e0c36a,
    inset 0 0 0 8px #3a2416;
}

.felt {
  position: relative;
  min-height: 520px;
  border-radius: 200px;
  background:
    radial-gradient(ellipse at 50% 42%, #1f8f55 0%, #0d5a36 58%, #083d25 100%);
  box-shadow: inset 0 0 90px rgba(0, 0, 0, .38);
}

.center {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  width: min(420px, 62%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 2;
  pointer-events: none;
}

.street {
  font-size: 13px;
  letter-spacing: .14em;
  color: rgba(246, 240, 228, .72);
}

.pot {
  text-align: center;
  background: rgba(4, 20, 12, .55);
  border-radius: 14px;
  padding: 4px 18px 6px;
}

.pot span { display: block; font-size: 12px; color: #d9ccb2; }

.pot strong {
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  color: #fff8e8;
}

.board, .seat-cards, .hero-cards, .actions, .raise-box { direction: ltr; }

.board, .seat-cards, .hero-cards { display: flex; gap: 6px; justify-content: center; }

.card {
  width: 58px;
  height: 82px;
  border-radius: 8px;
  background: linear-gradient(#fffefb, #f3ecdf);
  color: #1c1c1c;
  position: relative;
  box-shadow: 0 8px 16px rgba(0, 0, 0, .28);
  flex: 0 0 auto;
}

.card.red { color: #c0392b; }

.card .corner {
  position: absolute;
  top: 4px;
  left: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  font-family: Georgia, "Times New Roman", serif;
}

.card .corner b { font-size: 16px; font-weight: 700; }

.card .corner i { font-style: normal; font-size: 12px; }

.card .pip {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.card.sm { width: 38px; height: 54px; border-radius: 6px; box-shadow: 0 4px 10px rgba(0, 0, 0, .28); }

.card.sm .corner b { font-size: 11px; }

.card.sm .corner i { font-size: 10px; }

.card.sm .pip { font-size: 16px; }

.card.lg { width: 74px; height: 104px; }

.card.lg .corner b { font-size: 22px; }

.card.lg .pip { font-size: 36px; }

.card.back {
  background:
    radial-gradient(circle at 30% 18%, rgba(255, 255, 255, .2), transparent 42%),
    repeating-linear-gradient(45deg, #101a3d 0 6px, #1c316f 6px 12px);
  border: 2px solid #f3ead8;
  color: transparent;
}

.card.slot {
  background: rgba(0, 0, 0, .16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
}

.card.back .corner, .card.back .pip, .card.slot .corner, .card.slot .pip { display: none; }

.seat {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  z-index: 3;
}

.seat-cards { min-height: 0; margin-bottom: -14px; position: relative; z-index: 1; }

.seat-cards .card + .card { margin-inline-start: -14px; transform: rotate(6deg); }

.seat-cards .card:first-child { transform: rotate(-6deg); }

.tile {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(7, 18, 14, .88);
  border: 2px solid rgba(224, 195, 106, .25);
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .35);
  transition: border-color .2s ease, box-shadow .2s ease;
}

.seat.hero .tile { border-color: rgba(224, 195, 106, .6); }

.seat.turn .tile {
  border-color: #f0d78c;
  box-shadow: 0 0 0 2px rgba(240, 215, 140, .35), 0 0 24px rgba(240, 215, 140, .45);
}

.seat.win .tile { border-color: #7ef2b0; }

.seat.folded .tile, .seat.folded .seat-cards { opacity: .45; }

.seat.out { opacity: .4; }

.seat-avatar {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 70%, white), var(--c));
  color: #1b120b;
  font-size: 18px;
  font-weight: 900;
}

.seat-info { min-width: 0; flex: 1; text-align: start; }

.seat-name {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seat-stack {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: #f0d78c;
}

.dealer-btn {
  position: absolute;
  top: 4px;
  inset-inline-end: 4px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fffaf0;
  color: #1c1c1c;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .4);
}

/* Turn clock: a bar along the bottom of the tile, green to orange to red. */
.timer {
  position: absolute;
  inset: auto 0 0 0;
  height: 5px;
  background: rgba(0, 0, 0, .45);
}

.timer i {
  display: block;
  height: 100%;
  transform-origin: right center;
  animation-name: turn-clock;
  animation-timing-function: linear;
  animation-fill-mode: both;
}

@keyframes turn-clock {
  0% { transform: scaleX(1); background: #4fd18b; }
  55% { background: #4fd18b; }
  75% { background: #f0a43a; }
  100% { transform: scaleX(0); background: #e2483a; }
}

.action-badge {
  min-height: 22px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #f6f0e4;
  background: rgba(0, 0, 0, .55);
}

.action-badge:empty { visibility: hidden; }

.action-badge.fold { color: #ff8d8d; }

.action-badge.raise { color: #f0d78c; }

.won {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.1;
  white-space: nowrap;
  color: #8dffa9;
  font-weight: 900;
  font-size: 15px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, .6);
  z-index: 4;
}

.winner-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: linear-gradient(#ffe27a, #f0b92d);
  color: #3a2508;
  font-size: 13px;
}

.bet-row { display: flex; justify-content: center; }

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 50%, #fff8ea 0 42%, transparent 44%),
    repeating-radial-gradient(circle at 50% 50%, #f4f0e6 0 2px, #c62828 3px 5px);
  color: #2a120c;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 0 #6d1414;
}

.result-banner {
  max-width: 420px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(8, 20, 14, .78);
  border: 1px solid rgba(240, 215, 140, .45);
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
}

.dock {
  direction: rtl;
  margin-top: 10px;
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  background: #1a120d;
  border: 1px solid rgba(224, 195, 106, .28);
}

.dock.your-turn { box-shadow: 0 0 0 1px rgba(240, 215, 140, .55), 0 0 24px rgba(240, 215, 140, .15); }

.hero-row { display: flex; align-items: center; gap: 14px; }

.hero-cards.dim { opacity: .45; }

.hero-meta { min-width: 130px; display: flex; flex-direction: column; gap: 5px; }

.hero-meta .stack { color: #f0d78c; font-variant-numeric: tabular-nums; font-weight: 700; }

.hand-label {
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .45);
  color: #fff8e8;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.hand-label:empty { display: none; }

.meter {
  width: 130px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  overflow: hidden;
}

.meter i { display: block; height: 100%; border-radius: inherit; transition: width .3s ease; }

.turn-flag { color: #f0d78c; font-weight: 800; }

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

.bar {
  direction: rtl;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 8px;
}

.bar .btn { padding: 14px 8px; font-size: 17px; }

.btn.pre-btn {
  background: rgba(0, 0, 0, .35);
  border: 2px solid rgba(224, 195, 106, .35);
  color: #d9ccb2;
  font-size: 15px;
}

.btn.pre-btn.on {
  background: rgba(240, 215, 140, .18);
  border-color: #f0d78c;
  color: #fff8e8;
}

.btn.pre-btn.on::before { content: "✓ "; color: #7ef2b0; }

/* The raise panel floats above the buttons so the table does not shrink. */
.dock { position: relative; }

.raise-panel {
  position: absolute;
  inset-inline: 8px;
  bottom: calc(100% + 8px);
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(18, 13, 9, .97);
  border: 1px solid rgba(224, 195, 106, .45);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, .55);
}

/* Your own seat sits on the bottom edge and grows upward. */
.seat.hero { transform: translate(-50%, -100%); }

.seat.hero .action-badge { order: -1; }

.seat.hero .bet-row { order: -2; }

.seat.hero .seat-cards { order: -3; margin-bottom: 0; }

.raise-panel .presets { display: flex; flex-wrap: wrap; gap: 6px; direction: rtl; }

.raise-panel .presets button { flex: 1 1 auto; padding: 8px 6px; font-size: 13px; font-weight: 700; }

.raise-panel .presets button.on { background: linear-gradient(#f3dd9a, #c4962c); color: #2a1c08; }

.raise-row { display: flex; align-items: center; gap: 10px; direction: ltr; }

.raise-amount {
  min-width: 64px;
  text-align: center;
  font-size: 20px;
  color: #f0d78c;
  font-variant-numeric: tabular-nums;
}

.card.hl { box-shadow: 0 0 0 3px #ffd65a, 0 10px 20px rgba(0, 0, 0, .4); transform: translateY(-5px); }

.card.dim { filter: brightness(.55); }

.hand-name {
  padding: 6px 18px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .78);
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: .02em;
}

.side-pots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

.side-pots span {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(4, 20, 12, .6);
  font-size: 12px;
  color: #d9ccb2;
}

.opp-pick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-radius: 18px;
  background: #1a120d;
  border: 1px solid rgba(224, 195, 106, .25);
}

.opp-pick .segmented { flex: 0 1 320px; }

.log-toggle { display: none; }

.table-tools { display: flex; gap: 6px; }

.table-tools .btn, .action-badge { white-space: nowrap; }

.btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 800;
  letter-spacing: .03em;
}

.btn:focus-visible, .control input:focus-visible, .control select:focus-visible {
  outline: 2px solid #f0d78c;
  outline-offset: 2px;
}

.btn.fold { background: linear-gradient(#d4473b, #a3271e); color: white; }

.btn.call { background: linear-gradient(#3b8ee0, #225fa8); color: white; }

.btn.primary { background: #1f7a4d; color: white; }

.btn.raise.open { box-shadow: 0 0 0 2px #fff8e8 inset; }

.btn.raise { background: linear-gradient(#f3dd9a, #c4962c); color: #2a1c08; }

.btn.allin { background: #8e1e1e; color: white; }

.btn.ghost {
  background: transparent;
  color: #f0d78c;
  border: 1px solid rgba(224, 195, 106, .4);
}

.raise-box { display: flex; flex-direction: column; gap: 6px; min-width: 210px; }

.presets { display: flex; gap: 4px; }

.presets button, .wait {
  background: #2a2118;
  border: 1px solid rgba(224, 195, 106, .25);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
}

.wait { padding: 10px 12px; color: #d9ccb2; }

input[type="range"] { width: 100%; accent-color: #e0c36a; }

.hint { width: 100%; color: #b5a890; font-size: 12px; }

.log-panel {
  direction: rtl;
  background: #1a120d;
  border: 1px solid rgba(224, 195, 106, .28);
  border-radius: 18px;
  min-height: 560px;
  max-height: 760px;
  display: flex;
  flex-direction: column;
}

.log-panel h2 { margin: 0; padding: 14px 14px 8px; font-size: 16px; }

#log {
  overflow: auto;
  padding: 0 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  line-height: 1.4;
}

.log-line { color: #f6f0e4; }

.log-line.muted { color: #b5a890; }

.log-line.street { color: #9fd8b8; font-weight: 700; }

.log-line.win { color: #f0d78c; font-weight: 700; }

.lc.red { color: #ff8d8d; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .62);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: 18px;
}

.overlay.hidden { display: none; }

.modal {
  width: min(420px, 100%);
  background: #1c140f;
  border: 1px solid rgba(224, 195, 106, .45);
  border-radius: 18px;
  padding: 22px;
  text-align: center;
}

.modal h3 { margin: 0 0 8px; font-size: 26px; }

.modal p { margin: 0 0 16px; color: #d9ccb2; }

.hidden { display: none !important; }

.btn:disabled { cursor: not-allowed; opacity: .6; }

.btn.small { padding: 7px 12px; font-size: 13px; }

.table-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  direction: rtl;
}

.table-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.room-label { color: #d9ccb2; font-weight: 700; }

.table-bar .btn { padding: 8px 14px; }

.lobby { display: flex; flex-direction: column; gap: 16px; }

.welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border-radius: 22px;
  background:
    radial-gradient(ellipse at 15% 50%, rgba(240, 215, 140, .16), transparent 55%),
    radial-gradient(ellipse at 90% 0%, rgba(31, 143, 85, .45), transparent 65%),
    #17110c;
  border: 1px solid rgba(224, 195, 106, .35);
}

.welcome h2 { margin: 0 0 6px; font-size: 28px; }

.welcome p { margin: 0; max-width: 560px; color: #cbbfa6; line-height: 1.55; }

.welcome-wallet {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 220px;
  text-align: center;
}

.welcome-wallet span { color: #cbbfa6; font-size: 13px; }

.welcome-wallet strong {
  font-size: 34px;
  line-height: 1;
  color: #f0d78c;
  font-variant-numeric: tabular-nums;
}

.welcome-wallet .btn { margin-top: 6px; }

.perk-done { margin-top: 6px; font-size: 13px; color: #9fd8b8; }

.lobby-title { margin: 4px 0 0; font-size: 22px; }

.notice {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(31, 122, 77, .22);
  border: 1px solid rgba(126, 242, 176, .3);
}

.rooms {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.room {
  --accent: #1f8f55;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 16px 16px;
  border-radius: 20px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% -10%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 70%),
    #1a120d;
  border: 1px solid rgba(224, 195, 106, .32);
  transition: transform .18s ease, border-color .18s ease;
}

.room::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--accent);
}

.room:not(.locked):hover { transform: translateY(-3px); border-color: rgba(240, 215, 140, .7); }

.room.tier-0 { --accent: #2e9e62; }

.room.tier-1 { --accent: #2f7fc1; }

.room.tier-2 { --accent: #c0392b; }

.room.tier-3 { --accent: #d4a937; }

.room.locked { opacity: .62; }

.room.custom { --accent: #8e6fd1; border-style: dashed; }

.room-top { display: flex; align-items: center; gap: 12px; }

.room-suit {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #fffaf0;
  color: #1c1c1c;
  font-size: 26px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .3);
}

.tier-1 .room-suit, .tier-2 .room-suit { color: #c0392b; }

.custom .room-suit { color: #8e6fd1; }

.room h3 { margin: 0; font-size: 19px; }

.room-note { display: block; margin-top: 2px; color: #b5a890; font-size: 13px; }

.room-stakes { display: flex; gap: 10px; }

.room-stakes div {
  flex: 1;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .25);
}

.room-stakes span { display: block; font-size: 12px; color: #b5a890; }

.room-stakes strong { font-size: 18px; font-variant-numeric: tabular-nums; color: #fff8e8; }

.room .btn { margin-top: auto; }

.room .control input { width: 100%; }

.custom-summary { font-size: 13px; color: #9fd8b8; min-height: 18px; }

.custom-summary.bad { color: #ff9e9e; }

.scrim {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, .55);
}

.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  z-index: 31;
  width: min(360px, 92vw);
  overflow-y: auto;
  padding: 16px 18px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #17110c;
  border-left: 1px solid rgba(224, 195, 106, .3);
  box-shadow: -20px 0 50px rgba(0, 0, 0, .5);
  transform: translateX(105%);
  visibility: hidden;
  transition: transform .26s cubic-bezier(.2, .8, .25, 1), visibility 0s linear .26s;
}

.drawer.open {
  transform: none;
  visibility: visible;
  transition: transform .26s cubic-bezier(.2, .8, .25, 1);
}

.drawer-head { display: flex; align-items: center; justify-content: space-between; }

.drawer-head h2 { margin: 0; font-size: 20px; }

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

.grow { flex: 1; }

.grow input { width: 100%; }

.avatar {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f0d78c, #a67c2d);
  color: #2a160c;
  font-size: 24px;
  font-weight: 800;
}

.profile-wallet {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(224, 195, 106, .08);
  border: 1px solid rgba(224, 195, 106, .25);
}

.profile-wallet span { color: #cbbfa6; }

.profile-wallet strong { color: #f0d78c; font-size: 20px; font-variant-numeric: tabular-nums; }

.profile-wallet small { display: block; color: #b5a890; font-size: 12px; font-weight: 400; text-align: left; }

.menu-section {
  padding: 14px;
  border-radius: 16px;
  background: #1f1710;
  border: 1px solid rgba(224, 195, 106, .16);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.menu-section h3 { margin: 0; font-size: 15px; color: #f0d78c; letter-spacing: .02em; }

.menu-note { margin: 0; color: #b5a890; font-size: 13px; line-height: 1.5; }

.btn.wide { width: 100%; }

.field { display: flex; flex-direction: column; gap: 6px; }

.field-label { font-size: 13px; color: #cbbfa6; }

.segmented {
  display: flex;
  padding: 3px;
  border-radius: 12px;
  background: #120d09;
  border: 1px solid rgba(224, 195, 106, .2);
}

.segmented label { flex: 1; }

.segmented input { position: absolute; opacity: 0; pointer-events: none; }

.segmented span {
  display: block;
  padding: 8px 6px;
  border-radius: 9px;
  text-align: center;
  font-weight: 700;
  color: #cbbfa6;
  cursor: pointer;
}

.segmented input:checked + span { background: linear-gradient(#f3dd9a, #c4962c); color: #2a1c08; }

.segmented input:focus-visible + span { outline: 2px solid #f0d78c; outline-offset: 1px; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }

.switch {
  appearance: none;
  flex: 0 0 auto;
  position: relative;
  width: 46px;
  height: 26px;
  margin: 0;
  border-radius: 999px;
  background: #3a2c20;
  cursor: pointer;
  transition: background .18s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f6f0e4;
  transition: transform .18s ease;
}

.switch:checked { background: #1f7a4d; }

.switch:checked::after { transform: translateX(-20px); }

.switch:focus-visible { outline: 2px solid #f0d78c; outline-offset: 2px; }

.rules summary { cursor: pointer; font-weight: 700; color: #f0d78c; }

.rules ol { margin: 0; padding: 0 18px 0 0; display: grid; gap: 6px; font-size: 14px; }

.rules li span { display: block; color: #b5a890; font-size: 13px; text-align: right; }

.stats { margin: 0; display: grid; gap: 8px; }

.stats div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(224, 195, 106, .12);
}

.stats dt { color: #cbbfa6; }

.stats dd { margin: 0; font-weight: 700; text-align: left; font-variant-numeric: tabular-nums; }

.stats dd small { color: #b5a890; font-weight: 400; }

.stats .up { color: #8dffa9; }

.stats .down { color: #ff9e9e; }

.board { perspective: 700px; }

@keyframes deal-in {
  from { opacity: 0; transform: translate(var(--dx, 0), var(--dy, 0)) scale(.5) rotate(-14deg); }
  to { opacity: 1; transform: none; }
}

@keyframes drop-in {
  from { opacity: 0; transform: translateY(-90px) rotate(-8deg) scale(.8); }
  to { opacity: 1; transform: none; }
}

@keyframes flip-in {
  from { opacity: .3; transform: rotateY(90deg); }
  to { opacity: 1; transform: none; }
}

@keyframes bump {
  40% { transform: scale(1.18); color: #f0d78c; }
}

@keyframes chip-in {
  from { opacity: 0; transform: translateY(-14px) scale(.6); }
  to { opacity: 1; transform: none; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  25% { opacity: 1; transform: none; }
}

@keyframes pop {
  from { opacity: 0; transform: scale(.85); }
  to { opacity: 1; transform: none; }
}

@keyframes win-glow {
  50% { box-shadow: 0 0 0 3px rgba(126, 242, 176, .9), 0 0 34px rgba(80, 200, 130, .6); }
}

.anim-deal { animation: deal-in .42s cubic-bezier(.2, .8, .25, 1) both; }

.anim-drop { animation: drop-in .45s cubic-bezier(.2, .8, .25, 1) both; }

.anim-board, .anim-flip { animation: flip-in .4s ease-out both; }

.anim-bump { display: inline-block; animation: bump .32s ease-out both; }

.anim-chip { animation: chip-in .3s ease-out both; }

.anim-rise { animation: rise 1.2s ease-out both; }

.anim-pop { animation: pop .45s cubic-bezier(.2, .9, .3, 1.3) both; }

.seat.win { animation: win-glow 1.4s ease-in-out 3; }

@media (prefers-reduced-motion: reduce) {
  .anim-deal, .anim-drop, .anim-board, .anim-flip, .anim-bump,
  .anim-chip, .anim-rise, .anim-pop, .seat.win { animation: none !important; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* The table fills the screen: felt in the middle, your cards and buttons below. */
.table-area {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 104px);
  min-height: 600px;
}

.table-area .rail { flex: 1; min-height: 0; display: flex; }

.table-area .felt { flex: 1; min-height: 0; }

.log-panel { height: calc(100dvh - 104px); min-height: 600px; max-height: none; }

@media (hover: none) {
  .hint { display: none; }
}

@media (max-width: 980px) {
  .main { grid-template-columns: 1fr; }
  .log-toggle { display: inline-block; }
  .log-panel { display: none; }
  .main.show-log .log-panel {
    display: flex;
    position: fixed;
    inset: auto 8px 8px 8px;
    z-index: 15;
    height: 45dvh;
    min-height: 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, .6);
  }
  .felt { border-radius: 36px; }
  .rail { border-radius: 48px; }
  .dock { flex-wrap: wrap; }
  .actions { flex-basis: 100%; }
}

@media (max-width: 640px) {
  .appbar-inner { padding: 8px 12px; gap: 8px; }
  .brand p { display: none; }
  .brand-mark { width: 38px; height: 38px; font-size: 22px; }
  .wallet-pill small { display: none; }
  .welcome { flex-direction: column; align-items: stretch; padding: 18px; }
  .welcome h2 { font-size: 24px; }
  .welcome-wallet { min-width: 0; }
  .app { padding: 14px 12px 24px; }
  .app:has(#table-view:not(.hidden)) { padding: 6px 8px 8px; }
  .table-area { height: calc(100dvh - 72px); min-height: 0; }
  .table-bar { margin-bottom: 6px; }
  .table-bar .btn { padding: 6px 10px; font-size: 13px; }
  .room-label { font-size: 13px; }
  .hand-no { min-width: 0; padding: 3px 10px; font-size: 13px; }
  .rail { padding: 6px; border-radius: 110px; }
  .felt { border-radius: 104px; }
  .seat { width: 86px; gap: 3px; }
  .tile { flex-direction: column; gap: 2px; padding: 6px 4px 8px; }
  .seat-avatar { width: 30px; height: 30px; font-size: 15px; }
  .seat-info { text-align: center; width: 100%; }
  .seat-name { font-size: 12px; }
  .seat-stack { font-size: 13px; }
  .card.sm { width: 30px; height: 43px; }
  .card.sm .pip { font-size: 13px; }
  .center { width: 92%; gap: 6px; }
  .center { top: 50%; }
  .board { gap: 4px; }
  .board .card { width: 40px; height: 58px; }
  .board .card .corner b { font-size: 14px; }
  .board .card .pip { font-size: 20px; }
  .pot strong { font-size: 22px; }
  .hand-name { font-size: 19px; }
  .result-banner { font-size: 14px; padding: 8px 10px; }
  .card.lg { width: 56px; height: 80px; }
  .card.lg .corner b { font-size: 18px; }
  .card.lg .pip { font-size: 28px; }
  .dock { padding: 8px; margin-top: 6px; gap: 8px; }
  .hero-row { gap: 10px; width: 100%; }
  .hero-meta { min-width: 0; flex: 1; }
  .meter { width: 100%; }
  .bar .btn { padding: 13px 4px; font-size: 15px; }
  .btn.pre-btn { font-size: 13px; }
  .brand h1 { font-size: 18px; }
}

/* Play with friends */
.friends {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  background:
    radial-gradient(ellipse at 100% 0%, rgba(192, 57, 43, .28), transparent 60%),
    #1a120d;
  border: 1px solid rgba(224, 195, 106, .45);
}

.friends-head { display: flex; gap: 12px; align-items: flex-start; }

.friends-head .room-suit { color: #c0392b; }

.friends h2 { margin: 0 0 4px; font-size: 22px; }

.friends p { margin: 0; color: #cbbfa6; line-height: 1.5; font-size: 14px; }

.friends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  align-items: end;
}

.friends .control input { width: 100%; }

.join-row { display: flex; gap: 8px; align-items: flex-end; }

.join-row input { text-transform: uppercase; letter-spacing: .12em; }

.seat.empty-seat .tile {
  justify-content: center;
  background: rgba(0, 0, 0, .18);
  border-style: dashed;
  border-color: rgba(224, 195, 106, .2);
  color: rgba(246, 240, 228, .45);
  box-shadow: none;
  min-height: 44px;
}

.seat.away .tile { opacity: .55; }

.conn-banner {
  width: 100%;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(226, 72, 58, .2);
  border: 1px solid rgba(226, 72, 58, .5);
  text-align: center;
  font-weight: 700;
}

.dock .wait { text-align: center; }

.dock { flex-wrap: wrap; }

.dock .actions { min-width: 280px; }
