:root {
  color-scheme: dark;
  --bg-ink: #060809;
  --bg-soft: #0e1114;
  --wood-dark: #140f0f;
  --wood-mid: #241919;
  --wood-light: #34211f;
  --felt-dark: #0d312b;
  --felt-mid: #15614f;
  --felt-glow: rgba(78, 205, 166, 0.16);
  --gold: #d3b066;
  --gold-soft: #f4e3b5;
  --amber: #ca9150;
  --cream: #faf4e7;
  --muted: #d4c4a1;
  --muted-soft: #8f7e64;
  --card-dark: #121314;
  --card-soft: rgba(13, 15, 16, 0.78);
  --line: rgba(244, 227, 181, 0.18);
  --line-strong: rgba(244, 227, 181, 0.38);
  --shadow: rgba(0, 0, 0, 0.55);
  --danger: #b84d4d;
  --success: #4f9778;
  --toast: rgba(8, 10, 12, 0.94);
  --surface: rgba(12, 14, 16, 0.86);
  --surface-soft: rgba(20, 23, 27, 0.82);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --serif: "Baskerville Old Face", "Palatino Linotype", Georgia, serif;
  --sans: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
}

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

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

body {
  background:
    radial-gradient(circle at top, rgba(211, 176, 102, 0.13), transparent 30%),
    radial-gradient(circle at 20% 0%, rgba(21, 97, 79, 0.18), transparent 28%),
    linear-gradient(180deg, #0d0f12 0%, #040505 100%);
  color: var(--cream);
  font-family: var(--sans);
  overflow: hidden;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  filter: none !important;
  transform: none !important;
}

[hidden] {
  display: none !important;
}

.screen {
  display: none;
  min-height: 100dvh;
}

.screen-active {
  display: grid;
}

.intro-screen {
  place-items: center;
  padding: 24px;
  overflow: auto;
  background:
    radial-gradient(circle at 50% 18%, rgba(211, 176, 102, 0.15), transparent 26%),
    linear-gradient(180deg, rgba(10, 12, 14, 0.94), rgba(4, 5, 6, 0.98));
}

.hero-card {
  width: min(560px, 100%);
  padding: 32px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(22, 26, 29, 0.9), rgba(10, 13, 14, 0.96)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent 55%);
  border: 1px solid var(--line);
  box-shadow: 0 28px 90px var(--shadow);
  text-align: center;
}

.hero-card.wide {
  width: min(680px, 100%);
}

.hero-card h1,
.modal-header h2,
.brand-lockup h1,
.center-panel h2 {
  margin: 0;
  font-family: var(--serif);
  letter-spacing: -0.04em;
}

.hero-kicker,
.rail-kicker,
.section-label,
.center-kicker {
  margin: 0 0 10px;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-card h1 {
  font-size: clamp(2.2rem, 4vw, 3.1rem);
  line-height: 0.95;
}

.hero-card p,
.hero-card li,
.modal-note,
.howto-copy p {
  color: var(--cream);
  opacity: 0.9;
  line-height: 1.55;
}

.consent-list,
.rules-list {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.consent-list li,
.rules-list li {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.primary-button,
.secondary-button,
.rail-button,
.action-button,
.chip-button,
.quick-chip,
.mode-pill,
.icon-button {
  border-radius: 999px;
  transition: transform 0.12s ease, filter 0.18s ease, background 0.18s ease;
}

.primary-button,
.action-button.primary {
  padding: 12px 22px;
  background: linear-gradient(180deg, #ecd28f, #c69a46);
  color: #1f130c;
  font-weight: 800;
}

.secondary-button,
.action-button.secondary,
.quick-chip,
.rail-button {
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--cream);
  border: 1px solid var(--line);
}

.link-button {
  text-decoration: none;
}

.primary-button:hover,
.secondary-button:hover,
.action-button:hover,
.chip-button:hover,
.quick-chip:hover,
.mode-pill:hover,
.icon-button:hover {
  filter: brightness(1.06);
}

.primary-button:active,
.secondary-button:active,
.action-button:active,
.chip-button:active,
.quick-chip:active,
.mode-pill:active,
.icon-button:active {
  transform: scale(0.97);
}

.policy-link {
  display: inline-block;
  margin-top: 18px;
  color: var(--gold-soft);
}

.loading-chips {
  display: inline-flex;
  gap: 10px;
  margin-top: 26px;
}

.loading-chips span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff2c7, #b78334);
  animation: pulse-chip 1.2s infinite ease-in-out;
}

.loading-chips span:nth-child(2) { animation-delay: 0.16s; }
.loading-chips span:nth-child(3) { animation-delay: 0.32s; }

@keyframes pulse-chip {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(-6px); opacity: 1; }
}

.app-screen.screen-active {
  display: block;
  height: 100dvh;
  overflow: hidden;
}

.app-shell {
  height: 100dvh;
  width: min(1480px, 100%);
  margin: 0 auto;
  padding:
    calc(10px + env(safe-area-inset-top))
    10px
    calc(10px + env(safe-area-inset-bottom));
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 16px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(9, 11, 13, 0.94), rgba(20, 16, 17, 0.86)),
    linear-gradient(90deg, rgba(211, 176, 102, 0.08), transparent 38%);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.3);
}

.room-hud {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 8;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 1.8rem;
  color: #25170c;
  background:
    radial-gradient(circle at 30% 30%, #fff6d7, #d9b567 58%, #8c6a2f 100%);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.3);
}

.brand-lockup h1 {
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  line-height: 0.9;
}

.topbar-actions {
  display: inline-flex;
  gap: 8px;
}

.icon-button {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--cream);
  border: 1px solid var(--line);
  font-weight: 900;
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  justify-self: end;
}

.avatar-shell,
.seat-avatar,
.strip-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(211, 176, 102, 0.35), rgba(18, 22, 24, 0.92));
  color: var(--cream);
  font-weight: 800;
}

.avatar-shell img,
.seat-avatar img,
.strip-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-copy {
  display: grid;
  gap: 2px;
}

.profile-copy strong {
  font-size: 0.95rem;
}

.profile-copy span {
  color: var(--gold-soft);
  font-size: 0.84rem;
}

.muted-copy {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.room-layout {
  height: 100%;
}

.table-room,
.table-rail .rail-card,
.participant-strip,
.modal-card {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 24px 70px var(--shadow);
}

.table-room {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  height: 100%;
  padding: 0;
  background:
    radial-gradient(circle at 50% -10%, rgba(211, 176, 102, 0.11), transparent 34%),
    linear-gradient(180deg, rgba(12, 13, 16, 0.98), rgba(8, 8, 10, 0.99));
  min-height: 0;
}

.wood-panels {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent 28%),
    repeating-linear-gradient(
      90deg,
      rgba(46, 28, 28, 0.36) 0 56px,
      rgba(20, 16, 18, 0.74) 56px 108px,
      rgba(64, 38, 33, 0.24) 108px 114px
    );
  pointer-events: none;
}

.wall-sconce {
  position: absolute;
  top: 30px;
  width: 22px;
  height: 80px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 232, 177, 0.95), rgba(211, 143, 66, 0.28) 65%, transparent 100%);
  box-shadow: 0 0 24px rgba(255, 201, 113, 0.32), 0 0 120px rgba(255, 201, 113, 0.12);
}

.wall-sconce.left { left: 22px; }
.wall-sconce.right { right: 22px; }

.table-stage {
  position: relative;
  min-height: 0;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 84px 268px 16px 14px;
}

.bank-medallion {
  position: absolute;
  top: 2px;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 244, 205, 0.94), rgba(210, 176, 97, 0.96) 52%, rgba(77, 54, 26, 0.96) 100%);
  color: #24140c;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.4);
  z-index: 3;
}

.bank-title {
  display: block;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 0.9;
}

.bank-subtitle {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.felt-table {
  position: relative;
  display: grid;
  align-content: stretch;
  justify-items: center;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  gap: 6px;
  width: auto;
  height: min(100%, 572px);
  max-width: min(100%, 1040px);
  aspect-ratio: 1.62 / 1;
  padding: 48px 18px 12px;
  border-radius: 48% / 38%;
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 255, 255, 0.08), transparent 24%),
    radial-gradient(circle at 50% 58%, rgba(74, 205, 166, 0.1), transparent 34%),
    linear-gradient(180deg, #15614f, var(--felt-dark));
  border: 12px solid rgba(11, 13, 14, 0.94);
  box-shadow:
    inset 0 0 0 4px rgba(244, 227, 181, 0.38),
    inset 0 0 40px var(--felt-glow),
    0 30px 80px rgba(0, 0, 0, 0.4);
}

.ring-seats {
  position: absolute;
  inset: 100px 8px 52px;
  pointer-events: none;
  z-index: 1;
}

.seat {
  position: absolute;
  width: 126px;
  padding: 9px 11px;
  display: grid;
  gap: 6px;
  place-items: center;
  border-radius: 18px;
  background: rgba(8, 12, 14, 0.7);
  border: 1px solid rgba(244, 227, 181, 0.14);
  backdrop-filter: blur(10px);
  pointer-events: auto;
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.22);
}

.seat-0 { top: 30px; left: 50%; transform: translateX(-50%); }
.seat-1 { top: 132px; right: 6px; }
.seat-2 { top: 330px; right: -6px; }
.seat-3 { bottom: 70px; right: 86px; }
.seat-4 { bottom: 70px; left: 86px; }
.seat-5 { top: 330px; left: -6px; }

.seat.open {
  opacity: 0.46;
}

.seat.active {
  box-shadow: inset 0 0 0 1px rgba(212, 177, 100, 0.45), 0 0 0 2px rgba(212, 177, 100, 0.16);
}

.seat-label {
  text-align: center;
}

.seat-label strong {
  display: block;
  font-size: 0.9rem;
}

.seat-label span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mode-pills,
.center-metrics,
.action-tray {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.mode-pills {
  margin-bottom: 0;
  width: min(100%, 360px);
}

.mode-pill {
  padding: 9px 14px;
  background: rgba(7, 10, 12, 0.32);
  color: var(--cream);
  border: 1px solid var(--line);
}

.mode-pill.active {
  background: linear-gradient(180deg, rgba(230, 208, 143, 0.96), rgba(203, 162, 81, 0.96));
  color: #1f1710;
}

.dealer-area,
.player-area,
.center-panel {
  position: relative;
  z-index: 2;
}

.dealer-area {
  width: min(100%, 220px);
  text-align: center;
}

.card-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 66px;
}

.score-copy {
  min-height: 18px;
  margin: 2px 0 0;
  color: var(--gold-soft);
  font-size: 0.86rem;
}

.center-panel {
  width: min(100%, 350px);
  margin: 0;
  text-align: center;
}

.center-panel .hero-actions {
  gap: 8px;
  margin-top: 10px;
}

.center-panel h2 {
  font-size: clamp(1.2rem, 2vw, 1.82rem);
  line-height: 1.02;
  margin-bottom: 4px;
}

.center-panel p {
  color: var(--cream);
  opacity: 0.92;
  margin: 0;
  line-height: 1.08;
  font-size: 0.94rem;
}

.metric-pill {
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(7, 10, 12, 0.34);
  border: 1px solid var(--line);
  font-size: 0.78rem;
}

.center-metrics {
  gap: 8px;
}

.metric-pill.accent {
  color: #23150c;
  background: linear-gradient(180deg, rgba(235, 214, 154, 0.96), rgba(198, 155, 73, 0.96));
}

.player-area {
  width: min(100%, 560px);
  margin-top: 0;
  align-self: end;
  display: grid;
  gap: 6px;
  justify-items: center;
}

.hand-stack {
  width: min(100%, 560px);
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.hand-panel {
  min-width: 168px;
  padding: 8px;
  border-radius: var(--radius-lg);
  background: rgba(8, 11, 13, 0.5);
  border: 1px solid rgba(244, 227, 181, 0.12);
}

.betting-placeholder {
  min-width: 0;
  width: min(100%, 560px);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.betting-placeholder strong,
.betting-placeholder .hand-outcome {
  white-space: nowrap;
}

.placeholder-copy {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.12;
  text-align: center;
}

.hand-panel:has(.muted-copy):not(:has(.playing-card)) {
  min-width: 0;
  width: min(100%, 380px);
  padding: 8px 12px;
}

.hand-panel:has(.muted-copy):not(:has(.playing-card)) .hand-head {
  margin-bottom: 2px;
}

.hand-panel:has(.muted-copy):not(:has(.playing-card)) .muted-copy {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.18;
}

.hand-panel.active {
  box-shadow: inset 0 0 0 1px rgba(212, 177, 100, 0.3), 0 0 0 2px rgba(212, 177, 100, 0.16);
}

.hand-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 4px;
}

.hand-outcome {
  color: var(--gold-soft);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.playing-card {
  width: 44px;
  height: 64px;
  padding: 6px 5px;
  display: grid;
  align-content: space-between;
  border-radius: 12px;
  background: linear-gradient(180deg, #fffdf9, #e9dfcb);
  color: #23170e;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.playing-card.red { color: #b64444; }

.playing-card.back {
  background:
    repeating-linear-gradient(45deg, rgba(232, 209, 153, 0.18) 0 8px, rgba(65, 37, 20, 0.24) 8px 16px),
    linear-gradient(180deg, #3e2b1f, #1d140f);
  color: var(--gold-soft);
}

.playing-card .rank {
  font-weight: 900;
  font-size: 0.88rem;
}

.playing-card .suit {
  justify-self: end;
  font-size: 0.88rem;
}

.chip-tray {
  position: static;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  width: min(100%, 760px);
  margin-top: 0;
  gap: 8px;
}

.chip-button,
.quick-chip {
  padding: 8px 11px;
  width: 100%;
  min-width: 0;
  background: rgba(7, 10, 12, 0.82);
  color: var(--cream);
  border: 1px solid rgba(244, 227, 181, 0.18);
  font-weight: 800;
}

.chip-button {
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 233, 176, 0.16), transparent 36%),
    linear-gradient(180deg, rgba(12, 18, 19, 0.96), rgba(24, 28, 32, 0.96));
}

.action-tray {
  position: static;
  width: min(100%, 560px);
  margin-top: 0;
}

.action-button {
  padding: 8px 12px;
  min-width: 82px;
  font-weight: 800;
}

.table-rail {
  position: absolute;
  top: 102px;
  right: 14px;
  bottom: 14px;
  width: 248px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.rail-card {
  border-radius: 22px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(12, 14, 16, 0.92), rgba(18, 20, 24, 0.88)),
    linear-gradient(135deg, rgba(211, 176, 102, 0.05), transparent 58%);
  min-height: 0;
}

.rail-card h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 1.08rem;
}

.rail-callout,
.rail-state {
  flex: 0 0 auto;
}

.rail-rules,
.rail-history {
  flex: 1 1 0;
  overflow: hidden;
}

.rail-stats {
  display: grid;
  gap: 12px;
}

.rail-stats div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.rail-stats span,
.history-item time {
  color: var(--muted);
  font-size: 0.78rem;
}

.rules-list {
  display: grid;
  gap: 8px;
}

.history-list,
.leaderboard-list,
.recent-list {
  display: grid;
  gap: 10px;
}

.history-list {
  max-height: 100%;
  overflow: auto;
}

.history-item,
.leaderboard-row,
.recent-row,
.stats-tile {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(244, 227, 181, 0.1);
}

.participant-strip {
  position: absolute;
  left: 14px;
  right: 274px;
  bottom: 14px;
  z-index: 4;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 10px 12px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(9, 12, 14, 0.96), rgba(13, 16, 19, 0.92)),
    linear-gradient(90deg, rgba(21, 97, 79, 0.1), transparent 32%);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
}

.participant-card {
  min-width: 138px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(244, 227, 181, 0.12);
}

.table-room[data-phase="betting"] .felt-table {
  grid-template-rows: auto auto auto auto auto auto;
}

.table-room[data-phase="betting"] .player-area .section-label {
  display: none;
}

.table-room[data-phase="betting"] .player-area {
  align-self: start;
}

.rotate-lock {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  padding: 24px;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(4, 6, 8, 0.94), rgba(7, 9, 11, 0.98)),
    radial-gradient(circle at 50% 25%, rgba(211, 176, 102, 0.16), transparent 30%);
  backdrop-filter: blur(10px);
}

.rotate-card {
  width: min(460px, 100%);
  padding: 28px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(14, 18, 21, 0.98), rgba(9, 11, 13, 0.98)),
    linear-gradient(180deg, rgba(211, 176, 102, 0.07), transparent 38%);
  box-shadow: 0 24px 70px var(--shadow);
  text-align: center;
}

.rotate-card h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 2.8rem);
  letter-spacing: -0.04em;
}

.rotate-card p:last-child {
  margin: 12px 0 0;
  color: var(--cream);
  opacity: 0.9;
  line-height: 1.45;
}

.participant-card.active {
  box-shadow: inset 0 0 0 1px rgba(212, 177, 100, 0.32);
}

.participant-meta strong,
.leaderboard-row strong {
  display: block;
}

.participant-meta span,
.leaderboard-row span,
.recent-row span {
  color: var(--muted);
  font-size: 0.8rem;
}

.stats-tile span {
  color: var(--muted);
  font-size: 0.8rem;
}

.modal-shell {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 6, 8, 0.82);
  backdrop-filter: blur(10px);
  z-index: 25;
}

.modal-card {
  width: min(620px, 100%);
  max-height: min(86dvh, 760px);
  overflow: auto;
  border-radius: 28px;
  padding: 26px;
  background:
    linear-gradient(180deg, rgba(14, 18, 21, 0.98), rgba(9, 11, 13, 0.98)),
    linear-gradient(180deg, rgba(211, 176, 102, 0.07), transparent 38%);
}

.modal-header {
  margin-bottom: 18px;
}

.modal-close {
  float: right;
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--cream);
  border: 1px solid var(--line);
  border-radius: 50%;
}

.settings-grid,
.stats-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

.settings-row,
.stats-tile {
  display: grid;
  gap: 10px;
}

.settings-row {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(244, 227, 181, 0.1);
}

.settings-row select,
.settings-row input[type="range"] {
  width: 100%;
}

.leaderboard-row,
.recent-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.howto-copy h3 {
  margin: 18px 0 8px;
  font-family: var(--serif);
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  z-index: 30;
}

.toast {
  min-width: 260px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--toast);
  border: 1px solid var(--line);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

@media (max-width: 1480px), (max-height: 920px) {
  .ring-seats,
  .participant-strip {
    display: none;
  }

  .table-stage {
    padding-top: 76px;
    padding-right: 236px;
    padding-bottom: 16px;
  }

  .felt-table {
    height: min(100%, 520px);
    padding: 44px 16px 10px;
  }

  .table-rail {
    width: 224px;
  }

  .bank-medallion {
    width: 78px;
    height: 78px;
  }

  .bank-title {
    font-size: 1.18rem;
  }

  .bank-subtitle {
    font-size: 0.62rem;
  }

  .rail-card {
    padding: 12px;
  }

  .history-item,
  .leaderboard-row,
  .recent-row,
  .stats-tile {
    padding: 10px 12px;
  }
}

@media (max-width: 1200px), (max-height: 820px) {
  .topbar .hero-kicker {
    display: none;
  }

  .hero-kicker,
  .rail-kicker,
  .section-label,
  .center-kicker {
    margin-bottom: 4px;
    font-size: 0.64rem;
    letter-spacing: 0.15em;
  }

  .room-hud {
    top: 10px;
    left: 10px;
    right: 10px;
  }

  .rail-rules,
  .rail-history {
    display: none;
  }

  .table-stage {
    padding-top: 72px;
    padding-right: 212px;
    padding-left: 10px;
    padding-bottom: 14px;
  }

  .table-rail {
    top: 88px;
    right: 10px;
    bottom: 10px;
    width: 192px;
  }

  .felt-table {
    height: min(100%, 464px);
    padding: 40px 14px 10px;
  }

  .center-panel {
    width: min(100%, 312px);
  }

  .center-panel h2 {
    font-size: clamp(1.08rem, 1.7vw, 1.45rem);
  }

  .dealer-area {
    width: min(100%, 188px);
  }

  .player-area {
    width: min(100%, 500px);
  }

  .chip-tray,
  .action-tray {
    width: min(100%, 620px);
  }

  .chip-tray {
    gap: 6px;
  }

  .center-panel .hero-actions {
    margin-top: 8px;
  }
}

@media (orientation: landscape) and (max-width: 1024px) {
  .app-shell {
    padding:
      calc(8px + env(safe-area-inset-top))
      8px
      calc(8px + env(safe-area-inset-bottom));
  }

  .room-hud {
    top: 8px;
    left: 8px;
    right: 8px;
  }

  .topbar {
    padding: 6px 8px;
    border-radius: 20px;
    grid-template-columns: 1fr auto auto;
  }

  .topbar .hero-kicker {
    display: none;
  }

  .brand-lockup {
    gap: 10px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 14px;
    font-size: 1.2rem;
  }

  .brand-lockup h1 {
    font-size: clamp(1.2rem, 2vw, 1.6rem);
  }

  .topbar-actions {
    gap: 6px;
  }

  .icon-button {
    width: 30px;
    height: 30px;
  }

  .profile-chip {
    gap: 6px;
    padding: 5px 8px;
  }

  .avatar-shell,
  .seat-avatar,
  .strip-avatar {
    width: 28px;
    height: 28px;
  }

  .profile-copy strong {
    font-size: 0.86rem;
  }

  .profile-copy span {
    font-size: 0.75rem;
  }

  .table-room {
    border-radius: 24px;
  }

  .wall-sconce,
  .ring-seats,
  .participant-strip,
  .table-rail,
  .rail-rules,
  .rail-history {
    display: none;
  }

  .table-stage {
    padding: 42px 4px 4px;
  }

  .felt-table {
    height: min(100%, 232px);
    max-width: min(100%, 760px);
    aspect-ratio: 1.96 / 1;
    padding: 28px 8px 6px;
    gap: 3px;
    border-width: 6px;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
    box-shadow:
      inset 0 0 0 3px rgba(244, 227, 181, 0.3),
      inset 0 0 22px var(--felt-glow),
      0 18px 42px rgba(0, 0, 0, 0.28);
  }

  .bank-medallion {
    top: 0;
    width: 56px;
    height: 56px;
  }

  .bank-title {
    font-size: 0.84rem;
  }

  .bank-subtitle {
    font-size: 0.46rem;
  }

  .mode-pills {
    width: min(100%, 220px);
  }

  .mode-pill {
    padding: 4px 8px;
    font-size: 0.62rem;
  }

  .dealer-area {
    width: min(100%, 132px);
  }

  .card-row {
    gap: 4px;
    min-height: 38px;
  }

  .playing-card {
    width: 26px;
    height: 38px;
    padding: 3px;
    border-radius: 8px;
  }

  .playing-card .rank,
  .playing-card .suit {
    font-size: 0.52rem;
  }

  .score-copy {
    display: none;
  }

  .center-panel {
    width: min(100%, 200px);
  }

  .center-kicker,
  #center-copy,
  .section-label {
    display: none;
  }

  .center-panel h2 {
    font-size: clamp(0.68rem, 1.45vw, 0.86rem);
  }

  .metric-pill {
    padding: 3px 6px;
    font-size: 0.54rem;
  }

  .center-metrics {
    gap: 3px;
  }

  .hero-actions {
    gap: 4px;
    margin-top: 2px;
  }

  .primary-button,
  .secondary-button,
  .action-button.secondary,
  .action-button.primary {
    padding: 4px 7px;
    font-size: 0.6rem;
  }

  .player-area {
    width: min(100%, 332px);
  }

  .hand-stack {
    gap: 4px;
  }

  .hand-panel {
    min-width: 108px;
    padding: 4px;
    border-radius: 12px;
  }

  .hand-panel:has(.muted-copy):not(:has(.playing-card)) {
    width: min(100%, 230px);
    padding: 5px 8px;
  }

  .betting-placeholder {
    width: min(100%, 320px);
    padding: 4px 8px;
    gap: 8px;
  }

  .betting-placeholder strong,
  .betting-placeholder .hand-outcome,
  .placeholder-copy {
    font-size: 0.52rem;
  }

  .hand-head {
    gap: 4px;
    margin-bottom: 2px;
  }

  .hand-outcome,
  .muted-copy {
    font-size: 0.54rem;
  }

  .chip-tray,
  .action-tray {
    width: min(100%, 404px);
    gap: 4px;
  }

  .chip-tray {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .chip-button,
  .quick-chip,
  .action-button {
    min-width: 0;
    padding: 3px 5px;
    font-size: 0.56rem;
  }

  .table-room[data-phase="betting"] .felt-table {
    grid-template-rows: auto auto auto auto auto auto;
  }

  .profile-copy,
  .brand-lockup h1 {
    display: none;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
  }

  .profile-copy span {
    font-size: 0.72rem;
  }
}

@media (orientation: portrait) and (max-width: 1024px) {
  .rotate-lock {
    display: grid;
  }

  .room-layout,
  .topbar {
    filter: blur(16px);
    opacity: 0.18;
    pointer-events: none;
    user-select: none;
  }
}

@media (max-width: 760px) {
  .modal-shell {
    padding: 14px;
  }

  .modal-card {
    width: min(520px, 100%);
    padding: 18px;
    border-radius: 22px;
    max-height: min(90dvh, 720px);
  }

  .toast-stack {
    left: 14px;
    right: 14px;
    bottom: 14px;
  }

  .toast {
    min-width: 0;
    max-width: none;
  }
}
