/* Eloquence Trap drill — tool-specific styles.
 * The shared design system in /style.css handles header, palette, layout.
 * This file does: scoreboard, the two-card drill stage, the reveal panel,
 * the real-case "receipt", and the finale.
 * Colours come from the shared CSS variables — never hard-coded.
 */

/* ── per-audience subtitle (swaps with the audience chip) ───── */
.aud-subtitle {
  font-size: 17px;
  line-height: 1.5;
  font-weight: 500;
  color: var(--text);
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 10px 16px;
  border-radius: 0 8px 8px 0;
  margin: 0 0 22px;
  max-width: 760px;
}
.aud-subtitle:empty { display: none; }
@media (max-width: 640px) { .aud-subtitle { font-size: 15px; } }

/* ── scoreboard ─────────────────────────────────────────────── */

.scoreboard {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: center;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 18px;
}
.scoreboard .stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.scoreboard .stat .v {
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--accent);
  font-weight: 600;
}
.scoreboard .stat .k {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.scoreboard .spacer { flex: 1; }
.scoreboard .reset {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.scoreboard .reset:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

/* ── round header ───────────────────────────────────────────── */

.round-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
}
.round-head .topic {
  font-size: 16px;
  color: var(--text);
  font-weight: 600;
}
.round-head .topic .lead-in {
  color: var(--text-dim);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-right: 8px;
}
.round-head .counter {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
}
.round-head .counter b { color: var(--accent); }

.prompt-line {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 16px;
}
.prompt-line strong { color: var(--text); }

/* ── the two-card stage ─────────────────────────────────────── */

.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 720px) {
  .cards { grid-template-columns: 1fr; }
}

.drill-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 20px 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.15s ease, transform 0.15s ease,
    box-shadow 0.15s ease;
  min-height: 200px;
}
.drill-card[aria-disabled="false"]:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.drill-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.drill-card[aria-disabled="true"] { cursor: default; }
.drill-card[aria-disabled="true"]:hover { transform: none; }

.drill-card .card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.drill-card .card-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-family: var(--font-mono);
}
.drill-card .msg-badge {
  font-size: 11px;
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.drill-card .msg-badge.good,
.drill-card .msg-badge.bad { opacity: 1; }
.drill-card .msg-badge.good {
  color: var(--green);
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.4);
}
.drill-card .msg-badge.bad {
  color: var(--red);
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.drill-card .msg-body {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  flex: 1;
  /* quote styling — these are draft messages to a client */
  border-left: 3px solid var(--border);
  padding-left: 14px;
  font-style: normal;
}
.drill-card .send-hint {
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 6px;
}
.drill-card[aria-disabled="true"] .send-hint { visibility: hidden; }

/* answered states */
.drill-card.is-fabricated {
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(239, 68, 68, 0.06);
}
.drill-card.is-fabricated .msg-body { border-left-color: var(--red); }
.drill-card.is-accurate {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.05);
}
.drill-card.is-accurate .msg-body { border-left-color: var(--green); }
.drill-card.is-picked::after {
  content: "you'd send this";
  position: absolute;
  top: -10px;
  right: 14px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  background: var(--accent);
  color: var(--bg);
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 700;
}

/* ── reveal panel ───────────────────────────────────────────── */

.reveal {
  margin-top: 20px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.reveal.show {
  opacity: 1;
  transform: translateY(0);
}

.verdict {
  font-size: 16px;
  line-height: 1.55;
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 14px;
  color: var(--text);
}
.verdict .tag { font-weight: 700; margin-right: 6px; }
.verdict.win {
  background: rgba(34, 197, 94, 0.08);
  border-left: 3px solid var(--green);
}
.verdict.win .tag { color: var(--green); }
.verdict.lose {
  background: rgba(239, 68, 68, 0.08);
  border-left: 3px solid var(--red);
}
.verdict.lose .tag { color: var(--red); }

.flaw {
  padding: 16px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-muted);
}
.flaw .lbl {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
}

/* ── receipt (the real-world case) ──────────────────────────── */

.receipt {
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  margin-bottom: 18px;
}
.receipt .receipt-kicker {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: var(--font-mono);
  margin-bottom: 6px;
}
.receipt h4 {
  margin: 0 0 12px;
  font-size: 17px;
  color: var(--text);
  font-weight: 600;
  line-height: 1.35;
}
.receipt .receipt-body {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-muted);
}
.receipt .receipt-lesson {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}
.receipt .receipt-lesson strong { color: var(--accent); }
.receipt .receipt-source {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* ── next / continue row ────────────────────────────────────── */

.continue-row {
  display: flex;
  justify-content: flex-end;
}
.btn-next {
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  padding: 11px 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: filter 0.15s ease, transform 0.15s ease;
}
.btn-next:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* ── finale ─────────────────────────────────────────────────── */

.finale {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 36px 32px;
  text-align: center;
}
.finale h2 {
  margin: 0 0 18px;
  font-size: 26px;
  color: var(--text);
}
.finale-score {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 18px;
}
.finale-score .big {
  font-family: var(--font-mono);
  font-size: 44px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.finale-score .lbl {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.finale-verdict {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  max-width: 620px;
  margin: 0 auto 14px;
}
.finale-verdict em { color: var(--accent); font-style: normal; font-weight: 600; }
.finale-canon {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 24px;
}
.finale .btn-next { display: inline-block; }

/* ── explainer (collapsible) — matches tokenizer convention ─── */

.explainer {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 22px;
  margin-top: 22px;
}
.explainer summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  color: var(--accent);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.explainer summary::before {
  content: "▸";
  display: inline-block;
  transition: transform 0.15s ease;
  color: var(--text-muted);
  font-size: 12px;
}
.explainer[open] summary::before { transform: rotate(90deg); }
.explainer .body {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.65;
}
.explainer .body h3 {
  color: var(--text);
  margin: 18px 0 6px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.explainer .body p { margin: 0 0 10px; }

.loading {
  color: var(--text-dim);
  font-style: italic;
  font-family: var(--font-mono);
  font-size: 13px;
}

[hidden] { display: none !important; }
