/* The neutral tokens copy app/styles/tokens.css, so the solver matches the site.
   The action tones below (raise to d5) are the solver colors. They do not change. */
:root {
  --bg-0: #0a0a0a;
  --bg-1: #111111;
  --bg-2: #171717;
  --bg-3: #242424;
  --surface-3: #1f1f1f;
  --border-strong: #333333;
  --text: #f5f5f5;
  --muted: #a3a3a3;
  --dim: #6b6b6b;
  /* The site marks the current item with white, not a hue. */
  --accent: #ffffff;
  --radius: 6px;
  --raise: #e23b3b;
  --call: #2f9d57;
  --fold: #5b7fa6;
  --pat: #43BCCD;
  --d1: #397F62;
  --d2: #99A438;
  --d3: #F9C80E;
  --d4: #F27F2A;
  --d5: #FF001A;
  --empty: #1f1f1f;
  /* Inter sets all text. JetBrains Mono sets ranks and numbers. */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg-0);
  color: var(--text);
  font: 13.5px/1.35 var(--font-sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; }

.app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.setup {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  background: var(--bg-1);
  padding: 10px 12px;
  border-bottom: 1px solid var(--bg-3);
}

.setup-name strong {
  display: block;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}

.setup-name span,
.rule small,
.path-amt small {
  color: var(--muted);
  font-size: 11px;
}

.setup-rules,
.setup-live {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.rule {
  background: var(--bg-2);
  border: 1px solid var(--bg-3);
  border-radius: 0;
  padding: 4px 8px;
  font-size: 12px;
}

.rule b {
  margin-left: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
}
.rule small { margin-left: 2px; }

.phase {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 2px;
}

.actor {
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  padding: 4px 8px;
}

.pages {
  display: flex;
  gap: 4px;
  padding: 8px 12px 0;
}

/* Page tabs use the site segmented-control look: grey text, a dark
   fill on the active tab, and sentence-case labels. */
.page {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--muted);
  padding: 5px 12px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
}

.page:hover:not(:disabled) {
  color: var(--text);
}

.page.is-on {
  background: var(--surface-3);
  border-color: var(--bg-3);
  color: var(--text);
}

.page:disabled {
  color: var(--dim);
  cursor: default;
}

/* The Play link is a site secondary button. */
a.page {
  display: inline-block;
  margin-left: auto;
  text-decoration: none;
  border-color: var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
}

a.page:hover {
  background: var(--bg-2);
  border-color: var(--dim);
}

.path {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 12px 10px;
}

.path-card {
  flex: 0 0 124px;
  background: var(--bg-1);
  border: 1px solid var(--bg-3);
  border-radius: 0;
  padding: 6px;
}

/* The focused card has a white ring, like the site's active state. */
.path-card.is-current {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}
.path-card.is-current .path-seat { color: var(--accent); }

.path-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
  margin: 0 0 4px;
  padding: 0 2px 3px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--bg-2);
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
}

.path-amt { font-family: var(--font-mono); }
.path-amt b { font-weight: 700; }
.path-amt small { margin-left: 2px; font-weight: 400; }

.path-action {
  display: block;
  width: 100%;
  margin: 0;
  padding: 3px 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-size: 12.5px;
  font-weight: 400;
  cursor: pointer;
}

.path-action:hover {
  color: var(--text);
}

.path-action.is-selected {
  background: var(--surface-3);
  color: #ffffff;
  font-weight: 500;
}

.status {
  margin: 4px 12px 8px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 13px;
}

.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 500px;
  gap: 8px;
  padding: 0 8px 8px;
}

.workspace.is-terminal { grid-template-columns: 1fr; }
.workspace.is-terminal .inspector { display: none; }

.board,
.inspector {
  min-height: 0;
  overflow: auto;
}

.board.is-chart {
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.inspector {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
  overflow: hidden;
}

.band { margin: 0 4px 10px; }

.band h2 {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0 0 4px;
  padding: 4px 0;
  background: var(--bg-0);
  color: var(--dim);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
}

.matrix {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.row-gap { flex: 0 0 5px; }

.rank-row {
  flex: 0 0 22px;
  min-height: 22px;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: 1px;
}

.cell {
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--empty);
  color: #fff;
  text-align: center;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  container-type: size;
}

.cell.is-empty { color: var(--dim); }
.cell.is-hot,
.hand-row.is-hot { outline: 1px solid #fff; outline-offset: -1px; }
.cell.is-locked,
.hand-row.is-locked { outline: 1px solid #c8c8c8; outline-offset: -1px; }
.cell.is-match,
.hand-row.is-match { box-shadow: inset 0 0 0 2px var(--accent); }
.cell.is-dim,
.hand-row.is-dim { opacity: 0.22; }

.cell-label {
  display: inline-block;
  max-width: 100%;
  padding: 1px 2px;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.42);
  font-family: var(--font-mono);
  font-size: 10px;
  font-size: min(80cqh, 42cqw, 12.5px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
}

.cell.is-long .cell-label {
  font-size: 9px;
  font-size: min(78cqh, 28cqw, 11.5px);
}

.cell.is-empty .cell-label { background: transparent; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 4px;
}

.tiles.is-crowded {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tile {
  min-height: 72px;
  min-width: 0;
  padding: 6px 8px 8px;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  color: #fff;
}

.tile-name {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
}

.tile-pct {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 25px;
  font-weight: 600;
  line-height: 1;
}

.tiles.is-crowded .tile-pct { font-size: 20px; }

.tile-combo {
  align-self: end;
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
}

.tile.is-empty { background: var(--bg-2); color: var(--muted); }
.tile.is-empty .tile-combo { color: var(--dim); }

.tone-raise { background: var(--raise); }
.tone-call { background: var(--call); }
.tone-fold { background: var(--fold); }
.tone-pat { background: var(--pat); }
.tone-d1 { background: var(--d1); }
.tone-d2 { background: var(--d2); }
.tone-d3 { background: var(--d3); }
.tone-d4 { background: var(--d4); }
.tone-d5 { background: var(--d5); }

.tile.tone-pat,
.tile.tone-d2,
.tile.tone-d3,
.tile.tone-d4 { color: #1a1408; }
.tile.tone-pat .tile-combo,
.tile.tone-d2 .tile-combo,
.tile.tone-d3 .tile-combo,
.tile.tone-d4 .tile-combo { color: rgba(26, 20, 8, 0.75); }

.proportion {
  display: flex;
  height: 8px;
  margin-top: 2px;
  border-radius: 0;
  overflow: hidden;
  background: var(--bg-2);
}

.proportion .seg { height: 100%; flex-basis: 0; }

.suit-head .hand-label {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
}

.suit-title,
.suit-combo,
.suit-prompt {
  margin: 2px 0;
  color: var(--muted);
  font-size: 12px;
}

.suit-title { font-size: 13px; }

.suits h3,
#suits h3 {
  margin: 12px 0 6px;
  color: var(--dim);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
}

.suit-row {
  background: var(--bg-1);
  border: 1px solid var(--bg-3);
  border-radius: 0;
  padding: 6px 8px;
  margin-top: 4px;
}

.suit-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.mixbar {
  height: 8px;
  margin: 3px 0 2px;
  border-radius: 0;
  background: var(--bg-2);
}

.freq {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  justify-content: flex-end;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.tone-text-raise { color: var(--raise); }
.tone-text-call { color: #46c274; }
.tone-text-fold { color: #8eafd0; }
.tone-text-pat { color: #43BCCD; }
.tone-text-d1 { color: #6ec99a; }
.tone-text-d2 { color: #c5d15a; }
.tone-text-d3 { color: #F9C80E; }
.tone-text-d4 { color: #F27F2A; }
.tone-text-d5 { color: #FF4D5A; }

.end-note {
  margin: 28px 16px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
}

:focus-visible {
  outline: 2px solid var(--muted);
  outline-offset: 1px;
}

/* The hand filter matches the site's labeled controls and inputs. */
.hand-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 8px;
  color: var(--dim);
  font-family: var(--font-display);
  font-size: 12px;
}

.hand-filter input {
  width: min(240px, 70vw);
  padding: 5px 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
}

.hand-filter input:focus {
  outline: none;
  border-color: var(--muted);
}

/* Matches the raise/bet tone on solver action tiles. */
.hand-clear {
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--raise);
  border-radius: var(--radius);
  background: var(--raise);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 12px;
  cursor: pointer;
  transition: filter 0.12s ease;
}

.hand-clear:hover {
  filter: brightness(1.12);
}

#tiles { flex: 0 0 auto; }

#detail {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}

.detail-label {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.1;
}

.detail-title,
.detail-combo {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

/* The closed box is one line.
   A fixed height pushes the hand list off the draw page.
   An open box uses its text height and leaves room for the hands. */
.suit-box {
  flex: 0 0 auto;
  min-height: 0;
  overflow: auto;
}

#detail.is-suited .suit-box {
  flex: 0 1 auto;
  max-height: calc(100% - 148px);
}

.hand-list {
  flex: 1 1 auto;
  min-height: 72px;
  overflow: auto;
}

#detail.is-suited .hand-list {
  flex: 1 1 0;
}

.hand-row {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  width: 100%;
  height: 24px;
  margin: 0 0 1px;
  padding: 0 6px;
  border: 0;
  border-radius: 0;
  background: var(--bg-1);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.hand-row.is-empty { color: var(--dim); }
.hand-label {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
}
.hand-bar {
  display: block;
  height: 10px;
  border-radius: 0;
  background: var(--empty);
}
.hand-count {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.suit-case {
  background: var(--bg-1);
  border: 1px solid var(--bg-3);
  border-radius: 0;
  padding: 5px 8px;
  margin-top: 4px;
}

.suit-case-name {
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.suit-sub { margin-top: 2px; }
.suit-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.suit-pair .suit-sub { margin-top: 0; }
.suit-note { margin: 2px 0 0; color: var(--muted); font-size: 11px; }

.pips { display: flex; flex-wrap: wrap; gap: 3px; margin: 2px 0; }

.pip {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}

.pip.s-h, .pip.s-d { color: #ff5a6a; }
.pip.s-c, .pip.s-s { color: #f0f0f0; }
.pip-suit { font-size: 12px; }
.pip.is-off {
  margin-left: 4px;
  padding: 1px 3px;
  border-radius: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.pips .pip.is-off:first-child {
  margin-left: 0;
  margin-right: 4px;
}

@media (max-width: 720px) {
  .app { height: auto; min-height: 100vh; }
  .workspace { grid-template-columns: 1fr; }
  .board, .inspector { overflow: visible; }
  .suit-pair { grid-template-columns: 1fr; }
}
