:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #090b0a;
  color: #f3f5f2;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  min-height: 100vh;
  background: #090b0a;
}

button { font: inherit; }

.dashboard {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 48px 1fr;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 18px;
  border-bottom: 1px solid #2a2e2b;
  background: #101311;
}

.brand {
  color: #d9ded9;
  font-size: 12px;
  font-weight: 750;
}

.run-state {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #aeb6af;
  font-size: 11px;
  font-weight: 700;
}

.run-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #46d17d;
  box-shadow: 0 0 0 3px rgba(70, 209, 125, 0.12);
}

.run-dot.finished { background: #8d9690; box-shadow: none; }
.run-dot.error { background: #f35d62; box-shadow: 0 0 0 3px rgba(243, 93, 98, 0.12); }

#video-time {
  justify-self: end;
  color: #939b95;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.tables {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(var(--auto-columns, 3), minmax(0, 1fr));
  grid-template-rows: repeat(var(--auto-rows, 2), minmax(220px, 1fr));
  gap: 1px;
  background: #292d2a;
}

.table-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 42px 28px 28px;
  background: #111512;
  overflow: hidden;
}

.table-slot-empty {
  min-width: 0;
  min-height: 0;
  background: #090b0a;
}

.table-panel[data-tone="check_call"] { background: #101713; }
.table-panel[data-tone="raise"] { background: #18150e; }
.table-panel[data-tone="fold"] { background: #181011; }

.table-label {
  position: absolute;
  top: 15px;
  left: 17px;
  color: #8e9690;
  font-size: 11px;
  font-weight: 750;
}

.history-button {
  position: absolute;
  top: 16px;
  right: 17px;
  width: 13px;
  height: 13px;
  padding: 0;
  border: 1px solid #788079;
  border-radius: 50%;
  background: #202521;
  cursor: pointer;
}

.history-button:hover,
.history-button:focus-visible {
  border-color: #ffffff;
  background: #e5e9e5;
  outline: none;
}

.history-button:disabled { opacity: 0.25; cursor: default; }

.answer {
  width: 100%;
  text-align: center;
}

.answer-main {
  color: #f4f6f4;
  font-size: clamp(26px, 3.2vw, 54px);
  line-height: 1.05;
  font-weight: 820;
  overflow-wrap: anywhere;
}

.table-panel[data-tone="check_call"] .answer-main { color: #72e19d; }
.table-panel[data-tone="raise"] .answer-main { color: #f2c969; }
.table-panel[data-tone="fold"] .answer-main { color: #ff777b; }

.answer-sub {
  min-height: 18px;
  margin-top: 12px;
  color: #8f9891;
  font-size: 12px;
  line-height: 1.4;
}

.answer-sub.blocked { color: #e18487; }

dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid #3a403b;
  border-radius: 6px;
  background: #121512;
  color: #f3f5f2;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.55);
}

dialog::backdrop { background: rgba(0, 0, 0, 0.72); }

.dialog-head {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid #303530;
  background: #121512;
}

.dialog-kicker { color: #8d958f; font-size: 11px; font-weight: 750; }

h2 { margin: 3px 0 0; font-size: 21px; }

.icon-button {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #b9c0ba;
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
}

.icon-button:hover { color: #ffffff; }

.history-body { padding: 18px 20px 24px; overflow: auto; }

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 18px;
  background: #303530;
  border: 1px solid #303530;
}

.fact { padding: 11px 12px; background: #171b18; }
.fact-label { display: block; color: #868e88; font-size: 10px; }
.fact-value { display: block; margin-top: 4px; font-weight: 720; overflow-wrap: anywhere; }

.line-title { margin: 0 0 9px; color: #929b94; font-size: 11px; font-weight: 750; }

.action-line {
  display: grid;
  grid-template-columns: 54px 72px 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 9px 0;
  border-top: 1px solid #272c28;
  font-size: 13px;
}

.action-street { color: #777f79; font-size: 10px; }
.action-seat { color: #b5bcb6; font-family: "Cascadia Mono", Consolas, monospace; }
.action-move { color: #f0f2f0; }
.empty-history { color: #7f8881; padding: 14px 0; }

@media (max-width: 900px) {
  .tables {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(190px, 1fr));
  }
  .answer-main { font-size: clamp(25px, 6vw, 42px); }
}

@media (max-width: 560px) {
  .dashboard { grid-template-rows: 44px 1fr; }
  .topbar { padding: 0 12px; }
  .tables { grid-template-columns: 1fr; grid-template-rows: none; }
  .table-panel { min-height: 180px; }
  .facts { grid-template-columns: 1fr; }
}
