/* ── Best Local Eats — warm bistro chalkboard theme ─────────────────
   Charcoal-green board, butcher-paper cards, tomato red + mustard
   accents, serif menu typography. Hand-coded. */

:root {
  --board: #1e2a24;
  --board-2: #24332c;
  --chalk-line: rgba(240, 234, 214, 0.16);
  --paper: #f6efe0;
  --paper-2: #efe5cf;
  --ink: #2c241b;
  --ink-soft: #6f6353;
  --chalk: #f0ead6;
  --chalk-soft: #b9c4b4;
  --tomato: #d1493f;
  --tomato-dark: #b03a31;
  --mustard: #dfa528;
  --err: #d1493f;
  --font-display: 'Playfair Display', serif;
  --font-body: 'Karla', sans-serif;
}

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

.hidden { display: none !important; }

body {
  font-family: var(--font-body);
  background-color: var(--board);
  background-image:
    radial-gradient(90% 60% at 50% 0%, rgba(240, 234, 214, 0.05), transparent 70%),
    repeating-linear-gradient(90deg, transparent 0 90px, rgba(240, 234, 214, 0.012) 90px 92px);
  color: var(--chalk);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

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

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

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 70px 0 48px;
  border-bottom: 1px solid var(--chalk-line);
}

.est {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--mustard);
  margin-bottom: 18px;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.8rem, 9vw, 4.6rem);
  line-height: 1.04;
  color: var(--chalk);
}

.hero h1 em { color: var(--tomato); font-style: italic; }

.hero-rule {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 320px;
  margin: 18px auto;
  color: var(--mustard);
}

.hero-rule::before,
.hero-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--chalk-line);
}

.hero .sub {
  max-width: 560px;
  margin: 0 auto;
  color: var(--chalk-soft);
  font-size: 1.05rem;
}

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

.round-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 6vw, 2.7rem);
  color: var(--chalk);
}

.round-sub { color: var(--chalk-soft); font-size: 0.95rem; margin-top: 6px; }
.round-dates { color: var(--mustard); 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: var(--paper);
  color: var(--ink);
  border-radius: 6px;
  padding: 18px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
  position: relative;
}

.matchup::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1.5px solid rgba(44, 36, 27, 0.18);
  border-radius: 3px;
  pointer-events: none;
}

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

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

.song-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 13px 16px;
  background: var(--paper-2);
  border: 1.5px solid rgba(44, 36, 27, 0.25);
  border-radius: 4px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.song-btn .disc {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--mustard);
  border: 2px solid rgba(44, 36, 27, 0.4);
}

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

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

.song-btn.is-picked {
  background: var(--tomato);
  border-color: var(--tomato-dark);
  color: var(--paper);
}

.song-btn.is-picked .disc { background: var(--paper); }

.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; position: relative; }

.result-line { position: relative; }

.result-fill {
  position: absolute;
  inset: 0;
  border-radius: 4px;
  background: rgba(223, 165, 40, 0.3);
  width: 0%;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.result-line.is-pick .result-fill { background: rgba(209, 73, 63, 0.28); }

.result-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border: 1.5px solid rgba(44, 36, 27, 0.3);
  border-radius: 4px;
  font-weight: 700;
  color: var(--ink);
}

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

.result-pct { font-weight: 700; }

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

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

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

/* ── Results banner ───────────────────────────────────────────────── */
.results-banner {
  display: flex;
  gap: 16px;
  align-items: center;
  background: var(--paper);
  color: var(--ink);
  border-radius: 6px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
  padding: 20px 22px;
  margin-bottom: 26px;
}

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

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

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

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

.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.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--chalk-soft);
  margin-bottom: 6px;
}

.tree-slot {
  background: transparent;
  border: 1px solid var(--chalk-line);
  border-radius: 4px;
  padding: 7px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--chalk);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.tree-slot.is-empty { border-style: dashed; color: rgba(185, 196, 180, 0.5); }
.tree-slot.is-winner { border-color: var(--mustard); color: var(--mustard); }
.tree-slot.is-champ {
  background: var(--tomato);
  border-color: var(--tomato-dark);
  color: var(--paper);
  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: 1rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 15px 40px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
  line-height: 1.2;
}

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

.btn-primary {
  background: var(--tomato);
  color: var(--paper);
  box-shadow: 0 12px 28px rgba(209, 73, 63, 0.35);
}

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

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
  flex-shrink: 0;
  text-align: center;
  padding: 26px 20px;
  color: var(--chalk-soft);
  font-size: 0.85rem;
  border-top: 1px solid var(--chalk-line);
}

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

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