:root {
  --bg: #070b14;
  --panel: #141d31;
  --panel-glass: rgba(20, 29, 49, 0.88);
  --panel-2: #1c2740;
  --felt-1: #0e7a4f;
  --felt-2: #073a26;
  --rail-1: #6b4322;
  --rail-2: #2d1c0f;
  /* table redesign tokens */
  --felt-hi: #3ba193;
  --felt-mid: #1f7d72;
  --felt-lo: #0c4640;
  --rail-hi: #b07b42;
  --rail-mid: #6f4626;
  --rail-lo: #3c2413;
  --plate: rgba(9, 14, 24, 0.84);
  --plate-line: rgba(255, 255, 255, 0.10);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --gold: #f4b942;
  --gold-2: #ffd873;
  --blue: #3b82f6;
  --danger: #ef4444;
  --success: #22c55e;
  --purple: #8b5cf6;
  --text: #f5f7fb;
  --text-dim: #97a3c2;
  --radius: 16px;
  --font: 'Kanit', -apple-system, BlinkMacSystemFont, "Noto Sans Thai", Tahoma, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  overflow-x: hidden;
  font-family: var(--font);
}

#app {
  width: 100%;
  min-height: 100dvh;
}

button, input {
  font-family: var(--font);
}

.screen {
  display: none;
  min-height: 100dvh;
  position: relative;
}
.screen.active {
  display: flex;
  flex-direction: column;
  animation: screenFadeIn 0.35s ease both;
}

@keyframes screenFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.felt-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(244, 185, 66, 0.10), transparent 60%),
    radial-gradient(ellipse 90% 70% at 50% 110%, rgba(14, 122, 79, 0.18), transparent 60%),
    var(--bg);
}

/* ---------- Home / Lobby cards ---------- */
#screen-home, #screen-lobby {
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.home-card, .lobby-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 30px 26px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.03) inset;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 4px;
}
.brand-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--gold-2), var(--gold));
  color: #241a00;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(244,185,66,0.35);
}
.home-card h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.subtitle {
  color: var(--text-dim);
  text-align: center;
  font-size: 13px;
  margin: 0 0 22px;
  line-height: 1.5;
}

label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-dim);
  margin: 12px 0 6px;
}

input[type="text"], input[type="number"], input:not([type]) {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
input:focus {
  border-color: var(--gold);
  background: rgba(244,185,66,0.06);
}
input.uppercase {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-weight: 700;
  text-align: center;
}
input[type=number]::-webkit-inner-spin-button { opacity: 0.6; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.home-tabs {
  display: flex;
  gap: 4px;
  margin: 22px 0 4px;
  background: rgba(255,255,255,0.04);
  padding: 4px;
  border-radius: 12px;
}
.tab-btn {
  flex: 1;
  padding: 11px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  border-radius: 9px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}
.tab-btn.active {
  background: linear-gradient(145deg, var(--gold-2), var(--gold));
  color: #241a00;
  box-shadow: 0 4px 12px rgba(244,185,66,0.3);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: screenFadeIn 0.25s ease both; }

.primary-btn {
  width: 100%;
  margin-top: 20px;
  padding: 15px;
  border: none;
  border-radius: 13px;
  background: linear-gradient(145deg, var(--gold-2), var(--gold));
  color: #241a00;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(244,185,66,0.28);
  transition: transform 0.12s, box-shadow 0.12s, opacity 0.12s;
}
.primary-btn:active { transform: scale(0.97); box-shadow: 0 3px 10px rgba(244,185,66,0.25); }
.primary-btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.primary-btn.small { width: auto; margin-top: 0; padding: 11px 22px; font-size: 14px; }

.link-btn {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 0;
}

.error-text {
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
  text-align: center;
  margin-top: 14px;
  font-weight: 500;
}

.hint-text {
  color: var(--text-dim);
  font-size: 12px;
}

.hidden { display: none !important; }

/* ---------- Lobby (waiting room) ---------- */
.lobby-card { max-width: 460px; padding: 24px 22px; }

.lobby-eyebrow {
  display: block;
  text-align: center;
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.lobby-code-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(160deg, rgba(244,185,66,0.16), rgba(244,185,66,0.05));
  border: 1px solid rgba(244,185,66,0.35);
  border-radius: 14px;
  padding: 12px 12px 12px 16px;
}
.lobby-code-main { flex: 1; min-width: 0; }
.lobby-code-label {
  display: block;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
#lobby-room-code {
  color: var(--gold-2);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 6px;
  line-height: 1.15;
}
.lobby-copy {
  flex-shrink: 0;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.16);
  color: var(--text);
  font-weight: 700;
  font-size: 12.5px;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font);
}
.lobby-copy:active { transform: scale(0.95); }
.lobby-code-hint {
  text-align: center;
  color: var(--text-dim);
  font-size: 11.5px;
  margin: 8px 0 4px;
}

.lobby-players-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 16px 2px 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-dim);
}
.lobby-count { color: var(--gold-2); font-weight: 800; }

.lobby-players {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.lobby-slot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(255,255,255,0.045);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 10px;
  min-width: 0;
}
.lobby-slot.is-host { border-color: rgba(244,185,66,0.5); background: rgba(244,185,66,0.08); }
.lobby-slot.is-me { box-shadow: inset 0 0 0 1px rgba(59,130,246,0.55); }
.lobby-slot.is-empty { opacity: 0.5; border-style: dashed; }

.slot-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.7);
  box-shadow: inset 0 -4px 8px rgba(0,0,0,0.3);
}
.lobby-slot.is-host .slot-avatar {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(244,185,66,0.3), inset 0 -4px 8px rgba(0,0,0,0.3);
}
.slot-avatar.empty {
  background: none;
  border-style: dashed;
  border-color: rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.35);
  box-shadow: none;
}
.slot-info { min-width: 0; flex: 1; }
.slot-name {
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.slot-chips { font-size: 11px; color: var(--gold-2); font-weight: 600; }
.slot-badge {
  position: absolute;
  top: -7px;
  right: 8px;
  font-size: 8.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
}
.slot-badge.host { background: var(--gold); color: #241a00; }
.slot-badge.bot { background: var(--blue); color: #fff; }
.lobby-slot .bot-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(239,68,68,0.92);
  border: none;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.lobby-config {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 14px 0 2px;
}
.cfg-chip {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text);
}
.cfg-chip i { color: var(--text-dim); font-style: normal; font-weight: 500; margin-right: 3px; }

.gameover-banner {
  margin: 14px 0 4px;
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255,216,115,0.18), rgba(244,185,66,0.1));
  border: 1px solid rgba(244,185,66,0.4);
  color: var(--gold-2);
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  line-height: 1.5;
}

.lobby-host-actions { margin: 12px 0 0; }
.lobby-host-row { display: flex; gap: 8px; }
.lobby-mini-btn {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  font-size: 12.5px;
  padding: 10px 8px;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font);
}
.lobby-mini-btn:active { background: rgba(244,185,66,0.18); }
.lobby-mini-btn.hidden { display: none; }

.lobby-settings-form,
.lobby-rename-form {
  margin-top: 10px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  text-align: left;
}

.lobby-start { margin-top: 16px; }
.lobby-hint {
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  margin: 8px 0 0;
  min-height: 16px;
}
.lobby-hint.waiting { color: var(--gold-2); animation: tagPulse 1.4s ease-in-out infinite; }

.lobby-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.lobby-foot-sep { color: var(--text-dim); }
.link-btn.danger-link { color: var(--danger); font-weight: 600; }

/* ============ Table screen (redesigned) ============ */
#screen-table {
  --seat-scale: 0.8;
  --card-scale: 0.9;
  background:
    radial-gradient(ellipse 120% 80% at 50% 8%, rgba(63, 47, 28, 0.55), transparent 60%),
    radial-gradient(ellipse 90% 70% at 50% 120%, rgba(13, 74, 68, 0.45), transparent 62%),
    radial-gradient(circle at 50% 42%, #16202e 0%, #0a0f18 60%, #060a12 100%);
  height: 100dvh;
  overflow: hidden;
}
#screen-table::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(115deg, rgba(255,255,255,0.02) 0 2px, transparent 2px 9px);
  pointer-events: none;
  opacity: 0.6;
}

/* collapsible corner menu */
.table-menu {
  position: absolute;
  top: calc(6px + env(safe-area-inset-top));
  left: calc(8px + env(safe-area-inset-left));
  z-index: 16;
}
.menu-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(10, 15, 24, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.5);
  transition: transform 0.12s, background 0.15s;
}
.menu-toggle:active { transform: scale(0.92); }
.menu-toggle[aria-expanded="true"] { background: rgba(244,185,66,0.9); color: #241a00; }
.menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 190px;
  background: rgba(12, 17, 28, 0.97);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 5px;
  box-shadow: 0 18px 44px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  gap: 1px;
  animation: menuDrop 0.15s ease both;
}
.menu-panel.hidden { display: none; }
@keyframes menuDrop {
  from { opacity: 0; transform: translateY(-10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.menu-room {
  padding: 9px 12px 11px;
  font-size: 11.5px;
  color: var(--text-dim);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 4px;
}
.menu-room b {
  display: block;
  color: var(--gold-2);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 3px;
  margin-top: 2px;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 12px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font);
}
.menu-item:hover, .menu-item:active { background: rgba(255,255,255,0.09); }
.menu-item.danger { color: #ff8f8f; }
.menu-item.hidden { display: none; }
.menu-item-toggle { justify-content: space-between; gap: 12px; }
.menu-item-value {
  color: var(--gold-2);
  font-weight: 800;
  font-size: 12.5px;
  background: rgba(244,185,66,0.14);
  border: 1px solid rgba(244,185,66,0.3);
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.icon-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
  color: var(--text);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon-btn:active { transform: scale(0.92); }

.table-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(26px + env(safe-area-inset-top)) 8px 6px;
  min-height: 0;
  position: relative;
}

.poker-table {
  --rail-w: clamp(10px, 3vw, 16px);
  position: relative;
  width: min(84vw, 460px);
  height: 100%;
  max-height: 640px;
  border-radius: 46% / 17%;
  background:
    radial-gradient(ellipse 68% 52% at 50% 38%, var(--felt-hi) 0%, var(--felt-mid) 46%, var(--felt-lo) 100%);
  /* solid border keeps the border-radius; box-shadow rings build up the wooden rail */
  border: var(--rail-w) solid var(--rail-mid);
  box-shadow:
    inset 0 0 0 2px rgba(0,0,0,0.25),
    inset 0 0 55px rgba(0,0,0,0.4),
    inset 0 3px 6px rgba(255,255,255,0.10),
    0 0 0 1px var(--rail-hi),
    0 0 0 4px var(--rail-lo),
    0 22px 55px rgba(0,0,0,0.55),
    0 6px 16px rgba(0,0,0,0.4);
}
.poker-table::before {
  /* felt sheen + soft rail top-light */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(175deg, rgba(255,255,255,0.14), transparent 26%);
  pointer-events: none;
}
.poker-table::after {
  content: "\2660";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: min(28vw, 180px);
  color: rgba(255,255,255,0.05);
  pointer-events: none;
}

.community-area {
  position: absolute;
  top: 41%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 90%;
  z-index: 3;
}
.pot-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 14px 4px 6px;
  background: rgba(6, 10, 18, 0.6);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  font-weight: 800;
  color: var(--gold-2);
  font-size: clamp(12px, 3.2vw, 16px);
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}
.pot-badge.is-empty { opacity: 0.45; }
.pot-chip {
  width: clamp(16px, 4vw, 20px);
  height: clamp(16px, 4vw, 20px);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff8a8a, #e0333a 55%, #8f1a20 100%);
  border: 2px dashed rgba(255,255,255,0.85);
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
  flex-shrink: 0;
}
.community-cards {
  display: flex;
  gap: clamp(3px, 1.4vw, 7px);
  justify-content: center;
  min-height: calc(var(--card-scale) * clamp(42px, 11vw, 60px));
}
.board-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.3;
}
.pot-display {
  color: rgba(255,255,255,0.72);
  font-weight: 600;
  font-size: clamp(9px, 2.4vw, 12px);
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}
.blinds-info {
  color: rgba(255,255,255,0.45);
  font-weight: 500;
  font-size: clamp(8.5px, 2.1vw, 11px);
}

.seats { position: absolute; inset: 0; z-index: 4; }

.seat {
  position: absolute;
  top: var(--y);
  left: var(--x);
  transform: translate(-50%, -50%);
  width: calc(var(--seat-scale) * clamp(74px, 22vw, 96px));
  text-align: center;
  transition: opacity 0.25s, filter 0.25s;
  z-index: 1;
}
.seat.is-turn { z-index: 3; }
.seat.cards-up { z-index: 5; }
.seat.is-winner { z-index: 6; }
.seat.is-folded { opacity: 0.42; filter: grayscale(0.85); }
.seat.is-empty { opacity: 0.22; }
/* Hero seat: pinned to the bottom rail, left of the hero cards */
.seat.is-self {
  top: auto;
  left: 34%;
  bottom: 3%;
  transform: translateX(-50%);
}
.seat.is-self .seat-cards,
.seat.is-self .seat-reveal { display: none; }

/* last-action pill above the pod */
.seat-tag {
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  margin-bottom: 4px;
  background: rgba(10, 15, 24, 0.92);
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--text);
  font-size: calc(var(--seat-scale) * 10px);
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(0,0,0,0.45);
  z-index: 4;
}
.seat.tag-below .seat-tag {
  bottom: auto;
  top: 100%;
  margin: 4px 0 0;
}
.seat-tag.fold { color: var(--text-dim); }
.seat-tag.check, .seat-tag.call { color: #8fc0ff; border-color: rgba(59,130,246,0.5); }
.seat-tag.raise, .seat-tag.allin { color: var(--gold-2); border-color: rgba(244,185,66,0.55); }
.seat-tag.waiting { color: var(--gold-2); animation: tagPulse 1s ease-in-out infinite; }
@keyframes tagPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* face-down card backs peeking behind the avatar while a hand is live */
.seat-cards {
  position: absolute;
  left: 50%;
  top: calc(var(--seat-scale) * -7px);
  transform: translateX(-50%);
  display: flex;
  z-index: 0;
}
.seat-cards .mini-card { margin: 0 -3px; box-shadow: 0 3px 8px rgba(0,0,0,0.5); }
.seat-cards .mini-card:first-child { transform: rotate(-12deg); }
.seat-cards .mini-card:last-child { transform: rotate(12deg); }

/* showdown: revealed hole cards pop up over the avatar, hand name floating above */
.seat.cards-up .seat-avatar { opacity: 0.28; filter: saturate(0.6); }
.seat.cards-up .seat-avatar-wrap::before { opacity: 0.35; }
.seat.cards-up .seat-timer { display: none; }
.seat.cards-up .seat-position-badge { opacity: 0.4; }

.seat-reveal {
  position: absolute;
  left: 50%;
  top: calc(var(--seat-scale) * -14px);
  --reveal-dx: 0px;
  transform: translateX(calc(-50% + var(--reveal-dx)));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--seat-scale) * 3px);
  z-index: 8;
  animation: revealPop 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.4) both;
}
@keyframes revealPop {
  from { transform: translateX(calc(-50% + var(--reveal-dx))) translateY(10%) scale(0.7); opacity: 0; }
  to { transform: translateX(calc(-50% + var(--reveal-dx))) translateY(0) scale(1); opacity: 1; }
}
.seat-cards.revealed {
  position: static;
  transform: none;
  display: flex;
  padding: 3px;
  border-radius: 8px;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.7));
}
.seat-cards.revealed .mini-card {
  width: calc(var(--card-scale) * clamp(28px, 7vw, 44px));
  margin: 0 calc(var(--card-scale) * -4px);
  box-shadow: 0 3px 10px rgba(0,0,0,0.55), inset 0 0 0 1px rgba(0,0,0,0.12);
}
.seat-cards.revealed .mini-card:first-child { transform: rotate(-9deg); }
.seat-cards.revealed .mini-card:last-child { transform: rotate(9deg); }

.seat-avatar-wrap {
  position: relative;
  width: calc(var(--seat-scale) * clamp(48px, 15vw, 64px));
  height: calc(var(--seat-scale) * clamp(48px, 15vw, 64px));
  margin: 0 auto;
  z-index: 1;
}
.seat-avatar-wrap::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 130deg, #ffe7a6, #b9832f, #ffe7a6, #7d551f, #ffe7a6);
  z-index: -1;
  box-shadow: 0 3px 9px rgba(0,0,0,0.5);
}
.seat.is-turn .seat-avatar-wrap::before {
  background: conic-gradient(from 0deg, #ffd873, #f4b942 40%, #fff3cf 60%, #f4b942);
  box-shadow: 0 0 0 3px rgba(244,185,66,0.35), 0 0 24px rgba(244,185,66,0.75);
  animation: turnRing 2.4s linear infinite;
}
@keyframes turnRing { to { transform: rotate(360deg); } }
.seat.is-winner .seat-avatar-wrap::before {
  background: conic-gradient(#fff6d5, #ffd873, #fff6d5, #ffcf5c, #fff6d5);
  box-shadow: 0 0 0 4px rgba(255,216,115,0.45), 0 0 32px rgba(255,216,115,0.85);
}
.seat.is-winner .seat-avatar-wrap { animation: winnerPulse 1.1s ease-in-out infinite; }
@keyframes winnerPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }

.seat-avatar {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: calc(var(--seat-scale) * clamp(16px, 4.6vw, 22px));
  color: #fff;
  border: 2.5px solid rgba(255,255,255,0.9);
  box-shadow:
    inset 0 3px 8px rgba(255,255,255,0.3),
    inset 0 -8px 14px rgba(0,0,0,0.35),
    0 4px 12px rgba(0,0,0,0.5);
}

/* turn timer ring (SVG) */
.seat-timer {
  position: absolute;
  inset: -4px;
  width: calc(100% + 8px);
  height: calc(100% + 8px);
  transform: rotate(-90deg);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}
.seat.is-turn .seat-timer { opacity: 1; }
.seat-timer .tt-track { fill: none; stroke: rgba(0,0,0,0.4); stroke-width: 3.2; }
.seat-timer .tt-fill { fill: none; stroke: #ffe08a; stroke-width: 3.2; stroke-linecap: round; filter: drop-shadow(0 0 3px rgba(255,216,115,0.9)); }

.seat-position-badge {
  position: absolute;
  right: -10%;
  top: -8%;
  min-width: calc(var(--seat-scale) * 20px);
  height: calc(var(--seat-scale) * 20px);
  padding: 0 5px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--seat-scale) * 9.5px);
  font-weight: 800;
  border: 2px solid rgba(0,0,0,0.35);
  box-shadow: 0 2px 7px rgba(0,0,0,0.55);
  z-index: 3;
}
.seat-position-badge.dealer { background: linear-gradient(150deg, #ffffff, #d3d3d3); color: #1a1a1a; }
.seat-position-badge.sb { background: linear-gradient(150deg, #8fc0ff, #3b82f6); color: #fff; }
.seat-position-badge.bb { background: linear-gradient(150deg, #ff9a9a, #ef4444); color: #fff; }

.seat-info {
  margin-top: calc(var(--seat-scale) * 5px);
  background: var(--plate);
  border: 1px solid var(--plate-line);
  border-radius: 9px;
  padding: calc(var(--seat-scale) * 3px) calc(var(--seat-scale) * 8px);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  max-width: calc(var(--seat-scale) * 108px);
  box-shadow: 0 5px 14px rgba(0,0,0,0.45);
}
.seat-name {
  font-size: calc(var(--seat-scale) * clamp(9px, 2.4vw, 11px));
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.seat-chips {
  font-size: calc(var(--seat-scale) * clamp(8.5px, 2.2vw, 10.5px));
  color: var(--gold-2);
  font-weight: 800;
  letter-spacing: 0.2px;
}

/* bet chips: own layer, placed on the radial line between seat and pot */
.table-bet {
  position: absolute;
  left: var(--bx);
  top: var(--by);
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px 2px 3px;
  background: rgba(6, 10, 18, 0.82);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  font-size: calc(var(--seat-scale) * 11px);
  font-weight: 800;
  color: var(--gold-2);
  white-space: nowrap;
  z-index: 6;
  box-shadow: 0 3px 10px rgba(0,0,0,0.5);
  pointer-events: none;
}
.seat-disconnected {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  margin-top: 4px;
  font-size: calc(var(--seat-scale) * 9px);
  font-weight: 700;
  white-space: nowrap;
  background: rgba(6, 10, 18, 0.8);
  padding: 1px 8px;
  border-radius: 6px;
  z-index: 4;
  color: #ff8f8f;
}
.seat-hand-result {
  font-size: calc(var(--seat-scale) * 9.5px);
  font-weight: 800;
  white-space: nowrap;
  background: rgba(6, 10, 18, 0.85);
  padding: 2px 9px;
  border-radius: 999px;
  color: #7ef0a8;
}
.seat.is-winner .seat-hand-result { background: linear-gradient(180deg, #4a3616, #241a0a); color: var(--gold-2); }

.chip-dot {
  width: calc(var(--seat-scale) * 13px);
  height: calc(var(--seat-scale) * 13px);
  border-radius: 50%;
  display: inline-block;
  background: radial-gradient(circle at 35% 30%, #ffe9a8, var(--gold) 58%, #9a6c0d 100%);
  border: 1.5px dashed rgba(255,255,255,0.8);
  box-shadow: 0 1px 3px rgba(0,0,0,0.55);
  flex-shrink: 0;
}

/* ---------- Playing cards ---------- */
.card, .mini-card {
  position: relative;
  background: linear-gradient(157deg, #ffffff 0%, #f2f4f8 60%, #e4e8ef 100%);
  border-radius: calc(var(--card-scale) * 6px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(0,0,0,0.07);
  color: #1a1a1a;
  overflow: hidden;
  flex-shrink: 0;
}
.card {
  width: calc(var(--card-scale) * clamp(34px, 8vw, 52px));
  aspect-ratio: 0.68;
}
.mini-card {
  width: calc(var(--card-scale) * clamp(20px, 5vw, 28px));
  aspect-ratio: 0.68;
}
.card .card-rank, .mini-card .card-rank {
  position: absolute;
  top: 5%;
  left: 9%;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.5px;
}
.card .card-rank { font-size: calc(var(--card-scale) * clamp(11px, 2.9vw, 18px)); }
.mini-card .card-rank { font-size: calc(var(--card-scale) * clamp(8px, 2vw, 11px)); }
.card .card-suit, .mini-card .card-suit {
  position: absolute;
  right: 8%;
  bottom: 5%;
  line-height: 1;
}
.card .card-suit { font-size: calc(var(--card-scale) * clamp(15px, 3.9vw, 25px)); }
.mini-card .card-suit { font-size: calc(var(--card-scale) * clamp(9px, 2.3vw, 13px)); }
.card.red, .mini-card.red { color: #d81f2a; }
.card.black, .mini-card.black { color: #16181d; }

.card.back, .mini-card.back {
  background:
    repeating-linear-gradient(45deg, #c23b3b 0 5px, #a92f2f 5px 10px),
    #b63636;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.55), 0 3px 8px rgba(0,0,0,0.4);
}
.card.back::after, .mini-card.back::after {
  content: "";
  position: absolute;
  inset: 20%;
  border-radius: 4px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.4);
}

.card-enter {
  animation: cardFlipIn 0.45s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}
@keyframes cardFlipIn {
  from { transform: rotateY(95deg) scale(0.85); opacity: 0; }
  to { transform: rotateY(0) scale(1); opacity: 1; }
}

/* winning-combo cards — highlight via box-shadow only, so it survives the
   card's own rotation (fanned reveal / hero hand) */
.card.is-winning-card, .mini-card.is-winning-card {
  z-index: 4;
  animation: winCardGlow 1.15s ease-in-out infinite;
}
@keyframes winCardGlow {
  0%, 100% { box-shadow: 0 0 0 2px var(--gold-2), 0 0 12px 2px rgba(244, 185, 66, 0.8); }
  50% { box-shadow: 0 0 0 2.5px var(--gold-2), 0 0 22px 6px rgba(255, 216, 115, 1); }
}
/* dim the non-winning cards so the winning combo pops */
.community-cards.has-win .card:not(.is-winning-card),
.seat.is-winner .seat-cards.revealed .mini-card:not(.is-winning-card) {
  filter: brightness(0.6) saturate(0.75);
  transition: filter 0.3s;
}

/* ---------- Next hand banner (floating pill, top-centre) ---------- */
.next-hand-banner {
  position: absolute;
  left: 50%;
  top: calc(52px + env(safe-area-inset-top));
  transform: translateX(-50%);
  z-index: 11;
  text-align: center;
  padding: 5px 16px;
  background: rgba(10, 15, 24, 0.9);
  border: 1px solid rgba(244,185,66,0.35);
  border-radius: 999px;
  color: var(--gold-2);
  font-weight: 700;
  font-size: clamp(11px, 2.6vw, 13px);
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}
.next-hand-banner.hidden { display: none; }

.win-banner {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: clamp(6px, 1.5vw, 14px);
  background: linear-gradient(145deg, rgba(255,216,115,0.55), rgba(244,185,66,0.55));
  backdrop-filter: blur(10px) saturate(1.3);
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff8e6;
  padding: 7px 18px;
  border-radius: 999px;
  font-weight: 800;
  font-size: clamp(11px, 2.1vw, 15px);
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  z-index: 5;
  animation: winBannerPop 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.3) both;
  white-space: nowrap;
  max-width: min(92vw, 380px);
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
@keyframes winBannerPop {
  from { transform: translateX(-50%) scale(0.6); opacity: 0; }
  to { transform: translateX(-50%) scale(1); opacity: 1; }
}

/* ---------- Action bar ---------- */
.action-bar {
  position: relative;
  z-index: 10;
  background: linear-gradient(180deg, rgba(6,10,16,0) 0%, rgba(6,10,16,0.72) 40%, rgba(4,7,12,0.96) 100%);
  padding: 6px 14px calc(10px + env(safe-area-inset-bottom));
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  transition: box-shadow 0.25s;
}
.action-bar.my-turn {
  box-shadow: inset 0 3px 0 var(--gold), 0 -14px 34px -8px rgba(244,185,66,0.45);
}
.action-bar.my-turn .my-status { color: var(--gold-2); font-weight: 800; }

/* turn countdown — the hero's equivalent of the opponents' pod ring */
.turn-bar {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 6px;
  background: rgba(0,0,0,0.35);
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.action-bar.my-turn .turn-bar { opacity: 1; }
.turn-bar i {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  background: linear-gradient(90deg, #ef4444 0%, #f4b942 40%, #ffe08a 100%);
  box-shadow: 0 0 12px 1px rgba(255,216,115,1);
}

.hero-hand {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  z-index: 13;
  pointer-events: none;
}
.my-hand {
  display: flex;
  cursor: pointer;
  pointer-events: auto;
  transform-origin: bottom center;
  transition: transform 0.16s cubic-bezier(0.2, 0.8, 0.3, 1);
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.my-hand .card {
  width: calc(var(--card-scale) * clamp(38px, 10.5vw, 56px));
  box-shadow: 0 8px 18px rgba(0,0,0,0.55), inset 0 0 0 1px rgba(0,0,0,0.07);
  transition: transform 0.16s cubic-bezier(0.2, 0.8, 0.3, 1), margin 0.16s;
}
.my-hand .card:first-child { transform: rotate(-7deg); margin-right: -8%; }
.my-hand .card:last-child { transform: rotate(7deg); margin-left: -8%; }
.my-hand:empty { display: none; }

/* your own cards stay face-down until you peek (privacy from a neighbour) */
.my-hand.covered .card > * { visibility: hidden; }
.my-hand.covered .card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    repeating-linear-gradient(45deg, #c23b3b 0 5px, #a92f2f 5px 10px),
    #b63636;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.55);
  z-index: 2;
}
.my-hand.covered .card::after {
  content: "\2660";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--card-scale) * 20px);
  color: rgba(255,255,255,0.9);
  text-shadow: 0 1px 3px rgba(0,0,0,0.45);
  z-index: 3;
}

/* hold (touch) or hover (mouse) to view — cards flip up, spread apart, flat */
.my-hand.peek {
  transform: scale(2.2) translateY(-42%);
  z-index: 60;
  gap: calc(var(--card-scale) * 13px);
}
.my-hand.peek .card:first-child,
.my-hand.peek .card:last-child {
  transform: none;
  margin: 0;
  box-shadow: 0 14px 34px rgba(0,0,0,0.8), 0 0 0 2px rgba(255,255,255,0.5);
}
.my-hand.covered.peek .card > * { visibility: visible; }
.my-hand.covered.peek .card::before,
.my-hand.covered.peek .card::after { display: none; }
/* dim the table behind the peeked cards */
.peek-shade {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 9, 0.78);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}
.peek-shade.on { opacity: 1; }
#screen-table.peeking .action-bar { z-index: 50; }
#screen-table.peeking .table-menu { z-index: 39; }
.peek-hint {
  display: none;
  font-size: clamp(8.5px, 2.1vw, 10.5px);
  color: rgba(255,255,255,0.72);
  font-weight: 600;
  pointer-events: none;
}
/* show the hint only while your cards are face-down and not being peeked */
.my-hand.covered ~ .peek-hint { display: block; }
.my-hand.covered.peek ~ .peek-hint { display: none; }
/* hide the hand-rank label while the cards are face-down; reveal it on peek */
.my-hand.covered ~ .hand-rank { display: none; }
.my-hand.covered.peek ~ .hand-rank { display: block; }
.hand-rank {
  background: linear-gradient(180deg, #4a3616, #241a0a);
  border: 1px solid rgba(244,185,66,0.55);
  color: var(--gold-2);
  font-weight: 800;
  font-size: clamp(9.5px, 2.5vw, 12px);
  padding: 2px 10px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.55);
  white-space: nowrap;
}
.hand-rank:empty { display: none; }

.my-status {
  flex: 1;
  min-width: 120px;
  text-align: center;
  font-size: clamp(11px, 2.8vw, 13.5px);
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  min-height: 15px;
}
.my-status:empty { display: none; }
.my-status .accent { color: var(--gold-2); font-weight: 800; }

.action-buttons {
  flex-basis: 100%;
  display: flex;
  gap: 8px;
  justify-content: center;
}
.action-buttons:empty { display: none; }
.action-btn {
  flex: 1;
  min-width: 0;
  max-width: 170px;
  padding: clamp(10px, 2.6vw, 15px) 6px;
  border: none;
  border-radius: 14px;
  font-size: clamp(13px, 3.6vw, 17px);
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
  transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
}
.action-btn .btn-sub { font-size: 0.68em; font-weight: 700; opacity: 0.92; }
.action-btn:active { transform: translateY(3px); }
.action-btn.fold {
  background: linear-gradient(180deg, #ff7373, #e23b3b);
  box-shadow: 0 5px 0 #9e1f1f, 0 9px 18px rgba(0,0,0,0.45);
}
.action-btn.fold:active { box-shadow: 0 2px 0 #9e1f1f, 0 5px 12px rgba(0,0,0,0.45); }
.action-btn.check, .action-btn.call {
  background: linear-gradient(180deg, #4dd489, #22a857);
  box-shadow: 0 5px 0 #14683a, 0 9px 18px rgba(0,0,0,0.45);
}
.action-btn.check:active, .action-btn.call:active { box-shadow: 0 2px 0 #14683a, 0 5px 12px rgba(0,0,0,0.45); }
.action-btn.raise {
  background: linear-gradient(180deg, #ffce6b, #f0a52e);
  color: #3a2500;
  box-shadow: 0 5px 0 #a5701a, 0 9px 18px rgba(0,0,0,0.45);
}
.action-btn.raise:active { box-shadow: 0 2px 0 #a5701a, 0 5px 12px rgba(0,0,0,0.45); }
.action-btn.allin {
  background: linear-gradient(180deg, #c19bff, #8b5cf6);
  box-shadow: 0 5px 0 #5534a8, 0 9px 18px rgba(0,0,0,0.45);
}
.action-btn.allin:active { box-shadow: 0 2px 0 #5534a8, 0 5px 12px rgba(0,0,0,0.45); }
.action-btn:disabled { opacity: 0.4; box-shadow: none; filter: saturate(0.5); cursor: not-allowed; transform: none; }

.raise-controls {
  flex-basis: 100%;
  margin-top: 8px;
  background: rgba(8, 12, 20, 0.9);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 12px;
}
.raise-controls.hidden { display: none; }
.raise-presets {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.preset-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
}
.preset-btn:active { background: rgba(244,185,66,0.25); }
.raise-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
#raise-slider {
  flex: 1;
  accent-color: var(--gold);
  height: 6px;
}
#raise-amount {
  width: 96px;
  text-align: center;
  padding: 9px 8px;
  font-weight: 800;
  color: var(--gold-2);
}
.raise-confirm-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 10px;
}

/* ---------- Log drawer ---------- */
.log-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 60dvh;
  background: #0a0f1c;
  border-top: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  transform: translateY(100%);
  transition: transform 0.28s ease;
  z-index: 20;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
}
.log-drawer.open { transform: translateY(0); }
.log-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.log-panel {
  padding: 10px 16px calc(14px + env(safe-area-inset-bottom));
  overflow-y: auto;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.7;
}
.log-panel div:last-child { color: var(--text); }
.log-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 19;
}
.log-scrim.hidden { display: none; }

/* ---------- Toasts ---------- */
.toast-container {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: min(92vw, 380px);
}
.toast {
  background: rgba(24,20,10,0.95);
  border: 1px solid rgba(244,185,66,0.4);
  color: var(--text);
  padding: 11px 18px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: toastIn 0.25s ease both;
  text-align: center;
}
.toast.toast-error { border-color: rgba(239,68,68,0.5); background: rgba(35,14,14,0.95); }
.toast.toast-out { animation: toastOut 0.25s ease both; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-10px) scale(0.95); }
}

/* ---------- Confetti ---------- */
.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  top: -20px;
  width: 8px;
  height: 14px;
  opacity: 0.9;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  to { transform: translateY(115vh) rotate(540deg); opacity: 0.2; }
}

/* ---------- Small phones ---------- */
@media (max-width: 360px) {
  #screen-table { --seat-scale: 0.72; --card-scale: 0.82; }
  .action-btn { font-size: 12.5px; padding: 9px 4px; }
}

/* ---------- Landscape: the felt becomes one big oval table ---------- */
@media (orientation: landscape) {
  #screen-table { --seat-scale: 0.9; --card-scale: 0.9; }
  .table-wrap { padding: 34px 22px 4px; }

  .poker-table {
    --rail-w: clamp(9px, 1.3vw, 15px);
    width: min(96vw, 1160px);
    height: min(100%, 460px);
    max-height: none;
    border-radius: 46% / 46%;
  }
  .community-area { top: 42%; width: 62%; gap: 5px; }

  .action-bar { padding-top: 2px; }
  .hero-hand { bottom: calc(100% + 2px); }
  .next-hand-banner { padding: 4px 10px; }
}

/* ---------- Desktop / large screens ---------- */
@media (min-width: 900px) {
  #screen-table { --seat-scale: 1.4; --card-scale: 1.3; }
  .table-wrap { padding: 48px 28px 8px; }
  .poker-table {
    --rail-w: 16px;
    width: min(92vw, 1300px);
    height: min(100%, 560px);
    max-height: none;
    border-radius: 46% / 48%;
  }
  .community-area { top: 44%; width: 50%; gap: 10px; }
  .hero-hand { bottom: calc(100% + 6px); }
  .action-btn { max-width: 210px; border-radius: 16px; }
  .my-hand.peek { transform: scale(1.7) translateY(-42%); }
}

/* ---------- Short landscape (phones held sideways): hero lives in the bar ---------- */
@media (orientation: landscape) and (max-height: 500px) {
  #screen-table { --seat-scale: 0.8; --card-scale: 0.82; }
  .table-wrap { padding: 26px 20px 2px; }
  .poker-table { height: 100%; }
  .menu-toggle { width: 32px; height: 32px; font-size: 15px; }
  .seat.is-self { display: none; }
  .community-area { top: 40%; }
  .hero-hand { bottom: calc(100% + 1px); }
  .action-bar { gap: 3px 8px; padding-top: 4px; }
  .action-btn { padding: 8px 5px; }
  .poker-table::after { font-size: 22vw; }
  .next-hand-banner { display: none; }
  .my-hand.peek { transform: scale(1.7) translateY(-48%); }
}
