/* ── Mascot Madness — comic-book pep rally theme ────────────────────
   Electric purple + highlighter yellow, halftone dots, thick black
   outlines, tilted action cards, comic display type. Hand-coded. */

:root {
  --purple: #5b2ec2;
  --purple-deep: #3e1e87;
  --yellow: #f6f23a;
  --yellow-deep: #e0d51c;
  --paper: #fdfbf4;
  --black: #17141f;
  --pink: #ff5fa2;
  --cyan: #35d5e5;
  --err: #e0344a;
  --font-display: 'Bangers', cursive;
  --font-body: 'Mulish', sans-serif;
}

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

.hidden { display: none !important; }

body {
  font-family: var(--font-body);
  background-color: var(--purple);
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1.5px, transparent 1.6px);
  background-size: 18px 18px;
  color: var(--black);
  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; }

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

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero { position: relative; text-align: center; padding: 78px 0 46px; color: #fff; }

.burst {
  position: absolute;
  top: 34px;
  right: 8%;
  width: 92px;
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pink);
  clip-path: polygon(50% 0%, 61% 20%, 82% 9%, 80% 32%, 100% 38%, 85% 55%, 98% 72%, 75% 72%, 68% 95%, 50% 78%, 32% 95%, 25% 72%, 2% 72%, 15% 55%, 0% 38%, 20% 32%, 18% 9%, 39% 20%);
  transform: rotate(12deg);
}

.burst span { font-family: var(--font-display); font-size: 1.3rem; color: #fff; transform: rotate(-8deg); }

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(3rem, 11vw, 5.6rem);
  line-height: 0.92;
  letter-spacing: 0.02em;
  text-shadow: 4px 4px 0 var(--black);
}

.hero h1 .mega {
  color: var(--yellow);
  display: inline-block;
  transform: rotate(-2deg);
}

.hero .sub {
  max-width: 540px;
  margin: 20px auto 0;
  font-weight: 700;
  font-size: 1.06rem;
  color: rgba(255, 255, 255, 0.92);
}

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

.round-name {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6.5vw, 3rem);
  color: var(--yellow);
  text-shadow: 3px 3px 0 var(--black);
  letter-spacing: 0.03em;
}

.round-sub { color: rgba(255, 255, 255, 0.85); font-weight: 700; font-size: 0.95rem; margin-top: 6px; }
.round-dates { color: var(--yellow); font-weight: 900; font-size: 0.86rem; margin-top: 4px; }

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

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

.matchup {
  background: var(--paper);
  border: 4px solid var(--black);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 8px 8px 0 var(--black);
  transform: rotate(-0.6deg);
}

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

.match-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  color: #fff;
  background: var(--black);
  padding: 3px 14px;
  border-radius: 4px;
  margin-bottom: 12px;
  transform: rotate(-1.5deg);
}

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

.song-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 13px 16px;
  background: #fff;
  border: 3px solid var(--black);
  border-radius: 10px;
  font-family: inherit;
  font-weight: 900;
  font-size: 1.02rem;
  color: var(--black);
  cursor: pointer;
  transition: transform 0.1s ease, background 0.1s ease, box-shadow 0.1s ease;
}

.song-btn .disc {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid var(--black);
  background: var(--cyan);
}

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

.song-btn img { width: 42px; height: 42px; border-radius: 8px; border: 2px solid var(--black); object-fit: cover; flex-shrink: 0; }

.song-btn:hover { transform: translate(-1px, -2px); box-shadow: 3px 4px 0 var(--black); }

.song-btn.is-picked {
  background: var(--yellow);
  box-shadow: inset 0 0 0 3px #fff;
}

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

.vs-chip {
  align-self: center;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--purple);
  transform: rotate(-3deg);
}

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

.result-line { position: relative; }

.result-fill {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: rgba(53, 213, 229, 0.4);
  width: 0%;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.result-line.is-pick .result-fill { background: rgba(246, 242, 58, 0.75); }

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

.result-pct { font-family: var(--font-display); font-size: 1.15rem; letter-spacing: 0.04em; }

.pick-star {
  color: var(--purple);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.picks-status { font-weight: 900; color: #fff; margin-bottom: 14px; }

/* ── Results banner ───────────────────────────────────────────────── */
.results-banner {
  display: flex;
  gap: 16px;
  align-items: center;
  background: var(--paper);
  border: 4px solid var(--black);
  border-radius: 14px;
  box-shadow: 8px 8px 0 var(--black);
  padding: 20px 22px;
  margin-bottom: 28px;
}

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

.results-banner h3 { font-family: var(--font-display); font-size: 1.5rem; letter-spacing: 0.03em; }
.results-banner p { color: #5a5566; font-weight: 700; font-size: 0.94rem; }

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

.tree-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 5vw, 2.3rem);
  text-align: center;
  margin-bottom: 24px;
  color: #fff;
  text-shadow: 3px 3px 0 var(--black);
  letter-spacing: 0.04em;
}

.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-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--yellow);
  margin-bottom: 6px;
}

.tree-slot {
  background: var(--paper);
  border: 2.5px solid var(--black);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 165px;
}

.tree-slot.is-empty { border-style: dashed; background: rgba(253, 251, 244, 0.25); color: rgba(253, 251, 244, 0.8); }
.tree-slot.is-winner { background: var(--cyan); }
.tree-slot.is-champ {
  background: var(--yellow);
  font-family: var(--font-display);
  font-size: 0.95rem;
  text-align: center;
  letter-spacing: 0.04em;
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.06em;
  padding: 14px 42px;
  border: 4px solid var(--black);
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  line-height: 1.2;
}

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

.btn-primary {
  background: var(--yellow);
  color: var(--black);
  box-shadow: 6px 6px 0 var(--black);
}

.btn-primary:hover:not(:disabled) { box-shadow: 8px 9px 0 var(--black); }

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

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
  flex-shrink: 0;
  text-align: center;
  padding: 26px 20px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 700;
  font-size: 0.85rem;
  border-top: 3px solid var(--black);
  background: var(--purple-deep);
}

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

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