:root {
  color-scheme: dark;
  --bg-deep: #07110d;
  --bg-surface: #101a15;
  --bg-panel: rgba(16, 24, 20, 0.9);
  --felt: #0f5a42;
  --felt-bright: #157553;
  --gold: #d3b16d;
  --gold-soft: #8a774d;
  --line: rgba(211, 177, 109, 0.22);
  --text-main: #f4f1e7;
  --text-muted: #b7c1b8;
  --danger: #d56a62;
  --success: #88c28f;
  --card-light: #fbf7ef;
  --card-dark: #1b1b1b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family:
    "Palatino Linotype",
    "Book Antiqua",
    Palatino,
    serif;
  background:
    radial-gradient(circle at top, rgba(47, 121, 90, 0.22), transparent 28%),
    linear-gradient(180deg, #07110d 0%, #0b1712 42%, #09110d 100%);
  color: var(--text-main);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.02), transparent 36%),
    radial-gradient(circle at 12% 16%, rgba(41, 104, 80, 0.16), transparent 24%),
    radial-gradient(circle at 86% 12%, rgba(9, 41, 31, 0.22), transparent 20%);
  pointer-events: none;
}

.page-shell {
  width: min(1400px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 24px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(3rem, 6vw, 5.5rem);
  font-weight: 700;
  line-height: 0.95;
  color: #f4e3b3;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.18),
    0 14px 30px rgba(0, 0, 0, 0.28);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
}

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

.status-pill,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(216, 169, 74, 0.18);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(26, 22, 18, 0.88), rgba(10, 9, 8, 0.92));
  color: #e5d6ae;
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  box-shadow:
    inset 0 1px 0 rgba(255, 225, 170, 0.08),
    0 6px 16px rgba(0, 0, 0, 0.18);
}

.ghost-button,
.primary-button,
.secondary-button,
.danger-button {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: none;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease;
}

.ghost-button,
.secondary-button {
  background: linear-gradient(180deg, #3a3530 0%, #1f1c19 50%, #100e0c 100%);
  color: #e8d6a8;
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 200, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    0 4px 0 #0a0807,
    0 5px 0 #000,
    0 10px 18px rgba(0, 0, 0, 0.35);
}

.primary-button {
  background: linear-gradient(180deg, #f3d486 0%, #d8a94a 45%, #b48630 100%);
  color: #1a160d;
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 200, 0.55),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    0 4px 0 #5a3e10,
    0 5px 0 #2a1c06,
    0 10px 18px rgba(0, 0, 0, 0.35);
}

.danger-button {
  background: linear-gradient(180deg, #a8302d 0%, #7a1e1c 50%, #4d0f0e 100%);
  color: #fbf0ea;
  box-shadow:
    inset 0 1px 0 rgba(255, 220, 210, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    0 4px 0 #2a0606,
    0 5px 0 #0c0202,
    0 10px 18px rgba(0, 0, 0, 0.35);
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.app-root {
  display: grid;
  gap: 20px;
}

.hero-grid,
.table-shell,
.summary-shell {
  display: grid;
  gap: 20px;
}

.hero-grid {
  grid-template-columns: 1.15fr 0.85fr;
}

.panel,
.sidebar-panel,
.lobby-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(16, 24, 20, 0.96), rgba(11, 18, 15, 0.92)),
    rgba(16, 24, 20, 0.9);
  box-shadow: var(--shadow);
}

.panel,
.sidebar-panel,
.lobby-panel {
  padding: 20px;
}

.hero-stage {
  position: relative;
  min-height: 620px;
  overflow: hidden;
}

.hero-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 44%, rgba(22, 117, 82, 0.42), transparent 34%),
    radial-gradient(circle at 50% 46%, rgba(12, 56, 41, 0.72), transparent 58%),
    linear-gradient(180deg, rgba(255, 230, 175, 0.04), transparent 22%);
}

.hero-stage::after {
  content: "";
  position: absolute;
  inset: 24px;
  border-radius: 50% / 42%;
  border: 14px solid rgba(96, 82, 49, 0.42);
  box-shadow:
    inset 0 0 0 3px rgba(215, 193, 140, 0.18),
    0 24px 60px rgba(0, 0, 0, 0.24);
}

.hero-content,
.hero-side {
  position: relative;
  z-index: 1;
}

.hero-content {
  display: grid;
  align-content: start;
  gap: 18px;
}

.lede {
  max-width: 34rem;
  color: var(--text-muted);
  line-height: 1.55;
  font-size: 1.02rem;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 42rem;
}

.feature-tile {
  padding: 14px 16px;
  border: 1px solid rgba(211, 177, 109, 0.14);
  border-radius: 8px;
  background: rgba(12, 21, 17, 0.56);
}

.feature-tile strong,
.section-heading,
.subheading {
  display: block;
  margin-bottom: 6px;
}

.hero-side {
  display: grid;
  gap: 16px;
}

.form-panel {
  display: grid;
  gap: 16px;
}

.form-row,
.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--text-muted);
}

input,
select {
  min-height: 46px;
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(211, 177, 109, 0.18);
  background: rgba(8, 14, 11, 0.9);
  color: var(--text-main);
  padding: 0 14px;
  font: inherit;
}

.small-help {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.notice {
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid rgba(211, 177, 109, 0.14);
  background: rgba(10, 16, 13, 0.76);
  color: var(--text-muted);
}

.match-header,
.match-meta,
.match-actions,
.seat-list,
.hand-row,
.action-bar,
.take-row,
.stat-grid,
.summary-table {
  display: grid;
  gap: 12px;
}

.table-shell {
  grid-template-columns: 1.35fr 0.65fr;
  align-items: start;
}

.table-panel {
  position: relative;
  min-height: 780px;
  padding: 24px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at center, rgba(19, 111, 78, 0.96), rgba(11, 53, 38, 1) 64%),
    linear-gradient(180deg, rgba(15, 24, 20, 0.88), rgba(8, 13, 11, 0.96));
  box-shadow: var(--shadow);
}

.table-panel::before {
  content: "";
  position: absolute;
  inset: 26px;
  border-radius: 50% / 40%;
  border: 14px solid rgba(70, 60, 38, 0.62);
  box-shadow:
    inset 0 0 0 4px rgba(219, 195, 136, 0.2),
    0 12px 30px rgba(0, 0, 0, 0.28);
}

.table-center {
  position: absolute;
  inset: 50%;
  transform: translate(-50%, -50%);
  width: min(540px, 64%);
  display: grid;
  gap: 18px;
  justify-items: center;
}

.deck-stack,
.discard-stage {
  padding: 16px 18px;
  border: 1px solid rgba(211, 177, 109, 0.16);
  border-radius: 8px;
  background: rgba(8, 17, 13, 0.34);
}

.table-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.seat-ring {
  position: relative;
  min-height: 600px;
}

.seat {
  position: absolute;
  width: clamp(160px, 18vw, 210px);
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(211, 177, 109, 0.12);
  background: rgba(11, 19, 15, 0.8);
  backdrop-filter: blur(6px);
}

.seat.active {
  border-color: rgba(235, 194, 125, 0.64);
  box-shadow: 0 0 0 1px rgba(235, 194, 125, 0.25);
}

.seat.me {
  border-color: rgba(115, 195, 140, 0.46);
}

.seat-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
}

.seat-meta {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(211, 177, 109, 0.14);
  color: var(--text-main);
  font-size: 0.73rem;
  text-transform: uppercase;
}

.badge.success {
  background: rgba(127, 196, 143, 0.18);
}

.badge.danger {
  background: rgba(213, 106, 98, 0.16);
}

.sidebar-panel {
  display: grid;
  gap: 18px;
}

.card-grid,
.take-grid,
.discard-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.card-face,
.hidden-card {
  width: 84px;
  aspect-ratio: 0.7;
  border-radius: 8px;
  border: 1px solid rgba(23, 23, 23, 0.16);
  position: relative;
  padding: 10px 8px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

.card-face {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 237, 223, 0.96));
  color: var(--card-dark);
}

.card-face.red {
  color: #b2473f;
}

.card-face.joker {
  background:
    linear-gradient(180deg, rgba(252, 239, 217, 1), rgba(233, 206, 165, 1)),
    linear-gradient(45deg, rgba(173, 67, 53, 0.2), transparent);
  color: #2f1b14;
}

.card-face.selected {
  outline: 3px solid rgba(235, 194, 125, 0.8);
  transform: translateY(-6px);
}

.card-face.tiny,
.hidden-card.tiny {
  width: 62px;
}

.card-rank {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
}

.card-suit,
.card-score {
  display: block;
  font-size: 0.78rem;
}

.card-score {
  position: absolute;
  right: 8px;
  bottom: 8px;
  opacity: 0.7;
}

.hidden-card {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(18, 18, 18, 1), rgba(40, 40, 40, 0.95)),
    rgba(22, 22, 22, 1);
  color: #f2e5c0;
  font-size: 1.6rem;
}

.action-bar {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.action-bar .danger-button {
  grid-column: 1 / -1;
}

.summary-table {
  border-collapse: collapse;
}

.summary-table table,
.history-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.summary-table th,
.summary-table td,
.history-table th,
.history-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(211, 177, 109, 0.1);
}

.history-table {
  overflow-x: auto;
}

.error-banner {
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(213, 106, 98, 0.28);
  background: rgba(94, 29, 24, 0.48);
  color: #f4d6d2;
}

.subtle {
  color: var(--text-muted);
}

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

.stack {
  display: grid;
  gap: 14px;
}

.muted-box {
  padding: 14px 16px;
  border: 1px dashed rgba(211, 177, 109, 0.16);
  border-radius: 8px;
  color: var(--text-muted);
}

@media (max-width: 1100px) {
  .hero-grid,
  .table-shell {
    grid-template-columns: 1fr;
  }

  .table-panel {
    min-height: 980px;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 20px, 100%);
  }

  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .feature-list,
  .form-grid.two,
  .action-bar {
    grid-template-columns: 1fr;
  }

  .table-panel {
    min-height: 1080px;
    padding: 18px;
  }

  .seat-ring {
    min-height: 740px;
  }

  .seat {
    width: 148px;
  }

  .card-face,
  .hidden-card {
    width: 72px;
  }
}

/* Refined stage, framing, and motion */

:root {
  --bg-warm: #130f0d;
  --bg-ink: #090705;
  --panel-deep: rgba(18, 14, 12, 0.92);
  --panel-soft: rgba(12, 10, 9, 0.84);
  --line-strong: rgba(216, 169, 74, 0.24);
  --line-soft: rgba(216, 169, 74, 0.14);
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.28);
  --shadow-strong: 0 30px 80px rgba(0, 0, 0, 0.42);
}

html,
body {
  background:
    radial-gradient(circle at 18% 14%, rgba(131, 88, 31, 0.18), transparent 26%),
    radial-gradient(circle at 78% 11%, rgba(111, 34, 34, 0.12), transparent 24%),
    radial-gradient(circle at 50% 56%, rgba(31, 73, 55, 0.12), transparent 34%),
    linear-gradient(180deg, var(--bg-warm) 0%, var(--bg-ink) 100%);
}

.page-shell {
  position: relative;
  width: min(1480px, calc(100% - 32px));
  padding-top: 28px;
}

.topbar {
  margin-bottom: 18px;
}

.topbar h1 {
  letter-spacing: 0.01em;
}

.hero-grid {
  grid-template-columns: 1.2fr 0.8fr;
  align-items: start;
}

.panel,
.sidebar-panel,
.lobby-panel {
  border-radius: 18px;
  border-color: var(--line-soft);
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(216, 169, 74, 0.08), transparent 40%),
    linear-gradient(180deg, rgba(20, 16, 13, 0.96), rgba(9, 8, 7, 0.94));
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.panel::before,
.sidebar-panel::before,
.lobby-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 240, 200, 0.05), transparent 28%, transparent 72%, rgba(216, 169, 74, 0.05));
}

.hero-stage {
  min-height: 680px;
}

.hero-stage::before {
  background:
    radial-gradient(circle at 50% 42%, rgba(23, 94, 67, 0.4), transparent 32%),
    radial-gradient(circle at 50% 46%, rgba(12, 43, 31, 0.82), transparent 56%),
    linear-gradient(180deg, rgba(255, 230, 175, 0.05), transparent 20%);
}

.hero-stage::after {
  inset: 22px;
  border-radius: 48% / 42%;
  border-width: 16px;
  border-color: rgba(88, 69, 37, 0.58);
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4.7rem);
  line-height: 0.94;
  max-width: 10ch;
  margin-bottom: 8px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 48rem;
}

.metric-card {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  min-height: 108px;
  border-radius: 16px;
  border: 1px solid var(--line-soft);
  background: rgba(11, 18, 15, 0.6);
  backdrop-filter: blur(8px);
}

.metric-card.accent {
  border-color: rgba(246, 223, 161, 0.36);
  box-shadow: 0 0 0 1px rgba(246, 223, 161, 0.06), 0 0 28px rgba(216, 169, 74, 0.08);
}

.metric-card strong {
  margin: 0;
  font-size: 1.55rem;
  color: #f7ebcf;
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
}

.metric-label {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.feature-tile,
.notice,
.muted-box {
  border-radius: 14px;
  border-color: var(--line-soft);
}

.resume-card,
.play-summary-card,
.summary-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.table-shell {
  grid-template-columns: minmax(0, 1.32fr) 380px;
  gap: 22px;
}

.table-panel {
  min-height: 840px;
  padding: 22px;
  border-radius: 24px;
  border-color: var(--line-soft);
  background:
    linear-gradient(180deg, rgba(10, 8, 7, 0.98), rgba(8, 7, 6, 1)),
    radial-gradient(circle at center, rgba(19, 111, 78, 0.96), rgba(11, 53, 38, 1) 64%);
  box-shadow: var(--shadow-strong);
}

.table-panel::before {
  inset: 20px;
  border-radius: 48% / 42%;
  border: 12px solid rgba(84, 68, 40, 0.68);
  box-shadow:
    inset 0 0 0 4px rgba(219, 195, 136, 0.18),
    inset 0 0 120px rgba(0, 0, 0, 0.4),
    0 14px 34px rgba(0, 0, 0, 0.3);
}

.table-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, transparent 38%, rgba(0, 0, 0, 0.18) 68%, rgba(0, 0, 0, 0.42) 100%),
    radial-gradient(circle at 50% 38%, rgba(255, 220, 150, 0.08), transparent 18%);
  pointer-events: none;
}

.table-panel {
  background:
    radial-gradient(circle at center, rgba(13, 58, 38, 0.98), rgba(9, 36, 24, 1) 58%, rgba(6, 24, 16, 1) 100%),
    linear-gradient(180deg, rgba(10, 8, 7, 0.98), rgba(8, 7, 6, 1));
}

.table-meta {
  position: relative;
  z-index: 1;
}

.active-turn-banner {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(216, 169, 74, 0.2);
  background:
    radial-gradient(100% 160% at 0% 0%, rgba(216, 169, 74, 0.1), transparent 55%),
    linear-gradient(180deg, rgba(18, 15, 13, 0.88), rgba(10, 8, 7, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 220, 150, 0.08);
}

.turn-banner-name {
  font-size: 2rem;
  line-height: 1;
  color: #f7ebcf;
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
}

.turn-banner-meta,
.play-summary-card {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex-wrap: wrap;
}

.metric-mini {
  min-width: 90px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(8, 13, 11, 0.44);
}

.metric-mini span {
  display: block;
  margin-bottom: 4px;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.metric-mini strong {
  display: block;
  color: var(--text-main);
  font-size: 1.05rem;
}

.table-center {
  z-index: 1;
  width: min(520px, 62%);
}

.deck-stack,
.discard-stage {
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(18, 15, 13, 0.78), rgba(8, 8, 7, 0.72));
  box-shadow: inset 0 1px 0 rgba(255, 220, 150, 0.06);
}

.seat-ring {
  min-height: 620px;
  z-index: 1;
}

.seat {
  width: clamp(160px, 17vw, 206px);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(18, 16, 14, 0.88), rgba(8, 10, 9, 0.84));
  border-color: rgba(216, 169, 74, 0.14);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.22);
  animation: seatFloat 6s ease-in-out infinite;
  backdrop-filter: blur(6px);
}

.seat.active {
  box-shadow:
    0 0 0 1px rgba(235, 194, 125, 0.18),
    0 0 30px rgba(235, 194, 125, 0.12),
    0 12px 22px rgba(0, 0, 0, 0.22);
}

.card-grid.hand-grid {
  justify-content: center;
  gap: 14px;
}

.card-face,
.hidden-card {
  width: 88px;
  aspect-ratio: 0.7;
  border-radius: 10px;
  border: 1px solid rgba(20, 18, 16, 0.18);
  position: relative;
  overflow: hidden;
  padding: 10px 8px;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    outline-color 180ms ease;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
}

.card-face:hover,
.hidden-card:hover {
  transform: translateY(-4px);
}

.card-face {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.32), transparent 34%),
    linear-gradient(180deg, rgba(251, 246, 232, 0.98), rgba(241, 232, 210, 0.98));
  color: #101820;
}

.card-face.selected {
  box-shadow:
    0 0 0 1px rgba(235, 194, 125, 0.28),
    0 0 24px rgba(235, 194, 125, 0.18),
    0 18px 28px rgba(0, 0, 0, 0.22);
}

.card-face::before {
  content: attr(data-rank);
  position: absolute;
  top: 8px;
  left: 8px;
  font-family: "EB Garamond", "Palatino Linotype", serif;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1;
  color: currentColor;
}

.card-face::after {
  content: attr(data-suit-glyph);
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 0.94rem;
  line-height: 1;
  color: currentColor;
  opacity: 0.76;
}

.card-face.red {
  color: #b21a1a;
}

.card-face.joker {
  background:
    linear-gradient(180deg, rgba(59, 29, 77, 0.95), rgba(26, 10, 38, 0.98));
  color: #f2c450;
}

.selection-caption {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.hidden-card {
  background:
    linear-gradient(135deg, rgba(201, 152, 90, 0.16), transparent 34%),
    linear-gradient(135deg, #5b1a18, #2a0908);
  color: #f2c450;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.hidden-card::before {
  content: "?";
}

.card-rank {
  display: block;
  margin-top: 18px;
  text-align: center;
  font-family: "EB Garamond", "Palatino Linotype", serif;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}

.card-suit {
  display: block;
  margin-top: 12px;
  text-align: center;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.card-score {
  position: absolute;
  right: 8px;
  bottom: 24px;
  font-size: 0.74rem;
  opacity: 0.72;
}

.action-group {
  display: grid;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px solid var(--line-soft);
}

.action-group:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.action-group-title {
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.action-group-danger .action-group-title {
  color: #efb4ad;
}

.action-bar {
  grid-template-columns: 1fr;
}

.action-bar .danger-button {
  grid-column: auto;
}

.notice-spotlight {
  background:
    radial-gradient(100% 140% at 0% 0%, rgba(216, 169, 74, 0.12), transparent 50%),
    rgba(10, 16, 13, 0.76);
}

.summary-table,
.history-table {
  overflow-x: auto;
  border-radius: 14px;
  background: rgba(8, 13, 11, 0.36);
  border: 1px solid var(--line-soft);
}

.summary-table table,
.history-table table {
  min-width: 100%;
}

.summary-table th,
.summary-table td,
.history-table th,
.history-table td {
  white-space: nowrap;
}

.ghost-button,
.primary-button,
.secondary-button,
.danger-button {
  min-height: 48px;
  border-radius: 999px;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.ghost-button:hover,
.primary-button:hover,
.secondary-button:hover,
.danger-button:hover {
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.primary-button:active,
.secondary-button:active,
.danger-button:active,
.ghost-button:active {
  transform: translateY(2px);
}

@keyframes seatFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@media (max-width: 1100px) {
  .hero-grid,
  .table-shell {
    grid-template-columns: 1fr;
  }

  .hero-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .page-shell {
    padding-top: 18px;
  }

  .hero-title {
    max-width: none;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .active-turn-banner {
    align-items: flex-start;
  }

  .turn-banner-name {
    font-size: 1.7rem;
  }

  .card-face,
  .hidden-card {
    width: 74px;
  }
}

/* Screenshot-aligned table pass */

.page-shell {
  width: min(1600px, calc(100% - 40px));
}

.table-shell {
  grid-template-columns: minmax(0, 1.46fr) 430px;
  gap: 36px;
}

.table-panel {
  min-height: 1320px;
  padding: 28px;
  border-radius: 42px;
  border: 1px solid rgba(118, 90, 38, 0.44);
  background: linear-gradient(180deg, rgba(8, 7, 6, 0.995), rgba(5, 4, 3, 1));
}

.table-panel::before {
  inset: 70px 38px 116px;
  border-radius: 50% / 44%;
  border: 14px solid rgba(92, 77, 40, 0.76);
  background:
    radial-gradient(circle at 42% 46%, rgba(4, 58, 35, 1) 0%, rgba(4, 48, 30, 1) 56%, rgba(3, 32, 21, 1) 100%);
  box-shadow:
    inset 0 0 0 3px rgba(176, 151, 84, 0.12),
    inset 0 0 160px rgba(0, 0, 0, 0.38);
}

.table-panel::after {
  background:
    radial-gradient(circle at 20% 42%, rgba(182, 186, 90, 0.2), transparent 26%),
    radial-gradient(circle at 52% 76%, rgba(186, 186, 94, 0.16), transparent 20%),
    radial-gradient(circle at center, transparent 44%, rgba(0, 0, 0, 0.12) 70%, rgba(0, 0, 0, 0.3) 100%);
}

.active-turn-banner {
  margin-bottom: 18px;
  padding: 18px 36px;
  border-radius: 24px;
  border-color: rgba(183, 147, 76, 0.58);
  background:
    radial-gradient(80% 140% at 50% 0%, rgba(216, 169, 74, 0.08), transparent 60%),
    linear-gradient(180deg, rgba(45, 33, 21, 0.88), rgba(29, 22, 14, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255, 220, 150, 0.08),
    0 0 40px rgba(149, 107, 38, 0.08);
}

.active-turn-banner .eyebrow {
  margin-bottom: 6px;
  color: #baa56d;
  letter-spacing: 0.26em;
}

.turn-banner-name {
  font-family: "EB Garamond", "Palatino Linotype", serif;
  font-size: 3.6rem;
  font-weight: 600;
  color: #f7eccf;
}

.turn-banner-meta {
  gap: 12px;
}

.metric-mini {
  min-width: 118px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(173, 137, 70, 0.16);
  background: rgba(35, 27, 17, 0.46);
}

.metric-mini span {
  color: #b8a26d;
  letter-spacing: 0.2em;
}

.metric-mini strong {
  font-family: "EB Garamond", "Palatino Linotype", serif;
  font-size: 1.6rem;
  color: #f6dfa1;
}

.seat-ring {
  min-height: 1060px;
}

.seat {
  width: clamp(196px, 18vw, 320px);
  padding: 20px 28px 18px;
  border-radius: 22px;
  border: 1px solid rgba(82, 78, 45, 0.54);
  background:
    linear-gradient(180deg, rgba(11, 22, 17, 0.88), rgba(8, 16, 13, 0.94));
  box-shadow: 0 18px 26px rgba(0, 0, 0, 0.2);
}

.seat-name {
  align-items: flex-start;
  font-family: "EB Garamond", "Palatino Linotype", serif;
  font-size: 1.14rem;
  color: #efe1b4;
}

.seat-meta {
  color: #baa97a;
  font-size: 0.98rem;
  letter-spacing: 0.03em;
}

.badge {
  color: #f5e8bf;
  font-size: 0.66rem;
}

.table-center {
  width: 420px;
  gap: 26px;
}

.deck-stack,
.discard-stage {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  text-align: center;
  box-shadow: none;
}

.deck-stack strong,
.discard-stage strong {
  display: block;
  margin-bottom: 12px;
  color: #cfb57b;
  font-size: 1.12rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
}

.deck-stack .subtle {
  color: #cfb57b;
  font-size: 1rem;
}

.discard-stage .stack {
  gap: 26px;
}

.discard-grid {
  justify-content: center;
  gap: 0;
}

.discard-grid .card-face,
.discard-grid .hidden-card {
  margin-left: -16px;
}

.discard-grid .card-face:first-child,
.discard-grid .hidden-card:first-child {
  margin-left: 0;
}

.sidebar-panel {
  align-content: start;
  min-height: 1120px;
  padding: 38px 38px 34px;
  border-radius: 30px;
  border-color: rgba(118, 90, 38, 0.46);
  background:
    radial-gradient(90% 90% at 0% 0%, rgba(119, 82, 36, 0.22), transparent 40%),
    linear-gradient(180deg, rgba(34, 25, 18, 0.94), rgba(18, 13, 10, 0.985));
}

.sidebar-panel .section-heading,
.sidebar-panel .subheading {
  font-family: "EB Garamond", "Palatino Linotype", serif;
  color: #efdca9;
}

.play-summary-card {
  justify-content: flex-start;
  gap: 12px;
  background: transparent;
  border: none;
  padding: 0;
}

.selection-caption {
  color: #b7a26d;
  font-size: 0.9rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.action-group {
  gap: 14px;
  padding-top: 28px;
  border-top: 1px solid rgba(107, 82, 39, 0.24);
}

.action-group:first-of-type {
  padding-top: 10px;
}

.action-group-title {
  margin-bottom: 2px;
  color: #b69d69;
  font-size: 0.86rem;
  letter-spacing: 0.28em;
}

.action-bar {
  gap: 16px;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 68px;
  font-size: 0.96rem;
  letter-spacing: 0.18em;
}

.danger-button {
  box-shadow:
    inset 0 1px 0 rgba(255, 220, 210, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    0 6px 0 #2a0606,
    0 7px 0 #0c0202,
    0 14px 24px rgba(0, 0, 0, 0.34),
    0 0 26px rgba(168, 48, 45, 0.18);
}

.card-face,
.hidden-card {
  width: 102px;
  border-radius: 12px;
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.24);
}

.card-face.tiny,
.hidden-card.tiny {
  width: 76px;
}

.card-rank {
  margin-top: 16px;
  font-size: 2.16rem;
}

.card-suit {
  margin-top: 10px;
  font-size: 0.78rem;
}

.card-score {
  bottom: 22px;
}

.table-hand-shell {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 3;
  width: 620px;
  pointer-events: none;
}

.table-hand-grid {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: auto;
}

.table-hand-card {
  margin-left: -30px;
  transform: rotate(var(--fan-rotate)) translateY(var(--fan-offset));
  transform-origin: 50% 100%;
  transition: transform 220ms ease, box-shadow 180ms ease;
}

.table-hand-card:first-child {
  margin-left: 0;
}

.table-hand-card.selected {
  transform: rotate(var(--fan-rotate)) translateY(calc(var(--fan-offset) - 18px));
}

.table-hand-card:hover {
  transform: rotate(var(--fan-rotate)) translateY(calc(var(--fan-offset) - 8px));
}

@media (max-width: 1200px) {
  .table-shell {
    grid-template-columns: 1fr;
  }

  .sidebar-panel {
    min-height: auto;
  }
}

@media (max-width: 760px) {
  .table-panel {
    min-height: 900px;
    padding: 18px;
    border-radius: 28px;
  }

  .table-panel::before {
    inset: 98px 14px 110px;
  }

  .seat-ring {
    min-height: 730px;
  }

  .turn-banner-name {
    font-size: 2.2rem;
  }

  .table-hand-shell {
    width: 94%;
    bottom: 8px;
  }

    .table-hand-card {
    margin-left: -32px;
  }
}

/* Online app shell + fullscreen game fit */

body.game-live {
  overflow: hidden;
}

body.game-live .page-shell {
  height: 100vh;
  max-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding-top: 12px;
  padding-bottom: 12px;
}

body.game-live .app-root {
  min-height: 0;
}

body.game-live .table-shell {
  min-height: 0;
  height: 100%;
  align-items: stretch;
}

body.game-live .table-panel,
body.game-live .sidebar-panel {
  min-height: 0;
  height: 100%;
}

body.game-live .table-panel {
  min-height: calc(100vh - 150px);
}

body.game-live .seat-ring {
  min-height: calc(100% - 220px);
}

body.game-live .sidebar-panel {
  overflow: auto;
}

.auth-switch-row {
  justify-content: stretch;
}

.auth-switch-row > button {
  flex: 1;
}

.history-card {
  display: grid;
  gap: 6px;
}

.lobby-shell {
  align-items: stretch;
}

.lobby-seat {
  position: relative;
  inset: auto;
  width: 100%;
  transform: none;
  animation: none;
}

.seat-list {
  display: grid;
  gap: 14px;
}

.topbar {
  align-items: center;
}

.topbar-meta {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar h1 {
  font-family: "EB Garamond", "Palatino Linotype", serif;
  font-weight: 600;
}

.hero-side .sidebar-panel,
.lobby-panel,
.sidebar-panel {
  position: relative;
}

.take-grid {
  justify-content: center;
}

.take-grid .card-face,
.take-grid .hidden-card {
  width: 82px;
}

.form-panel input,
.form-panel select {
  min-height: 52px;
  border-radius: 14px;
}

@media (max-width: 1440px) {
  body.game-live .page-shell {
    width: min(100vw - 24px, 1500px);
  }

  .table-shell {
    grid-template-columns: minmax(0, 1.34fr) 390px;
    gap: 24px;
  }

  .table-panel::before {
    inset: 76px 26px 108px;
  }
}

@media (max-width: 1100px) {
  body.game-live {
    overflow: auto;
  }

  body.game-live .page-shell {
    height: auto;
    max-height: none;
    grid-template-rows: auto;
  }

  body.game-live .table-shell {
    height: auto;
  }
}
