/* pages/demos.css: the four product demos. Demos need JavaScript, so the section only shows with it. */

.demo-section { display: none; }
.js .demo-section { display: block; }

.demo-frame {
  padding: var(--s-6);
  border-radius: var(--r-xl);
  background: var(--surface);
}

.demo-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-6);
  max-width: none;
  color: var(--text-2);
  font-weight: 600;
}

.demo-controls { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }
.demo-controls .button:disabled { opacity: 0.55; cursor: not-allowed; }

.demo-status { min-height: 1.6em; margin-top: var(--s-4); color: var(--text-2); }

/* Bracket walk-up */
.br-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-5);
  align-items: center;
}
.br-round { display: flex; flex-direction: column; gap: var(--s-3); }
.br-title { font-size: var(--small-size); font-weight: 700; color: var(--text-2); }
.br-list { display: grid; gap: var(--s-3); padding: 0; list-style: none; }
.br-match {
  display: grid;
  gap: 2px;
  padding: 4px;
  border-radius: var(--r-md);
  background: var(--canvas);
  border: 1px solid var(--rule);
}
.br-entrant {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 36px;
  padding: 0 var(--s-3);
  border-radius: var(--r-sm);
  font-weight: 600;
  transition: background-color var(--dur-ui) var(--ease-out);
}
.br-seed {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
}
.br-empty { color: var(--text-2); font-weight: 400; font-style: italic; }
.br-new { background: var(--tone); color: var(--on-tone); }
.br-new .br-seed { background: var(--canvas); color: var(--text); }

@media (max-width: 720px) {
  .br-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Dartboard */
.dart-layout {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--s-7);
  align-items: center;
}
.dart-board { width: 100%; max-width: 440px; height: auto; margin-inline: auto; cursor: crosshair; border-radius: 50%; touch-action: manipulation; }
.dart-board:focus-visible { outline-offset: 6px; }
.seg { stroke: var(--canvas); stroke-width: 1.2; transition: fill var(--dur-fast) var(--ease-out); }
.seg-single.seg-a { fill: var(--canvas); }
.seg-single.seg-b { fill: #E4E8F2; }
.seg-ring.seg-a { fill: var(--navy); }
.seg-ring.seg-b { fill: var(--ink-2); }
.seg-outer-bull { fill: var(--ink-2); }
.seg-bull { fill: var(--navy); }
.seg-aim { fill: var(--tint) !important; stroke: var(--link); stroke-width: 3; }
.seg-hit { fill: var(--tone) !important; }
.dart-number { fill: var(--text); font-family: var(--font-body); font-weight: 800; font-size: 15px; }

[data-theme="dark"] .seg-single.seg-b { fill: #1A2A66; }
[data-theme="dark"] .seg-ring.seg-a { fill: #F4F6FF; }
[data-theme="dark"] .seg-ring.seg-b { fill: #A9B4D9; }
[data-theme="dark"] .seg-outer-bull { fill: #A9B4D9; }
[data-theme="dark"] .seg-bull { fill: #F4F6FF; }

.dart-remaining { display: flex; flex-direction: column; }
.dart-remaining-label { color: var(--text-2); font-weight: 600; }
.dart-remaining-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--display-size);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.dart-darts { display: grid; gap: var(--s-2); margin-top: var(--s-5); padding: 0; list-style: none; }
.dart-dart {
  display: flex;
  justify-content: space-between;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: var(--canvas);
  font-weight: 600;
}
.dart-dart-empty { color: var(--text-2); font-weight: 400; }

@media (max-width: 900px) {
  .dart-layout { grid-template-columns: minmax(0, 1fr); gap: var(--s-5); }
}

/* Council */
.cn-question { font-weight: 800; font-size: var(--h3-size); line-height: var(--h3-lh); max-width: none; }
.cn-label { display: block; margin-bottom: var(--s-1); color: var(--text-2); font-size: var(--small-size); font-weight: 600; }
.cn-seats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); margin-top: var(--s-5); padding: 0; list-style: none; }
.cn-seat, .cn-judge {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  padding: var(--s-4);
  border-radius: var(--r-md);
  background: var(--canvas);
  border: 2px solid transparent;
  transition: border-color var(--dur-ui) var(--ease-out);
}
.cn-judge { margin-top: var(--s-3); }
.cn-done { border-color: var(--tone); }
.cn-seat-name { color: var(--text-2); font-size: var(--small-size); font-weight: 600; }
.cn-answer { font-weight: 800; font-size: 20px; }
.cn-meter { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s-2) var(--s-4); margin-top: var(--s-5); }
.cn-meter .cn-label { grid-column: 1 / -1; margin: 0; }
.cn-track { height: 16px; border-radius: var(--r-pill); background: var(--canvas); overflow: hidden; border: 1px solid var(--rule); }
.cn-fill { display: block; width: 0; height: 100%; border-radius: var(--r-pill); background: var(--tone-ink); transition: width 500ms var(--ease-out); }
.cn-value { font-weight: 800; font-variant-numeric: tabular-nums; }
.cn-disclaimer { margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--rule); color: var(--text-2); font-size: var(--small-size); }

@media (max-width: 720px) {
  .cn-seats { grid-template-columns: minmax(0, 1fr); }
}

/* Leaderboard */
.lb-table { width: 100%; max-width: 560px; border-collapse: separate; border-spacing: 0 6px; }
.lb-table th { padding: 0 var(--s-4); color: var(--text-2); font-size: var(--small-size); font-weight: 600; text-align: left; }
.lb-table td { padding: var(--s-3) var(--s-4); background: var(--canvas); font-weight: 600; }
.lb-table td:first-child { border-radius: var(--r-md) 0 0 var(--r-md); }
.lb-table td:last-child { border-radius: 0 var(--r-md) var(--r-md) 0; }
.lb-table .lb-num { text-align: right; font-variant-numeric: tabular-nums; }
.lb-rank { width: 3em; color: var(--text-2); }
.lb-up { color: var(--green-ink); }
.lb-down { color: var(--red-ink); }
