/* Amplified Industries lunch & learn quiz — style tokens mirror the dashboard
   (Inter, brand blue #0092FF, outlined surfaces, 16px card radius, no shadows). */

:root {
  --brand: #0092ff;
  --primary: #42a5f5;
  --secondary: #ffa726;
  --good: #66bb6a;
  --bad: #ef5350;
  --bg: #fafafa;
  --paper: #ffffff;
  --text: rgba(0, 0, 0, 0.87);
  --text2: rgba(0, 0, 0, 0.6);
  --border: rgba(0, 0, 0, 0.15);
  --divider: rgba(0, 0, 0, 0.12);
  --hover: rgba(0, 0, 0, 0.04);
}
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #64b5f6;
    --secondary: #ffb74d;
    --good: #81c784;
    --bad: #e57373;
    --bg: #060606;
    --paper: #191919;
    --text: rgba(255, 255, 255, 0.92);
    --text2: rgba(255, 255, 255, 0.65);
    --border: rgba(255, 255, 255, 0.15);
    --divider: rgba(255, 255, 255, 0.12);
    --hover: rgba(255, 255, 255, 0.06);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
a { color: var(--brand); }
textarea {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 10px 12px; width: 100%; min-height: 70px; resize: vertical;
}
textarea:focus { outline: none; border-color: var(--brand); }
label.field { display: block; font-size: 13px; color: var(--text2); }
label.field > input, label.field > select, label.field > textarea { margin-top: 4px; }
label.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); }
label.check input { width: auto; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100dvh;
}

.wrap { max-width: 640px; margin: 0 auto; padding: 16px 16px 48px; }
.wrap.wide { max-width: 860px; }

header.top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 12px 0 20px;
}
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand .word { font-weight: 600; letter-spacing: 0.02em; color: var(--brand); font-size: 15px; }
.brand .sub { font-size: 12px; color: var(--text2); }

.card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 14px;
}

h1 { font-size: 22px; font-weight: 600; margin-bottom: 6px; }
h2 { font-size: 16px; font-weight: 600; margin-bottom: 10px; }
.muted { color: var(--text2); font-size: 13px; }
.big { font-size: 20px; font-weight: 600; }

button {
  font: inherit; font-weight: 500; letter-spacing: 0.01em;
  border-radius: 6px; border: 1px solid var(--border);
  background: var(--paper); color: var(--text);
  padding: 8px 14px; cursor: pointer;
  transition: all 150ms ease;
  -webkit-tap-highlight-color: transparent;
}
button:hover { background: var(--hover); }
button:disabled { opacity: 0.45; cursor: default; }
button.primary {
  background: var(--brand); border-color: var(--brand); color: #fff;
}
button.primary:hover { filter: brightness(1.1); background: var(--brand); }
button.danger { color: var(--bad); border-color: var(--bad); }
button.small { padding: 4px 10px; font-size: 13px; }

input, select {
  font: inherit; color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 10px 12px;
  transition: border-color 150ms ease;
  width: 100%;
}
input:focus, select:focus { outline: none; border-color: var(--brand); }
input.answer-input { font-size: 24px; font-weight: 600; text-align: center; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.center { text-align: center; }

.name-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--hover); border: 1px solid var(--divider);
  border-radius: 999px; padding: 6px 14px; font-weight: 500;
}

.countdown {
  font-variant-numeric: tabular-nums;
  font-size: 34px; font-weight: 700; text-align: center;
  color: var(--brand);
}
.countdown.hurry { color: var(--bad); }
.timerbar { height: 6px; border-radius: 3px; background: var(--divider); overflow: hidden; margin-top: 8px; }
.timerbar > div { height: 100%; background: var(--brand); border-radius: 3px; transition: width 300ms linear; }

.question-text { font-size: 19px; font-weight: 600; line-height: 1.4; margin-bottom: 4px; }
.subtitle { color: var(--text2); font-size: 13px; line-height: 1.45; margin-bottom: 3px; }
.unit-tag { color: var(--text2); font-size: 13px; margin-top: 4px; }

/* alternate-unit questions: pick which unit you're typing in */
.unit-toggle { display: flex; justify-content: center; }
.unit-toggle button { border-radius: 0; min-width: 76px; }
.unit-toggle button:first-child { border-radius: 6px 0 0 6px; }
.unit-toggle button:last-child { border-radius: 0 6px 6px 0; border-left: none; }
.unit-toggle button.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.who-answered { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.who-answered span {
  font-size: 12px; background: var(--hover);
  border-radius: 999px; padding: 2px 10px; border: 1px solid var(--divider);
}

.err { color: var(--bad); font-size: 13px; min-height: 18px; }

/* deliberately hard to read from a neighbor's seat */
.subtle { opacity: 0.35; font-size: 11px; }

.plot-box { overflow-x: auto; }
.plot-box svg { display: block; width: 100%; height: auto; }

/* explanation under the real answer (mini-markdown: paragraphs, lists, code) */
.explanation { margin-top: 8px; line-height: 1.5; }
.explanation p { margin-bottom: 8px; }
.explanation p:last-child { margin-bottom: 0; }
.explanation ul { margin: 0 0 8px 4px; padding-left: 18px; }
.explanation li { margin-bottom: 3px; }
.explanation code {
  font-family: ui-monospace, Consolas, monospace; font-size: 0.9em;
  background: var(--hover); border: 1px solid var(--divider);
  border-radius: 4px; padding: 0 4px;
}

/* optional per-question insight plot shown with the results */
.insight-plot { display: block; width: 100%; height: auto; margin-top: 12px; border-radius: 8px; }

.badge {
  display: inline-block; border-radius: 999px; padding: 3px 12px;
  font-weight: 600; font-size: 14px; border: 1px solid transparent;
}
.badge.calibrated { background: rgba(102, 187, 106, 0.15); color: var(--good); border-color: var(--good); }
.badge.optimist { background: rgba(66, 165, 245, 0.15); color: var(--primary); border-color: var(--primary); }
.badge.pessimist { background: rgba(255, 167, 38, 0.15); color: var(--secondary); border-color: var(--secondary); }

table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list td, table.list th { padding: 7px 8px; text-align: left; border-bottom: 1px solid var(--divider); }
table.list th { color: var(--text2); font-weight: 500; font-size: 12px; }
table.list td.num, table.list th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.me td { background: rgba(0, 146, 255, 0.08); }

.rank-1 { font-size: 17px; font-weight: 700; }
.medal { width: 26px; display: inline-block; }

.q-item { padding: 12px; border: 1px solid var(--divider); border-radius: 8px; margin-bottom: 8px; }
.q-item .q-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.q-item.asked { opacity: 0.6; }

.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

footer { text-align: center; color: var(--text2); font-size: 11px; padding-top: 24px; }
