/* ── Battle for the Candy Crown — Halloween theme ───────────────
   Purple → orange gradients, yellow accents, groovy display type,
   pumpkin basket motif, sticker-style cards. Hand-coded. */

:root {
  --bg-top: #6B21A8; /* deep purple */
  --bg-bottom: #EA580C; /* vibrant orange */
  --cream: #fff6ec;
  --ink: #2E1065;
  --ink-soft: #581C87;
  --accent: #FDE047; /* bright yellow */
  --accent-deep: #EAB308; /* deeper yellow */
  --pop: #F97316; /* another orange for text */
  --white: #ffffff;
  --err: #DC2626;
  --font-display: 'Righteous', cursive;
  --font-body: 'Nunito', sans-serif;
}

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

.hidden { display: none !important; }

body {
  font-family: var(--font-body);
  background: linear-gradient(175deg, var(--bg-top) 0%, var(--bg-bottom) 42%, var(--cream) 42.2%);
  color: var(--ink);
  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: 900px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }

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

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  text-align: center;
  padding: 74px 0 120px;
  overflow: hidden;
  color: var(--white);
}

.pumpkin-basket {
  position: absolute;
  left: 50%;
  bottom: -40px;
  transform: translateX(-50%);
  width: 320px;
  height: 320px;
  pointer-events: none;
  z-index: 0;
}

.pumpkin-basket img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.95;
  filter: drop-shadow(0 20px 30px rgba(0,0,0,0.4));
  mix-blend-mode: multiply;
}

.badge {
  display: inline-block;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  padding: 8px 22px;
  margin-bottom: 22px;
  backdrop-filter: blur(4px);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 9vw, 5rem);
  line-height: 1.02;
  text-shadow: 3px 4px 0 rgba(53, 32, 75, 0.4);
  position: relative;
}

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

.hero .sub {
  max-width: 540px;
  margin: 16px auto 0;
  font-size: 1.08rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.94);
  position: relative;
  text-shadow: 1px 2px 4px rgba(0,0,0,0.3);
}

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

.round-eyebrow {
  display: inline-block;
  font-weight: 800;
  font-size: 0.74rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--accent-deep);
  border-radius: 999px;
  padding: 6px 18px;
  box-shadow: 0 6px 18px rgba(234, 179, 8, 0.4);
}

.round-name {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3rem);
  margin-top: 12px;
  color: var(--ink);
}

.round-dates { color: var(--ink-soft); font-weight: 800; font-size: 0.95rem; margin-top: 4px; }

.round-instructions {
  max-width: 600px;
  margin: 14px auto 0;
  font-size: 1.05rem;
  color: var(--ink-soft);
  font-weight: 700;
}

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

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

.matchup {
  background: var(--white);
  border-radius: 18px;
  padding: 18px;
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 rgba(46, 16, 101, 0.18);
  transform: rotate(-0.4deg);
}

.matchup:nth-child(even) { transform: rotate(0.4deg); }

.match-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--bg-top);
  border-radius: 6px;
  padding: 3px 10px;
  margin-bottom: 12px;
}

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

.seed-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 13px 16px;
  background: var(--cream);
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  font-family: inherit;
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.seed-btn .disc {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent); /* Fallback */
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.seed-btn .disc::after {
  content: '🍬';
}

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

.seed-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 rgba(46, 16, 101, 0.15); }

.seed-btn.is-picked {
  background: var(--accent);
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--white);
}

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

.vs-chip {
  align-self: center;
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--bg-top);
}

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

.result-line { position: relative; }

.result-fill {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(253, 224, 71, 0.4), rgba(253, 224, 71, 0.12));
  width: 0%;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.result-line.is-pick .result-fill {
  background: linear-gradient(90deg, rgba(107, 33, 168, 0.4), rgba(234, 88, 12, 0.22));
}

.result-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  font-weight: 800;
}

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

.pick-star { color: var(--bg-top); font-size: 0.8rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }

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

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

/* ── Results banner ───────────────────────────────────────────────── */
.results-banner {
  display: flex;
  gap: 16px;
  align-items: center;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 6px 6px 0 rgba(46, 16, 101, 0.18);
  padding: 20px 22px;
  margin-bottom: 26px;
}

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

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

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

.tree-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4.5vw, 2.1rem);
  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: 640px; }

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

.tree-slot {
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 0.8rem;
  font-weight: 800;
  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 { background: var(--accent); }
.tree-slot.is-champ {
  background: linear-gradient(120deg, var(--bg-top), var(--bg-bottom));
  color: var(--white);
  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-display);
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  padding: 14px 34px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  line-height: 1.2;
}

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

.btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-deep));
  color: var(--ink);
  box-shadow: 5px 5px 0 rgba(46, 16, 101, 0.25);
}

.btn-big { font-size: 1.2rem; padding: 16px 44px; }

/* ── Toast ────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--err);
  color: #fff;
  padding: 14px 26px;
  border-radius: 12px;
  font-weight: 800;
  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(--ink-soft);
  font-weight: 700;
  font-size: 0.85rem;
  border-top: 3px dashed rgba(46, 16, 101, 0.2);
}

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

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