/* ThisOrThat styles — design tokens per the pipeline. */
:root {
  --bg: #0B0B0F;
  --surface: #121218;
  --border: #23232E;
  --text: #F5F5F7;
  --muted: #9A9AA5;
  --accent: #E5484D;
  --accent-soft: rgba(229, 72, 77, 0.14);
  --accent-border: rgba(229, 72, 77, 0.45);
  --radius: 14px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }

.site-header { padding: 44px 0 8px; }
.site-header h1 {
  margin: 0;
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.site-header h1::after {
  content: "";
  display: block;
  width: 64px;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
  margin-top: 12px;
}
.tagline { color: var(--muted); font-size: 17px; margin: 14px 0 0; max-width: 620px; }

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding: 28px 20px 40px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.panel h2 { margin: 0 0 16px; font-size: 20px; letter-spacing: -0.01em; }

.deck-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.deck-head h2 { margin: 0; }
.streak-line { color: var(--muted); font-size: 15px; margin: 0; font-weight: 600; }
.streak-line strong { color: var(--accent); }

.category-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.category-blurb { color: var(--muted); margin: 12px 0 0; font-size: 15px; }
.category-btn .count { color: var(--muted); font-size: 12px; font-weight: 600; margin-left: 2px; }
.category-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.category-btn.active .count { color: #ffd9da; }

.progress { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; margin: 24px 0 4px; }
.question-label { font-size: 26px; font-weight: 800; margin: 0; letter-spacing: -0.01em; }
.question-category { color: var(--accent); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin: 6px 0 0; }

.options { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: stretch; margin-top: 20px; }
.options-or {
  align-self: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.option-btn {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  min-height: 150px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  text-align: left;
  padding: 18px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, opacity 0.2s ease;
}
.option-btn:hover:not(:disabled) { border-color: var(--accent-border); }
.option-btn:disabled { cursor: default; }
.option-btn.picked { border-color: var(--accent); background: var(--accent-soft); }
.option-btn.dimmed { opacity: 0.45; }
.option-key {
  align-self: flex-start;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
}
.option-btn.picked .option-key { color: var(--accent); border-color: var(--accent-border); }
.option-text { font-size: 18px; font-weight: 600; line-height: 1.4; }
.option-pick { color: var(--accent); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.option-vote { display: flex; flex-direction: column; gap: 6px; }
.vote-track { display: block; height: 10px; background: var(--border); border-radius: 5px; overflow: hidden; }
.vote-fill { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 5px; transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1); }
.option-btn.dimmed .vote-fill { background: #5a5a66; }
.vote-number { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }

.deck-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.btn-next { flex: 1; min-width: 200px; padding: 14px 18px; font-size: 16px; }
.hint { color: var(--muted); font-size: 13px; margin: 14px 0 0; }
.status-message { color: var(--muted); font-size: 14px; margin: 12px 0 0; min-height: 20px; }

.deck-finished { text-align: center; padding: 28px 12px 8px; }
.finished-title { font-size: 26px; font-weight: 800; margin: 0 0 8px; }
.finished-text { color: var(--muted); font-size: 16px; margin: 0 0 8px; }
.deck-finished .deck-actions { justify-content: center; }

/* Share */
.share-text { font-size: 16px; margin: 0 0 18px; }
.card-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* History */
.history-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.history-head h2 { margin: 0; }
.history-list { list-style: none; margin: 16px 0 0; padding: 0; }
.history-list li { border-top: 1px solid var(--border); }
.history-list button {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  padding: 12px 2px;
  cursor: pointer;
}
.history-list button:hover .history-main { color: var(--accent); }
.history-main { font-weight: 600; }
.history-main .history-pick { color: var(--accent); }
.history-meta { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* Buttons */
.btn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.05s ease;
}
.btn:hover:not(:disabled) { border-color: var(--accent-border); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #f0565b; border-color: #f0565b; }
.btn-small { padding: 7px 12px; font-size: 13px; }
.btn-ghost { background: transparent; }

/* About + footer */
.about p { color: var(--muted); font-size: 15px; }
.about p:first-of-type { color: var(--text); }

.site-footer { border-top: 1px solid var(--border); padding: 22px 0 32px; color: var(--muted); font-size: 14px; }
.site-footer a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--accent-border); }
.site-footer a:hover { color: var(--accent); }
.site-footer p { margin: 4px 0; }

@media (max-width: 640px) {
  .site-header { padding-top: 32px; }
  .site-header h1 { font-size: 32px; }
  .panel { padding: 18px; }
  .options { grid-template-columns: 1fr; }
  .options-or { justify-self: center; }
  .option-btn { min-height: 0; }
  .btn-next { min-width: 0; }
  .question-label { font-size: 22px; }
  .vote-number { font-size: 22px; }
}
