/* Conformdle — mobile-first, vanilla CSS. Single column <= 480px; option grid
   becomes 2 columns at >= 400px. Both options share identical chrome. */
:root {
  --bg: #0f1220;
  --card: #1a1f33;
  --card-alt: #232948;
  --text: #e8eaf6;
  --muted: #9aa3c0;
  --accent: #6c8cff;
  --good: #3ddc84;
  --bad: #ff5c7a;
  --neutral: #8d93a8;
  --gold: #ffd166;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.4;
}
header { padding: 12px 16px 0; text-align: center; }
h1 { margin: 0; font-size: 1.6rem; letter-spacing: 0.5px; }
.tagline { margin: 2px 0 14px; color: var(--muted); font-size: 0.85rem; }
main { max-width: 560px; margin: 0 auto; padding: 8px 12px 48px; }

.pair-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  margin: 12px 0;
}
.pair-title { color: var(--muted); font-size: 0.8rem; margin: 0 0 10px; }
.options { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 400px) { .options { grid-template-columns: 1fr 1fr; } }

/* v1.3 (spec conformdle/005 D4/R9, pure CSS): desktop-class viewports get a
   wider main column and a per-option media size floor (≥360px). The .options
   grid is already 2-column at ≥400px, so at a 900px main width each column
   computes ≥360px → side-by-side with the floor satisfied. NO JS dimension
   logic anywhere; rules below 1024px are untouched (mobile byte-unchanged
   from v1.2). */
@media (min-width: 1024px) {
  main { max-width: 900px; }
  .option img, .option video, .option audio { min-width: 360px; }
}

.option {
  background: var(--card-alt);
  border: 1px solid #33395c;
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}
.option img, .option audio { width: 100%; border-radius: 8px; }
.option img, .option video {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.option video {
  /* v1.3 (D4): hybrid gif video options sit visually flush with images. */
  width: 100%;
  border-radius: 8px;
}
.option audio { height: 40px; }
.vote-btn {
  background: var(--accent);
  color: #0b0e1a;
  border: none;
  border-radius: 8px;
  padding: 10px 0;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}
.vote-btn:disabled { opacity: 0.45; cursor: default; }
.option.voted { border-color: var(--accent); }

.result { margin-top: 10px; }
.bar-wrap { background: #0b0e1a; border-radius: 6px; height: 18px; overflow: hidden; display: flex; }
.bar-a, .bar-b { height: 100%; transition: width 0.6s ease; }
.bar-a { background: var(--accent); }
.bar-b { background: #b26cff; }
.bar-labels { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.badge { display: inline-block; margin-top: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.badge.match { background: rgba(61, 220, 132, 0.15); color: var(--good); }
.badge.mismatch { background: rgba(255, 92, 122, 0.15); color: var(--bad); }
.badge.tie { background: rgba(141, 147, 168, 0.15); color: var(--neutral); }
.score-chip { display: inline-block; margin-top: 6px; margin-left: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; background: rgba(108, 140, 255, 0.15); color: var(--accent); }
/* First-picker result: gold-tinted, clearly distinct from normal results (R6). */
.result.first-picker {
  border: 1px solid var(--gold);
  background: rgba(255, 209, 102, 0.08);
  border-radius: var(--radius);
  padding: 10px;
}
.first-picker-header {
  color: var(--gold);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 8px;
}
.continue-btn { margin-top: 10px; background: var(--accent); color: #0b0e1a; border: none; border-radius: 8px; padding: 10px 24px; font-size: 1rem; font-weight: 700; cursor: pointer; }
.continue-btn:disabled { opacity: 0.45; cursor: default; }
.stage-notice { color: var(--bad); font-size: 0.85rem; margin-top: 8px; }

.summary-card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-top: 12px; }
.summary-card h2 { margin: 0 0 8px; }
.total-line { font-size: 1.4rem; font-weight: 700; }
.share-box {
  width: 100%;
  background: #0b0e1a;
  color: var(--text);
  border: 1px solid #33395c;
  border-radius: 8px;
  padding: 10px;
  font-family: inherit;
  white-space: pre-wrap;
  resize: vertical;
}
.copy-btn { margin-top: 8px; background: var(--accent); color: #0b0e1a; border: none; border-radius: 8px; padding: 8px 16px; font-weight: 700; cursor: pointer; }
.copy-feedback { margin-left: 8px; color: var(--good); font-size: 0.85rem; }

.pending { color: var(--muted); font-size: 0.85rem; margin-top: 6px; }
.error-banner { background: rgba(255, 92, 122, 0.15); color: var(--bad); border-radius: 8px; padding: 10px 12px; margin: 10px 0; }
.rate-limited { color: var(--bad); font-size: 0.85rem; margin-top: 6px; }
