/* open-setlist-stash — Wappy Picks (Umphrey's McGee) theme
   Clean dark slate, single denim-blue accent.
   Mount via: THEME_FILE=themes/umphreys-mcgee.css */

/* Groovy display font for the site title / brand (jam-band personality). */
@import url("https://fonts.googleapis.com/css2?family=Righteous&display=swap");

:root {
  /* Slate dark — proven GitHub-dark foundation */
  --bg:           #0d1117;
  --surface:      #161b22;
  --surface-alt:  #1c2128;
  --border:       #30363d;
  --border-soft:  #21262d;

  /* Clear, high-contrast text */
  --text:         #e6edf3;
  --text-soft:    #8b949e;
  --text-mute:    #484f58;

  /* Single accent: denim blue — classic, muted, musical, high-contrast on slate */
  --accent:       #6f93c7;
  --accent-soft:  #11202f;
  --accent-deep:  #3b5b7f;

  --error:        #f85149;
  --error-soft:   #200e0e;
  --warn:         #d29922;

  --radius:       6px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.4);
  --shadow:       0 3px 12px rgba(0,0,0,0.5);
  --shadow-lg:    0 8px 24px rgba(0,0,0,0.6);
}

/* Belt-and-suspenders: hard-denim the brand/title wordmark so it never
   falls back to the platform default teal-green (#0e7c66) under any
   cascade/cache edge case. Hardcoded denim, not var(), on purpose. */
.brand,
.brand:link,
.brand:visited {
  color: #6f93c7 !important;
}
.brand:hover { color: #9bb6dc !important; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

::selection {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---- topbar ---- */

.topbar {
  background: #010409;
  border-bottom: 1px solid var(--border);
}

.brand {
  font-family: "Righteous", "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  font-size: 1.35rem;
  letter-spacing: 0.01em;
  color: var(--accent);
}
.brand:hover { color: #9bb6dc; }

.handle { color: var(--text-mute); }
.handle strong { color: var(--text-soft); }

.topbar nav a { color: var(--text-soft); }
.topbar nav a:hover { color: var(--text); }

/* ---- headings ---- */

h1 {
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2, h3 { color: var(--text); }
h3 { color: var(--text-soft); }

/* ---- links ---- */

a {
  color: var(--accent);
  text-decoration-color: rgba(111,147,199,0.3);
}
a:hover {
  color: #9bb6dc;
  text-decoration-color: rgba(155,182,220,0.5);
}

/* ---- cards ---- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: none;
}
.card:hover {
  border-color: var(--accent-deep);
  box-shadow: 0 0 0 1px var(--accent-deep);
}
.card.error-card {
  background: var(--error-soft) !important;
  border-color: var(--error) !important;
}

/* ---- button ---- */

.btn {
  background: var(--accent);
  border-color: var(--accent);
  color: #010409;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius);
  letter-spacing: 0;
  text-transform: none;
}
.btn:hover {
  background: #9bb6dc;
  border-color: #9bb6dc;
  color: #010409;
}

.btn + .btn {
  background: var(--surface-alt);
  color: var(--text-soft);
  border-color: var(--border);
}
.btn + .btn:hover {
  background: var(--surface-alt);
  color: var(--text);
  border-color: var(--text-mute);
}

/* ---- inputs ---- */

input[type="text"],
input[type="email"] {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border);
  border-radius: var(--radius);
}
input[type="text"]:focus,
input[type="email"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--bg);
}
input::placeholder { color: var(--text-mute); }

/* ---- fieldset / legend ---- */

fieldset {
  background: var(--surface);
  border-color: var(--border);
  border-radius: var(--radius);
}
legend { color: var(--text); }
label { color: var(--text-soft); }

/* ---- lock countdown ---- */

.lock {
  background: var(--accent-soft);
  border-left-color: var(--accent);
  color: var(--text);
}
.lock strong { color: var(--accent); background: none; }
#lock-countdown { color: var(--accent); }

/* ---- song picker ---- */

.song-picker-picked input.song-picker-title {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.song-picker-picked::after { color: var(--accent); }

/* ---- scope tabs ---- */

.scope-tabs { border-bottom-color: var(--border); }
.scope-tab { color: var(--text-soft); }
.scope-tab:hover { color: var(--text); }
.scope-tab.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.scope-key-list { color: var(--text-mute); }
.scope-key-list a { color: var(--text-soft); }
.scope-key-list a:hover { color: var(--accent); }

/* ---- leaderboard ---- */

table.leaderboard {
  background: var(--surface);
  border-color: var(--border);
}
table.leaderboard th {
  background: #010409;
  color: var(--text-soft);
  border-bottom-color: var(--border);
}
table.leaderboard td { border-bottom-color: var(--border-soft); }
table.leaderboard tbody tr:hover td { background: var(--surface-alt); }
table.leaderboard tr.is-me td { background: var(--accent-soft) !important; }
table.leaderboard tr.is-me td:first-child {
  border-left: 3px solid var(--accent);
  padding-left: calc(0.95rem - 3px);
}
table.leaderboard a { color: var(--text); text-decoration: none; }
table.leaderboard a:hover { color: var(--accent); }

/* ---- decorative ---- */

.me-tag {
  background: var(--accent);
  color: #010409;
}

.stamp {
  color: var(--text-mute);
  border-color: var(--border);
  background: var(--surface-alt);
}
.stamp.stamp-gold {
  background: #1c1800;
  color: var(--warn);
  border-color: #5a4500;
}
.stamp.stamp-teal,
.stamp.stamp-brick {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-deep);
}
.stamp.stamp-yellow {
  background: #1c1800;
  color: var(--warn);
  border-color: #5a4500;
}

.sticker {
  background: var(--accent-soft);
  color: var(--accent);
}

.patch {
  background: var(--accent);
  color: #010409;
  box-shadow: none;
}
.patch:hover { background: #9bb6dc; color: #010409; }

/* ---- error states ---- */

.error { color: var(--error); }
.error-card { background: var(--error-soft) !important; border-color: var(--error) !important; }
.error-card h2 { color: var(--error); }

/* ---- leagues ---- */

.league-name { color: var(--text); }
.league-name:hover { color: var(--accent); }
.member-list li { border-bottom-color: var(--border-soft); }
.member-list a { color: var(--text); }
.member-list a:hover { color: var(--accent); }
.claim-stub { color: var(--text-mute); }

/* ---- footer ---- */

.footer {
  color: var(--text-mute);
  border-top-color: var(--border);
}

/* ---- code ---- */

code {
  background: var(--surface-alt);
  color: var(--text);
  border-color: var(--border-soft);
}

/* ============================================================
   Home page: Google-like centered hero (Wappy Picks only)
   ------------------------------------------------------------
   Scoped to the home page via :has(#how-it-works) so predict /
   leaderboard / blog / league pages are untouched. The hero
   (brand title + tagline + primary CTA: handle entry / "Start
   playing" / "Make your picks") sits centered with generous
   whitespace ABOVE the "How it works" section.
   ============================================================ */

/* Tighten the column and breathe. Everything before #how-it-works
   is the hero; it gets centered. */
.content:has(#how-it-works) {
  max-width: 680px;
  margin-top: 4.5rem;
}

/* Brand title — the hero wordmark. Big, centered, Righteous.
   Clamp rebalanced for narrow screens + enlarged root fonts: a lower
   rem floor with more vw weight so the wordmark (incl. the 🎸 … 🤘
   emoji) scales down on a ~360–390px phone instead of being pinned by
   an oversized min. overflow-wrap guards against any single-token
   overflow if the user's base font is very large. */
.content:has(#how-it-works) > h1 {
  font-family: "Righteous", "IBM Plex Sans", -apple-system, sans-serif;
  font-weight: 400;
  font-size: clamp(1.7rem, 9vw, 4rem);
  text-align: center;
  letter-spacing: 0.005em;
  color: var(--accent);
  margin: 0 auto 0.35rem;
  line-height: 1.1;
  max-width: 100%;
  overflow-wrap: break-word;
}

/* Tagline directly under the wordmark. */
.content:has(#how-it-works) > p.muted {
  text-align: center;
  font-size: 1.02rem;
  color: var(--text-soft);
  margin: 0 auto 2.4rem;
  max-width: 34rem;
}

/* Logged-out: "Pick a handle" prompt + intro, centered. */
.content:has(#how-it-works) > h2 {
  text-align: center;
  font-size: 1.25rem;
  margin: 0 auto 0.4rem;
}
.content:has(#how-it-works) > p {
  text-align: center;
}

/* Logged-out: the sign-on form, centered as a tidy column. Fluid
   width so it never exceeds the content box on a narrow phone. */
.content:has(#how-it-works) > form {
  width: min(100%, 30rem);
  margin: 0.4rem auto 0;
}
.content:has(#how-it-works) > form fieldset {
  text-align: center;
  padding: 1.5rem 1.6rem 1.7rem;
}
.content:has(#how-it-works) > form legend {
  margin: 0 auto;
  float: none;
}
.content:has(#how-it-works) > form label {
  display: block;
  text-align: center;
  margin-bottom: 0.4rem;
}
.content:has(#how-it-works) > form input[type="text"] {
  display: block;
  width: 100%;
  max-width: 22rem;
  margin: 0 auto 1rem;
  text-align: center;
}
.content:has(#how-it-works) > form button.btn {
  display: inline-block;
  /* min-width is a desktop nicety; cap it to the available width so a
     large root font can't push the button past a narrow viewport. */
  min-width: min(12rem, 100%);
  max-width: 100%;
}

/* Logged-in: the welcome / upcoming-show card, centered hero card. */
.content:has(#how-it-works) > .card:not(#how-it-works) {
  width: min(100%, 32rem);
  margin: 0.4rem auto 0;
  text-align: center;
}
.content:has(#how-it-works) > .card:not(#how-it-works) .btn {
  margin-top: 0.5rem;
}

/* "How it works" — the calmer block below the hero. A generous gap
   and a hairline divider set it apart from the centered hero above.
   Body copy stays left-aligned for readability. */
#how-it-works {
  margin-top: 4rem !important;
  text-align: left;
  border-top: 1px solid var(--border);
  padding-top: 1.6rem;
}
#how-it-works h2 {
  text-align: center;
  margin-bottom: 1rem;
}

/* ---- Home hero: mobile + enlarged-font behavior ----
   Matches the base style.css breakpoint (max-width: 640px) so the
   theme cooperates with the platform's existing responsive rules
   (base already sets .content padding 0 1.1rem and h1 1.6rem here;
   we keep that padding and tune the hero-specific spacing/widths).
   Everything stays scoped to :has(#how-it-works) so predict /
   leaderboard / blog / league pages are untouched. Goal: keep the
   centered "Google-like" intent but trim the big desktop top-margin
   and gaps, let the column be fully fluid, and ensure nothing forces
   a width wider than the viewport even under an enlarged root font. */
@media (max-width: 640px) {
  .content:has(#how-it-works) {
    /* fluid column; inherit base .content side padding (1.1rem) */
    max-width: 100%;
    margin-top: 1.75rem;
  }

  /* Wordmark: more vw weight, lower floor — fits ~340px usable width
     without wrapping/overflow; degrades gracefully if root font grows. */
  .content:has(#how-it-works) > h1 {
    font-size: clamp(1.5rem, 9vw, 2.4rem);
    line-height: 1.12;
  }

  .content:has(#how-it-works) > p.muted {
    font-size: 0.98rem;
    margin-bottom: 1.5rem;
  }

  .content:has(#how-it-works) > h2 {
    font-size: 1.15rem;
  }

  /* Fluid form/card; no fixed widths that could overflow. */
  .content:has(#how-it-works) > form,
  .content:has(#how-it-works) > .card:not(#how-it-works) {
    width: 100%;
    margin-top: 0.4rem;
  }
  .content:has(#how-it-works) > form fieldset {
    padding: 1.2rem 1.1rem 1.3rem;
  }
  .content:has(#how-it-works) > form input[type="text"] {
    max-width: 100%;
  }
  .content:has(#how-it-works) > form button.btn {
    /* full-width tap target on phones, can't overflow */
    width: 100%;
    min-width: 0;
  }

  /* Smaller gap before the calmer "How it works" block. */
  #how-it-works {
    margin-top: 2.5rem !important;
  }

  /* ---- Header brand on mobile ----
     The topbar flex-wraps on mobile (base style.css): the nav links drop
     to their own full-width line below the brand, so the brand effectively
     owns the top line by itself. Center it there and force the whole
     "🎸 Wappy Picks 🤘" string onto ONE line so the trailing 🤘 can't wrap
     to a second row. Reduced font-size + nowrap keep it inside a ~360–390px
     viewport without horizontal overflow, even under an enlarged root font. */
  .topbar .brand {
    flex: 1 1 100%;
    text-align: center;
    font-size: 1rem;
    white-space: nowrap;
    overflow-wrap: normal;
    /* never push the viewport wider than itself */
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* Keep the nav row centered under the now-centered brand. */
  .topbar nav {
    justify-content: center;
  }

  /* Hide the redundant hero wordmark on the home page only. The header
     brand already shows "🎸 Wappy Picks 🤘" right above it on small
     screens, so the big hero <h1> is duplicative on a phone. The tagline
     (p.muted) and the CTA (handle form / "Start playing" / welcome card)
     stay visible. Desktop keeps the hero wordmark (this rule is inside the
     640px breakpoint). */
  .content:has(#how-it-works) > h1 {
    display: none;
  }
}
