/* ── 16-Team Voting Bracket — varsity athletics theme ───────────────
   White field, navy + athletic gold, slab-serif collegiate type,
   pennant stripes. Hand-coded. */

:root {
  --field: #f7f8fa;
  --navy: #14264c;
  --navy-2: #1d3567;
  --navy-soft: #5a6a8c;
  --gold: #f2b135;
  --gold-dark: #d69a1f;
  --white: #ffffff;
  --line: #dfe4ec;
  --err: #cf3d3d;
  --font-display: 'Alfa Slab One', serif;
  --font-body: 'Public Sans', sans-serif;
}

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

.hidden { display: none !important; }

body {
  font-family: var(--font-body);
  background: var(--field);
  color: var(--navy);
  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 {
  position: relative;
  text-align: center;
  padding: 72px 0 58px;
  background: var(--navy);
  color: var(--white);
  overflow: hidden;
}

.pennants {
  position: absolute;
  inset: auto 0 0 0;
  height: 14px;
  background: repeating-linear-gradient(-45deg, var(--gold) 0 16px, var(--white) 16px 32px, var(--navy-2) 32px 48px);
}

.hero::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  border: 26px solid rgba(242, 177, 53, 0.18);
}

.badge {
  display: inline-block;
  font-weight: 800;
  font-size: 0.74rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--navy);
  background: var(--gold);
  padding: 7px 20px;
  margin-bottom: 22px;
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 8px 100%, 0 50%);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 8.5vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.hero h1 .gold { color: var(--gold); }

.hero .sub {
  max-width: 540px;
  margin: 16px auto 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.04rem;
  font-weight: 600;
}

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

.round-name {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5.5vw, 2.6rem);
  text-transform: uppercase;
}

.round-sub { color: var(--navy-soft); font-weight: 600; font-size: 0.95rem; margin-top: 6px; }
.round-dates { color: var(--gold-dark); font-weight: 800; font-size: 0.86rem; margin-top: 4px; }

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

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

.matchup {
  background: var(--white);
  border: 2px solid var(--line);
  border-top: 6px solid var(--navy);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 10px 24px rgba(20, 38, 76, 0.07);
}

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

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

.song-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 13px 16px;
  background: var(--field);
  border: 2px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  font-weight: 800;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--navy);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.song-btn .disc {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  display: inline-block;
  position: relative;
}

.song-btn .disc::after {
  content: '';
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--gold);
}

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

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

.song-btn.is-picked {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

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

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

.vs-chip {
  align-self: center;
  font-family: var(--font-display);
  font-size: 0.78rem;
  color: var(--gold-dark);
  text-transform: uppercase;
}

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

.result-line { position: relative; }

.result-fill {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: rgba(20, 38, 76, 0.1);
  width: 0%;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.result-line.is-pick .result-fill { background: rgba(242, 177, 53, 0.35); }

.result-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border: 2px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.92rem;
  letter-spacing: 0.03em;
}

.result-pct { font-family: var(--font-display); font-size: 1rem; }

.pick-star {
  color: var(--gold-dark);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

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

/* ── Results banner ───────────────────────────────────────────────── */
.results-banner {
  display: flex;
  gap: 16px;
  align-items: center;
  background: var(--white);
  border: 2px solid var(--line);
  border-left: 8px solid var(--gold);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(20, 38, 76, 0.07);
  padding: 20px 22px;
  margin-bottom: 24px;
}

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

.results-banner h3 { font-family: var(--font-display); font-size: 1.3rem; text-transform: uppercase; }
.results-banner p { color: var(--navy-soft); font-weight: 600; font-size: 0.94rem; }

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

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

.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: 800;
  font-size: 0.64rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--navy-soft);
  margin-bottom: 6px;
}

.tree-slot {
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.tree-slot.is-empty { border-style: dashed; color: var(--navy-soft); background: transparent; }
.tree-slot.is-winner { border-color: var(--gold); background: rgba(242, 177, 53, 0.14); }
.tree-slot.is-champ {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 0.9rem;
  text-align: center;
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 16px 44px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
  line-height: 1.2;
}

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

.btn-primary {
  background: var(--gold);
  color: var(--navy);
  box-shadow: 0 12px 28px rgba(242, 177, 53, 0.4);
}

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

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

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

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