:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #1a2230;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #0f766e;
  --green: #10b981;
  --red: #dc2626;
  --felt: #0f5132;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.topbar h1 { margin: 0; font-size: 20px; letter-spacing: .2px; }
.topbar h1 small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 8px; }
.subtitle { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 10px; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
}
.badge.demo { background: #fff1d6; color: #9a5b00; border: 1px solid #f7d08a; }
.badge.real { background: #dcfce7; color: #166534; border: 1px solid #86efac; }

.notice {
  margin: 14px 24px 0;
  padding: 10px 14px;
  border-left: 4px solid #e0a020;
  background: #fffbeb;
  color: #6b4a00;
  font-size: 12px;
  border-radius: 0 8px 8px 0;
}

main {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 16px;
  padding: 16px 24px 24px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.panel h2 { margin: 0 0 12px; font-size: 15px; }
.panel h3 { margin: 18px 0 8px; font-size: 13px; color: var(--muted); }
.pill {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.seats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.seat {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  min-height: 108px;
  background: #f8fafc;
  position: relative;
}
.seat.hero { border-color: var(--accent); background: #f0fdfa; }
.seat.active { box-shadow: 0 0 0 2px var(--green); }
.seat.folded { opacity: .48; }
.seat-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.seat-head .pos { color: var(--muted); font-size: 10px; }
.hole { display: flex; gap: 3px; margin: 8px 0 6px; }
.stack { font-size: 10px; color: var(--muted); line-height: 1.35; }
.tag {
  position: absolute; right: 6px; bottom: 6px;
  font-size: 9px; font-weight: 700; color: var(--red);
}

.card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px; height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  font-size: 14px;
  font-weight: 800;
  font-family: "Segoe UI Symbol", "Microsoft YaHei", sans-serif;
}
.card.red { color: var(--red); }
.card.black { color: #111827; }
.card.empty { color: #cbd5e1; background: #f8fafc; }
.card.back { background: repeating-linear-gradient(45deg, #1e40af, #1e40af 4px, #1e3a8a 4px, #1e3a8a 8px); border-color: #1e3a8a; }

.board-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 16px 0;
  padding: 14px;
  border-radius: 10px;
  background: var(--felt);
}
.cards { display: flex; gap: 5px; }
.pot { margin-left: auto; color: #d1fae5; font-weight: 700; font-size: 13px; }

.decision-bar { display: flex; flex-wrap: wrap; gap: 8px; min-height: 38px; align-items: center; }
.decision-bar button, .primary {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  padding: 7px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.decision-bar button.fold { background: #fff; color: #b91c1c; border-color: #fca5a5; }
.decision-bar button.check { background: #fff; color: #334155; border-color: #cbd5e1; }
.decision-bar button.allin { background: #b91c1c; border-color: #b91c1c; }
.decision-bar button:hover, .primary:hover, .quiet:hover { filter: brightness(.96); }
.quiet { border: 1px solid var(--line); background: #fff; color: var(--muted); padding: 4px 10px; border-radius: 6px; cursor: pointer; font-size: 11px; }
.muted { color: var(--muted); font-size: 12px; }
.fine { color: var(--muted); font-size: 11px; margin: 10px 0 0; }
.bad, .good { font-weight: 700; }
.bad { color: var(--red); }
.good { color: var(--accent); }
.kv { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 12px; }
.kv span { color: var(--muted); }

.bar-row { display: grid; grid-template-columns: 118px 1fr 38px; align-items: center; gap: 8px; margin-top: 8px; font-size: 11px; }
.bar-row.picked .bar-label { font-weight: 800; color: var(--accent); }
.bar-track { height: 8px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--green); }
.bar-pct { text-align: right; color: var(--muted); }

.range-grid {
  display: grid;
  grid-template-columns: 24px repeat(13, minmax(0, 1fr));
  gap: 2px;
  font-size: 9px;
}
.cell {
  min-width: 0;
  height: 27px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  color: #0b2b22;
  font-weight: 700;
  overflow: hidden;
}
.cell.head { background: transparent; color: var(--muted); font-size: 10px; }
.cell.blocked { background: #e2e8f0 !important; color: #94a3b8; }
.cell.suited { border-top: 2px solid rgba(15, 118, 110, .45); }
.cell.offsuit { border-bottom: 2px solid rgba(15, 118, 110, .28); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; color: var(--muted); font-size: 10px; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.metric { background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 8px; text-align: center; }
.metric span { display: block; color: var(--muted); font-size: 10px; }
.metric b { display: block; margin-top: 2px; font-size: 17px; }

.timeline { max-height: 150px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.tl-item { display: flex; gap: 8px; padding: 5px 8px; border-bottom: 1px solid var(--line); font-size: 11px; }
.tl-item:last-child { border-bottom: 0; }
.tl-item span { color: #94a3b8; }
.tl-item em { color: var(--muted); font-style: normal; }
.history-head { display: flex; justify-content: space-between; align-items: center; }
.history { max-height: 180px; overflow: auto; }
.hist { border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; margin-bottom: 6px; font-size: 11px; }
.hist summary { cursor: pointer; }
.hist-steps { margin-top: 6px; color: var(--muted); }

footer { padding: 0 24px 24px; color: var(--muted); font-size: 11px; }

@media (max-width: 1100px) {
  main { grid-template-columns: 1fr; }
  .seats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
