:root {
  --gap: 16px;
  --radius: 10px;
  --surface: #fff;
  --border: #e3e7ef;
  --bg: #fafafa;
  --muted: #5c667a;
}

@media (prefers-color-scheme: dark){
  :root{
    --surface:#16171d; --border:#2a2d37; --bg:#0f0f12; --muted:#a7afbf;
    color-scheme: dark;
  }
}

html, body { height: 100% }
body {
  font-family: -apple-system, system-ui, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  margin: var(--gap);
  background: var(--bg);
  color: #111;
}

.page {
  display: grid;
  grid-template-rows: auto auto auto auto 1fr;
  gap: var(--gap);
}

/* Cards / panels */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.row { display:flex; flex-wrap:wrap; gap:8px; align-items:center }
.sep { width: 1px; align-self: stretch; background: var(--border); margin: 0 8px }

input, button {
  padding: 8px 10px;
  border: 1px solid #bbb;
  border-radius: 7px;
  background: #fff;
}
button { background:#f5f5f5; cursor:pointer }

/* Bar headers */
.bar { display:flex; justify-content:space-between; align-items:center; margin-bottom:6px }
.bar h2 { font-size:16px; margin:0 }

/* Pill */
.pill {
  border-radius: 999px; padding:6px 10px; font-weight:700; font-size:12px;
  background:#efefef; color:#222;
}
.pill--ok { background:#eaf8f0; color:#166b3b; border:1px solid #bfe7d0 }

/* Two column bottom area */
.two { display:grid; grid-template-columns: 1fr 1fr; gap: var(--gap) }
@media (max-width: 820px){ .two { grid-template-columns: 1fr } }

/* Seating grid */
/* === Seating cards === */
.seat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
}

.seat-card {
  background: #f9f9f9;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.seat-card h4 {
  margin: 0 0 6px 0;
  font-size: 14px;
  font-weight: 600;
}

.seat-card .seat-meta {
  font-size: 12px;
  color: #333;
  margin-bottom: 8px;
}
.seat-footer {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #e4e4e4;
  font-size: 12px;
  color: #666;
  display: flex;
  justify-content: space-between;
}

/* States you can style more later */
.seat-card.open { opacity: 0.7; }
.seat-card.me   { outline: 2px solid #4a7cff; outline-offset: 2px; background: #f9f9f9; }

/* Future hooks (when you toggle these data-attrs to "true"): */
.seat-card[data-active="true"] {
  outline: 2px solid #4a7cff;
  outline-offset: 2px;
  background: #f0f6ff; /* adjust for dark theme if you like */
  color: #0b0d12;
}
.seat-card[data-bot="true"] .seat-footer span:last-child::after {
  content: "🤖";
  margin-left: 4px;
}

/* World Balance meter */
.wb-wrap { margin: 6px 0 12px }
.wb-label { display:flex; justify-content:space-between; font-size:12px; color:#555; margin-bottom:4px }
.wb-bar { position:relative; height:14px; background:#eee; border-radius:999px; overflow:hidden }
.wb-fill { position:absolute; inset:0 auto 0 0; width:0%; background: linear-gradient(90deg, #59c173, #a17fe0, #5d26c1); transition: width .25s }

/* Hand strip */
.start-deal {
  color: #6a6a6a;
  font-size: 12px;
}
.hand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.hand-card {
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 10px;
  background: #fafafa;
  display: flex;
  flex-direction: column;
}
.hand-card h4 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
}
.hand-card h4 small { font-weight: 600; opacity: .75; }
.hand-card p { margin: 0 0 4px; font-size: 13px; }
.hand-card-meta { display: grid; gap: 6px; }
.card-footer { margin-top: auto; padding-top: 8px; }

/* Mission button (UI-only) */
.mission-btn {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #cfd8ff;
  background: #e8edff;
  color: #24335e;
  cursor: pointer;
}
.mission-btn[disabled],
.mission-btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Mission window banner */
.round-banner {
  background:#000; color:#fff; padding:8px 12px; border-radius:8px; font-weight:700; text-align:center;
}

/* Log + diag panes */
.log, .diag { max-height: 52vh; overflow:auto; background:#fff; border:1px solid #eee; border-radius:8px; padding:10px }
.log p { margin:8px 0 }

/* Choice bar */
.choicebar { display:flex; gap:8px; align-items:center; margin-top:8px }
.muted { color: var(--muted) }