/* ── Dad Joke Duel — backyard-BBQ dad energy ────────────────────────
   Mustard + plaid red on cream, chunky rounded type, speech-bubble
   joke cards. Hand-coded. */

:root {
  --cream: #fbf5e9;
  --mustard: #e3a92c;
  --mustard-deep: #c78f16;
  --plaid: #c0392b;
  --plaid-deep: #9c2d21;
  --grass: #5a8f4f;
  --ink: #3a2f22;
  --ink-soft: #857459;
  --bubble: #ffffff;
  --err: #c0392b;
  --font-display: 'Chewy', cursive;
  --font-body: 'Figtree', sans-serif;
}

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

.hidden { display: none !important; }

body {
  font-family: var(--font-body);
  background-color: var(--cream);
  background-image:
    repeating-linear-gradient(0deg, transparent 0 34px, rgba(192, 57, 43, 0.05) 34px 36px),
    repeating-linear-gradient(90deg, transparent 0 34px, rgba(227, 169, 44, 0.07) 34px 36px);
  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: 880px; margin: 0 auto; padding: 0 20px; }

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

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

.badge {
  display: inline-block;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cream);
  background: var(--plaid);
  border-radius: 999px;
  padding: 8px 20px;
  margin-bottom: 20px;
  transform: rotate(-1.5deg);
  box-shadow: 3px 3px 0 rgba(58, 47, 34, 0.25);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 9.5vw, 4.8rem);
  line-height: 1.02;
  color: var(--ink);
}

.hero h1 .duel {
  color: var(--plaid);
  display: inline-block;
  transform: rotate(2deg);
  text-shadow: 3px 3px 0 var(--mustard);
}

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

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

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

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

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

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

.matchup {
  background: var(--mustard);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 6px 6px 0 rgba(58, 47, 34, 0.2);
}

.match-tag {
  display: block;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--ink);
  margin-bottom: 12px;
}

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

.song-btn {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  padding: 15px 18px;
  background: var(--bubble);
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}

/* speech-bubble tail */
.song-btn::after {
  content: '';
  position: absolute;
  bottom: -11px;
  left: 26px;
  width: 16px;
  height: 16px;
  background: inherit;
  border-right: 2.5px solid var(--ink);
  border-bottom: 2.5px solid var(--ink);
  transform: rotate(45deg) skew(8deg, 8deg);
}

.song-btn .disc { display: none; }

.song-btn img { display: none; }

.song-btn:hover { transform: translateY(-2px); }

.song-btn.is-picked {
  background: var(--grass);
  color: #fff;
}

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

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

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

.result-line { position: relative; }

.result-fill {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: rgba(90, 143, 79, 0.3);
  width: 0%;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.result-line.is-pick .result-fill { background: rgba(192, 57, 43, 0.25); }

.result-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  background: var(--bubble);
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.45;
}

.result-pct {
  font-family: var(--font-display);
  font-size: 1.1rem;
  flex-shrink: 0;
}

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

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

.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(--bubble);
  border: 2.5px solid var(--ink);
  border-radius: 18px;
  box-shadow: 6px 6px 0 rgba(58, 47, 34, 0.2);
  padding: 20px 22px;
  margin-bottom: 28px;
}

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

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

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

.tree-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  text-align: center;
  margin-bottom: 24px;
  color: var(--plaid);
}

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

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

.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;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.tree-slot {
  background: var(--bubble);
  border: 2px solid rgba(58, 47, 34, 0.35);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}

.tree-slot.is-empty { border-style: dashed; color: var(--ink-soft); background: transparent; }
.tree-slot.is-winner { border-color: var(--grass); background: rgba(90, 143, 79, 0.15); }
.tree-slot.is-champ {
  background: var(--plaid);
  border-color: var(--plaid-deep);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.85rem;
  text-align: center;
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  padding: 14px 34px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  line-height: 1.25;
  max-width: 100%;
}

.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(--grass); outline-offset: 3px; }

.btn-primary {
  background: var(--plaid);
  color: #fff;
  box-shadow: 5px 5px 0 rgba(58, 47, 34, 0.25);
}

/* ── Toast ────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--err);
  color: #fff;
  padding: 14px 26px;
  border-radius: 14px;
  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(--ink-soft);
  font-weight: 600;
  font-size: 0.85rem;
  border-top: 2.5px dashed rgba(58, 47, 34, 0.3);
}

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

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