:root {
  color-scheme: dark;
  --ink: #f2eadc;
  --muted: #c6b79e;
  --line: rgba(241, 224, 196, 0.16);
  --panel: rgba(16, 13, 10, 0.82);
  --panel-strong: rgba(22, 17, 12, 0.94);
  --gold: #e0b56a;
  --gold-deep: #a67732;
  --wine: #6d202d;
  --wine-bright: #9e3244;
  --green: #27523d;
  --green-bright: #3c7758;
  --shadow: rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #120d09;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  letter-spacing: 0;
}

button,
strong,
h1,
h2,
p {
  margin: 0;
}

button {
  font: inherit;
}

#game-shell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #140e0b;
}

#world {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#hud {
  position: absolute;
  inset: 22px 22px auto 22px;
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(320px, 1fr) minmax(280px, 1.2fr);
  gap: 14px;
  pointer-events: none;
  z-index: 5;
}

.hud-cluster,
#side-panel,
#prompt,
#toast {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(29, 21, 15, 0.92), rgba(12, 9, 7, 0.84));
  box-shadow: 0 18px 46px var(--shadow);
  backdrop-filter: blur(16px);
}

.hud-cluster {
  min-height: 88px;
  padding: 16px 18px;
  border-radius: 8px;
}

.brand-cluster h1 {
  margin-top: 6px;
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
}

.eyebrow,
.panel-label,
.stat span,
.mission-cluster span,
.table-meta span,
.table-footer span {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 11px;
  font-weight: 700;
}

.stats-cluster {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stat {
  display: grid;
  align-content: center;
  gap: 6px;
}

.stat strong,
.mission-cluster strong,
.panel-section strong {
  font-size: 18px;
  line-height: 1.15;
}

.mission-cluster {
  display: grid;
  gap: 8px;
  align-content: center;
}

#side-panel {
  position: absolute;
  right: 22px;
  top: 132px;
  width: min(280px, calc(100vw - 44px));
  padding: 16px;
  border-radius: 8px;
  display: grid;
  gap: 16px;
  z-index: 4;
}

.panel-section {
  display: grid;
  gap: 6px;
}

.panel-section.compact p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

#prompt {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  min-width: 280px;
  max-width: min(720px, calc(100vw - 32px));
  padding: 14px 18px;
  border-radius: 8px;
  text-align: center;
  font-size: 15px;
  line-height: 1.35;
  z-index: 6;
}

#toast {
  position: absolute;
  left: 50%;
  top: 128px;
  transform: translateX(-50%);
  max-width: min(620px, calc(100vw - 32px));
  padding: 14px 18px;
  border-radius: 8px;
  text-align: center;
  font-size: 14px;
  z-index: 12;
}

.hidden {
  display: none !important;
}

.modal {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 5, 3, 0.7);
  backdrop-filter: blur(12px);
}

.poker-card {
  position: relative;
  width: min(1040px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 8px;
  border: 1px solid rgba(235, 210, 163, 0.24);
  background:
    radial-gradient(circle at top center, rgba(162, 90, 43, 0.15), transparent 32%),
    linear-gradient(180deg, rgba(29, 20, 15, 0.98), rgba(13, 10, 7, 0.98));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.72);
  padding: 22px;
}

.poker-header,
.table-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.poker-header h2 {
  margin-top: 6px;
  font-size: 30px;
  line-height: 1.05;
}

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(242, 234, 220, 0.18);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  font-size: 24px;
}

.table-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.table-meta > div,
.table-footer > div {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.table-meta strong,
.table-footer strong {
  font-size: 18px;
  line-height: 1.25;
}

.felt-layout {
  position: relative;
  min-height: 430px;
  margin-top: 18px;
  border-radius: 8px;
  border: 1px solid rgba(230, 205, 154, 0.16);
  background:
    radial-gradient(circle at 50% 38%, rgba(95, 150, 109, 0.22), transparent 24%),
    radial-gradient(circle at 50% 50%, rgba(28, 75, 53, 0.84), rgba(12, 30, 23, 0.96) 70%);
  overflow: hidden;
}

.felt-layout::before {
  content: "";
  position: absolute;
  inset: 28px;
  border: 2px solid rgba(225, 183, 106, 0.24);
  border-radius: 999px;
}

.seat,
.board-zone {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  gap: 12px;
  justify-items: center;
}

.rival-seat {
  top: 22px;
}

.player-seat {
  bottom: 22px;
}

.board-zone {
  top: 50%;
  width: min(680px, calc(100% - 72px));
  transform: translate(-50%, -50%);
}

.seat-copy {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(9, 7, 5, 0.58);
  border: 1px solid rgba(241, 224, 196, 0.12);
}

.seat-copy span {
  color: var(--muted);
  font-size: 13px;
}

.seat-copy strong {
  font-size: 16px;
}

.card-row {
  min-height: 92px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.playing-card {
  width: 66px;
  height: 92px;
  border-radius: 8px;
  border: 1px solid rgba(30, 18, 10, 0.3);
  background: linear-gradient(180deg, #fffaf0, #eadcc3);
  color: #231712;
  box-shadow: 0 14px 22px rgba(0, 0, 0, 0.26);
  display: grid;
  align-content: space-between;
  padding: 8px;
  font-weight: 800;
}

.playing-card.red {
  color: #9f2033;
}

.playing-card.back {
  background:
    radial-gradient(circle at center, rgba(224, 181, 106, 0.26), transparent 32%),
    linear-gradient(145deg, #5f1826, #2d0f16);
  border-color: rgba(224, 181, 106, 0.32);
}

.playing-card.back::before {
  content: "✦";
  align-self: center;
  justify-self: center;
  color: var(--gold);
  font-size: 26px;
}

.playing-card .corner {
  display: grid;
  line-height: 0.92;
  font-size: 16px;
}

.playing-card .suit {
  justify-self: end;
  font-size: 22px;
}

#table-narration {
  max-width: 560px;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(7, 5, 4, 0.56);
  border: 1px solid rgba(241, 224, 196, 0.12);
  color: var(--ink);
  text-align: center;
  font-size: 14px;
  line-height: 1.4;
}

.action-rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.action-rail button {
  min-height: 54px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--ink);
  font-weight: 700;
}

.secondary-action {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12) !important;
}

.primary-action {
  background: linear-gradient(180deg, #27523d, #1d3f2f);
  border-color: rgba(120, 190, 146, 0.26) !important;
}

.accent-action {
  background: linear-gradient(180deg, #9b5931, #6d341b);
  border-color: rgba(224, 181, 106, 0.22) !important;
}

.ghost-action {
  background: linear-gradient(180deg, #6d202d, #4c1620);
  border-color: rgba(224, 181, 106, 0.18) !important;
}

.action-rail button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.table-footer {
  margin-top: 18px;
}

.table-footer > div {
  flex: 1 1 0;
}

@media (max-width: 980px) {
  #hud {
    grid-template-columns: 1fr;
  }

  #side-panel {
    top: auto;
    bottom: 26px;
    right: 16px;
    width: min(260px, calc(100vw - 32px));
  }

  #prompt {
    bottom: 172px;
  }

  .table-meta,
  .action-rail,
  .table-footer {
    grid-template-columns: 1fr;
    display: grid;
  }

  .felt-layout {
    min-height: 480px;
  }
}

