/* ================================================================
   ROYAL FLUSH · Texas Hold'em
   A hand-built, dependency-free casino table.
   ================================================================ */

:root {
  --bg: #070c0b;
  --bg-soft: #0a1210;
  --panel: rgba(12, 22, 19, 0.92);
  --panel-solid: #0c1714;
  --felt-deep: #0a2a24;
  --felt: #124438;
  --cream: #f3ecdc;
  --cream-dim: #d8d0c0;
  --muted: #8e9a94;
  --muted-2: #69756f;
  --gold: #d6b36a;
  --gold-bright: #f2d99a;
  --gold-deep: #9d7a3e;
  --red: #d95e55;
  --red-soft: #f08a7f;
  --green: #5fc29b;
  --line: rgba(226, 206, 164, 0.14);
  --line-strong: rgba(226, 206, 164, 0.26);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --serif: "Bodoni MT", Didot, "Cormorant Garamond", "STZhongsong", "Songti SC", "SimSun", Georgia, serif;
  --sans: "Segoe UI", "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --board-card-w: clamp(42px, 4.45vw, 64px);
  --seat-card-w: clamp(26px, 2.15vw, 34px);
  --hero-card-w: clamp(54px, 4.6vw, 68px);
}

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

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  height: 100%;
  overflow: hidden;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

body.modal-open {
  overflow: hidden;
}

::selection {
  background: rgba(214, 179, 106, 0.32);
  color: #fff;
}

/* Ambient backdrop ------------------------------------------------ */

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, #12241f 0%, transparent 60%),
    linear-gradient(180deg, #09100e 0%, #070c0b 60%, #060a09 100%);
}

.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.45;
}

.ambient-glow--one {
  width: 55vw;
  height: 45vw;
  top: -24vw;
  left: 8vw;
  background: rgba(31, 83, 67, 0.35);
}

.ambient-glow--two {
  width: 40vw;
  height: 40vw;
  right: -16vw;
  bottom: -20vw;
  background: rgba(115, 84, 37, 0.18);
}

.ambient-grid {
  position: absolute;
  inset: 0;
  opacity: 0.25;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 78%);
}

/* App shell ------------------------------------------------------ */

.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
}

.topbar {
  flex: 0 0 70px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(14, 25, 22, 0.88), rgba(8, 14, 12, 0.65)),
    rgba(8, 13, 12, 0.7);
  backdrop-filter: blur(18px);
}

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

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(214, 179, 106, 0.16), rgba(214, 179, 106, 0.02));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.brand-mark > span {
  font-size: 21px;
  line-height: 1;
  color: var(--gold-bright);
  transform: translateY(-2px);
}

.brand-mark > i {
  position: absolute;
  right: 7px;
  bottom: 5px;
  font-style: normal;
  font-size: 8px;
  color: var(--red-soft);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  min-width: 0;
}

.brand-copy strong {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--cream);
  white-space: nowrap;
}

.brand-copy small {
  margin-top: 5px;
  font-size: 9px;
  letter-spacing: 0.28em;
  color: var(--gold);
  white-space: nowrap;
}

.top-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.table-state {
  display: flex;
  align-items: center;
  gap: 7px;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(95, 194, 155, 0.1), 0 0 10px rgba(95, 194, 155, 0.7);
  animation: breathe 2.6s ease-in-out infinite;
}

.meta-divider {
  width: 1px;
  height: 12px;
  background: var(--line);
}

.top-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 7px;
}

.top-btn,
.icon-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.top-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 13px;
  border-radius: 9px;
  color: var(--cream-dim);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.top-btn-icon {
  font-size: 12px;
  opacity: 0.7;
}

.top-btn--log {
  display: none;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  color: var(--cream-dim);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#soundBtn svg {
  fill: currentColor;
}

#soundBtn .sound-wave {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

#soundBtn .sound-slash {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  opacity: 0;
}

#soundBtn.is-muted .sound-wave {
  opacity: 0;
}

#soundBtn.is-muted .sound-slash {
  opacity: 1;
}

.top-btn:hover,
.icon-btn:hover {
  border-color: var(--line-strong);
  background: rgba(214, 179, 106, 0.08);
  color: var(--gold-bright);
}

.icon-btn:active,
.top-btn:active {
  transform: scale(0.96);
}

/* Layout --------------------------------------------------------- */

.game-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 288px;
  gap: 15px;
  padding: 15px 20px 17px;
}

.table-column {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.table-stage {
  flex: 1;
  min-height: 360px;
  position: relative;
  display: flex;
  min-width: 0;
}

.table-scene {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
}

/* Table ---------------------------------------------------------- */

.table-rail {
  position: absolute;
  inset: 2.5% 2.5% 7.5%;
  padding: 14px;
  border-radius: 50%;
  background:
    linear-gradient(145deg, #3b2f21 0%, #1b1711 28%, #0c0b09 66%, #2b2419 100%);
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.55),
    0 4px 18px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 238, 198, 0.18);
}

.table-rail::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px solid rgba(214, 179, 106, 0.26);
  pointer-events: none;
}

.table-rail::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  background:
    repeating-conic-gradient(from 15deg, rgba(255, 255, 255, 0.015) 0deg 2deg, transparent 2deg 9deg);
  opacity: 0.5;
}

.table-felt {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 36%, #1d5b4b 0%, #15483d 32%, #0e352d 62%, #08251f 84%, #061b17 100%);
  box-shadow:
    inset 0 0 90px rgba(0, 0, 0, 0.62),
    inset 0 0 20px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(242, 217, 154, 0.17),
    inset 0 0 0 7px rgba(0, 0, 0, 0.1);
}

.felt-grain {
  position: absolute;
  inset: 0;
  opacity: 0.1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.65'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.felt-ring {
  position: absolute;
  inset: 7%;
  border-radius: 50%;
  border: 1px solid rgba(236, 211, 157, 0.09);
  box-shadow:
    0 0 0 12px rgba(0, 0, 0, 0.025),
    inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.felt-ring::after {
  content: "";
  position: absolute;
  inset: 9%;
  border-radius: 50%;
  border: 1px dashed rgba(236, 211, 157, 0.05);
}

.table-brand {
  position: absolute;
  left: 50%;
  top: 28.5%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
  color: rgba(233, 216, 177, 0.21);
  pointer-events: none;
  user-select: none;
}

.table-brand-suit {
  font-size: 23px;
  line-height: 1;
  color: rgba(233, 216, 177, 0.23);
  margin-bottom: 6px;
}

.table-brand b {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.18em;
}

.table-brand small {
  font-size: 6.5px;
  letter-spacing: 0.32em;
  opacity: 0.8;
}

.street-badge {
  position: absolute;
  left: 50%;
  top: 34%;
  transform: translateX(-50%);
  padding: 3px 11px;
  border: 1px solid rgba(242, 217, 154, 0.13);
  border-radius: 999px;
  background: rgba(3, 12, 10, 0.26);
  color: rgba(243, 236, 220, 0.62);
  font-size: 9px;
  letter-spacing: 0.22em;
  white-space: nowrap;
  pointer-events: none;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.street-badge.is-live {
  color: var(--gold-bright);
  border-color: rgba(242, 217, 154, 0.3);
}

/* Cards ---------------------------------------------------------- */

.board {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: clamp(5px, 0.62vw, 9px);
  z-index: 2;
}

.board-slot {
  width: var(--board-card-w);
  height: calc(var(--board-card-w) * 1.4);
  perspective: 900px;
}

.playing-card {
  position: relative;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 6px;
  background:
    linear-gradient(145deg, #fffdf7 0%, #f4eee1 58%, #e5ddce 100%);
  color: #1a211f;
  box-shadow:
    0 8px 16px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 #fff,
    inset 0 0 0 1px rgba(113, 94, 58, 0.08);
  overflow: hidden;
  transform-origin: 50% 90%;
  user-select: none;
}

.playing-card::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(65, 55, 35, 0.08);
  border-radius: 3px;
  pointer-events: none;
}

.playing-card.is-red {
  color: #c34740;
}

.pc-corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.92;
  z-index: 2;
}

.pc-corner--tl {
  top: 5%;
  left: 9%;
}

.pc-corner--br {
  right: 9%;
  bottom: 5%;
  transform: rotate(180deg);
}

.pc-corner b {
  font-family: Georgia, "Times New Roman", serif;
  font-size: calc(var(--board-card-w) * 0.25);
  font-weight: 700;
  letter-spacing: -0.04em;
}

.pc-corner i {
  margin-top: 2px;
  font-style: normal;
  font-size: calc(var(--board-card-w) * 0.2);
}

.pc-suit {
  position: absolute;
  left: 50%;
  top: 53%;
  transform: translate(-50%, -50%);
  font-size: calc(var(--board-card-w) * 0.5);
  line-height: 1;
  opacity: 0.92;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.playing-card.card--empty {
  border: 1px dashed rgba(242, 225, 188, 0.13);
  background: rgba(1, 10, 8, 0.16);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.12);
}

.playing-card.card--empty::after {
  display: none;
}

.playing-card.card--winning {
  border-color: rgba(255, 233, 170, 0.95);
  box-shadow:
    0 0 0 2px rgba(242, 217, 154, 0.9),
    0 0 28px rgba(242, 217, 154, 0.35),
    0 9px 20px rgba(0, 0, 0, 0.4);
  transform: translateY(-4px);
}

/* Self-only read: the five cards currently making a straight or better. */
.playing-card.card--hand-glow {
  border-color: rgba(137, 244, 201, 0.96);
  box-shadow:
    0 0 0 2px rgba(170, 255, 221, 0.9),
    0 0 24px rgba(76, 223, 171, 0.65),
    0 8px 18px rgba(0, 0, 0, 0.38);
  animation: hand-glow-pulse 1.7s ease-in-out infinite;
  z-index: 3;
}

@keyframes hand-glow-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(137, 244, 201, 0.8),
      0 0 13px rgba(76, 223, 171, 0.5),
      0 8px 18px rgba(0, 0, 0, 0.38);
  }
  50% {
    box-shadow:
      0 0 0 2px rgba(170, 255, 221, 0.95),
      0 0 26px rgba(76, 223, 171, 0.78),
      0 0 42px rgba(39, 171, 132, 0.42),
      0 8px 18px rgba(0, 0, 0, 0.38);
  }
}

@media (prefers-reduced-motion: reduce) {
  .playing-card.card--hand-glow {
    animation: none;
    box-shadow:
      0 0 0 2px rgba(170, 255, 221, 0.9),
      0 0 24px rgba(76, 223, 171, 0.65),
      0 8px 18px rgba(0, 0, 0, 0.38);
  }
}

.board-slot.is-dimmed .playing-card {
  opacity: 0.44;
  filter: saturate(0.75);
}

.playing-card.is-dealing {
  animation: deal-in 0.52s cubic-bezier(0.2, 0.9, 0.25, 1.15) both;
  animation-delay: calc(var(--delay, 0) * 55ms);
}

.playing-card.is-revealed {
  animation: reveal-card 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--delay, 0) * 45ms);
}

/* The read glow must keep pulsing even while the card keeps its deal/reveal class. */
.playing-card.is-dealing.card--hand-glow,
.playing-card.is-revealed.card--hand-glow {
  animation: hand-glow-pulse 1.7s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .playing-card.is-dealing.card--hand-glow,
  .playing-card.is-revealed.card--hand-glow {
    animation: none;
    box-shadow:
      0 0 0 2px rgba(170, 255, 221, 0.9),
      0 0 24px rgba(76, 223, 171, 0.65),
      0 8px 18px rgba(0, 0, 0, 0.38);
  }
}

.playing-card.card--back {
  border: 2px solid #ece0c6;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.22) 0 2px, transparent 3px),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.12) 0 2px, transparent 2px 7px),
    linear-gradient(145deg, #8d2d3b 0%, #651c2a 100%);
  box-shadow:
    0 7px 14px rgba(0, 0, 0, 0.34),
    inset 0 0 0 3px #7b2432,
    inset 0 0 0 4px rgba(255, 245, 219, 0.5);
}

.playing-card.card--back::before {
  content: "";
  position: absolute;
  inset: 22%;
  border: 1px solid rgba(255, 241, 209, 0.42);
  border-radius: 2px;
  background:
    radial-gradient(circle at center, rgba(255, 240, 203, 0.22) 0 2px, transparent 3px),
    linear-gradient(45deg, transparent 45%, rgba(255, 241, 209, 0.18) 46% 54%, transparent 55%);
}

.playing-card.card--back::after {
  border-color: rgba(255, 241, 209, 0.2);
}

.playing-card.card--mini {
  border-radius: 4px;
}

.card--mini .pc-corner--tl {
  top: 5%;
  left: 12%;
}

.card--mini .pc-corner--br {
  display: none;
}

.card--mini .pc-corner b {
  font-size: calc(var(--seat-card-w) * 0.72);
}

.card--mini .pc-corner i {
  font-size: calc(var(--seat-card-w) * 0.55);
  margin-top: 1px;
}

.card--mini .pc-suit {
  top: 58%;
  font-size: calc(var(--seat-card-w) * 0.9);
}

.playing-card.card--hero {
  border-radius: 7px;
}

.card--hero .pc-corner b {
  font-size: calc(var(--hero-card-w) * 0.25);
}

.card--hero .pc-corner i {
  font-size: calc(var(--hero-card-w) * 0.2);
}

.card--hero .pc-suit {
  font-size: calc(var(--hero-card-w) * 0.52);
}

/* Pot ------------------------------------------------------------ */

.pot-display {
  position: absolute;
  left: 50%;
  top: 64%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 108px;
  padding: 6px 14px 6px 8px;
  border: 1px solid rgba(242, 225, 188, 0.11);
  border-radius: 999px;
  background: rgba(3, 12, 10, 0.48);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(7px);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.pot-display.is-growing {
  border-color: rgba(242, 217, 154, 0.4);
  box-shadow: 0 0 28px rgba(214, 179, 106, 0.16);
}

.pot-chips {
  position: relative;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
}

.pot-chips i {
  position: absolute;
  left: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transform: translateX(-50%);
  background:
    repeating-conic-gradient(from 0deg, #f6e5b7 0deg 18deg, #a47f42 18deg 36deg);
  border: 2px solid #2b2011;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.pot-chips i:nth-child(1) { top: 10px; }
.pot-chips i:nth-child(2) { top: 7px; }
.pot-chips i:nth-child(3) { top: 4px; }
.pot-chips i:nth-child(4) { top: 1px; opacity: 0.95; }

.pot-copy {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.pot-copy small {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.pot-copy strong {
  margin-top: 3px;
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

/* Seats ---------------------------------------------------------- */

.seats {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.seat {
  --panel-bg: rgba(8, 17, 15, 0.9);
  position: absolute;
  width: 158px;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: opacity 0.35s ease, filter 0.35s ease;
}

.seat[data-seat="0"] {
  left: 50%;
  top: 84%;
  width: 224px;
}

.seat[data-seat="1"] {
  left: 8.2%;
  top: 69%;
}

.seat[data-seat="2"] {
  left: 16.5%;
  top: 28%;
}

.seat[data-seat="3"] {
  left: 50%;
  top: 9.5%;
  flex-direction: column-reverse;
  gap: 7px;
}

.seat[data-seat="4"] {
  left: 83.5%;
  top: 28%;
}

.seat[data-seat="5"] {
  left: 91.8%;
  top: 69%;
}

.seat .hole {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: calc(var(--seat-card-w) * 1.4);
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.22));
}

.seat .hole .playing-card {
  width: var(--seat-card-w);
  height: calc(var(--seat-card-w) * 1.4);
}

.seat--human .hole {
  gap: 7px;
  height: calc(var(--hero-card-w) * 1.4);
  margin-bottom: 2px;
}

.seat--human .hole .playing-card {
  width: var(--hero-card-w);
  height: calc(var(--hero-card-w) * 1.4);
  border-radius: 7px;
}

.seat-panel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 45px;
  padding: 6px 9px;
  border: 1px solid rgba(242, 225, 188, 0.14);
  border-radius: 12px;
  background:
    linear-gradient(150deg, rgba(28, 45, 39, 0.72), rgba(7, 15, 13, 0.92));
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(9px);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.seat--human .seat-panel {
  min-height: 50px;
  padding: 7px 11px;
  border-color: rgba(214, 179, 106, 0.26);
  background:
    linear-gradient(150deg, rgba(54, 47, 31, 0.82), rgba(12, 20, 16, 0.95));
}

.avatar {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--avatar, #7d6a47), #14211e 130%);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.18),
    0 3px 9px rgba(0, 0, 0, 0.24);
  color: #f8f1e4;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.seat--human .avatar {
  width: 37px;
  height: 37px;
  border-color: rgba(242, 217, 154, 0.45);
  font-size: 15px;
}

.avatar::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid transparent;
  border-radius: 50%;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.seat.is-active .avatar::after {
  border-color: rgba(242, 217, 154, 0.6);
  box-shadow: 0 0 16px rgba(242, 217, 154, 0.25);
  animation: avatar-pulse 1.8s ease-in-out infinite;
}

.seat-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 1;
  gap: 2px;
}

.seat-name {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: var(--cream);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.you-tag {
  flex: 0 0 auto;
  padding: 1px 4px;
  border: 1px solid rgba(214, 179, 106, 0.35);
  border-radius: 3px;
  color: var(--gold);
  font-size: 6.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.seat-stack {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--gold-bright);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.stack-chip {
  display: inline-block;
  width: 7px;
  height: 7px;
  border: 1px solid #eed494;
  border-radius: 50%;
  background: #a77c39;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.dealer-btn {
  position: absolute;
  right: -7px;
  top: -8px;
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border: 1px solid #5b4422;
  border-radius: 50%;
  background: linear-gradient(150deg, #f8e7ba, #cfa95d 56%, #9b7436);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.7);
  color: #32240f;
  font-family: Georgia, serif;
  font-size: 9px;
  font-weight: 800;
  opacity: 0;
  transform: scale(0.4) rotate(-20deg);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.2, 0.9, 0.2, 1.2);
}

.seat.has-dealer .dealer-btn {
  opacity: 1;
  transform: scale(1) rotate(0);
}

.seat-status {
  position: absolute;
  left: 50%;
  bottom: -25px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  max-width: 220px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.seat-status.is-visible {
  opacity: 1;
}

.seat--human .seat-status {
  bottom: -20px;
}

.action-badge,
.bet-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 19px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 8.5px;
  line-height: 1;
  letter-spacing: 0.03em;
  font-weight: 600;
  backdrop-filter: blur(6px);
}

.action-badge {
  border: 1px solid rgba(242, 225, 188, 0.15);
  background: rgba(6, 16, 13, 0.82);
  color: var(--cream-dim);
}

.action-badge.is-thinking {
  color: var(--gold-bright);
  border-color: rgba(214, 179, 106, 0.3);
}

.action-badge.is-thinking::after {
  content: "···";
  display: inline-block;
  width: 8px;
  overflow: hidden;
  vertical-align: bottom;
  animation: thinking-ellipsis 1.5s steps(4, end) infinite;
}

.action-badge.is-raise {
  color: #18211d;
  border-color: rgba(242, 217, 154, 0.65);
  background: linear-gradient(180deg, #f0d99d, #d3ae61);
}

.action-badge.is-fold {
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.07);
}

.action-badge.is-win {
  color: #152019;
  border-color: rgba(242, 217, 154, 0.8);
  background: linear-gradient(180deg, #f6e3b1, #cfa85a);
  box-shadow: 0 0 18px rgba(242, 217, 154, 0.25);
}

.bet-badge {
  border: 1px solid rgba(214, 179, 106, 0.2);
  background: rgba(29, 24, 12, 0.78);
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
}

.bet-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border: 1px solid #f3d994;
  border-radius: 50%;
  background: #a77c39;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.seat.is-active .seat-panel {
  border-color: rgba(242, 217, 154, 0.62);
  box-shadow:
    0 0 0 1px rgba(242, 217, 154, 0.12),
    0 0 32px rgba(214, 179, 106, 0.2),
    0 10px 26px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.seat.is-folded {
  opacity: 0.46;
  filter: saturate(0.45);
}

.seat.is-folded .seat-panel {
  border-color: rgba(255, 255, 255, 0.06);
}

.seat.is-folded .action-badge {
  color: #7b8580;
}

.seat.is-allin .seat-panel {
  border-color: rgba(240, 138, 127, 0.34);
}

.seat.is-winner .seat-panel {
  border-color: rgba(242, 217, 154, 0.9);
  box-shadow:
    0 0 0 1px rgba(242, 217, 154, 0.28),
    0 0 40px rgba(242, 217, 154, 0.28),
    0 12px 28px rgba(0, 0, 0, 0.4);
}

.seat.is-winner .avatar::after {
  border-color: rgba(242, 217, 154, 0.8);
  box-shadow: 0 0 22px rgba(242, 217, 154, 0.4);
}

.table-shade {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 52%, transparent 48%, rgba(0, 0, 0, 0.18) 100%);
}

/* Action dock ---------------------------------------------------- */

.action-dock {
  position: relative;
  flex: 0 0 178px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 9px;
  min-height: 0;
  padding: 11px 15px;
  border: 1px solid rgba(242, 225, 188, 0.13);
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(44, 74, 62, 0.2), transparent 60%),
    linear-gradient(155deg, rgba(17, 30, 26, 0.94), rgba(7, 14, 12, 0.96));
  box-shadow:
    0 15px 40px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.action-dock::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(242, 217, 154, 0.32), transparent);
}

.action-dock.is-turn {
  border-color: rgba(242, 217, 154, 0.28);
  box-shadow:
    0 0 0 1px rgba(242, 217, 154, 0.06),
    0 15px 45px rgba(0, 0, 0, 0.3),
    0 0 40px rgba(214, 179, 106, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.dock-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 21px;
  padding: 0 3px;
}

.status-prompt {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--cream-dim);
  font-size: 11.5px;
  letter-spacing: 0.04em;
}

.status-prompt > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-dock.is-turn .status-prompt {
  color: var(--gold-bright);
  font-weight: 600;
}

.turn-pulse {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #52605a;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.025);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.action-dock.is-turn .turn-pulse {
  background: var(--gold-bright);
  box-shadow:
    0 0 0 4px rgba(242, 217, 154, 0.12),
    0 0 14px rgba(242, 217, 154, 0.55);
  animation: breathe 1.8s ease-in-out infinite;
}

.hand-read {
  flex: 0 1 auto;
  min-width: 0;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hand-read strong {
  color: var(--gold);
  font-weight: 600;
}

.idle-strip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-height: 104px;
  padding: 15px 18px;
  border: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: 11px;
  background:
    radial-gradient(ellipse at 8% 50%, rgba(214, 179, 106, 0.055), transparent 46%),
    rgba(0, 0, 0, 0.13);
  overflow: hidden;
}

.idle-strip::after {
  content: "♠";
  position: absolute;
  right: 27%;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(242, 217, 154, 0.028);
  font-size: 150px;
  line-height: 1;
  pointer-events: none;
}

.idle-suit {
  align-self: flex-start;
  flex: 0 0 auto;
  margin-top: 1px;
  color: rgba(242, 217, 154, 0.34);
  font-size: 18px;
}

.idle-note {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
}

.idle-kicker {
  display: block;
  margin-bottom: 5px;
  color: rgba(214, 179, 106, 0.62);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.24em;
}

.idle-note p {
  max-width: 520px;
  margin: 0;
  color: #8d9993;
  font-size: 11px;
  line-height: 1.8;
  letter-spacing: 0.02em;
}

.idle-metrics {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 0 0 auto;
  border: 1px solid rgba(242, 225, 188, 0.075);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.018);
}

.idle-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 72px;
  padding: 7px 12px;
  border-left: 1px solid rgba(242, 225, 188, 0.065);
}

.idle-metric:first-child {
  border-left: none;
}

.idle-metric span {
  color: #68756f;
  font-size: 7px;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.idle-metric strong {
  color: var(--cream-dim);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.thinking-dots {
  display: none;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
}

.thinking-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  animation: dot-bounce 1.2s ease-in-out infinite;
}

.thinking-dots i:nth-child(2) { animation-delay: 0.15s; }
.thinking-dots i:nth-child(3) { animation-delay: 0.3s; }

.action-dock.is-busy .thinking-dots {
  display: flex;
}

.play-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: 14px;
  align-items: end;
}

.action-dock:not(.is-turn) .play-controls {
  display: none;
}

.action-dock.is-turn .idle-strip {
  display: none;
}

.raise-box {
  min-width: 0;
  padding: 8px 11px 9px;
  border: 1px solid rgba(242, 225, 188, 0.09);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.17);
}

.raise-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 19px;
  color: var(--muted);
  font-size: 10.5px;
}

.raise-heading strong {
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}

.raise-shortcuts {
  display: flex;
  gap: 5px;
}

.mini-btn {
  height: 21px;
  padding: 0 8px;
  border: 1px solid rgba(242, 225, 188, 0.13);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.mini-btn:hover {
  border-color: rgba(242, 217, 154, 0.4);
  color: var(--gold-bright);
}

.mini-btn--gold {
  border-color: rgba(214, 179, 106, 0.24);
  color: var(--gold);
}

.mini-btn:disabled {
  opacity: 0.32;
  cursor: default;
}

.slider-wrap {
  position: relative;
  padding: 6px 0 3px;
}

.raise-slider {
  --fill: 30%;
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 4px;
  margin: 0;
  border-radius: 99px;
  background:
    linear-gradient(90deg, var(--gold) 0 var(--fill), rgba(255, 255, 255, 0.11) var(--fill) 100%);
  cursor: pointer;
  outline: none;
}

.raise-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid #f3dfab;
  border-radius: 50%;
  background: linear-gradient(145deg, #f4dfa7, #b78c43);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45), 0 0 12px rgba(242, 217, 154, 0.2);
  cursor: grab;
}

.raise-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 2px solid #f3dfab;
  border-radius: 50%;
  background: linear-gradient(145deg, #f4dfa7, #b78c43);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  cursor: grab;
}

.raise-slider::-moz-range-track {
  height: 4px;
  border-radius: 99px;
  background: transparent;
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  padding: 0 4px;
  margin-top: 3px;
  pointer-events: none;
}

.slider-ticks i {
  width: 1px;
  height: 2px;
  background: rgba(255, 255, 255, 0.12);
}

.quick-bets {
  display: flex;
  gap: 5px;
  margin-top: 1px;
}

.quick-bets button {
  flex: 1;
  height: 20px;
  padding: 0;
  border: 1px solid rgba(242, 225, 188, 0.08);
  border-radius: 4px;
  background: transparent;
  color: #7f8b85;
  font-size: 8.5px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.quick-bets button:hover {
  border-color: rgba(242, 217, 154, 0.25);
  background: rgba(214, 179, 106, 0.07);
  color: var(--gold-bright);
}

.action-buttons {
  display: grid;
  grid-template-columns: 0.82fr 1.15fr 1.15fr;
  gap: 7px;
}

.action-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  height: 54px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.16s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.action-key {
  color: rgba(255, 255, 255, 0.24);
  font-family: Georgia, serif;
  font-size: 8px;
  letter-spacing: 0.12em;
}

.action-label {
  color: var(--cream);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.action-btn--fold {
  border-color: rgba(217, 94, 85, 0.18);
  background: rgba(217, 94, 85, 0.045);
}

.action-btn--fold .action-label {
  color: #dca59f;
}

.action-btn--fold:hover {
  border-color: rgba(217, 94, 85, 0.45);
  background: rgba(217, 94, 85, 0.11);
  box-shadow: 0 0 24px rgba(217, 94, 85, 0.08);
}

.action-btn--call {
  border-color: rgba(242, 217, 154, 0.5);
  background: linear-gradient(155deg, #f5e3b3 0%, #d9b56a 55%, #bc9145 100%);
  box-shadow:
    0 5px 18px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.action-btn--call .action-label {
  color: #24200f;
  font-weight: 700;
}

.action-btn--call .action-key {
  color: rgba(35, 28, 11, 0.36);
}

.action-btn--call:hover {
  background: linear-gradient(155deg, #fff0c9 0%, #e4c078 55%, #c79c4e 100%);
  box-shadow: 0 7px 24px rgba(0, 0, 0, 0.34), 0 0 24px rgba(242, 217, 154, 0.14);
}

.action-btn--raise {
  border-color: rgba(242, 217, 154, 0.26);
  background:
    linear-gradient(155deg, rgba(52, 91, 77, 0.36), rgba(12, 26, 22, 0.5));
}

.action-btn--raise .action-label {
  color: var(--gold-bright);
}

.action-btn--raise:hover {
  border-color: rgba(242, 217, 154, 0.55);
  background: linear-gradient(155deg, rgba(64, 112, 94, 0.46), rgba(15, 33, 27, 0.66));
  box-shadow: 0 0 24px rgba(95, 194, 155, 0.08);
}

.action-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.action-btn:active:not(:disabled) {
  transform: translateY(0) scale(0.985);
}

.action-btn:disabled {
  opacity: 0.32;
  cursor: default;
  filter: saturate(0.55);
}

.action-btn:disabled:hover {
  transform: none;
}

/* Sidebar -------------------------------------------------------- */

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(242, 225, 188, 0.12);
  border-radius: 17px;
  background:
    linear-gradient(170deg, rgba(16, 28, 24, 0.9), rgba(7, 14, 12, 0.94));
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 17px 14px;
  border-bottom: 1px solid rgba(242, 225, 188, 0.07);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.25em;
  line-height: 1.2;
  text-transform: uppercase;
}

.sidebar-head h2 {
  margin: 0;
  color: var(--cream);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.sidebar-head-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  padding: 3px 7px;
  border: 1px solid rgba(95, 194, 155, 0.16);
  border-radius: 999px;
  color: #79bda6;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.sidebar-close {
  display: none;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid rgba(242, 225, 188, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-family: Georgia, serif;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-close:hover {
  border-color: rgba(242, 217, 154, 0.4);
  color: var(--gold-bright);
}

.live-badge i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--green);
  animation: breathe 2.4s ease-in-out infinite;
}

.log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 13px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(214, 179, 106, 0.25) transparent;
}

.log::-webkit-scrollbar {
  width: 5px;
}

.log::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(214, 179, 106, 0.22);
}

.log-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 100%;
  min-height: 200px;
  text-align: center;
  color: #5f6d67;
}

.log-empty span {
  color: rgba(214, 179, 106, 0.22);
  font-size: 27px;
}

.log-empty p {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.8;
}

.log-entry {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 6px 2px 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.035);
  color: #9ba7a1;
  font-size: 10.5px;
  line-height: 1.5;
  animation: log-in 0.28s ease both;
}

.log-entry:last-child {
  border-bottom: none;
}

.log-entry::before {
  content: "";
  flex: 0 0 auto;
  width: 4px;
  height: 4px;
  margin-top: 5px;
  border-radius: 50%;
  background: #617069;
}

.log-entry--hand {
  margin: 7px 0 2px;
  padding-top: 9px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  border-top: 1px solid rgba(214, 179, 106, 0.1);
  border-bottom: none;
}

.log-entry--hand::before {
  display: none;
}

.log-entry--street {
  color: #aebbb4;
  background: linear-gradient(90deg, rgba(214, 179, 106, 0.055), transparent);
}

.log-entry--street::before {
  background: var(--gold);
  box-shadow: 0 0 6px rgba(242, 217, 154, 0.4);
}

.log-entry--raise,
.log-entry--bet,
.log-entry--allin {
  color: #d7c9a9;
}

.log-entry--raise::before,
.log-entry--bet::before,
.log-entry--allin::before {
  background: var(--gold);
}

.log-entry--fold {
  color: #6e7a74;
}

.log-entry--win,
.log-entry--hand-end {
  color: var(--gold-bright);
  background: linear-gradient(90deg, rgba(214, 179, 106, 0.08), transparent);
}

.log-entry--win::before {
  background: var(--gold-bright);
  box-shadow: 0 0 7px rgba(242, 217, 154, 0.7);
}

.log-entry--pot-result {
  color: #7f8c85;
  font-size: 9.5px;
  padding-left: 11px;
}

.log-entry--rebuy {
  color: #7f9e91;
}

.log-entry--rebuy::before {
  background: #5b8d7b;
}

.log-entry .log-player {
  color: #d9d2c3;
}

.sidebar-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  padding: 12px 13px;
  border-top: 1px solid rgba(242, 225, 188, 0.07);
}

.sidebar-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
}

.sidebar-stat--wide {
  grid-column: 1 / -1;
}

.sidebar-stat span {
  color: #68756f;
  font-size: 8px;
  letter-spacing: 0.12em;
}

.sidebar-stat strong {
  color: var(--cream-dim);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-top: 1px solid rgba(242, 225, 188, 0.06);
  color: #59655f;
  font-size: 8px;
  letter-spacing: 0.08em;
}

.blind-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(214, 179, 106, 0.6);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(2, 7, 6, 0.65);
  backdrop-filter: blur(4px);
}

/* Showdown panel (lives in the action dock) ---------------------- */

.action-dock.has-result {
  justify-content: stretch;
  border-color: rgba(242, 217, 154, 0.3);
  background:
    radial-gradient(ellipse at 50% -30%, rgba(126, 98, 43, 0.25), transparent 60%),
    linear-gradient(155deg, rgba(20, 33, 28, 0.97), rgba(7, 14, 12, 0.98));
  box-shadow:
    0 0 0 1px rgba(242, 217, 154, 0.05),
    0 18px 48px rgba(0, 0, 0, 0.32),
    0 0 50px rgba(214, 179, 106, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.action-dock.has-result .dock-status,
.action-dock.has-result .idle-strip,
.action-dock.has-result .play-controls {
  display: none;
}

.showdown-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(120px, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  flex: 1;
  align-self: stretch;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 10px 15px;
  border: 1px solid rgba(242, 217, 154, 0.24);
  border-radius: 12px;
  background:
    radial-gradient(ellipse at 34% 0%, rgba(111, 84, 38, 0.2), transparent 58%),
    rgba(5, 12, 10, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: result-in 0.4s cubic-bezier(0.18, 0.9, 0.25, 1.08) both;
}

.showdown-panel.is-fold {
  grid-template-columns: minmax(240px, 1fr) auto auto;
}

.showdown-panel::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(242, 217, 154, 0.055);
  border-radius: 8px;
  pointer-events: none;
}

.result-lead {
  min-width: 0;
}

.result-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 7px;
  color: var(--gold);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-align: left;
  white-space: nowrap;
}

.result-eyebrow::before {
  content: "";
  width: 19px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.result-headline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.result-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid rgba(242, 217, 154, 0.36);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--avatar, #7d6a47), #14211e 130%);
  color: #fff7e6;
  font-family: var(--serif);
  font-size: 13px;
  box-shadow: 0 0 18px rgba(242, 217, 154, 0.13);
}

.result-copy {
  min-width: 0;
  flex: 1;
}

.result-copy h3 {
  margin: 0;
  color: var(--cream);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-copy p {
  margin: 3px 0 0;
  color: var(--gold);
  font-size: 9.5px;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-middle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}

.result-cards {
  display: flex;
  justify-content: center;
  gap: 3px;
  margin: 0;
  min-height: 0;
}

.result-cards .playing-card {
  width: 28px;
  height: 39px;
  border-radius: 4px;
  animation: result-card-in 0.34s ease both;
  animation-delay: calc(var(--delay, 0) * 55ms);
}

.result-cards .pc-corner--br {
  display: none;
}

.result-cards .pc-corner b {
  font-size: 8.5px;
}

.result-cards .pc-corner i {
  font-size: 7px;
}

.result-cards .pc-suit {
  font-size: 13px;
}

.result-tail {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 90px;
}

.result-amount {
  flex: 0 0 auto;
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.result-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin: 0;
  color: #77847d;
  font-size: 7.5px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.result-meta i {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #5b6761;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.next-hand-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 146px;
  height: 40px;
  border: 1px solid rgba(242, 217, 154, 0.55);
  border-radius: 8px;
  background: linear-gradient(155deg, #f3e0ac, #d4ae62 60%, #b98d42);
  color: #28200e;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease;
}

.next-hand-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.next-hand-btn .next-count {
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 99px;
  background: rgba(40, 32, 14, 0.14);
  font-size: 9px;
  font-weight: 600;
}

.result-winners {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin: 0;
}

.result-winner-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  border: 1px solid rgba(242, 217, 154, 0.14);
  border-radius: 999px;
  color: #b9b2a3;
  font-size: 7.5px;
  white-space: nowrap;
}

.result-winner-chip b {
  color: var(--gold-bright);
  font-weight: 500;
}

.confetti {
  position: absolute;
  inset: 0;
  z-index: 7;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Intro ---------------------------------------------------------- */

.intro {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse 55% 65% at 72% 38%, rgba(30, 72, 59, 0.28), transparent 65%),
    radial-gradient(ellipse 60% 55% at 20% 70%, rgba(72, 56, 30, 0.15), transparent 65%),
    linear-gradient(135deg, rgba(7, 14, 12, 0.94), rgba(5, 10, 9, 0.97));
  backdrop-filter: blur(18px);
  transition: opacity 0.65s ease, visibility 0.65s ease, transform 0.65s ease;
}

.intro.is-leaving {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.02);
  pointer-events: none;
}

.intro-noise {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.intro-glow {
  position: absolute;
  width: 48vw;
  height: 48vw;
  right: 5vw;
  top: 8vh;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 179, 106, 0.12), transparent 65%);
  filter: blur(40px);
  pointer-events: none;
}

.intro::before,
.intro::after {
  content: "";
  position: absolute;
  left: 8vw;
  right: 8vw;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(214, 179, 106, 0.22), transparent);
  pointer-events: none;
}

.intro::before { top: 11vh; }
.intro::after { bottom: 11vh; }

.hero-cards {
  position: absolute;
  right: 9vw;
  top: 50%;
  width: 340px;
  height: 440px;
  transform: translateY(-50%);
  pointer-events: none;
  perspective: 1200px;
}

.hero-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 176px;
  height: 250px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 11px;
  background: linear-gradient(150deg, #fffdf7, #eee7d8 60%, #ddd3c2);
  box-shadow:
    0 35px 60px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 #fff;
  color: #1b2420;
  transform-origin: 50% 95%;
  animation: hero-float 9s ease-in-out infinite;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(90, 74, 45, 0.12);
  border-radius: 6px;
}

.hero-card--1 {
  transform: translate(-50%, -55%) rotate(-21deg) translateX(-128px);
  animation-delay: -1.2s;
}

.hero-card--2 {
  transform: translate(-50%, -55%) rotate(-10deg) translateX(-65px);
  color: #c34740;
  animation-delay: -2.8s;
}

.hero-card--3 {
  transform: translate(-50%, -55%) rotate(1deg) translateX(0);
  color: #c34740;
  z-index: 2;
  animation-delay: -4.1s;
}

.hero-card--4 {
  transform: translate(-50%, -55%) rotate(12deg) translateX(64px);
  animation-delay: -5.5s;
}

.hero-card--5 {
  transform: translate(-50%, -55%) rotate(23deg) translateX(128px);
  animation-delay: -7s;
}

.hero-corner {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.9;
  font-family: Georgia, "Times New Roman", serif;
}

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

.hero-corner i {
  font-style: normal;
  font-size: 18px;
  margin-top: 3px;
}

.hero-suit {
  position: absolute;
  right: 16px;
  bottom: 10px;
  font-size: 78px;
  line-height: 1;
  opacity: 0.13;
}

.hero-suit--red {
  opacity: 0.14;
}

.intro-content {
  position: relative;
  z-index: 3;
  width: min(620px, 88vw);
  margin-right: min(33vw, 440px);
  padding: 10px 0;
  text-align: left;
  animation: intro-rise 0.9s cubic-bezier(0.18, 0.9, 0.25, 1) both;
}

.intro-eyebrow {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 0 0 16px;
  color: var(--gold);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.28em;
}

.intro-eyebrow span {
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}

.intro-eyebrow span:last-child {
  transform: rotate(180deg);
}

.intro h1 {
  margin: 0;
  color: #f7f0e2;
  font-family: var(--serif);
  font-size: clamp(66px, 7.8vw, 112px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: 0.04em;
  text-shadow: 0 4px 40px rgba(242, 217, 154, 0.06);
}

.title-mark {
  color: var(--gold);
}

.intro-subtitle {
  margin: 13px 0 0;
  color: rgba(214, 179, 106, 0.8);
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.2em;
}

.intro-subtitle i {
  font-style: normal;
  font-size: 8px;
  opacity: 0.7;
  padding: 0 7px;
}

.intro-copy {
  margin: 24px 0 0;
  color: #9ba69f;
  font-size: 13px;
  line-height: 2;
  letter-spacing: 0.03em;
}

.profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-top: 20px;
  padding: 5px 11px 5px 6px;
  border: 1px solid rgba(242, 225, 188, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.profile-pill:hover {
  border-color: rgba(242, 217, 154, 0.38);
  background: rgba(214, 179, 106, 0.075);
  transform: translateY(-1px);
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--profile-color, #c9a65c), #14211e 140%);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.18);
  color: #fff7e6;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
}

.profile-pill-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.profile-pill-copy small {
  color: #6d7973;
  font-size: 7px;
  letter-spacing: 0.13em;
}

.profile-pill-copy strong {
  max-width: 150px;
  overflow: hidden;
  color: var(--cream-dim);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-edit {
  margin-left: 3px;
  color: rgba(214, 179, 106, 0.72);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.intro-difficulty {
  display: flex;
  align-items: center;
  gap: 17px;
  margin-top: 22px;
}

.intro-label {
  color: #68756e;
  font-size: 10px;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.segmented {
  position: relative;
  display: flex;
  padding: 3px;
  border: 1px solid rgba(242, 225, 188, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.segmented button {
  position: relative;
  z-index: 2;
  min-width: 53px;
  height: 26px;
  padding: 0 11px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #77837d;
  font-size: 10px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color 0.22s ease;
}

.segmented button.is-active {
  color: #251e0d;
  font-weight: 700;
}

.segmented-thumb {
  position: absolute;
  z-index: 1;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: 53px;
  border-radius: 5px;
  background: linear-gradient(155deg, #f0dcaa, #cfa85c);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.25s ease;
}

.intro-actions {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 30px;
}

.btn-start {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-width: 202px;
  height: 50px;
  padding: 0 16px 0 21px;
  border: 1px solid rgba(255, 244, 209, 0.55);
  border-radius: 8px;
  background: linear-gradient(155deg, #f5e4b7 0%, #d8b46a 56%, #bc9146 100%);
  text-decoration: none;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.32),
    0 0 30px rgba(214, 179, 106, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  color: #261f0f;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.btn-start:hover {
  filter: brightness(1.05);
  transform: translateY(-2px);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.38),
    0 0 44px rgba(214, 179, 106, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.btn-start-arrow {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid rgba(39, 31, 14, 0.2);
  border-radius: 50%;
  font-size: 14px;
}

.btn-ghost {
  height: 46px;
  padding: 0 17px;
  border: 1px solid rgba(242, 225, 188, 0.15);
  border-radius: 7px;
  background: transparent;
  color: #b8b1a1;
  font-size: 11px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-ghost:hover {
  border-color: rgba(242, 217, 154, 0.35);
  background: rgba(214, 179, 106, 0.06);
  color: var(--gold-bright);
}

.btn-ghost--solid {
  height: 36px;
  border-color: rgba(242, 217, 154, 0.3);
  background: rgba(214, 179, 106, 0.1);
  color: var(--gold-bright);
}

#profileSave {
  border-color: rgba(255, 244, 209, 0.5);
  background: linear-gradient(155deg, #f3e0ac, #d4ae62 60%, #b98d42);
  color: #28200e;
  font-weight: 700;
}

#profileSave:hover {
  filter: brightness(1.05);
}

.intro-rules-link {
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: none;
  color: #7b8881;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color 0.2s ease;
}

.intro-rules-link span {
  color: rgba(214, 179, 106, 0.65);
  font-size: 10px;
}

.intro-rules-link:hover {
  color: var(--gold-bright);
}

.intro-stats {
  display: flex;
  gap: 35px;
  margin-top: 25px;
  padding-top: 15px;
  border-top: 1px solid rgba(242, 225, 188, 0.09);
  max-width: 380px;
}

.intro-stats > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.intro-stats span {
  color: #69746e;
  font-size: 8px;
  letter-spacing: 0.18em;
}

.intro-stats strong {
  color: #cbc2ae;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.intro-foot {
  position: absolute;
  left: 8vw;
  right: 8vw;
  bottom: 5vh;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #4f5b55;
  font-size: 8.5px;
  letter-spacing: 0.12em;
}

.intro-foot span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.intro-foot i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.6;
}

/* Modal ---------------------------------------------------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
}

.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(2, 7, 6, 0.76);
  backdrop-filter: blur(9px);
  animation: fade-in 0.25s ease both;
}

.modal-card {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(920px, 100%);
  max-height: min(90vh, 820px);
  overflow: hidden;
  border: 1px solid rgba(242, 217, 154, 0.28);
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 50% -20%, rgba(80, 112, 88, 0.2), transparent 50%),
    linear-gradient(165deg, #13231e, #09130f);
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.62),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: modal-in 0.35s cubic-bezier(0.18, 0.9, 0.25, 1.08) both;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 23px 30px 17px;
  border-bottom: 1px solid rgba(242, 225, 188, 0.1);
}

.modal-head h2 {
  margin: 0;
  color: var(--cream);
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.modal-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(242, 225, 188, 0.13);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-family: Georgia, serif;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close:hover {
  border-color: rgba(242, 217, 154, 0.4);
  color: var(--gold-bright);
  transform: rotate(90deg);
}

.modal-scroll {
  overflow-y: auto;
  padding: 22px 30px 26px;
  scrollbar-width: thin;
  scrollbar-color: rgba(214, 179, 106, 0.3) transparent;
}

.modal-scroll::-webkit-scrollbar {
  width: 6px;
}

.modal-scroll::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(214, 179, 106, 0.25);
}

.profile-card {
  width: min(500px, 100%);
}

.profile-body {
  min-height: 0;
  overflow-y: auto;
  padding: 20px 28px 25px;
}

.profile-preview {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px;
  border: 1px solid rgba(242, 225, 188, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.profile-preview-avatar {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border: 1px solid rgba(242, 217, 154, 0.38);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--profile-color, #c9a65c), #14211e 140%);
  color: #fff7e6;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  box-shadow: 0 0 22px rgba(214, 179, 106, 0.1);
}

.profile-preview-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.profile-preview-copy small {
  color: #6f7c75;
  font-size: 7.5px;
  letter-spacing: 0.11em;
}

.profile-preview-copy strong {
  color: var(--cream);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 19px;
}

.profile-field > span,
.profile-color-label {
  color: #8a968f;
  font-size: 8.5px;
  letter-spacing: 0.12em;
}

.profile-field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(242, 225, 188, 0.14);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--cream);
  font-size: 13px;
  letter-spacing: 0.03em;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.profile-field input:focus {
  border-color: rgba(242, 217, 154, 0.55);
  box-shadow: 0 0 0 3px rgba(242, 217, 154, 0.07);
}

.profile-color-label {
  margin-top: 18px;
  margin-bottom: 8px;
}

.profile-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.profile-color {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.profile-color:hover {
  transform: scale(1.1);
}

.profile-color[aria-pressed="true"] {
  border-color: #f8e8ba;
  box-shadow:
    0 0 0 3px rgba(242, 217, 154, 0.2),
    0 0 12px rgba(242, 217, 154, 0.2);
  transform: scale(1.08);
}

.profile-hint {
  margin: 17px 0 0;
  color: #68756f;
  font-size: 9px;
  line-height: 1.75;
}

.rules-intro {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
}

.rule-step {
  display: flex;
  gap: 12px;
  padding: 15px 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.022);
}

.rule-step > span {
  flex: 0 0 auto;
  color: rgba(214, 179, 106, 0.6);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1;
}

.rule-step h3 {
  margin: 0 0 5px;
  color: #e1d9c8;
  font-size: 12px;
  font-weight: 600;
}

.rule-step p {
  margin: 0;
  color: #a6b1ab;
  font-size: 11px;
  line-height: 1.75;
}

.hand-ranks {
  margin-top: 24px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.section-heading h3,
.rules-notes h3 {
  margin: 0;
  color: #e1d9c8;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.section-heading > span {
  color: #8a968f;
  font-size: 9.5px;
  letter-spacing: 0.06em;
}

.rank-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 26px;
}

.rank-row {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 53px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.rank-no {
  flex: 0 0 15px;
  color: rgba(214, 179, 106, 0.58);
  font-family: var(--serif);
  font-size: 12px;
}

.rank-name {
  flex: 1;
  min-width: 0;
  color: #e0d8c8;
  font-size: 12px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.rank-cards {
  display: flex;
  gap: 2px;
  flex: 0 0 auto;
}

.rule-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 37px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 3px;
  background: linear-gradient(145deg, #fffdf7, #e9e2d4);
  color: #1a211f;
  font-family: Georgia, serif;
  font-size: 10px;
  font-weight: 700;
  line-height: 0.9;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.rule-card.is-red {
  color: #bd423b;
}

.rule-card i {
  margin-top: 1px;
  font-style: normal;
  font-size: 9px;
}

.rules-notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 28px;
  margin-top: 25px;
  padding-top: 19px;
  border-top: 1px solid rgba(242, 225, 188, 0.1);
}

.rules-notes h3 {
  margin-bottom: 5px;
  font-size: 14px;
}

.rules-notes p {
  margin: 0;
  color: #a6b1ab;
  font-size: 11px;
  line-height: 1.8;
}

.rules-notes kbd {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border: 1px solid rgba(242, 225, 188, 0.16);
  border-bottom-color: rgba(242, 225, 188, 0.28);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.045);
  color: #bdb5a5;
  font-family: var(--sans);
  font-size: 8px;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 30px;
  border-top: 1px solid rgba(242, 225, 188, 0.1);
  background: rgba(0, 0, 0, 0.16);
}

.modal-foot > span {
  color: #89958e;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.06em;
}

/* Toasts --------------------------------------------------------- */

.toast-stack {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 340px;
  padding: 9px 13px;
  border: 1px solid rgba(242, 217, 154, 0.25);
  border-radius: 8px;
  background: rgba(11, 20, 17, 0.96);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.38);
  color: var(--cream-dim);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  backdrop-filter: blur(10px);
  animation: toast-in 0.3s cubic-bezier(0.2, 0.9, 0.2, 1.1) both;
}

.toast::before {
  content: "♠";
  color: var(--gold);
  font-size: 11px;
}

.toast.is-leaving {
  animation: toast-out 0.3s ease both;
}

.toast--error {
  border-color: rgba(217, 94, 85, 0.35);
}

.toast--error::before {
  content: "!";
  color: var(--red-soft);
  font-family: Georgia, serif;
  font-weight: 700;
}

/* Responsive ----------------------------------------------------- */

@media (max-width: 1280px) {
  .game-layout {
    grid-template-columns: minmax(0, 1fr) 268px;
    padding: 13px 16px 15px;
  }

  .play-controls {
    grid-template-columns: minmax(0, 1fr) 270px;
  }

  .seat {
    width: 148px;
  }

  .seat[data-seat="0"] {
    width: 214px;
  }
}

@media (max-width: 1120px) {
  .game-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .top-btn--log {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    z-index: 40;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(330px, 88vw);
    border-radius: 16px 0 0 16px;
    transform: translateX(calc(100% + 20px));
    transition: transform 0.35s cubic-bezier(0.2, 0.85, 0.25, 1);
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: grid;
  }
}

@media (max-width: 900px) {
  .topbar {
    padding: 0 16px;
    grid-template-columns: 1fr auto;
  }

  .top-meta {
    display: none;
  }

  .table-stage {
    min-height: 330px;
  }

  .split-br {
    display: none;
  }

  .play-controls {
    grid-template-columns: minmax(0, 1fr) 250px;
  }

  .seat {
    width: 132px;
  }

  .seat[data-seat="0"] {
    width: 190px;
  }

  .seat-name {
    font-size: 10.5px;
  }

  .seat-stack {
    font-size: 10px;
  }

  .avatar {
    width: 29px;
    height: 29px;
    font-size: 12px;
  }

  .seat--human .avatar {
    width: 33px;
    height: 33px;
    font-size: 13px;
  }

  .hero-cards {
    right: 4vw;
    opacity: 0.5;
    transform: translateY(-50%) scale(0.9);
  }

  .intro-content {
    margin-right: 25vw;
  }
}

@media (max-width: 760px) {
  body {
    overflow-y: auto;
    overflow-x: hidden;
  }

  .app {
    height: auto;
    min-height: 100dvh;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    flex-basis: 58px;
    min-height: 58px;
  }

  .brand-mark {
    width: 33px;
    height: 33px;
  }

  .brand-copy strong {
    font-size: 12px;
  }

  .brand-copy small {
    font-size: 8px;
  }

  .top-btn {
    height: 33px;
    padding: 0 10px;
    font-size: 10.5px;
  }

  .icon-btn {
    width: 33px;
    height: 33px;
  }

  .top-btn--log span:last-child {
    display: none;
  }

  .top-btn--log,
  #rulesBtn {
    padding: 0 9px;
  }

  .game-layout {
    padding: 8px 8px 12px;
    min-height: 0;
  }

  .table-column {
    gap: 8px;
  }

  .table-stage {
    min-height: 430px;
    height: 52vh;
    max-height: 520px;
  }

  .table-rail {
    inset: 4% 0.5% 6%;
    padding: 9px;
  }

  .table-brand {
    top: 29%;
    opacity: 0.75;
  }

  .table-brand b {
    font-size: 10px;
  }

  .table-brand small {
    font-size: 5px;
  }

  .street-badge {
    top: 37%;
    font-size: 7.5px;
    padding: 2px 8px;
  }

  .board {
    top: 48.5%;
    gap: 5px;
  }

  :root {
    --board-card-w: clamp(40px, 11.2vw, 50px);
    --seat-card-w: 16px;
    --hero-card-w: clamp(42px, 11.8vw, 52px);
  }

  .pot-display {
    top: 64%;
    gap: 7px;
    min-width: 88px;
    padding: 4px 10px 4px 5px;
  }

  .pot-chips {
    width: 23px;
    height: 23px;
    flex-basis: 23px;
  }

  .pot-chips i {
    width: 15px;
    height: 15px;
    border-width: 1px;
  }

  .pot-copy strong {
    font-size: 14px;
  }

  .pot-copy small {
    font-size: 6.5px;
  }

  .seat {
    width: 104px;
    gap: 3px;
  }

  .seat[data-seat="0"] {
    left: 50%;
    top: 83.5%;
    width: 172px;
  }

  .seat[data-seat="1"] {
    left: 15%;
    top: 69%;
  }

  .seat[data-seat="2"] {
    left: 19%;
    top: 27%;
  }

  .seat[data-seat="3"] {
    left: 50%;
    top: 8%;
  }

  .seat[data-seat="4"] {
    left: 81%;
    top: 27%;
  }

  .seat[data-seat="5"] {
    left: 85%;
    top: 69%;
  }

  .seat-panel {
    min-height: 36px;
    padding: 4px 6px;
    gap: 5px;
    border-radius: 8px;
  }

  .seat--human .seat-panel {
    min-height: 40px;
    padding: 5px 8px;
  }

  .avatar {
    width: 24px;
    height: 24px;
    font-size: 10px;
  }

  .seat--human .avatar {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  .seat-name {
    font-size: 9px;
    gap: 3px;
  }

  .you-tag {
    font-size: 5.5px;
    padding: 0 2px;
  }

  .seat-stack {
    font-size: 8.5px;
  }

  .stack-chip {
    width: 5px;
    height: 5px;
  }

  .dealer-btn {
    width: 17px;
    height: 17px;
    font-size: 7px;
    right: -5px;
    top: -6px;
  }

  .seat-status {
    bottom: -20px;
    gap: 2px;
  }

  .seat--human .seat-status {
    bottom: -20px;
  }

  .action-badge,
  .bet-badge {
    height: 15px;
    padding: 0 5px;
    font-size: 6.5px;
    gap: 2px;
  }

  .bet-badge::before {
    width: 5px;
    height: 5px;
  }

  .seat--human .hole {
    margin-bottom: 0;
  }

  .action-dock {
    flex: 0 0 196px;
    padding: 9px 10px;
    gap: 7px;
    border-radius: 13px;
  }

  .dock-status {
    gap: 8px;
    min-height: 18px;
    padding: 0 2px;
  }

  .status-prompt {
    font-size: 10.5px;
    gap: 6px;
  }

  .hand-read {
    font-size: 9px;
  }

  .idle-strip {
    min-height: 118px;
    padding: 10px 12px;
    gap: 7px;
    flex-wrap: wrap;
    align-content: center;
  }

  .idle-suit {
    display: none;
  }

  .idle-note {
    flex: 1 1 100%;
  }

  .idle-kicker {
    font-size: 6.5px;
    margin-bottom: 3px;
  }

  .idle-note p {
    max-width: none;
    font-size: 9.5px;
    line-height: 1.7;
  }

  .idle-metrics {
    width: 100%;
    order: 3;
  }

  .idle-metric {
    flex: 1;
    min-width: 0;
    padding: 5px 8px;
  }

  .idle-metric span {
    font-size: 6.5px;
  }

  .idle-metric strong {
    font-size: 13px;
  }

  .idle-strip .thinking-dots {
    position: absolute;
    right: 12px;
    top: 15px;
  }

  .play-controls {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .raise-box {
    padding: 6px 9px 7px;
  }

  .raise-heading {
    font-size: 9.5px;
  }

  .raise-heading strong {
    font-size: 14px;
  }

  .quick-bets button {
    height: 18px;
    font-size: 7.5px;
  }

  .action-buttons {
    gap: 6px;
  }

  .action-btn {
    height: 46px;
    padding: 0 9px;
  }

  .action-label {
    font-size: 10.5px;
  }

  .action-key {
    font-size: 7px;
  }

  .showdown-panel {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "lead tail"
      "middle middle"
      "actions actions";
    gap: 4px 10px;
    padding: 8px 11px;
  }

  .showdown-panel.is-fold {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "lead tail"
      "actions actions";
  }

  .result-lead {
    grid-area: lead;
  }

  .result-middle {
    grid-area: middle;
    flex-direction: row;
    gap: 7px;
  }

  .result-tail {
    grid-area: tail;
    min-width: 0;
  }

  .result-actions {
    grid-area: actions;
  }

  .result-eyebrow {
    font-size: 6px;
    margin-bottom: 4px;
  }

  .result-avatar {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    font-size: 11px;
  }

  .result-copy h3 {
    font-size: 15px;
  }

  .result-copy p {
    font-size: 8.5px;
  }

  .result-amount {
    font-size: 17px;
  }

  .result-meta {
    font-size: 6.5px;
  }

  .result-cards .playing-card {
    width: 24px;
    height: 33px;
  }

  .next-hand-btn {
    width: 100%;
    height: 32px;
    font-size: 10px;
  }

  .next-hand-btn .next-count {
    width: 15px;
    min-width: 15px;
    height: 15px;
    font-size: 8px;
  }

  .intro {
    align-items: center;
    overflow-y: auto;
    padding: 30px 0 70px;
  }

  .hero-cards {
    right: 50%;
    top: 45%;
    opacity: 0.07;
    transform: translate(50%, -50%) scale(0.95);
    filter: blur(0.5px);
  }

  .intro-content {
    width: min(86vw, 480px);
    margin: 0;
    padding: 0;
    text-align: center;
  }

  .intro-eyebrow {
    justify-content: center;
    font-size: 6.5px;
    letter-spacing: 0.2em;
    margin-bottom: 12px;
  }

  .intro h1 {
    font-size: clamp(50px, 15vw, 78px);
  }

  .intro-subtitle {
    font-size: 8px;
    letter-spacing: 0.22em;
    margin-top: 10px;
  }

  .intro-copy {
    margin-top: 19px;
    font-size: 11px;
    line-height: 1.9;
  }

  .desktop-break {
    display: none;
  }

  .profile-pill {
    margin-top: 17px;
    padding: 4px 10px 4px 5px;
  }

  .profile-avatar {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    font-size: 12px;
  }

  .profile-pill-copy strong {
    max-width: 130px;
    font-size: 10px;
  }

  .profile-pill-copy small {
    font-size: 6.5px;
  }

  .intro-difficulty {
    justify-content: center;
    margin-top: 18px;
    gap: 10px;
  }

  .intro-actions {
    justify-content: center;
    margin-top: 23px;
    gap: 9px;
  }

  .btn-start {
    min-width: 176px;
    height: 46px;
    gap: 18px;
    font-size: 11px;
  }

  .btn-ghost {
    height: 44px;
    padding: 0 13px;
    font-size: 10px;
  }

  .intro-stats {
    justify-content: center;
    gap: 28px;
    margin-top: 28px;
    max-width: none;
  }

  .intro-stats strong {
    font-size: 17px;
  }

  .intro-foot {
    left: 5vw;
    right: 5vw;
    bottom: 22px;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 7px;
    text-align: center;
  }

  .modal {
    padding: 10px;
  }

  .modal-card {
    max-height: 92vh;
    border-radius: 14px;
  }

  .modal-head {
    padding: 17px 17px 13px;
  }

  .modal-head h2 {
    font-size: 23px;
  }

  .modal-scroll {
    padding: 14px 16px 18px;
    overscroll-behavior: contain;
  }

  .profile-body {
    padding: 16px 18px 20px;
  }

  .profile-preview-avatar {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    font-size: 17px;
  }

  .profile-preview-copy strong {
    font-size: 18px;
  }

  .rules-intro,
  .rank-list,
  .rules-notes {
    grid-template-columns: 1fr;
  }

  .rule-step {
    gap: 9px;
    padding: 10px 11px;
  }

  .rule-step > span {
    font-size: 16px;
  }

  .rule-step h3 {
    margin-bottom: 3px;
    font-size: 11.5px;
  }

  .rule-step p {
    font-size: 9.5px;
    line-height: 1.65;
  }

  .rank-row {
    min-height: 43px;
  }

  .rank-cards {
    gap: 1px;
  }

  .rule-card {
    width: 21px;
    height: 28px;
    font-size: 8px;
  }

  .modal-foot {
    padding: 10px 16px;
  }

  .modal-foot > span {
    display: none;
  }

  .modal-foot .btn-ghost--solid {
    width: 100%;
  }

  .toast-stack {
    right: 12px;
    bottom: 12px;
    left: 12px;
    align-items: stretch;
  }

  .toast {
    max-width: none;
  }
}

@media (max-width: 430px) {
  .brand-copy strong {
    font-size: 10.5px;
    letter-spacing: 0.11em;
  }

  .brand-copy small {
    display: none;
  }

  .top-btn--log {
    padding: 0 8px;
  }

  .table-stage {
    min-height: 400px;
    height: 49vh;
  }

  .seat {
    width: 92px;
  }

  .seat[data-seat="0"] {
    width: 158px;
  }

  .seat[data-seat="1"] {
    left: 14.5%;
  }

  .seat[data-seat="2"] {
    left: 18.5%;
  }

  .seat[data-seat="4"] {
    left: 81.5%;
  }

  .seat[data-seat="5"] {
    left: 85.5%;
  }

  .seat-name {
    font-size: 8px;
  }

  .seat-stack {
    font-size: 7.5px;
  }

  .action-badge,
  .bet-badge {
    font-size: 6px;
    padding: 0 4px;
  }

  .intro h1 {
    font-size: 47px;
  }

  .intro-copy {
    font-size: 10.5px;
  }

  .intro-stats {
    gap: 22px;
  }

  .intro-stats span {
    font-size: 7px;
  }

  .intro-stats strong {
    font-size: 15px;
  }

  .showdown-card {
    padding: 7px 9px;
    gap: 3px 8px;
  }

  .result-copy h3 {
    font-size: 14px;
  }

  .result-copy p {
    font-size: 8px;
  }

  .result-avatar {
    width: 26px;
    height: 26px;
    flex-basis: 26px;
    font-size: 10px;
  }

  .result-amount {
    font-size: 15px;
  }

  .result-cards .playing-card {
    width: 22px;
    height: 30px;
  }

  .result-cards .pc-suit {
    font-size: 11px;
  }
}

@media (max-width: 360px) {
  .topbar {
    padding: 0 12px;
    gap: 10px;
  }

  .brand-copy {
    display: none;
  }

  .top-actions {
    gap: 5px;
  }

  .top-btn--log,
  #rulesBtn {
    padding: 0 7px;
  }

  .seat[data-seat="1"] {
    left: 16%;
  }

  .seat[data-seat="2"] {
    left: 20%;
  }

  .seat[data-seat="4"] {
    left: 80%;
  }

  .seat[data-seat="5"] {
    left: 84%;
  }
}

@media (max-height: 760px) and (min-width: 761px) {
  .action-dock {
    flex-basis: 158px;
    gap: 6px;
    padding: 8px 13px;
  }

  .idle-strip {
    min-height: 72px;
  }

  .action-btn {
    height: 48px;
  }

  .topbar {
    flex-basis: 62px;
  }

  .game-layout {
    padding-top: 10px;
    padding-bottom: 12px;
  }
}

@media (max-width: 760px) and (max-height: 700px) {
  .table-stage {
    flex: 0 0 356px;
    height: 356px;
    min-height: 0;
    max-height: none;
  }

  .action-dock {
    flex-basis: 184px;
  }
}

@media (max-height: 620px) {
  body {
    overflow-y: auto;
    overflow-x: hidden;
  }

  .app {
    height: auto;
    min-height: 100dvh;
  }

  .table-stage {
    flex: 0 0 370px;
    min-height: 340px;
  }
}

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

/* Keyframes ------------------------------------------------------ */

@keyframes breathe {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}

@keyframes avatar-pulse {
  0%, 100% { box-shadow: 0 0 12px rgba(242, 217, 154, 0.18); }
  50% { box-shadow: 0 0 22px rgba(242, 217, 154, 0.38); }
}

@keyframes deal-in {
  from {
    opacity: 0;
    transform: translate3d(0, -46px, 0) rotate(-14deg) scale(0.7);
    filter: blur(1.6px);
  }
  55% {
    opacity: 1;
    transform: translate3d(0, 6px, 0) rotate(2deg) scale(1.04);
    filter: blur(0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(0) scale(1);
  }
}
@keyframes reveal-card {
  from {
    opacity: 0.2;
    transform: rotateY(80deg) scale(0.92);
  }
  to {
    opacity: 1;
    transform: rotateY(0) scale(1);
  }
}

@keyframes result-card-in {
  from {
    opacity: 0;
    transform: translateY(7px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes log-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes thinking-ellipsis {
  0% { width: 0; }
  100% { width: 12px; }
}

@keyframes dot-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
  30% { transform: translateY(-3px); opacity: 1; }
}

@keyframes result-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes intro-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hero-float {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -11px; }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
}

/* ================================================================
   Round 2 additions: bet input, seat callouts, showdown overlay
   ================================================================ */

.raise-amount {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10.5px;
}

.raise-input {
  width: 96px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid rgba(242, 225, 188, 0.18);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.raise-input:focus {
  border-color: rgba(242, 217, 154, 0.55);
  box-shadow: 0 0 0 3px rgba(242, 217, 154, 0.08);
}

.raise-input::-webkit-outer-spin-button,
.raise-input::-webkit-inner-spin-button {
  appearance: none;
  margin: 0;
}

/* Compact, readable quick-bet chips. */
.quick-bets {
  display: flex;
  gap: 6px;
  margin-top: 7px;
}

.quick-bets button {
  flex: 1;
  height: 28px;
  padding: 0 8px;
  border: 1px solid rgba(242, 225, 188, 0.17);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--cream-dim);
  font-size: 11px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.quick-bets button:hover {
  border-color: rgba(242, 217, 154, 0.5);
  background: rgba(214, 179, 106, 0.12);
  color: var(--gold-bright);
}

.quick-bets button:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Short-lived action bubble above a seat. */
.seat-callout {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 9px);
  transform: translate(-50%, 5px);
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(242, 225, 188, 0.22);
  background: rgba(8, 15, 13, 0.92);
  color: var(--cream);
  font-size: 11px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 6;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.seat-callout.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.seat-callout.is-raise,
.seat-callout.is-bet,
.seat-callout.is-allin {
  border-color: rgba(242, 217, 154, 0.55);
  color: var(--gold-bright);
}

.seat-callout.is-fold {
  color: #c99490;
  border-color: rgba(217, 94, 85, 0.3);
}

/* Showdown presentation */
.showdown {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
}

.showdown[hidden] {
  display: none !important;
}

.showdown-scrim {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 7, 0.74);
  backdrop-filter: blur(7px);
}

.showdown-card {
  position: relative;
  width: min(1000px, 94vw);
  max-height: 88vh;
  overflow: auto;
  padding: 22px 26px 24px;
  border: 1px solid rgba(242, 225, 188, 0.18);
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(18, 31, 27, 0.99), rgba(7, 14, 12, 0.99));
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.62);
}

.showdown-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.showdown-head .eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 9px;
  letter-spacing: 0.24em;
}

.showdown-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.showdown-close {
  margin-left: auto;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(242, 225, 188, 0.16);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.showdown-close:hover {
  color: var(--cream);
  border-color: rgba(242, 225, 188, 0.4);
}

.showdown-body {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Two-player duel */
.duel {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: center;
}

.duel-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 14px;
  border: 1px solid rgba(242, 225, 188, 0.12);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
  opacity: 0.55;
  transform: scale(0.97);
  transition: opacity 0.35s ease, transform 0.35s ease, border-color 0.35s ease;
}

.duel-side.is-revealed {
  opacity: 1;
  transform: none;
}

.duel-side.is-winner {
  border-color: rgba(242, 217, 154, 0.6);
  background: rgba(214, 179, 106, 0.08);
  box-shadow: 0 0 40px rgba(214, 179, 106, 0.12);
}

.duel-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(214, 179, 106, 0.16);
  color: var(--gold-bright);
  font-size: 12px;
  font-weight: 700;
}

.duel-name {
  font-size: 13px;
  letter-spacing: 0.04em;
}

.duel-hand {
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 15px;
}

.duel-cards {
  display: flex;
  gap: 6px;
}

.duel-vs {
  color: var(--muted-2);
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.12em;
}

.duel-result {
  text-align: center;
  color: var(--cream-dim);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.duel-result b {
  color: var(--gold-bright);
  font-weight: 600;
}

/* Ranking list */
.rank-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid rgba(242, 225, 188, 0.12);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.16);
  opacity: 0;
  transform: translateY(8px);
  animation: rank-in 0.4s ease forwards;
}

.rank-row.is-winner {
  border-color: rgba(242, 217, 154, 0.55);
  background: rgba(214, 179, 106, 0.09);
  box-shadow: 0 0 30px rgba(214, 179, 106, 0.1);
}

.rank-no {
  width: 24px;
  color: var(--muted-2);
  font-family: var(--serif);
  font-size: 15px;
  text-align: center;
}

.rank-name {
  min-width: 110px;
  font-size: 12.5px;
  letter-spacing: 0.03em;
}

.rank-cards {
  display: flex;
  gap: 4px;
  flex: 0 0 auto;
  margin-left: auto;
}
.rank-hand {
  width: 168px;
  color: var(--cream-dim);
  font-size: 11.5px;
  letter-spacing: 0.04em;
}
.rank-row.is-winner .rank-hand {
  color: var(--gold-bright);
}

.rank-won {
  width: 84px;
  color: var(--green);
  font-family: var(--serif);
  font-size: 13px;
  text-align: right;
}

@keyframes rank-in {
  to {
    opacity: 1;
    transform: none;
  }
}

.sd-card {
  width: 44px;
  height: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 6px;
  background: #fffdf7;
  color: #1a1712;
  font-family: var(--serif);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.32);
}

.sd-card b {
  font-size: 17px;
  line-height: 1;
}

.sd-card i {
  font-style: normal;
  font-size: 13px;
}

.sd-card.is-red {
  color: #c34740;
}

.hunt-note {
  padding: 10px 14px;
  border: 1px solid rgba(242, 217, 154, 0.4);
  border-radius: 10px;
  background: rgba(214, 179, 106, 0.1);
  color: var(--gold-bright);
  font-size: 11.5px;
  letter-spacing: 0.03em;
}

.hunt-note b {
  color: var(--cream);
  font-weight: 600;
}

@media (max-width: 760px) {
  .duel {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .duel-vs {
    display: none;
  }

  .showdown-card {
    padding: 16px 14px 18px;
  }

  .rank-name {
    min-width: 70px;
    font-size: 11px;
  }

  .rank-cards .sd-card {
    width: 30px;
    height: 44px;
  }

  .rank-cards .sd-card b {
    font-size: 13px;
  }

  .sd-card {
    width: 38px;
    height: 54px;
  }
}

/* Blackjack Wars (solo) */
.blackjack-view {
  grid-column: 1 / -1;
  padding: 26px 32px 60px;
  max-width: 980px;
  margin: 0 auto;
  width: 100%;
}

.bj-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.bj-head h1 {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-size: 34px;
  color: var(--cream);
  font-weight: 600;
}

.bj-balance {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.bj-balance small {
  color: rgba(242, 225, 188, 0.5);
  font-size: 9px;
  letter-spacing: 0.14em;
}

.bj-balance strong {
  color: var(--gold-bright);
  font-size: 26px;
  font-variant-numeric: tabular-nums;
}

.bj-board {
  border: 1px solid rgba(242, 225, 188, 0.14);
  border-radius: 18px;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(217, 181, 109, 0.08), transparent 60%),
    linear-gradient(180deg, rgba(16, 30, 24, 0.96), rgba(8, 16, 13, 0.98));
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.35);
}

.bj-hand {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bj-hand-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(242, 225, 188, 0.55);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.bj-hand-label span {
  color: var(--gold-bright);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.bj-cards {
  display: flex;
  gap: 10px;
  min-height: 116px;
  flex-wrap: wrap;
}

.bj-cards .playing-card {
  width: 78px;
  height: 112px;
  animation: bjDeal 0.35s ease both;
}

@keyframes bjDeal {
  from { transform: translateY(-14px) rotate(-4deg); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.bj-message {
  margin: 20px 0;
  text-align: center;
  color: rgba(242, 225, 188, 0.78);
  font-size: 13px;
  min-height: 20px;
}

.bj-bets {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
  flex-wrap: wrap;
}

.bj-chip {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(242, 225, 188, 0.18);
  background: rgba(9, 17, 15, 0.6);
  color: rgba(242, 225, 188, 0.75);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: all 0.18s ease;
}

.bj-chip:hover:not(:disabled) { border-color: rgba(217, 181, 109, 0.55); color: var(--cream); }

.bj-chip.is-active {
  border-color: var(--gold);
  color: var(--gold-bright);
  background: rgba(217, 181, 109, 0.14);
}

.bj-chip:disabled { opacity: 0.4; cursor: not-allowed; }

.bj-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

.bj-btn {
  padding: 11px 24px;
  border-radius: 9px;
  border: 1px solid rgba(242, 225, 188, 0.2);
  background: rgba(9, 17, 15, 0.6);
  color: var(--cream);
  font-size: 13px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.18s ease;
}

.bj-btn:hover:not(:disabled) { transform: translateY(-1px); border-color: rgba(217, 181, 109, 0.6); }

.bj-btn--primary {
  border-color: rgba(217, 181, 109, 0.6);
  background: linear-gradient(180deg, rgba(217, 181, 109, 0.24), rgba(217, 181, 109, 0.1));
  color: var(--gold-bright);
}

.bj-btn--ghost { color: rgba(242, 225, 188, 0.6); }

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

@media (max-width: 720px) {
  .blackjack-view { padding: 18px 16px 40px; }
  .bj-head h1 { font-size: 26px; }
  .bj-cards .playing-card { width: 64px; height: 92px; }
}

/* Volume slider (shared) */
.volume-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px;
}

.volume-icon { font-size: 13px; opacity: 0.75; }

.volume-control input[type="range"] {
  width: 78px;
  accent-color: var(--gold, #d9b56d);
  cursor: pointer;
}

@media (max-width: 720px) {
  .volume-control,
  .volume-icon { display: none; }
}

/* All-in flames, burst and high-hand flashes (shared by solo and online) */
.seat.is-allin .avatar {
  box-shadow:
    0 0 0 2px rgba(255, 146, 64, 0.6),
    0 0 24px rgba(255, 110, 40, 0.55);
  animation: allinPulse 1.3s ease-in-out infinite;
}

.seat.is-allin .avatar::after {
  content: '';
  position: absolute;
  inset: -13px;
  border-radius: 50%;
  pointer-events: none;
  background:
    conic-gradient(from 0deg,
      rgba(255, 90, 20, 0) 0deg,
      rgba(255, 150, 50, 0.55) 60deg,
      rgba(255, 210, 120, 0.8) 110deg,
      rgba(255, 120, 30, 0.5) 170deg,
      rgba(255, 70, 10, 0) 240deg,
      rgba(255, 170, 70, 0.65) 310deg,
      rgba(255, 90, 20, 0) 360deg);
  filter: blur(6px);
  mix-blend-mode: screen;
  animation: flameSpin 2.2s linear infinite, flameFlicker 0.3s ease-in-out infinite alternate;
}

@keyframes allinPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@keyframes flameSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes flameFlicker {
  from { opacity: 0.75; filter: blur(5px); }
  to { opacity: 1; filter: blur(8px); }
}

.seat.is-allin-burst .seat-panel {
  animation: allinBurst 0.9s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.seat.is-allin-burst::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  border: 2px solid rgba(255, 170, 80, 0.85);
  box-shadow: 0 0 24px rgba(255, 140, 50, 0.6);
  pointer-events: none;
  animation: allinShock 0.9s ease-out forwards;
}

@keyframes allinBurst {
  0% { transform: scale(1); }
  22% { transform: scale(1.12); }
  48% { transform: scale(0.98) rotate(-1deg); }
  72% { transform: scale(1.03) rotate(0.5deg); }
  100% { transform: scale(1); }
}

@keyframes allinShock {
  from { transform: scale(1); opacity: 0.9; }
  to { transform: scale(24); opacity: 0; }
}

.hand-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
  animation: handFlash 1.7s ease-out forwards;
  mix-blend-mode: screen;
}

.hand-flash--fullhouse {
  background: radial-gradient(circle at 50% 45%, rgba(217, 181, 109, 0.32), transparent 62%);
}

.hand-flash--quads {
  background: radial-gradient(circle at 50% 45%, rgba(168, 120, 255, 0.32), transparent 62%);
}

.hand-flash--straightflush {
  background: radial-gradient(circle at 50% 45%, rgba(80, 200, 255, 0.3), transparent 62%);
}

.hand-flash--royal {
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 226, 130, 0.42), transparent 64%),
    conic-gradient(from 0deg,
      rgba(255, 120, 40, 0.16),
      rgba(120, 200, 255, 0.16),
      rgba(200, 120, 255, 0.16),
      rgba(255, 220, 120, 0.16),
      rgba(255, 120, 40, 0.16));
}

@keyframes handFlash {
  0% { opacity: 0; }
  12% { opacity: 1; }
  100% { opacity: 0; }
}

.seat.is-allin .avatar::before {
  content: '';
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 50% 62%,
    rgba(255, 214, 120, 0.55),
    rgba(255, 120, 30, 0.28) 55%,
    rgba(255, 60, 0, 0) 74%);
  filter: blur(9px);
  mix-blend-mode: screen;
  animation: flamePulse 0.9s ease-in-out infinite alternate;
}

@keyframes flamePulse {
  from { transform: scale(0.94); opacity: 0.7; }
  to { transform: scale(1.1); opacity: 1; }
}
