/* ═══════════════════════════════════════════════
   layout.css — Structural layout: topbar, nav,
   pages, grids, section headers
   ═══════════════════════════════════════════════ */

/* ── Prevent horizontal scroll at the page root ── */
html { overflow-x: hidden; }

/* ── Topbar ── */
#topbar {
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.18);
  /* Prevent the topbar itself from generating horizontal overflow */
  overflow: hidden;
}

.logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px;
  letter-spacing: 3px;
  color: #fff;
  cursor: pointer;
  user-select: none;
}
.logo span { color: var(--gold); }

/* ── Live pill ── */
.live-pill {
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 1s infinite;
}

/* ── Desktop nav ── */
.nav-links { display: flex; gap: 4px; }

.nav-link {
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  background: none;
  transition: var(--transition);
  font-family: 'DM Sans', sans-serif;
}
.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

/* ── Hamburger ── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px 4px;
  background: none;
  border: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.22s ease, opacity 0.18s ease;
  transform-origin: center;
}
/* Open state: top → rotate 45°, middle → fade, bottom → rotate -45° */
.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile nav ── */
#mobile-nav {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  background: var(--green-d);
  z-index: 190;
  flex-direction: column;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
#mobile-nav.open { display: flex; }

.mobile-link {
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  background: none;
  text-align: left;
  font-family: 'DM Sans', sans-serif;
  width: 100%;
  transition: var(--transition);
}
.mobile-link:hover,
.mobile-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

/* ── Mobile nav season indicator (replaces old native select) ── */
.mobile-season-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid rgba(255,255,255,.13);
  margin-top: 4px;
}
.mobile-season-label {
  font-size: 11px;
  color: rgba(255,255,255,.5);
  text-transform: uppercase;
  letter-spacing: .5px;
  flex-shrink: 0;
}
.mobile-season-val {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  flex: 1;
}
.mobile-season-switch {
  font-size: 12px;
  color: var(--gold);
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px;
  padding: 4px 12px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
  transition: background .15s;
}
.mobile-season-switch:hover { background: rgba(255,255,255,.18); }

/* ── Season archive banner ── */
.season-banner {
  display: none;
  background: linear-gradient(90deg, #1a3a7c, #2d5fad);
  color: #fff;
  padding: 9px 24px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.3px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.15);
}
.season-banner.show { display: block; }

/* ── Pages ── */
.page {
  display: none;
  flex: 1;
  padding: 24px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}
.page.active { display: block; }

/* ── Grids ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr;             gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr;         gap: 16px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr;     gap: 12px; }

/* ── Card shell ── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title  { font-size: 15px; font-weight: 600; }
.card-body   { padding: 20px; }

/* ── Section header ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 1px;
  color: var(--text);
}
.section-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ══════════════════════════════════════════════════
   RESPONSIVE — MOBILE FIRST
   ══════════════════════════════════════════════════ */

/* ── Tablet / large phones (≤ 768 px) ── */
@media (max-width: 768px) {

  /* Desktop nav → hide; hamburger → show */
  .nav-links  { display: none; }
  .hamburger  { display: flex; }

  /* Single-column grids */
  .grid-2,
  .grid-3,
  .grid-4     { grid-template-columns: 1fr; }

  /* Reduce page padding */
  .page       { padding: 16px; }

  /* ── Topbar: compact mobile layout ──────────────── */
  #topbar     { padding: 0 12px; }

  /* Logo: shrink size + hide the "Football" word to save space */
  .logo       { font-size: 20px; letter-spacing: 1px; flex-shrink: 0; white-space: nowrap; }
  .logo > span { display: none; }          /* hides "Football" — shows "PI Media" only */

  /* Topbar right controls: tighten gap, clip nothing — let flex handle it */
  #topbar-controls { gap: 5px !important; flex-shrink: 0; }

  /* LIVE pill: show dot indicator only, no text */
  .live-pill  { padding: 4px 5px; gap: 0; flex-shrink: 0; }
  .live-text  { display: none; }           /* hide "LIVE" label */
  .live-dot   { width: 7px; height: 7px; }

  /* Auth pill: icon/avatar only — text hidden, keep it always visible */
  #auth-pill       { padding: 5px 8px; flex-shrink: 0; min-width: 0; }
  .auth-pill-text  { display: none; }      /* text hidden on mobile, only icon shows */

  /* Guide "?" button: keep compact */
  .guide-help-btn  { flex-shrink: 0; }

  /* ── Section headers: wrap so buttons don't overflow ── */
  .section-header {
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
  }
  .section-header > div { min-width: 0; }  /* allow title to shrink */

  /* ── Cards: slightly less padding on mobile ── */
  .card-body  { padding: 14px; }
}

/* ── Small phones (≤ 480 px) ── */
@media (max-width: 480px) {
  .page       { padding: 12px; }
  .card-body  { padding: 12px; }

  /* Section title smaller */
  .section-title { font-size: 19px; }
}
