:root {
  --bg: #09121b;
  --card: #142331;
  --card-2: #10202c;
  --text: #edf4fb;
  --muted: #9bb0c3;
  --accent: #63f5bc;
  --accent-2: #7ac7ff;
  --danger: #ff8d8d;
  --felt-1: #0f5a46;
  --felt-2: #0b4235;
  --gold: #f6d27a;
  --border: rgba(255,255,255,0.08);
  --shadow: 0 24px 60px rgba(0,0,0,0.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background:
    radial-gradient(circle at top, rgba(122,199,255,0.14), transparent 28%),
    linear-gradient(180deg, #081018 0%, var(--bg) 100%);
  color: var(--text);
}

.app-shell {
  width: min(1220px, calc(100vw - 32px));
  margin: 24px auto 48px;
  display: grid;
  gap: 20px;
}

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero {
  padding: 24px;
  display: grid;
  gap: 20px;
  grid-template-columns: 1.5fr 1fr;
}

.eyebrow, .label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  color: var(--muted);
}

.hero h1 {
  margin: 8px 0 12px;
  font-size: clamp(2rem, 3.2vw, 3.35rem);
  line-height: 1.03;
}

.lede {
  margin: 0;
  color: var(--muted);
  max-width: 70ch;
}

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

button {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}
button:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.09);
}
button.primary {
  background: linear-gradient(135deg, rgba(99,245,188,0.28), rgba(122,199,255,0.2));
  border-color: rgba(99,245,188,0.38);
}

.scene-nav,
.table-wrap { padding: 20px; }

.scene-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.scene-buttons button.active {
  background: rgba(122,199,255,0.18);
  border-color: rgba(122,199,255,0.42);
}
.table-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.table-meta > div {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 12px 14px;
}
.table-meta strong {
  display: block;
  margin-top: 6px;
  font-size: 16px;
}

.table-felt {
  position: relative;
  min-height: 560px;
  border-radius: 30px;
  background:
    radial-gradient(circle at center, rgba(255,255,255,0.08), transparent 38%),
    linear-gradient(180deg, var(--felt-1) 0%, var(--felt-2) 100%);
  border: 10px solid #392718;
  overflow: hidden;
}

.board-zone {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: min(540px, calc(100% - 280px));
  padding: 18px;
  border-radius: 20px;
  background: rgba(9, 18, 27, 0.24);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(4px);
}

.board-header, .section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.board-header { margin-bottom: 12px; }

.card-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.playing-card {
  width: 64px;
  height: 88px;
  border-radius: 12px;
  background: #fcfcff;
  color: #111827;
  box-shadow: 0 12px 28px rgba(0,0,0,0.18);
  padding: 8px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  font-weight: 800;
}
.playing-card.red { color: #c62f2f; }
.playing-card.back {
  background: linear-gradient(135deg, #1f4460, #0f2438);
  color: #dbeafe;
  border: 1px solid rgba(255,255,255,0.16);
}
.playing-card.placeholder {
  opacity: 0.5;
}
.playing-card.compact {
  width: 60px;
}
.playing-card .center-suit {
  text-align: center;
  font-size: 24px;
  align-self: center;
}
.playing-card .bottom-rank {
  text-align: right;
  font-size: 12px;
  opacity: 0.72;
}

.player-seat {
  position: absolute;
  width: 240px;
  min-height: 122px;
  border-radius: 18px;
  padding: 14px;
  background: rgba(9, 18, 27, 0.42);
  border: 1px solid rgba(255,255,255,0.08);
}
.seat-top { top: 22px; left: 50%; transform: translateX(-50%); }
.seat-left { left: 22px; top: 50%; transform: translateY(-50%); }
.seat-right { right: 22px; top: 50%; transform: translateY(-50%); }
.seat-bottom { bottom: 22px; left: 50%; transform: translateX(-50%); }

.player-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.player-name {
  font-weight: 700;
}
.player-role, .stack {
  color: var(--muted);
  font-size: 13px;
}
.player-status {
  margin-top: 10px;
  font-size: 13px;
  color: var(--gold);
}
.player-seat.winner {
  box-shadow: 0 0 0 2px rgba(246,210,122,0.56), 0 20px 40px rgba(246,210,122,0.15);
}
.player-seat.governance-target {
  box-shadow: 0 0 0 2px rgba(122,199,255,0.5), 0 20px 40px rgba(122,199,255,0.18);
}

.grid-two {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
}
.grid-two > .card, .notes-card {
  padding: 20px;
}

.action-log {
  margin: 16px 0 0;
  padding-left: 22px;
  display: grid;
  gap: 12px;
}
.action-log li {
  color: var(--muted);
  line-height: 1.45;
}
.action-log li.current {
  color: var(--text);
}

.boundary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}
.boundary-grid > div {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}
.boundary-grid p {
  margin: 8px 0 0;
  color: var(--text);
  line-height: 1.5;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pill.accent {
  background: rgba(99,245,188,0.12);
  color: var(--accent);
}

.notes-list {
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--muted);
  display: grid;
  gap: 10px;
}
.footer {
  padding: 0 16px 32px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 980px) {
  .hero, .grid-two { grid-template-columns: 1fr; }
  .table-meta { grid-template-columns: 1fr 1fr; }
  .table-felt { min-height: 760px; }
  .board-zone { width: calc(100% - 40px); }
  .seat-left { top: 170px; left: 18px; transform: none; }
  .seat-right { top: 170px; right: 18px; transform: none; }
  .seat-top { top: 18px; }
  .seat-bottom { bottom: 18px; }
}

@media (max-width: 640px) {
  .app-shell { width: min(100vw - 16px, 1220px); margin-top: 12px; }
  .hero, .scene-nav, .table-wrap, .grid-two > .card, .notes-card { padding: 16px; }
  .table-meta { grid-template-columns: 1fr; }
  .player-seat { width: calc(100% - 28px); }
  .seat-top, .seat-left, .seat-right, .seat-bottom {
    left: 14px;
    right: 14px;
    transform: none;
  }
  .seat-top { top: 14px; }
  .seat-left { top: 152px; }
  .seat-right { top: 292px; }
  .seat-bottom { bottom: 14px; }
  .table-felt { min-height: 910px; }
  .board-zone { top: 56%; }
  .boundary-grid { grid-template-columns: 1fr; }
}
