:root {
  /* Perennial Pools palette: deep forest navy + brass gold, our own mix -
     not a straight copy of CBS's all-blue look or Daqs's all-dark look. */
  --navy: #0f2b3d;
  --navy-dark: #0a1e2c;
  --blue: #2f6f8f;
  --blue-hover: #285f7a;
  --blue-light: #eaf3f3;
  --bg: #f4f2ec;
  --card-bg: #ffffff;
  --border: #ddd8cb;
  --text: #1a1f29;
  --text-dim: #6b7280;
  --green: #1a7f37;
  --red: #b3372c;
  --gold: #c8962c;
  --gold-bright: #e0ac3a;
  --gold-light: #faf1de;
  --font: 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  background: var(--navy);
  border-bottom: 4px solid var(--gold);
  flex-wrap: wrap;
  gap: 10px;
}

.navbar .brand {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: #fff;
}
.navbar .brand .accent { color: var(--gold); }

.navbar nav a {
  color: #cdd9ef;
  margin-right: 6px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 3px;
  font-size: 0.92rem;
}

.navbar nav a.active, .navbar nav a:hover {
  background: rgba(255,255,255,0.14);
  color: #fff;
  text-decoration: none;
}

.navbar form { display: inline; }

.navbar button.logout {
  background: rgba(255,255,255,0.08);
  color: #cdd9ef;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 7px 14px;
  border-radius: 3px;
  cursor: pointer;
  font-weight: 600;
}
.navbar button.logout:hover { background: rgba(255,255,255,0.18); color: #fff; }

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

.hero {
  text-align: left;
  padding: 16px 4px 18px;
  margin-bottom: 16px;
  border-bottom: 3px solid var(--gold);
}
.hero h1 {
  font-size: 1.6rem;
  margin: 0;
  font-weight: 800;
  color: var(--navy);
}
.hero .sub { color: var(--text-dim); margin-top: 4px; font-size: 0.9rem; }

.week-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 20px;
}
.week-nav a {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 4px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
}
.week-nav a:hover { border-color: var(--blue); text-decoration: none; }
.week-nav .current {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--navy);
  background: var(--blue-light);
  padding: 8px 18px;
  border-radius: 4px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(10,45,110,0.06);
}
.card h2 {
  margin-top: 0;
  font-size: 1.15rem;
  color: var(--navy);
  border-bottom: 2px solid var(--blue-light);
  padding-bottom: 10px;
}

.game-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
  padding: 0;
  border-bottom: 1px solid var(--border);
}
.game-row:last-child { border-bottom: none; }
.game-row:nth-child(even) { background: #fafaf6; }

.team-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  padding: 4px 10px;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.1s ease;
  line-height: 1.1;
}
.team-pick:hover { background: var(--blue-light); }
.team-pick.selected {
  border-color: var(--blue);
  background: var(--blue-light);
}
.team-pick img { width: 22px; height: 22px; object-fit: contain; flex-shrink: 0; }
.team-pick .abbr { font-weight: 700; font-size: 0.82rem; color: var(--navy); width: 34px; }
.team-pick .score { font-weight: 700; font-size: 0.82rem; width: 22px; text-align: right; }
.team-pick .pct { font-size: 0.72rem; color: var(--text-dim); margin-left: auto; }
.team-pick input { display: none; }

.vs {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.72rem;
  padding: 4px 4px;
  text-align: center;
  width: 26px;
  flex-shrink: 0;
  align-self: center;
}

.game-status {
  font-size: 0.62rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 700;
  display: block;
}
.game-status.live { color: var(--red); }
.game-status.final { color: var(--green); }

.btn {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  border: none;
  padding: 12px 28px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95rem;
}
.btn:hover { background: var(--blue-hover); text-decoration: none; }
.btn.secondary {
  background: #fff;
  border: 2px solid var(--border);
  color: var(--navy);
}
.btn.secondary:hover { border-color: var(--blue); background: var(--blue-light); }
.btn.danger {
  background: var(--red);
  color: #fff;
}

.alert {
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 16px;
  font-weight: 600;
}
.alert.success { background: #eafaf0; border: 1px solid var(--green); color: var(--green); }
.alert.error { background: #fdecea; border: 1px solid var(--red); color: var(--red); }

table.standings {
  width: 100%;
  border-collapse: collapse;
}
table.standings th, table.standings td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
table.standings th {
  color: var(--navy);
  text-transform: uppercase;
  font-size: 0.75rem;
  background: var(--blue-light);
}
table.standings tr:first-child td { font-weight: 800; }
.status-alive { color: var(--green); font-weight: 700; }
.status-out { color: var(--text-dim); text-decoration: line-through; }

.login-wrap {
  max-width: 380px;
  margin: 80px auto;
  text-align: center;
  background: var(--card-bg);
  padding: 36px 30px;
  border-radius: 5px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 18px rgba(10,45,110,0.08);
}
.login-wrap h1 { font-size: 1.8rem; margin-bottom: 4px; color: var(--navy); }
.login-wrap .tagline { color: var(--text-dim); margin-bottom: 28px; font-size: 0.9rem; }
.login-wrap input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 1rem;
}
.login-wrap .btn { width: 100%; padding: 13px; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.admin-table th, .admin-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.admin-table th { background: var(--blue-light); color: var(--navy); text-transform: uppercase; font-size: 0.72rem; }

.live-grid { font-size: 0.72rem; }
.live-grid th, .live-grid td { padding: 4px 5px !important; }
.live-grid th { font-size: 0.62rem; line-height: 1.3; }
.live-grid th a { font-size: 0.58rem; }
.live-grid td:first-child, .live-grid th:first-child { min-width: 90px; }
.paid { color: var(--green); font-weight: 700; }
.unpaid { color: var(--red); font-weight: 700; }
.small-btn { padding: 5px 10px; font-size: 0.72rem; border-radius: 3px; }

.survivor-picker {
  background: var(--blue-light);
  border-radius: 4px;
  padding: 20px;
  text-align: center;
}
.survivor-picker select {
  font-size: 1.05rem;
  padding: 12px 16px;
  border-radius: 4px;
  border: 1px solid var(--border);
  width: 100%;
  max-width: 360px;
  margin: 12px 0;
  background: #fff;
  color: var(--text);
}
.survivor-current-pick {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 10px;
}
.survivor-current-pick img { width: 36px; height: 36px; object-fit: contain; }

.used-teams {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}
.used-teams img { width: 28px; height: 28px; object-fit: contain; opacity: 0.4; }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .navbar {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 14px;
    gap: 8px;
  }
  .navbar .brand { text-align: center; font-size: 18px; }
  .navbar nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
  }
  .navbar nav a { margin-right: 0; padding: 7px 10px; font-size: 0.85rem; }
  .navbar > div:last-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }
  .navbar > div:last-child span { margin-right: 0 !important; font-size: 0.8rem; }
  .navbar > div:last-child a { margin-right: 0 !important; font-size: 0.78rem; }

  .container { padding: 16px 10px 40px; }

  .hero h1 { font-size: 1.3rem; }
  .hero .sub { font-size: 0.82rem; }

  .card { padding: 12px; }
  .card h2 { font-size: 1rem; }

  .week-nav { gap: 8px; flex-wrap: wrap; }
  .week-nav a, .week-nav .current { padding: 7px 12px; font-size: 0.82rem; }

  .team-pick { padding: 4px 6px; gap: 5px; }
  .team-pick img { width: 20px; height: 20px; }
  .team-pick .abbr { width: 28px; font-size: 0.76rem; }
  .team-pick .score { width: 18px; font-size: 0.76rem; }
  .team-pick .pct { font-size: 0.64rem; }
  .vs { width: 20px; font-size: 0.6rem; }

  .login-wrap { margin: 32px auto; padding: 26px 20px; max-width: 92vw; }
  .login-wrap h1 { font-size: 1.5rem; }

  .survivor-picker { padding: 14px; }
  .survivor-picker select { font-size: 0.95rem; }

  table.standings th, table.standings td { padding: 8px 8px; font-size: 0.85rem; }

  .btn { padding: 11px 18px; font-size: 0.9rem; }
}

@media (max-width: 400px) {
  .team-pick .pct { display: none; }
  .navbar .brand { font-size: 16px; }
}

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- Public landing page (/home) ----------
   Additive only. Nothing above this line changes, so the members' login and
   pool pages render exactly as they did before. */

/* Script wordmark. Scoped to .brand-fancy so the members' navbar keeps the
   plain PERENNIALPOOLS lockup it has always had. */
.landing-navbar {
  background: transparent;
  border-bottom: none;
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 3;
  padding: 18px 28px;
}

.brand-fancy {
  display: flex;
  align-items: baseline;
  gap: 9px;
}
.brand-fancy .brand-script {
  font-family: 'Pinyon Script', 'Snell Roundhand', 'Apple Chancery', cursive;
  font-size: 2.3rem;
  font-weight: 400;
  line-height: 1;
  color: #fff;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 14px rgba(0,0,0,0.4);
  padding-right: 2px;
}
.brand-fancy .brand-pools {
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--gold-bright);
  text-transform: uppercase;
  position: relative;
  top: -2px;
}

.landing-hero {
  position: relative;
  overflow: hidden;
  background: radial-gradient(120% 90% at 20% 0%, #14405c 0%, var(--navy) 45%, #050d15 100%);
  border-bottom: 4px solid var(--gold);
  padding: 96px 16px 0;
  isolation: isolate;
}

/* Optional licensed background clip. Absent file = element renders nothing and
   the light treatment below shows through, so there is never a broken frame. */
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.28;
  z-index: -3;
  filter: saturate(0.8) contrast(1.1);
}

/* Two slow-drifting pools of light - reads as stadium floods without needing
   a single byte of imagery. */
.hero-lights {
  position: absolute;
  inset: -20%;
  z-index: -2;
  background:
    radial-gradient(38% 44% at 18% 12%, rgba(200,150,44,0.28) 0%, transparent 62%),
    radial-gradient(32% 40% at 82% 24%, rgba(47,111,143,0.42) 0%, transparent 65%),
    radial-gradient(44% 50% at 62% 96%, rgba(224,172,58,0.14) 0%, transparent 70%);
  animation: heroDrift 26s ease-in-out infinite alternate;
}
@keyframes heroDrift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to   { transform: translate3d(3%, 2%, 0) scale(1.08); }
}

/* Fine grain so the large flat areas read as film rather than flat CSS. */
.hero-grain {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.16;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

.landing-inner { max-width: 980px; margin: 0 auto; position: relative; }

.hero-eyebrow {
  color: var(--gold-bright);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.landing-hero h1 {
  color: #fff;
  font-size: 4rem;
  line-height: 1.02;
  margin: 0 0 24px;
  font-weight: 800;
  letter-spacing: -2px;
  text-shadow: 0 2px 30px rgba(0,0,0,0.45);
}
.landing-hero h1 .accent {
  background: linear-gradient(92deg, var(--gold-bright) 0%, #f3d488 45%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.landing-hero .lede {
  color: #cfdce8;
  font-size: 1.15rem;
  line-height: 1.65;
  max-width: 660px;
  margin: 0 0 34px;
}

.btn.btn-xl {
  padding: 17px 40px;
  font-size: 1.05rem;
  box-shadow: 0 10px 34px rgba(200,150,44,0.34);
}

/* Scrolling league names. Deliberately typographic - no league logos, which
   are trademarks and would imply an endorsement that does not exist. */
.league-marquee {
  margin-top: 76px;
  padding: 18px 0;
  border-top: 1px solid rgba(255,255,255,0.13);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 22px;
  width: max-content;
  animation: marqueeScroll 55s linear infinite;
}
.marquee-item {
  color: rgba(255,255,255,0.34);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  white-space: nowrap;
}
/* American leagues lead - biggest pool market by a distance, so they read
   first and brightest while the rest still scroll past. */
.marquee-item.us {
  color: #fff;
  font-size: 1.3rem;
  font-weight: 800;
  text-shadow: 0 0 26px rgba(224,172,58,0.45);
}
.marquee-dot { color: var(--gold); font-size: 0.7rem; }
@keyframes marqueeScroll {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-lights, .marquee-track { animation: none; }
  .hero-video { display: none; }
}

.league-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0 0 28px;
}
.league-strip span {
  color: #cfe0ee;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 2px;
  padding: 5px 9px;
}
.league-strip .league-more {
  border: none;
  color: #8fa5b8;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.8rem;
  padding-left: 2px;
}

.cta-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.cta-note { color: #9fb3c4; font-size: 0.88rem; }
.cta-note strong { color: var(--gold-bright); }

.btn.btn-gold {
  background: var(--gold);
  color: var(--navy-dark);
  font-weight: 800;
  letter-spacing: 0.2px;
}
.btn.btn-gold:hover { background: var(--gold-bright); }

.feature-list { margin: 0; padding-left: 20px; line-height: 1.75; }
.feature-list li { margin-bottom: 6px; }

.quote-demo {
  margin: 16px 0;
  padding: 16px 18px;
  background: var(--blue-light);
  border-left: 4px solid var(--blue);
  color: var(--navy);
  font-size: 1rem;
  line-height: 1.55;
  font-style: italic;
}

.honest-note {
  color: var(--text-dim);
  font-size: 0.88rem;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-bottom: 0;
}

.founder-card { border-top: 3px solid var(--gold); }
.founder-meter {
  height: 10px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin: 16px 0 8px;
}
.founder-bar { height: 100%; background: var(--gold); }
.founder-count { font-size: 0.88rem; color: var(--text-dim); }

@media (max-width: 640px) {
  /* The base .navbar mobile rule stacks into a column, which made the absolutely
     positioned landing navbar tall enough to sit on top of the headline. Keep
     this one a single row and give the hero enough clearance below it. */
  .landing-navbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    gap: 10px;
  }
  .brand-fancy .brand-script { font-size: 1.75rem; }
  .brand-fancy .brand-pools { font-size: 0.78rem; letter-spacing: 2.5px; }

  .landing-hero { padding: 86px 16px 0; }
  .landing-hero h1 { font-size: 2.1rem; letter-spacing: -1px; }
  .landing-hero .lede { font-size: 0.98rem; }
  .hero-eyebrow { font-size: 0.64rem; letter-spacing: 1.8px; margin-bottom: 12px; }
  .cta-row { gap: 12px; }
  .btn.btn-xl { padding: 14px 30px; font-size: 0.96rem; }
  .league-marquee { margin-top: 44px; }
  .marquee-item.us { font-size: 1.1rem; }
  .marquee-item { font-size: 0.92rem; }
}
