/* ── Baby Name Battle — soft storybook nursery theme ────────────────
   Warm ivory, watercolor blush + sage, rounded serif display,
   scalloped cards, star & moon accents. Hand-coded. */

:root {
  --ivory: #fdf9f0;
  --ivory-2: #f8f1e3;
  --blush: #f3c5c9;
  --blush-deep: #e08e96;
  --sage: #b9cdb6;
  --sage-deep: #7fa07c;
  --ink: #4a4038;
  --ink-soft: #8d7f72;
  --gold: #d9b36a;
  --err: #d9736f;
  --font-display: 'Fraunces', serif;
  --font-body: 'Quicksand', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

.hidden { display: none !important; }

body {
  font-family: var(--font-body);
  background-color: var(--ivory);
  background-image:
    radial-gradient(48% 34% at 8% 4%, rgba(243, 197, 201, 0.35), transparent 70%),
    radial-gradient(44% 30% at 94% 10%, rgba(185, 205, 182, 0.4), transparent 70%);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

.wrap { width: 100%; max-width: 900px; margin: 0 auto; padding: 0 20px; }

main { flex: 1 0 auto; padding-bottom: 70px; }

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero { text-align: center; padding: 68px 0 30px; }

.stars {
  color: var(--gold);
  font-size: 1.3rem;
  letter-spacing: 0.6em;
  margin-bottom: 14px;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 8.5vw, 4.4rem);
  line-height: 1.05;
}

.hero h1 .script {
  display: block;
  color: var(--blush-deep);
  font-style: italic;
  font-weight: 600;
}

.hero .sub {
  max-width: 560px;
  margin: 18px auto 0;
  color: var(--ink-soft);
  font-size: 1.06rem;
  font-weight: 600;
}

/* ── Round headline ───────────────────────────────────────────────── */
.round-head { text-align: center; margin: 34px 0 28px; }

.round-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 5.5vw, 2.5rem);
}

.round-sub { color: var(--ink-soft); font-weight: 600; font-size: 0.95rem; margin-top: 6px; }
.round-dates { color: var(--sage-deep); font-weight: 700; font-size: 0.86rem; margin-top: 4px; }

/* ── Matchups ─────────────────────────────────────────────────────── */
.matchups { display: grid; grid-template-columns: 1fr; gap: 18px; }

@media (min-width: 720px) { .matchups { grid-template-columns: 1fr 1fr; } }

.matchup {
  background: #fff;
  border-radius: 22px;
  padding: 20px;
  border: 2px solid rgba(217, 179, 106, 0.35);
  box-shadow: 0 12px 30px rgba(74, 64, 56, 0.08);
  position: relative;
}

.matchup::after {
  content: '\2726';
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ivory);
  color: var(--gold);
  padding: 0 10px;
  font-size: 0.9rem;
}

.match-tag {
  display: block;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

.song-row { display: flex; flex-direction: column; gap: 10px; }

.song-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 16px;
  background: var(--ivory-2);
  border: 2px solid transparent;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.song-btn .disc {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--blush-deep);
  flex-shrink: 0;
}

.song-btn:nth-child(3) .disc { background: var(--sage-deep); }

.song-btn img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }

.song-btn:hover { transform: translateY(-2px); border-color: var(--blush); }

.song-btn.is-picked {
  background: linear-gradient(120deg, var(--blush), #f7dcde);
  border-color: var(--blush-deep);
}

.song-btn.is-dimmed { opacity: 0.45; }

.vs-chip {
  align-self: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* Result bars */
.result-pair { display: flex; flex-direction: column; gap: 10px; }

.result-line { position: relative; }

.result-fill {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(185, 205, 182, 0.5);
  width: 0%;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.result-line.is-pick .result-fill { background: rgba(243, 197, 201, 0.65); }

.result-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 20px;
  border: 2px solid rgba(74, 64, 56, 0.14);
  border-radius: 999px;
  font-weight: 700;
}

.result-content > span:first-child { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; }

.result-pct { font-weight: 700; color: var(--ink); }

.pick-star {
  color: var(--blush-deep);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-body);
}

/* ── Submit row ───────────────────────────────────────────────────── */
.submit-row { text-align: center; margin-top: 30px; }

.picks-status { font-weight: 700; color: var(--ink-soft); margin-bottom: 14px; }

/* ── Results banner ───────────────────────────────────────────────── */
.results-banner {
  display: flex;
  gap: 16px;
  align-items: center;
  background: #fff;
  border: 2px solid rgba(217, 179, 106, 0.35);
  border-radius: 22px;
  box-shadow: 0 12px 30px rgba(74, 64, 56, 0.08);
  padding: 20px 22px;
  margin-bottom: 26px;
}

.results-icon { font-size: 2.2rem; }

.results-banner h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; }
.results-banner p { color: var(--ink-soft); font-weight: 600; font-size: 0.94rem; }

/* ── Bracket tree ─────────────────────────────────────────────────── */
.tree-section { margin-top: 56px; }

.tree-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  text-align: center;
  margin-bottom: 24px;
}

.tree-scroll { overflow-x: auto; padding-bottom: 14px; -webkit-overflow-scrolling: touch; }

.tree { display: flex; gap: 26px; min-width: 660px; }

.tree-round { display: flex; flex-direction: column; justify-content: space-around; gap: 10px; flex: 1; }

.tree-round-label {
  text-align: center;
  font-weight: 700;
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.tree-slot {
  background: #fff;
  border: 1.5px solid rgba(74, 64, 56, 0.15);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.tree-slot.is-empty { border-style: dashed; color: var(--ink-soft); background: transparent; }
.tree-slot.is-winner { border-color: var(--sage-deep); background: rgba(185, 205, 182, 0.25); }
.tree-slot.is-champ {
  background: linear-gradient(120deg, var(--blush), var(--blush-deep));
  border-color: var(--blush-deep);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.95rem;
  text-align: center;
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 15px 40px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
  line-height: 1.2;
}

.btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn:focus-visible { outline: 3px solid var(--sage); outline-offset: 3px; }

.btn-primary {
  background: linear-gradient(120deg, var(--sage-deep), var(--sage));
  color: #fff;
  box-shadow: 0 12px 28px rgba(127, 160, 124, 0.4);
}

/* ── Toast ────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--err);
  color: #fff;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 700;
  z-index: 120;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
  max-width: 92vw;
  text-align: center;
}

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
  flex-shrink: 0;
  text-align: center;
  padding: 26px 20px;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.85rem;
  border-top: 2px dashed rgba(217, 179, 106, 0.4);
}

#wbx-powered-by-slot { margin-top: 12px; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
