:root {
  --ink: #171c22;
  --felt: #215c45;
  --rail: #c4a36a;
  --ivory: #f0ead8;
  --muted: #c5bfae;
  --fold: #9a4540;
  --call: #3d7394;
  --raise: #c4a36a;
  --check: #6d7a86;
  --wait: #4a5560;
  --bet: #c4a36a;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--ink);
  color: var(--ivory);
  font-family: system-ui, "Segoe UI", sans-serif;
}
.center {
  min-height: 100dvh;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
}
.card {
  width: min(420px, 100%);
  background: #222830;
  border: 1px solid #2e3640;
  border-radius: 8px;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
h1 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-size: 1.7rem;
  font-weight: 700;
}
p { margin: 0; color: var(--muted); }
input[type=password] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid #3b4450;
  background: #12161b;
  color: var(--ivory);
  font-size: 16px;
}
.btn, button[type=submit] {
  display: block;
  text-align: center;
  text-decoration: none;
  color: #171c22;
  background: var(--rail);
  border: 0;
  border-radius: 6px;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.btn.ghost {
  background: transparent;
  color: var(--ivory);
  border: 1px solid #3b4450;
}
.page { padding: 16px; max-width: 720px; margin: 0 auto; }
header { display: flex; gap: 16px; align-items: center; }
header a { color: var(--rail); }
#preview {
  width: 100%;
  max-height: 40vh;
  background: #000;
  margin-top: 12px;
  border-radius: 8px;
}
body.hud {
  height: 100dvh;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.felt {
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 48dvh;
  min-height: 200px;
}
#table {
  width: 100%;
  height: 100%;
  display: block;
  background: var(--ink);
}
.solver {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rec {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-size: clamp(1.8rem, 8vw, 2.4rem);
  line-height: 1.1;
  color: var(--ivory);
}
.rec[data-kind="fold"] { color: #e2b4b0; }
.rec[data-kind="call"], .rec[data-kind="check"] { color: #c5d8e6; }
.rec[data-kind="bet"], .rec[data-kind="raise"] { color: var(--rail); }
.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.mix {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mix li {
  display: grid;
  grid-template-columns: minmax(5.5rem, 34%) 1fr 3.2rem;
  gap: 8px;
  align-items: center;
  font-size: 0.92rem;
}
.mix .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mix .bar {
  height: 10px;
  background: #2a313a;
  border-radius: 99px;
  overflow: hidden;
}
.mix .bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--check);
}
.mix li[data-kind="fold"] .bar i { background: var(--fold); }
.mix li[data-kind="call"] .bar i { background: var(--call); }
.mix li[data-kind="check"] .bar i { background: var(--check); }
.mix li[data-kind="bet"] .bar i,
.mix li[data-kind="raise"] .bar i { background: var(--raise); }
.mix .pct {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.mix li.top .name,
.mix li.top .pct {
  font-weight: 700;
  color: var(--ivory);
}
.stats {
  margin: 8px 0 0;
  padding-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.stats div {
  border-top: 1px solid #2e3640;
  padding-top: 8px;
}
.stats dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.stats dd {
  margin: 2px 0 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-size: 1.55rem;
  font-variant-numeric: tabular-nums;
}
@media (min-width: 720px) {
  body.hud { flex-direction: row; }
  .felt {
    flex: 1 1 58%;
    height: 100dvh;
    max-height: none;
    aspect-ratio: auto;
    min-height: 0;
  }
  .solver { flex: 0 0 min(380px, 42%); padding: 28px 28px 24px; }
  .rec { font-size: 2.4rem; }
}
