:root {
  --ink: #f5efe2;
  --ink-soft: #d9d0bd;
  --muted: #9e9585;
  --black: #090806;
  --black-soft: #0f0d0a;
  --panel: #15120e;
  --panel-raised: #1d1812;
  --leather: #281711;
  --leather-deep: #150c09;
  --felt: #0d3d2e;
  --felt-light: #155940;
  --felt-dark: #062219;
  --gold: #d5aa53;
  --gold-pale: #f0d48b;
  --gold-deep: #77501e;
  --gold-line: rgba(218, 177, 91, 0.28);
  --danger: #d97768;
  --success: #75b991;
  --line: rgba(235, 216, 171, 0.13);
  --shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.48);
  --shadow-tight: 0 0.75rem 1.75rem rgba(0, 0, 0, 0.38);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
  font-family: var(--sans);
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--black);
  color: var(--ink);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% -10%, rgba(126, 79, 31, 0.2), transparent 32rem),
    radial-gradient(circle at 90% 20%, rgba(45, 21, 12, 0.34), transparent 35rem),
    linear-gradient(145deg, #0d0b08, #070605 72%);
  color: var(--ink);
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background:
    repeating-linear-gradient(92deg, transparent 0 4px, rgba(255, 255, 255, 0.012) 5px, transparent 6px 11px),
    repeating-linear-gradient(2deg, rgba(255, 255, 255, 0.008) 0 1px, transparent 1px 5px);
  content: "";
  opacity: 0.7;
  pointer-events: none;
}

body.nav-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, .button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button, select { cursor: pointer; }
img { max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: var(--gold); color: #171109; }
:focus-visible { outline: 2px solid var(--gold-pale); outline-offset: 3px; }

.skip-link {
  position: fixed;
  z-index: 2000;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gold);
  border-radius: 0.4rem;
  background: var(--black);
  color: var(--ink);
  transform: translateY(-150%);
}

.skip-link:focus { transform: none; }

/* Shared chrome */
.site-header {
  position: sticky;
  z-index: 500;
  top: 0;
  height: 4.5rem;
  border-bottom: 1px solid var(--gold-line);
  background: linear-gradient(180deg, rgba(25, 20, 14, 0.96), rgba(8, 7, 5, 0.96)), var(--black);
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.28), inset 0 -1px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(1rem);
}

.header-inner {
  display: flex;
  width: min(100%, 92rem);
  height: 100%;
  margin: 0 auto;
  padding: 0 1rem;
  align-items: center;
  justify-content: space-between;
}

.brand { display: inline-flex; gap: 0.65rem; align-items: center; }

.brand-mark {
  position: relative;
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid #f2d98e;
  border-radius: 50%;
  place-items: center;
  background:
    radial-gradient(circle at 35% 25%, #f7dfa1 0 8%, transparent 9%),
    linear-gradient(145deg, #ebcb77, #8e6329 55%, #d5a94e);
  box-shadow: inset 0 0 0 2px #4c3215, inset 0 0 0 3px rgba(255, 240, 184, 0.45), 0 0.3rem 0.8rem rgba(0, 0, 0, 0.4);
  color: #1a1209;
  font-size: 1.05rem;
  text-shadow: 0 1px rgba(255, 255, 255, 0.35);
}

.brand-name { display: grid; line-height: 1; }
.brand-name strong { font-family: var(--serif); font-size: 1.12rem; font-weight: 500; letter-spacing: 0.025em; }
.brand-name small { margin-top: 0.3rem; color: var(--gold); font-size: 0.47rem; font-weight: 800; letter-spacing: 0.3em; text-transform: uppercase; }

.nav-toggle {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.72rem;
  border: 1px solid var(--gold-line);
  border-radius: 50%;
  place-content: center;
  gap: 0.25rem;
  background: linear-gradient(180deg, #201a12, #100d09);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08), 0 0.35rem 1rem rgba(0, 0, 0, 0.3);
}

.nav-toggle span { display: block; width: 1rem; height: 1px; background: var(--gold-pale); transition: transform 180ms ease, opacity 180ms ease; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-5px) rotate(-45deg); }

.site-nav {
  position: fixed;
  top: 4.5rem;
  right: 0;
  left: 0;
  display: none;
  max-height: calc(100dvh - 4.5rem);
  padding: 0.75rem 1rem max(1.2rem, env(safe-area-inset-bottom));
  overflow-y: auto;
  border-bottom: 1px solid var(--gold-line);
  background: linear-gradient(180deg, rgba(19, 15, 11, 0.99), rgba(8, 7, 5, 0.99)), var(--black);
  box-shadow: var(--shadow);
}

.site-nav.is-open { display: grid; }
.site-nav a { min-height: 3.25rem; padding: 0.95rem 0.75rem; border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: 0.84rem; font-weight: 650; letter-spacing: 0.025em; }
.site-nav a:hover { color: var(--gold-pale); }
.site-nav .profile-link { color: var(--gold-pale); }

.site-nav .nav-cta {
  min-height: 2.75rem;
  margin-top: 0.75rem;
  padding: 0.8rem 1rem;
  border: 1px solid #e6c474;
  border-radius: 0.4rem;
  background: linear-gradient(180deg, #e6c36d, #aa762e);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.45), 0 0.35rem 1rem rgba(0, 0, 0, 0.3);
  color: #181006;
  text-align: center;
  text-shadow: 0 1px rgba(255, 255, 255, 0.3);
}

.page-shell { width: min(100%, 76rem); margin: 0 auto; padding: 2.25rem 1rem 5rem; }
.page-shell.wide { width: min(100%, 90rem); }
.page-shell.table-page { width: 100%; max-width: none; padding: 0; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; text-wrap: balance; }
h1 { font-size: clamp(2.7rem, 13vw, 4.8rem); line-height: 0.98; letter-spacing: -0.04em; }
h2 { margin-bottom: 0.65rem; font-size: clamp(1.6rem, 7vw, 2.15rem); line-height: 1.08; }
h3 { font-size: 1.3rem; }
.eyebrow { margin-bottom: 0.75rem; color: var(--gold); font-size: 0.65rem; font-weight: 800; letter-spacing: 0.2em; line-height: 1.4; text-transform: uppercase; }

.panel {
  border: 1px solid var(--gold-line);
  border-radius: 0.85rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent 32%), linear-gradient(160deg, rgba(31, 25, 18, 0.98), rgba(12, 10, 8, 0.98));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.07), inset 0 0 0 3px rgba(0, 0, 0, 0.22), var(--shadow);
}

.button-row { display: flex; flex-wrap: wrap; gap: 0.65rem; align-items: center; }

.button {
  position: relative;
  display: inline-flex;
  min-height: 2.9rem;
  padding: 0.78rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 0.42rem;
  appearance: none;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.025em;
  line-height: 1;
  transition: filter 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.button:active { box-shadow: inset 0 0.2rem 0.55rem rgba(0, 0, 0, 0.35); transform: translateY(1px); }
.button:disabled { cursor: not-allowed; filter: grayscale(0.65); opacity: 0.48; transform: none; }

.button.primary {
  border-color: #ebce80;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.25), transparent 45%), linear-gradient(180deg, #e4bd60, #a97129);
  box-shadow: inset 0 1px rgba(255, 250, 218, 0.6), inset 0 -2px rgba(74, 42, 12, 0.45), 0 0.45rem 1.1rem rgba(0, 0, 0, 0.32);
  color: #1a1005;
  text-shadow: 0 1px rgba(255, 255, 255, 0.25);
}

.button.secondary {
  border-color: rgba(222, 188, 116, 0.26);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 42%), linear-gradient(180deg, #211b14, #100d09);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06), inset 0 -2px rgba(0, 0, 0, 0.4), 0 0.4rem 1rem rgba(0, 0, 0, 0.26);
  color: var(--ink);
}

.button.danger { border-color: rgba(217, 119, 104, 0.42); background: linear-gradient(180deg, #48221d, #25110e); box-shadow: inset 0 1px rgba(255, 255, 255, 0.06), 0 0.35rem 1rem rgba(0, 0, 0, 0.28); color: #f3b4aa; }
.button.small { min-height: 2.25rem; padding: 0.58rem 0.78rem; font-size: 0.67rem; }
.button.full { width: 100%; margin-top: 0.5rem; }
.value-notice { margin-top: 1.35rem; color: var(--muted); font-size: 0.68rem; letter-spacing: 0.035em; }
.centered-text { text-align: center; }

.flash-stack { position: fixed; z-index: 1000; top: 5.25rem; right: 0.75rem; left: 0.75rem; display: grid; gap: 0.5rem; }
.flash { padding: 0.85rem 1rem; border: 1px solid var(--gold-line); border-left: 3px solid var(--gold); border-radius: 0.45rem; background: rgba(22, 18, 13, 0.97); box-shadow: var(--shadow-tight); color: var(--ink); font-size: 0.78rem; }
.flash-error { border-left-color: var(--danger); }
.flash-warning { border-left-color: var(--gold-pale); }

/* Landing */
.landing-shell { width: min(100%, 94rem); padding-top: 1rem; }

.hero {
  position: relative;
  display: flex;
  min-height: min(42rem, calc(100svh - 6.5rem));
  padding: 1.5rem;
  overflow: hidden;
  border: 1px solid rgba(222, 184, 100, 0.34);
  border-radius: 1.1rem;
  align-items: flex-end;
  background:
    linear-gradient(180deg, rgba(5, 4, 3, 0.1) 20%, rgba(5, 4, 3, 0.9) 78%),
    linear-gradient(90deg, rgba(5, 4, 3, 0.72), rgba(5, 4, 3, 0.04)),
    url("/static/image/riverstone-salon.webp") 64% center / cover no-repeat;
  box-shadow: inset 0 0 0 4px rgba(6, 4, 2, 0.62), inset 0 0 0 5px rgba(222, 184, 100, 0.16), 0 2rem 5rem rgba(0, 0, 0, 0.48);
}

.hero::after { position: absolute; inset: 0.55rem; border: 1px solid rgba(241, 207, 129, 0.12); border-radius: 0.75rem; content: ""; pointer-events: none; }
.hero-copy { position: relative; z-index: 2; width: 100%; padding-bottom: 2.7rem; }
.hero h1 { max-width: 11ch; margin-bottom: 1.1rem; color: #f8f1e3; font-size: clamp(3.05rem, 14.2vw, 6.7rem); text-shadow: 0 0.2rem 1.5rem rgba(0, 0, 0, 0.9); }
.hero h1 em { color: var(--gold-pale); font-weight: inherit; }
.hero-lede { max-width: 34rem; margin-bottom: 1.4rem; color: #d6cdbb; font-family: var(--serif); font-size: clamp(1rem, 4.6vw, 1.25rem); line-height: 1.55; text-shadow: 0 2px 0.75rem #000; }
.hero-scene { position: absolute; z-index: 2; top: 1.4rem; right: 1.4rem; }

.hero-table-card {
  display: grid;
  min-width: 7.4rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(232, 198, 119, 0.35);
  border-radius: 0.55rem;
  grid-template-columns: auto 1fr;
  gap: 0.12rem 0.45rem;
  background: linear-gradient(145deg, rgba(46, 31, 20, 0.94), rgba(10, 8, 6, 0.96));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08), 0 0.8rem 2rem rgba(0, 0, 0, 0.5);
}

.hero-table-card .live-dot { grid-row: 1 / 3; align-self: center; }
.hero-table-card small, .hero-table-card em { color: var(--muted); font-size: 0.5rem; font-style: normal; letter-spacing: 0.09em; text-transform: uppercase; }
.hero-table-card strong { color: var(--gold-pale); font-family: var(--serif); font-size: 1.15rem; font-weight: 500; }
.hero-table-card em { grid-column: 2; }
.hero-notice { position: absolute; z-index: 2; bottom: 1.25rem; left: 1.5rem; margin: 0; color: rgba(234, 222, 198, 0.62); font-size: 0.58rem; letter-spacing: 0.08em; text-transform: uppercase; }

.feature-grid { display: grid; gap: 0.75rem; margin-top: 0.85rem; }
.feature-grid article { position: relative; min-height: 10rem; padding: 1.4rem 1.35rem 1.25rem 4.25rem; overflow: hidden; border: 1px solid var(--gold-line); border-radius: 0.75rem; background: repeating-linear-gradient(105deg, transparent 0 7px, rgba(255, 255, 255, 0.012) 8px 9px), linear-gradient(150deg, #241711, #100b08); box-shadow: inset 0 1px rgba(255, 255, 255, 0.055), var(--shadow-tight); }
.feature-grid article > span { position: absolute; top: 1.15rem; left: 1.2rem; display: grid; width: 2.25rem; height: 2.25rem; border: 1px solid rgba(224, 188, 109, 0.42); border-radius: 50%; place-items: center; background: linear-gradient(145deg, #2d2519, #0f0d09); color: var(--gold); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.38), 0 0.35rem 0.8rem rgba(0, 0, 0, 0.3); }
.feature-grid h2 { margin-bottom: 0.55rem; font-size: 1.42rem; }
.feature-grid p { margin-bottom: 0; color: var(--muted); font-size: 0.78rem; line-height: 1.6; }

/* Forms and account screens */
.auth-layout { display: grid; gap: 1rem; align-items: center; }
.auth-aside { display: none; padding: 1rem 0 0.5rem; }
.auth-aside h1 { margin-bottom: 0.5rem; color: var(--ink); }
.auth-aside > p:last-child { max-width: 29rem; margin-bottom: 0; color: var(--muted); line-height: 1.65; }
.form-panel { padding: 1.35rem; }
.form-panel.centered, .centered { width: min(100%, 35rem); margin: 1rem auto; }
.form-panel h1 { margin-bottom: 1.4rem; font-size: clamp(2.35rem, 11vw, 3.3rem); }
.form-panel h2 { margin-bottom: 1.2rem; font-size: 2rem; }
.form-field { display: grid; gap: 0.45rem; margin: 1rem 0; }
.form-field label { color: var(--ink-soft); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.015em; }
.form-field small, .form-note { color: var(--muted); font-size: 0.67rem; line-height: 1.55; }

.input {
  width: 100%;
  min-height: 2.9rem;
  padding: 0.75rem 0.8rem;
  border: 1px solid rgba(224, 194, 130, 0.2);
  border-radius: 0.4rem;
  outline: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent), #0d0b08;
  box-shadow: inset 0 0.2rem 0.7rem rgba(0, 0, 0, 0.55), 0 1px rgba(255, 255, 255, 0.035);
  color: var(--ink);
}

.input:focus { border-color: rgba(231, 197, 117, 0.62); box-shadow: inset 0 0.2rem 0.7rem rgba(0, 0, 0, 0.55), 0 0 0 3px rgba(213, 170, 83, 0.09); }
textarea.input { min-height: 6rem; resize: vertical; }
.input.invalid { border-color: var(--danger); }
.field-error { margin: 0; color: #f0a59b; font-size: 0.68rem; }
.check-row { display: flex; margin: 1rem 0; align-items: flex-start; gap: 0.65rem; color: #bdb3a1; font-size: 0.68rem; line-height: 1.55; }
.check-row input { margin-top: 0.15rem; accent-color: var(--gold); }
.form-foot { margin: 1.1rem 0 0; color: var(--muted); font-size: 0.72rem; text-align: center; }
.form-foot a, .form-links a { color: var(--gold-pale); }
.form-links { display: flex; margin-top: 1.1rem; justify-content: space-between; gap: 0.75rem; font-size: 0.72rem; }
.form-columns { display: grid; gap: 0.75rem; }
.mail-glyph { display: grid; width: 4rem; height: 4rem; margin: 0 auto 1.35rem; border: 1px solid var(--gold-line); border-radius: 50%; place-items: center; background: radial-gradient(circle at 35% 25%, #3b2d19, #15100b); box-shadow: inset 0 0 0 3px #0c0906, 0 0.75rem 1.5rem rgba(0, 0, 0, 0.35); color: var(--gold-pale); font-size: 1.35rem; }

/* Lobby */
.lobby-head { display: grid; margin-bottom: 3.5rem; gap: 1.25rem; }
.lobby-head h1 { margin: 0; font-size: clamp(3rem, 14vw, 4.7rem); }

.bankroll-card {
  position: relative;
  display: grid;
  min-width: 13rem;
  padding: 1.1rem 1.25rem 1.1rem 4.5rem;
  overflow: hidden;
  border: 1px solid var(--gold-line);
  border-radius: 0.7rem;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 0.15rem 0.55rem;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.045), transparent 40%), linear-gradient(155deg, #241811, #0e0a07);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06), var(--shadow-tight);
}

.bankroll-card::before { position: absolute; top: 50%; left: 1.15rem; display: grid; width: 2.7rem; height: 2.7rem; border: 0.35rem dashed rgba(63, 39, 14, 0.8); border-radius: 50%; place-items: center; background: radial-gradient(circle, #ebc86e 0 47%, #9b6a27 48% 100%); box-shadow: 0 0.35rem 0 #6f461c, 0 0.55rem 0.8rem rgba(0, 0, 0, 0.5); color: #42270e; content: "♠"; font-size: 0.9rem; transform: translateY(-55%) rotate(-8deg); }
.bankroll-card > span { grid-column: 1 / -1; color: var(--muted); font-size: 0.56rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.bankroll-card strong { font-family: var(--serif); font-size: 1.85rem; font-weight: 500; }
.bankroll-card small { color: var(--gold); font-size: 0.62rem; }
.section-block { margin: 3.5rem 0; }
.section-title { display: grid; margin-bottom: 1.2rem; gap: 0.5rem; }
.section-title h2 { margin: 0; }
.section-title > p { margin: 0; color: var(--muted); font-size: 0.7rem; line-height: 1.5; }
.stake-grid { display: grid; gap: 0.8rem; }

.stake-card {
  position: relative;
  padding: 1.35rem;
  overflow: hidden;
  border: 1px solid rgba(215, 170, 83, 0.2);
  border-radius: 0.8rem;
  background: repeating-linear-gradient(98deg, transparent 0 8px, rgba(255, 255, 255, 0.01) 9px 10px), linear-gradient(145deg, #211611, #0d0907);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.055), var(--shadow-tight);
}

.stake-card::after { position: absolute; top: -1rem; right: -0.5rem; color: rgba(210, 168, 80, 0.055); content: "♠"; font-family: var(--serif); font-size: 8rem; line-height: 1; pointer-events: none; }
.stake-card.featured { border-color: rgba(232, 196, 112, 0.52); background: repeating-linear-gradient(98deg, transparent 0 8px, rgba(255, 255, 255, 0.012) 9px 10px), linear-gradient(145deg, #302015, #100b08); box-shadow: inset 0 1px rgba(255, 255, 255, 0.08), 0 0 0 3px rgba(0, 0, 0, 0.18), var(--shadow); }
.stake-card > p { position: relative; z-index: 1; margin-bottom: 0.35rem; color: var(--muted); font-size: 0.58rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.stake-card h3 { position: relative; z-index: 1; margin: 0.25rem 0 0; color: var(--ink); font-size: 2.65rem; }
.stake-card > span { color: var(--muted); font-size: 0.58rem; }
.stake-card label { position: relative; z-index: 1; display: grid; margin: 1.4rem 0 0.75rem; gap: 0.4rem; color: var(--ink-soft); font-size: 0.66rem; }
.stake-card .button { position: relative; z-index: 1; width: 100%; }
.tag { position: absolute; z-index: 2; top: 1rem; right: 1rem; padding: 0.32rem 0.5rem !important; border: 1px solid #e7c77b; border-radius: 999px; background: linear-gradient(180deg, #dfb85c, #8d5e21); color: #1b1105 !important; font-size: 0.48rem !important; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.queue-panel { display: flex; margin-top: 0.85rem; padding: 0.85rem 1rem; border: 1px solid var(--gold-line); border-radius: 0.55rem; align-items: center; gap: 0.65rem; background: rgba(213, 170, 83, 0.07); font-size: 0.7rem; }
.queue-panel .text-button { margin-left: auto; }
.pulse, .live-dot { display: inline-block; width: 0.45rem; height: 0.45rem; flex: 0 0 auto; border-radius: 50%; background: #7fc396; box-shadow: 0 0 0 0.25rem rgba(127, 195, 150, 0.1), 0 0 0.8rem rgba(127, 195, 150, 0.35); }
.text-button { padding: 0.4rem; border: 0; background: none; color: var(--gold-pale); font-size: 0.7rem; }
.inline-error { margin: 0 0 1.2rem; padding: 0.8rem 0.9rem; border: 1px solid rgba(217, 119, 104, 0.32); border-radius: 0.45rem; background: rgba(97, 39, 31, 0.24); color: #efb0a6; font-size: 0.76rem; }
.lobby-split { display: grid; margin: 3.5rem 0; gap: 0.8rem; }
.room-panel, .practice-panel { min-height: 14rem; padding: 1.5rem; }
.room-panel p:not(.eyebrow), .practice-panel p:not(.eyebrow) { color: var(--muted); font-size: 0.78rem; line-height: 1.65; }

.table-list { overflow: hidden; border: 1px solid var(--gold-line); border-radius: 0.65rem; background: rgba(13, 10, 7, 0.62); box-shadow: inset 0 1px rgba(255, 255, 255, 0.03); }
.table-list-row { display: grid; min-height: 3.8rem; padding: 0.85rem; border-bottom: 1px solid var(--line); grid-template-columns: auto 1fr auto; align-items: center; gap: 0.75rem; font-size: 0.7rem; }
.table-list-row:last-child { border-bottom: 0; }
.table-list-row:hover { background: rgba(213, 170, 83, 0.055); }
.table-list-row span:not(.live-dot) { display: none; color: var(--muted); }
.table-list-row strong { font-family: var(--serif); font-size: 1rem; }
.table-list-row b { color: var(--gold-pale); }
.empty-state { margin: 0; padding: 1.5rem; border: 1px dashed rgba(222, 188, 116, 0.2); border-radius: 0.55rem; color: var(--muted); font-size: 0.74rem; line-height: 1.55; text-align: center; }
.table-list .empty-state { border: 0; }
.recovery-strip { display: grid; padding: 1.3rem; border: 1px solid var(--gold-line); border-radius: 0.65rem; gap: 1rem; background: linear-gradient(120deg, rgba(214, 171, 83, 0.08), transparent 45%), #100d09; box-shadow: inset 0 1px rgba(255, 255, 255, 0.035), var(--shadow-tight); }
.recovery-strip p { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.7rem; line-height: 1.55; }

/* Profiles, badges, and ranking */
.page-title { margin-bottom: 2rem; }
.page-title h1 { margin-bottom: 0.85rem; font-size: clamp(3rem, 14vw, 4.7rem); }
.page-title > p:last-child { max-width: 42rem; color: var(--muted); font-size: 0.8rem; line-height: 1.6; }
.profile-head { display: grid; padding: 1.25rem; grid-template-columns: auto 1fr; align-items: center; gap: 1rem; }
.profile-head h1 { margin: 0 0 0.45rem; font-size: clamp(2.1rem, 10vw, 3.4rem); }
.profile-head p:last-child { margin: 0; color: var(--muted); font-size: 0.75rem; line-height: 1.5; }
.profile-head .button { grid-column: 1 / -1; }

.avatar { display: grid; width: 4.4rem; height: 4.4rem; border: 1px solid rgba(239, 207, 130, 0.36); border-radius: 50%; place-items: center; background: radial-gradient(circle at 35% 25%, #365748, #0a2118); box-shadow: inset 0 0 0 4px rgba(0, 0, 0, 0.35), 0 0.55rem 1.3rem rgba(0, 0, 0, 0.38); color: var(--gold-pale); font-family: var(--serif); font-size: 1.9rem; }
.avatar-emerald { background: radial-gradient(circle at 35% 25%, #28624c, #09271c) !important; color: #d9f1e3 !important; }
.avatar-teal { background: radial-gradient(circle at 35% 25%, #2b6460, #0b2726) !important; color: #dbf4ef !important; }
.avatar-blue { background: radial-gradient(circle at 35% 25%, #365874, #111f30) !important; color: #d8e9f7 !important; }
.avatar-violet { background: radial-gradient(circle at 35% 25%, #5c4c70, #21182e) !important; color: #eadff3 !important; }
.avatar-rose { background: radial-gradient(circle at 35% 25%, #744351, #2c141c) !important; color: #f4dce2 !important; }
.avatar-amber { background: radial-gradient(circle at 35% 25%, #7a5729, #2c1b0a) !important; color: #f4deb7 !important; }
.avatar-slate { background: radial-gradient(circle at 35% 25%, #50575a, #1d2224) !important; color: #e2e5e4 !important; }
.avatar-coral { background: radial-gradient(circle at 35% 25%, #805044, #321913) !important; color: #f4ddd7 !important; }

.stat-grid, .rank-grid { display: grid; margin: 0.8rem 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.stat-grid article, .rank-grid article { display: grid; min-width: 0; padding: 1rem; border: 1px solid var(--gold-line); border-radius: 0.6rem; gap: 0.35rem; background: linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent), rgba(17, 13, 9, 0.8); box-shadow: inset 0 1px rgba(255, 255, 255, 0.03), var(--shadow-tight); }
.stat-grid span, .rank-grid span { color: var(--muted); font-size: 0.52rem; font-weight: 700; letter-spacing: 0.11em; text-transform: uppercase; }
.stat-grid strong, .rank-grid strong { overflow-wrap: anywhere; font-family: var(--serif); font-size: clamp(1.25rem, 6vw, 1.8rem); font-weight: 500; }
.stat-grid small { color: var(--gold); font-size: 0.57rem; }
.badge-grid { display: grid; gap: 0.6rem; }
.badge { display: flex; min-height: 5.5rem; padding: 1rem; border: 1px solid var(--line); border-radius: 0.65rem; align-items: center; gap: 0.9rem; background: repeating-linear-gradient(100deg, transparent 0 7px, rgba(255, 255, 255, 0.008) 8px 9px), linear-gradient(145deg, #17110d, #0b0806); opacity: 0.48; }
.badge.earned { border-color: rgba(220, 181, 94, 0.42); box-shadow: inset 0 1px rgba(255, 255, 255, 0.05), 0 0.7rem 1.6rem rgba(0, 0, 0, 0.25); opacity: 1; }
.badge > span { display: grid; width: 2.3rem; height: 2.3rem; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 50%; place-items: center; color: var(--muted); font-size: 1rem; }
.badge.earned > span { border-color: var(--gold-line); background: radial-gradient(circle at 35% 25%, #f0d589, #8b5e24); box-shadow: inset 0 0 0 3px #2a1b0d, 0 0.3rem 0.9rem rgba(0, 0, 0, 0.35); color: #2a1908; }
.badge div { display: grid; gap: 0.25rem; }
.badge small { color: var(--muted); font-size: 0.66rem; line-height: 1.4; }
.badge em { color: var(--gold); font-size: 0.5rem; font-style: normal; letter-spacing: 0.08em; text-transform: uppercase; }
.leaderboard-grid { display: grid; gap: 0.8rem; }
.leaderboard { padding: 1.15rem; }
.leaderboard h2 { margin-bottom: 0; padding-bottom: 0.85rem; border-bottom: 1px solid var(--gold-line); font-size: 1.3rem; }
.leaderboard > a { display: grid; min-height: 3.4rem; padding: 0.65rem 0; border-bottom: 1px solid var(--line); grid-template-columns: 1.3rem 1.8rem minmax(0, 1fr) auto; align-items: center; gap: 0.55rem; font-size: 0.66rem; }
.leaderboard > a:hover strong { color: var(--gold-pale); }
.leaderboard .rank { color: var(--muted); font-family: ui-monospace, monospace; }
.leaderboard b { color: var(--gold); font-size: 0.62rem; font-weight: 700; text-align: right; }
.mini-avatar { display: grid; width: 1.75rem; height: 1.75rem; border: 1px solid rgba(222, 188, 116, 0.25); border-radius: 50%; place-items: center; font-size: 0.7rem; }

/* Hand history and replay */
.history-filters { display: grid; margin-bottom: 1.1rem; padding: 1rem; gap: 0.75rem; }
.history-filters label { display: grid; gap: 0.35rem; color: var(--muted); font-size: 0.62rem; }
.history-list { overflow: hidden; border: 1px solid var(--gold-line); border-radius: 0.65rem; background: rgba(12, 9, 7, 0.5); }
.history-row, .admin-row { display: grid; padding: 0.9rem; border-bottom: 1px solid var(--line); grid-template-columns: 3.6rem minmax(0, 1fr) auto; align-items: center; gap: 0.75rem; font-size: 0.65rem; }
.history-row:last-child, .admin-row:last-child { border-bottom: 0; }
.history-row:hover { background: rgba(213, 170, 83, 0.045); }
.history-row span, .admin-row span { color: var(--muted); }
.history-row span:nth-of-type(n + 2), .admin-row span:nth-of-type(n + 2) { display: none; }
.history-row b.positive { color: var(--success); }
.history-row b.negative { color: var(--danger); }
.pagination { display: flex; margin-top: 1.2rem; align-items: center; justify-content: center; gap: 0.8rem; color: var(--muted); font-size: 0.68rem; }
.replay-heading { display: grid; margin-bottom: 1.4rem; gap: 1rem; }
.replay-heading h1 { margin: 0 0 0.5rem; font-size: clamp(2.8rem, 13vw, 4.3rem); }
.replay-heading p:last-child { margin: 0; color: var(--muted); font-size: 0.7rem; }
.replayer { padding: 0.8rem; }

.replay-table {
  position: relative;
  height: 21rem;
  border: 0.65rem solid transparent;
  border-radius: 44%;
  background: radial-gradient(ellipse at center, var(--felt-light), var(--felt) 55%, var(--felt-dark)) padding-box, linear-gradient(145deg, #5d3a24, #160d09 48%, #4c2c1b) border-box;
  box-shadow: inset 0 0 3rem rgba(0, 0, 0, 0.5), 0 1.25rem 2.5rem rgba(0, 0, 0, 0.42);
  overflow: hidden;
}

.replay-center { position: absolute; inset: 34% 17%; display: grid; place-items: center; gap: 0.75rem; }
.replay-center > div:first-child { color: var(--gold-pale); font-size: 0.68rem; font-weight: 800; }
.replay-seat { position: absolute; display: grid; width: 6.2rem; padding: 0.4rem; border: 1px solid var(--gold-line); border-radius: 0.45rem; gap: 0.15rem; background: rgba(14, 10, 7, 0.94); box-shadow: 0 0.45rem 1rem rgba(0, 0, 0, 0.35); text-align: center; }
.replay-seat strong { font-size: 0.55rem; }
.replay-seat span { color: var(--gold-pale); font-size: 0.52rem; }
.replay-seat small { min-height: 0.7rem; color: var(--gold); font-size: 0.48rem; }
.replay-seat em { color: var(--muted); font-size: 0.42rem; font-style: normal; }
.replay-seat-0 { bottom: 1%; left: 39%; }
.replay-seat-1 { bottom: 12%; left: 2%; }
.replay-seat-2 { top: 36%; left: 0; }
.replay-seat-3 { top: 3%; left: 5%; }
.replay-seat-4 { top: 1%; left: 39%; }
.replay-seat-5 { top: 3%; right: 5%; }
.replay-seat-6 { top: 36%; right: 0; }
.replay-seat-7 { right: 2%; bottom: 12%; }
.replay-seat-8 { right: 21%; bottom: 1%; }
.replay-controls { display: flex; padding-top: 0.8rem; flex-wrap: wrap; align-items: end; gap: 0.5rem; }
.replay-controls label { display: grid; flex: 1 1 7rem; gap: 0.25rem; color: var(--muted); font-size: 0.5rem; }
.replay-controls .input { min-height: 2.2rem; padding: 0.5rem; }
.replay-controls > span { width: 100%; color: var(--muted); font-family: ui-monospace, monospace; font-size: 0.62rem; }
.replay-caption { min-height: 1.5rem; margin: 0.8rem 0 0; color: var(--ink-soft); font-size: 0.7rem; text-align: center; }
.replay-summary { margin-top: 0.8rem; padding: 1.1rem; }
.replay-summary article { display: grid; padding: 0.7rem 0; border-top: 1px solid var(--line); gap: 0.35rem; font-size: 0.68rem; }
.replay-summary article span { color: var(--muted); }

/* Live table */
.table-mode { height: 100dvh; overflow: hidden; }
.table-mode .site-header, .table-mode .skip-link { display: none; }
.table-mode .page-shell { height: 100dvh; }

.poker-app {
  position: relative;
  display: grid;
  width: 100%;
  height: 100dvh;
  min-height: 36rem;
  overflow: hidden;
  grid-template-rows: 3.4rem minmax(0, 1fr) auto 1.3rem;
  background: radial-gradient(ellipse at 50% 5%, rgba(84, 54, 23, 0.3), transparent 35%), linear-gradient(150deg, #100d09, #050504 68%);
}

.table-toolbar { position: relative; z-index: 50; display: grid; padding: 0.4rem 0.55rem; border-bottom: 1px solid var(--gold-line); grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.55rem; background: linear-gradient(180deg, rgba(31, 24, 16, 0.98), rgba(10, 8, 6, 0.98)); box-shadow: 0 0.55rem 1.4rem rgba(0, 0, 0, 0.28), inset 0 -1px rgba(0, 0, 0, 0.75); }
.table-toolbar > div:nth-child(2) { display: grid; min-width: 0; gap: 0.1rem; }
.table-toolbar > div:nth-child(2) strong { overflow: hidden; font-family: var(--serif); font-size: 0.78rem; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.table-toolbar > div:nth-child(2) span { overflow: hidden; color: var(--muted); font-size: 0.5rem; text-overflow: ellipsis; white-space: nowrap; }
.icon-button { display: grid; width: 2.35rem; height: 2.35rem; border: 1px solid var(--gold-line); border-radius: 50%; place-items: center; background: linear-gradient(180deg, #221b12, #0d0b08); box-shadow: inset 0 1px rgba(255, 255, 255, 0.07), 0 0.3rem 0.7rem rgba(0, 0, 0, 0.3); color: var(--gold-pale); font-size: 1rem; }
.room-code, .practice-pill { display: none; }
.room-code { align-items: center; gap: 0.55rem; }
.room-code span { color: var(--muted); font-size: 0.5rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.room-code button { padding: 0.4rem 0.55rem; border: 1px dashed rgba(229, 194, 115, 0.48); border-radius: 0.3rem; background: rgba(213, 170, 83, 0.07); color: var(--gold-pale); font-size: 0.62rem; letter-spacing: 0.12em; }
.table-toolbar-actions { display: flex; min-width: 0; align-items: center; gap: 0.3rem; }
.table-toolbar-actions .button { min-height: 2.2rem; padding: 0.55rem 0.65rem; font-size: 0.58rem; }
.table-toolbar-actions #sit-out-button, .table-toolbar-actions #ready-button { display: none; }
.spectator-pill, .practice-pill { padding: 0.4rem 0.6rem; border: 1px solid var(--gold-line); border-radius: 999px; background: rgba(213, 170, 83, 0.08); color: var(--gold-pale); font-size: 0.54rem; font-weight: 800; }
.poker-stage { position: relative; display: grid; min-height: 0; padding: 2.4rem 1.35rem 1.8rem; place-items: center; }

.felt-table {
  position: relative;
  width: min(calc(100vw - 3rem), 25.5rem);
  height: min(48dvh, 29rem);
  min-height: 19rem;
  border: 0.7rem solid transparent;
  border-radius: 44%;
  background:
    radial-gradient(ellipse at 48% 42%, rgba(29, 110, 78, 0.65), transparent 45%),
    radial-gradient(ellipse at center, var(--felt-light), var(--felt) 60%, var(--felt-dark)) padding-box,
    linear-gradient(145deg, #68432b 0%, #281610 38%, #100907 52%, #563520 80%, #21130e 100%) border-box;
  box-shadow: inset 0 0 4rem rgba(0, 0, 0, 0.55), inset 0 0 0 2px rgba(239, 214, 161, 0.08), 0 0 0 1px #070504, 0 0 0 2px rgba(203, 155, 65, 0.35), 0 1.35rem 3.5rem rgba(0, 0, 0, 0.62);
}

.felt-table::before { position: absolute; z-index: 2; inset: 0.55rem; border: 1px dashed rgba(225, 201, 147, 0.17); border-radius: inherit; content: ""; pointer-events: none; }
.felt-table::after { position: absolute; z-index: 1; inset: 0; border-radius: inherit; background: repeating-linear-gradient(17deg, transparent 0 3px, rgba(255, 255, 255, 0.008) 4px, transparent 5px 8px), repeating-linear-gradient(97deg, transparent 0 5px, rgba(0, 0, 0, 0.014) 6px 7px); content: ""; mix-blend-mode: overlay; pointer-events: none; }
.seat-layer { position: absolute; z-index: 10; inset: 0; }
.seat { position: absolute; display: grid; width: 5.3rem; justify-items: center; gap: 0.15rem; transform: translate(-50%, -50%); transition: left 300ms ease, top 300ms ease; }
.seat.visual-0 { top: 101%; left: 50%; }
.seat.visual-1 { top: 91%; left: 18%; }
.seat.visual-2 { top: 68%; left: 1%; }
.seat.visual-3 { top: 31%; left: 1%; }
.seat.visual-4 { top: 1%; left: 28%; }
.seat.visual-5 { top: 1%; left: 72%; }
.seat.visual-6 { top: 31%; left: 99%; }
.seat.visual-7 { top: 68%; left: 99%; }
.seat.visual-8 { top: 91%; left: 82%; }

.seat-card { position: relative; display: grid; width: 100%; min-width: 0; min-height: 2.25rem; padding: 0.3rem 0.35rem; border: 1px solid rgba(232, 202, 139, 0.21); border-radius: 0.45rem; grid-template-columns: 1.3rem minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 0.28rem; background: repeating-linear-gradient(100deg, transparent 0 5px, rgba(255, 255, 255, 0.012) 6px), linear-gradient(155deg, rgba(42, 26, 18, 0.98), rgba(10, 7, 5, 0.98)); box-shadow: inset 0 1px rgba(255, 255, 255, 0.055), 0 0.4rem 0.9rem rgba(0, 0, 0, 0.48); }
.seat.current .seat-card { border-color: var(--gold-pale); box-shadow: inset 0 1px rgba(255, 255, 255, 0.09), 0 0 0 2px rgba(213, 170, 83, 0.2), 0 0 1rem rgba(213, 170, 83, 0.24), 0 0.4rem 0.9rem rgba(0, 0, 0, 0.5); }
.seat.disconnected .seat-card, .seat.folded .seat-card, .seat.sitting-out .seat-card { filter: saturate(0.35); opacity: 0.52; }
.seat.sitting-out .seat-card { border-style: dashed; }
.seat.empty .seat-card { display: grid; min-height: 1.75rem; place-items: center; opacity: 0.28; }
.seat.empty .seat-name { grid-column: 1 / -1; }
.seat-avatar { display: grid; width: 1.3rem; height: 1.3rem; border: 1px solid rgba(240, 211, 143, 0.2); border-radius: 50%; grid-row: 1 / -1; place-items: center; color: var(--gold-pale); font-size: 0.55rem; }
.seat-name { overflow: hidden; color: var(--ink); font-size: 0.5rem; font-weight: 800; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.seat-stack { overflow: hidden; color: var(--gold-pale); font-size: 0.45rem; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.seat-markers { position: absolute; z-index: 2; top: -0.72rem; left: 50%; display: flex; gap: 0.12rem; transform: translateX(-50%); }
.marker { display: grid; width: 1.1rem; height: 1.1rem; border: 2px dashed #5f431e; border-radius: 50%; place-items: center; background: radial-gradient(circle, #ead18d, #a87530); box-shadow: 0 0.2rem 0.4rem rgba(0, 0, 0, 0.35); color: #241405; font-size: 0.38rem; font-style: normal; font-weight: 900; }
.marker.blind { background: radial-gradient(circle, #ca9360, #7c3e27); }
.seat-bet { min-height: 1rem; padding: 0.22rem 0.36rem; border: 2px dashed rgba(67, 42, 14, 0.62); border-radius: 999px; background: radial-gradient(circle, #e4bd61, #a36b25); box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.35); color: #251605; font-size: 0.39rem; font-weight: 900; line-height: 1; }
.seat-bet:empty { visibility: hidden; }
.seat-action { height: 0.55rem; max-width: 6.5rem; overflow: hidden; color: rgba(238, 231, 215, 0.72); font-size: 0.36rem; letter-spacing: 0.06em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.connection-dot { position: absolute; top: 0.2rem; right: 0.2rem; width: 0.25rem; height: 0.25rem; border-radius: 50%; background: #70bc8b; box-shadow: 0 0 0.35rem #70bc8b; }
.seat.disconnected .connection-dot { background: var(--danger); box-shadow: none; }
.mini-cards { color: var(--ink); font-family: var(--serif); font-size: 0.45rem; text-shadow: 0 1px 0.3rem #000; }

.table-center { position: absolute; z-index: 4; top: 49%; left: 50%; display: grid; justify-items: center; gap: 0.65rem; transform: translate(-50%, -50%); }
.pot-display { display: grid; gap: 0.1rem; text-align: center; }
.pot-display > span, .rake-display { color: rgba(236, 229, 211, 0.58); font-size: 0.42rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.pot-display strong { color: var(--gold-pale); font-family: var(--serif); font-size: 0.85rem; font-weight: 500; text-shadow: 0 2px 0.6rem #000; }
.pot-display small { color: var(--ink-soft); font-size: 0.4rem; }
.board { display: flex; min-height: 3rem; gap: 0.2rem; }

.playing-card { position: relative; display: grid; width: 2.1rem; height: 2.95rem; border: 1px solid #d9d2c2; border-radius: 0.25rem; place-items: center; background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), transparent 30%), linear-gradient(145deg, #fffdf5, #e8e3d5); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55), 0 0.3rem 0.65rem rgba(0, 0, 0, 0.42); color: #171511; font-family: var(--serif); font-size: 0.9rem; font-weight: 700; text-shadow: 0 1px rgba(255, 255, 255, 0.5); }
.playing-card.red { color: #9f2723; }
.playing-card.back { border: 3px solid #e7d8aa; background: repeating-linear-gradient(45deg, rgba(232, 206, 130, 0.75) 0 2px, transparent 2px 4px), repeating-linear-gradient(-45deg, #6d331d 0 2px, #1d5a42 2px 4px); box-shadow: inset 0 0 0 2px #4b2418, 0 0.3rem 0.7rem rgba(0, 0, 0, 0.45); color: transparent; }
.board:empty::before { display: grid; width: min(10rem, 46vw); min-height: 2.8rem; border: 1px dashed rgba(238, 226, 199, 0.14); border-radius: 0.4rem; place-items: center; color: rgba(238, 226, 199, 0.32); content: "Waiting for the deal"; font-size: 0.46rem; letter-spacing: 0.1em; text-transform: uppercase; }
.hole-cards { position: absolute; z-index: 12; bottom: -0.85rem; left: 50%; display: flex; gap: 0.18rem; transform: translateX(-50%); }
.hole-cards .playing-card { width: 2.45rem; height: 3.45rem; font-size: 1rem; }

.table-console { position: relative; z-index: 40; display: grid; min-height: 4.25rem; padding: 0.45rem max(0.5rem, env(safe-area-inset-right)) 0.4rem max(0.5rem, env(safe-area-inset-left)); border-top: 1px solid var(--gold-line); align-items: center; background: linear-gradient(180deg, rgba(35, 27, 18, 0.98), rgba(9, 7, 5, 0.99)); box-shadow: 0 -0.8rem 1.8rem rgba(0, 0, 0, 0.32), inset 0 1px rgba(255, 255, 255, 0.045); }
.hand-status { display: none; }
.action-controls { display: flex; width: 100%; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.32rem; }
.action-controls .button { min-width: 3.2rem; min-height: 2.35rem; padding: 0.55rem 0.6rem; flex: 1 1 auto; font-size: 0.58rem; }
.raise-control { display: grid; width: 100%; padding: 0.32rem 0.32rem 0.32rem 0.55rem; border: 1px solid var(--gold-line); border-radius: 0.45rem; grid-template-columns: minmax(4rem, 1fr) auto auto; align-items: center; gap: 0.35rem; background: rgba(0, 0, 0, 0.22); box-shadow: inset 0 0.2rem 0.6rem rgba(0, 0, 0, 0.28); }
.raise-control input { width: 100%; accent-color: var(--gold); }
.raise-control output { min-width: 3.5rem; color: var(--gold-pale); font-family: ui-monospace, monospace; font-size: 0.52rem; text-align: right; }
.bet-presets { display: none; gap: 0.18rem; }
.bet-presets button, .pre-action-controls button, .chat-actions button { padding: 0.35rem 0.42rem; border: 1px solid var(--gold-line); border-radius: 0.3rem; background: rgba(255, 255, 255, 0.04); color: var(--ink-soft); font-size: 0.48rem; }
.pre-action-controls { display: flex; margin-bottom: 0.35rem; justify-content: flex-end; gap: 0.25rem; }
.pre-action-controls button.selected { border-color: var(--gold); color: var(--gold-pale); }
.hand-message { overflow: hidden; color: var(--muted); font-size: 0.57rem; line-height: 1.35; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.table-disclaimer { position: relative; z-index: 41; display: grid; padding-bottom: env(safe-area-inset-bottom); place-items: center; background: #080604; color: #6e6659; font-size: 0.4rem; letter-spacing: 0.09em; text-transform: uppercase; }
.table-toast { position: fixed; z-index: 100; top: 4rem; left: 50%; width: min(90vw, 24rem); padding: 0.7rem 0.85rem; border: 1px solid rgba(217, 119, 104, 0.4); border-radius: 0.45rem; background: rgba(69, 27, 22, 0.97); box-shadow: var(--shadow); color: #f3b5ac; font-size: 0.68rem; transform: translateX(-50%); }

.table-chat { position: absolute; z-index: 46; top: 3.8rem; right: 0; bottom: 5.7rem; display: grid; width: min(17rem, 88vw); overflow: hidden; border: 1px solid var(--gold-line); border-right: 0; border-radius: 0.65rem 0 0 0.65rem; grid-template-rows: auto 1fr auto; background: rgba(13, 10, 7, 0.98); box-shadow: var(--shadow); transform: translateX(calc(100% - 2rem)); transition: transform 200ms ease; }
.table-chat.open, .table-chat:focus-within { transform: none; }
.table-chat > header { position: relative; display: grid; min-height: 3rem; padding: 0.75rem 0.8rem 0.65rem 2.45rem; border-bottom: 1px solid var(--line); gap: 0.1rem; cursor: pointer; }
.table-chat > header::before { position: absolute; top: 0.5rem; bottom: 0.5rem; left: 0.45rem; display: grid; width: 1rem; place-items: center; color: var(--gold); content: "CHAT"; font-size: 0.43rem; font-weight: 900; letter-spacing: 0.12em; writing-mode: vertical-rl; }
.table-chat > header strong { font-family: var(--serif); font-size: 0.76rem; font-weight: 500; }
.table-chat > header span { color: var(--muted); font-size: 0.48rem; }
.chat-messages { display: flex; min-height: 0; padding: 0.6rem; overflow: auto; flex-direction: column; gap: 0.45rem; }
.chat-message { padding: 0.55rem; border: 1px solid rgba(255, 255, 255, 0.03); border-radius: 0.42rem; background: rgba(255, 255, 255, 0.035); }
.chat-message > div:first-child { display: flex; justify-content: space-between; gap: 0.5rem; }
.chat-message strong { color: var(--gold-pale); font-size: 0.54rem; }
.chat-message time { color: var(--muted); font-size: 0.43rem; }
.chat-message p { margin: 0.3rem 0 0; overflow-wrap: anywhere; font-size: 0.6rem; line-height: 1.4; white-space: pre-wrap; }
.chat-actions { display: flex; margin-top: 0.3rem; gap: 0.2rem; opacity: 0.7; }
.table-chat form { padding: 0.55rem; border-top: 1px solid var(--line); }
.table-chat textarea { width: 100%; padding: 0.55rem; resize: none; border: 1px solid var(--gold-line); border-radius: 0.4rem; background: #080604; color: var(--ink); font-size: 0.6rem; }
.table-chat form > div { display: flex; margin-top: 0.35rem; align-items: center; justify-content: space-between; }
.table-chat form span { color: var(--muted); font-size: 0.48rem; }

/* Administration */
.admin-nav { display: flex; margin-bottom: 2rem; padding: 0.45rem; overflow-x: auto; border: 1px solid var(--gold-line); border-radius: 0.55rem; gap: 0.3rem; background: rgba(12, 9, 7, 0.78); scrollbar-width: thin; }
.admin-nav a { padding: 0.55rem 0.7rem; border-radius: 0.35rem; flex: 0 0 auto; color: var(--muted); font-size: 0.58rem; }
.admin-nav a:hover { background: rgba(213, 170, 83, 0.08); color: var(--gold-pale); }
.admin-section { margin: 0.75rem 0; padding: 1rem; }
.admin-section .admin-row { padding: 0.7rem 0; }
.admin-table { margin: 0.75rem 0; padding: 0.7rem; overflow-x: auto; }
.admin-action-form { display: grid; margin-top: 0.75rem; gap: 0.55rem; }
.admin-section details { margin: 0.6rem 0; padding: 0.65rem; border: 1px solid var(--line); border-radius: 0.4rem; }
.admin-section pre { overflow: auto; color: var(--muted); font-size: 0.62rem; white-space: pre-wrap; }
.admin-chat-body { overflow-wrap: anywhere; white-space: pre-wrap; }

@media (max-width: 23rem) {
  .brand-name small { display: none; }
  .hero { padding: 1.15rem; }
  .hero-scene { display: none; }
  .hero h1 { font-size: 2.7rem; }
  .hero-notice { left: 1.15rem; font-size: 0.5rem; }
  .playing-card { width: 1.85rem; height: 2.65rem; font-size: 0.78rem; }
  .seat { width: 4.8rem; }
  .action-controls .button { min-width: 2.8rem; padding-inline: 0.4rem; }
}

@media (min-width: 40rem) {
  .page-shell { padding: 3.75rem 2rem 6rem; }
  .landing-shell { padding-top: 1.5rem; }
  .hero { min-height: 43rem; padding: 2.5rem; border-radius: 1.35rem; }
  .hero-copy { width: 70%; padding-bottom: 2.2rem; }
  .hero-notice { bottom: 1.65rem; left: 2.5rem; }
  .feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .feature-grid article { min-height: 13rem; padding: 4.2rem 1.35rem 1.35rem; }
  .feature-grid article > span { top: 1.25rem; }
  .form-panel { padding: 2rem; }
  .form-columns, .lobby-split, .leaderboard-grid, .badge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lobby-head { grid-template-columns: 1fr auto; align-items: end; }
  .bankroll-card { width: auto; }
  .stake-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .section-title { grid-template-columns: 1fr auto; align-items: end; }
  .section-title > p { max-width: 25rem; text-align: right; }
  .recovery-strip { grid-template-columns: 1fr auto; align-items: center; }
  .profile-head { padding: 1.7rem; grid-template-columns: auto 1fr auto; gap: 1.35rem; }
  .profile-head .button { grid-column: auto; }
  .avatar { width: 5.7rem; height: 5.7rem; font-size: 2.4rem; }
  .stat-grid, .rank-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .badge-grid.large { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .table-list-row { grid-template-columns: auto 1fr 1fr 1fr auto; gap: 1rem; }
  .table-list-row span:not(.live-dot) { display: inline; }
  .history-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
  .history-row { grid-template-columns: 4rem 1.25fr 1fr 1fr auto; }
  .history-row span:nth-of-type(n + 2) { display: inline; }
  .replay-heading { grid-template-columns: 1fr auto; align-items: end; }
  .replay-table { height: 28rem; }
  .replay-seat { width: 8.2rem; padding: 0.55rem; }
  .replay-controls > span { width: auto; margin-left: auto; }
  .replay-summary article { grid-template-columns: 1fr 7rem 1fr; gap: 0.75rem; }
  .poker-app { grid-template-rows: 3.8rem minmax(0, 1fr) auto 1.5rem; }
  .table-toolbar { padding: 0.45rem 0.9rem; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 0.8rem; }
  .room-code, .practice-pill { display: flex; }
  .table-toolbar-actions #sit-out-button, .table-toolbar-actions #ready-button { display: inline-flex; }
  .poker-stage { padding: 3rem 6vw 2.5rem; }
  .felt-table { width: min(78vw, 53rem); height: min(52dvh, 31rem); min-height: 23rem; border-width: 0.95rem; border-radius: 50%; }
  .seat { width: 7.4rem; gap: 0.2rem; }
  .seat.visual-0 { top: 103%; }
  .seat.visual-1 { top: 95%; left: 19%; }
  .seat.visual-2 { top: 68%; left: -1%; }
  .seat.visual-3 { top: 28%; left: 2%; }
  .seat.visual-4 { top: -1%; left: 28%; }
  .seat.visual-5 { top: -1%; left: 72%; }
  .seat.visual-6 { top: 28%; left: 98%; }
  .seat.visual-7 { top: 68%; left: 101%; }
  .seat.visual-8 { top: 95%; left: 81%; }
  .seat-card { min-height: 2.65rem; padding: 0.38rem 0.45rem; border-radius: 0.58rem; grid-template-columns: 1.65rem minmax(0, 1fr); column-gap: 0.4rem; }
  .seat-avatar { width: 1.65rem; height: 1.65rem; font-size: 0.68rem; }
  .seat-name { font-size: 0.6rem; }
  .seat-stack { font-size: 0.52rem; }
  .seat-action { height: 0.72rem; font-size: 0.44rem; }
  .seat-bet { font-size: 0.46rem; }
  .playing-card { width: 2.75rem; height: 3.85rem; font-size: 1.15rem; }
  .board { min-height: 3.9rem; gap: 0.3rem; }
  .hole-cards .playing-card { width: 3rem; height: 4.2rem; font-size: 1.25rem; }
  .table-center { gap: 0.9rem; }
  .pot-display strong { font-size: 1rem; }
  .table-console { min-height: 5.2rem; padding: 0.55rem 0.9rem; grid-template-columns: 8rem minmax(0, 1fr) 10rem; gap: 0.8rem; }
  .hand-status { display: grid; gap: 0.15rem; }
  .hand-status > span:first-child { color: var(--muted); font-size: 0.46rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
  .hand-status strong { font-size: 0.6rem; }
  .hand-status > span:last-child { color: var(--gold-pale); font-family: ui-monospace, monospace; font-size: 0.55rem; }
  .hand-status small { color: var(--gold); font-size: 0.45rem; }
  .action-controls { flex-wrap: nowrap; }
  .action-controls .button { min-width: auto; flex: 0 1 auto; }
  .raise-control { width: auto; flex: 1 1 15rem; }
  .hand-message { text-align: right; white-space: normal; }
  .table-chat { bottom: 7rem; }
  .admin-action-form { grid-template-columns: 9rem 1fr 2fr auto; align-items: end; }
}

@media (min-width: 56rem) {
  body.nav-open { overflow: auto; }
  .site-header { height: 5rem; }
  .header-inner { padding: 0 2rem; }
  .brand-mark { width: 2.7rem; height: 2.7rem; }
  .brand-name strong { font-size: 1.24rem; }
  .nav-toggle { display: none; }
  .site-nav, .site-nav.is-open { position: static; display: flex; max-height: none; padding: 0; overflow: visible; border: 0; align-items: center; gap: 1.55rem; background: transparent; box-shadow: none; }
  .site-nav a { min-height: auto; padding: 0.65rem 0; border: 0; font-size: 0.68rem; }
  .site-nav .nav-cta { min-height: 2.35rem; margin: 0; padding: 0.72rem 1rem; }
  .flash-stack { top: 5.75rem; right: 1.5rem; left: auto; width: min(23rem, calc(100vw - 3rem)); }
  .hero { min-height: min(45rem, calc(100vh - 7.5rem)); padding: 4.2rem; align-items: center; background: linear-gradient(90deg, rgba(5, 4, 3, 0.93) 0%, rgba(5, 4, 3, 0.57) 46%, rgba(5, 4, 3, 0.04) 73%), linear-gradient(180deg, transparent 60%, rgba(5, 4, 3, 0.72)), url("/static/image/riverstone-salon.webp") center / cover no-repeat; }
  .hero-copy { width: min(58%, 43rem); padding-bottom: 0; }
  .hero h1 { margin-bottom: 1.45rem; }
  .hero-lede { margin-bottom: 1.8rem; }
  .hero-scene { top: auto; right: 2.7rem; bottom: 2.5rem; }
  .hero-table-card { min-width: 9rem; padding: 0.9rem 1rem; }
  .hero-notice { bottom: 2.6rem; left: 4.2rem; }
  .feature-grid article { min-height: 11.5rem; padding: 1.7rem 1.7rem 1.5rem 5rem; }
  .feature-grid article > span { top: 1.55rem; left: 1.55rem; width: 2.65rem; height: 2.65rem; }
  .auth-layout { min-height: 39rem; grid-template-columns: 1fr minmax(21rem, 29rem); gap: 5rem; }
  .auth-aside { display: block; }
  .auth-layout.compact { width: min(100%, 66rem); margin: auto; }
  .form-panel { padding: 2.3rem; }
  .lobby-split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .leaderboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-filters { grid-template-columns: 1fr 1fr 1.2fr 1fr 1fr auto; }
  .replayer { padding: 1.3rem; }
  .admin-row { grid-template-columns: 9rem 1fr 1fr 1.5fr; }
  .admin-row span:nth-of-type(n + 2) { display: inline; }
}

@media (min-width: 72rem) {
  .poker-app:not([data-practice="true"]) .poker-stage { padding-right: 19rem; padding-left: 3rem; }
  .felt-table { width: min(68vw, 64rem); height: min(57dvh, 34rem); }
  .seat { width: 8.5rem; }
  .seat-card { min-height: 3rem; padding: 0.45rem 0.55rem; grid-template-columns: 1.9rem minmax(0, 1fr); }
  .seat-avatar { width: 1.9rem; height: 1.9rem; }
  .seat-name { font-size: 0.66rem; }
  .seat-stack { font-size: 0.57rem; }
  .playing-card { width: 3.15rem; height: 4.4rem; font-size: 1.3rem; }
  .board { min-height: 4.4rem; gap: 0.38rem; }
  .hole-cards .playing-card { width: 3.35rem; height: 4.7rem; }
  .table-console { min-height: 6rem; padding: 0.65rem 1.3rem; grid-template-columns: 11rem minmax(0, 1fr) 15rem; gap: 1rem; }
  .action-controls .button { min-height: 2.5rem; padding: 0.65rem 0.75rem; font-size: 0.62rem; }
  .bet-presets { display: flex; }
  .table-chat { top: 4.5rem; right: 0.75rem; bottom: 7.5rem; width: 17rem; border-right: 1px solid var(--gold-line); border-radius: 0.65rem; transform: none; }
  .table-chat > header { padding-left: 0.85rem; }
  .table-chat > header::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
