/* Flip Vote — styles. Mobile-first; the live 2026 build broke here (headline
   text-shadow duplicated as a second absolutely-positioned element, which
   overlapped illegibly once the title wrapped to two lines on narrow
   screens). This build uses a single text node with a CSS text-shadow for
   the layered look, so wrapping can never cause overlap. See REVIEW.md. */

:root {
  --ink: #0b0d14;
  --ink-soft: #161a26;
  --paper: #f1ece0;
  --paper-ink: #17141d;
  --accent: #d7ff3b;
  --accent-ink: #17190a;
  --a: #e42a5c;
  --a-dark: #7a1030;
  --b: #3b4ce6;
  --b-dark: #171b5c;
  --line: rgba(255, 255, 255, 0.14);
  --muted: rgba(255, 255, 255, 0.6);
  --font-display: "Anton", Impact, "Arial Narrow Bold", sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-body);
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.shell { display: flex; flex-direction: column; min-height: 100vh; }

/* ---------- header / footer bars ---------- */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
}
.bar--top { border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.bar--bottom { border-top: 1px solid var(--line); flex-wrap: wrap; color: var(--muted); }

.logo {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: #fff;
  white-space: nowrap;
}
.logo span { color: var(--accent); }

.matchup-no { margin: 0; color: var(--muted); order: 3; flex-basis: 100%; text-align: center; }
.streak { display: flex; align-items: center; gap: 6px; }
.streak strong { color: var(--accent); font-size: 14px; }

.link-btn {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--accent);
  text-decoration: none;
}

/* ---------- arena ---------- */
.arena {
  position: relative;
  padding: 40px 20px 32px;
  overflow: hidden;
  isolation: isolate;
}
.arena__bg { position: absolute; inset: 0; z-index: -1; display: flex; }
.arena__bg .side-a,
.arena__bg .side-b { flex: 1; }
.arena__bg .side-a { background: radial-gradient(120% 140% at 30% 20%, var(--a) 0%, var(--a-dark) 75%); }
.arena__bg .side-b { background: radial-gradient(120% 140% at 70% 20%, var(--b) 0%, var(--b-dark) 75%); }

.arena__head { text-align: center; margin-bottom: 28px; }
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  background: var(--ink);
  color: var(--accent);
  padding: 5px 10px;
  border-radius: 3px;
  margin-bottom: 14px;
}
.eyebrow--dark { background: var(--paper-ink); }

#headline {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  font-size: clamp(28px, 8vw, 56px);
  line-height: 1.05;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.35);
}
.sub {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.85);
}

.arena__fight {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  max-width: 1000px;
  margin: 0 auto;
}
.fighter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 10px;
  border-radius: 10px;
  transition: transform 0.15s ease, background 0.15s ease;
}
.fighter:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); }
.fighter:active:not(:disabled) { transform: scale(0.98); }
.fighter:disabled { cursor: default; }
.fighter__badge {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 3px solid #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 28px;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.3));
}
.fighter small {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.75);
}
.fighter b {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(22px, 6vw, 40px);
  line-height: 1.05;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
  text-align: center;
}
.fighter__pct {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(26px, 7vw, 42px);
  color: var(--accent);
}
.fighter--b .fighter__pct { color: #c8d0ff; }

.fighter.is-loser .fighter__badge { border-color: rgba(255, 255, 255, 0.35); opacity: 0.55; color: rgba(255, 255, 255, 0.5); }
.fighter.is-loser b { opacity: 0.45; }
.fighter.is-loser .fighter__pct { color: rgba(255, 255, 255, 0.45); }

.vs {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 3px solid var(--ink);
  border-radius: 50%;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
}

.result {
  max-width: 720px;
  margin: 24px auto 0;
  background: var(--ink);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.result p { margin: 0; }
#flipCount { color: var(--muted); }
.result__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 9px 12px;
  border-radius: 4px;
  white-space: nowrap;
}
.btn--accent { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn--ghost { background: transparent; border: 1px solid var(--line); color: #fff; }
.btn--accent:hover, .btn--ghost:hover { filter: brightness(1.08); }

/* ---------- vault ---------- */
.vault { background: var(--paper); color: var(--paper-ink); padding: 48px 20px; flex: 1; }
.vault__intro { max-width: 760px; margin: 0 auto 28px; }
.vault__intro h2 {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(26px, 6vw, 42px);
  line-height: 1.08;
  margin: 0 0 10px;
}
.vault__note { margin: 0; font-family: var(--font-mono); font-size: 13px; color: rgba(23, 20, 29, 0.65); }

.vault__list { max-width: 760px; margin: 0 auto; border-top: 2px solid var(--paper-ink); }
.vault__row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(70px, auto) 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 14px 4px;
  border-bottom: 1px solid rgba(23, 20, 29, 0.18);
  text-align: left;
}
.vault__row:hover { background: rgba(23, 20, 29, 0.05); }
.vault__row .cat { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; color: rgba(23, 20, 29, 0.55); text-transform: uppercase; }
.vault__row .pair { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 16px; font-weight: 500; }
.vault__row .pair .vs-mini { font-family: var(--font-mono); font-weight: 700; font-size: 11px; color: var(--a); }
.vault__row .go { font-family: var(--font-mono); font-size: 11px; color: rgba(23, 20, 29, 0.4); }
.vault__row.is-current { background: rgba(215, 255, 59, 0.35); }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 6px;
  z-index: 20;
}

/* ---------- breakpoints ---------- */
@media (max-width: 560px) {
  .arena__fight { grid-template-columns: 1fr; }
  .vs { justify-self: center; margin: 4px 0; }
  .fighter__badge { width: 68px; height: 68px; font-size: 22px; }
  .vault__row { grid-template-columns: 1fr; row-gap: 4px; }
  .vault__row .go { display: none; }
}

@media (min-width: 640px) {
  .bar { padding: 16px 32px; }
  .matchup-no { order: 0; flex-basis: auto; }
  .arena { padding: 56px 32px 44px; }
  .vault { padding: 72px 32px; }
}

@media (min-width: 900px) {
  .vault__row { grid-template-columns: 100px 1fr auto; }
}
