/* ============================================================
   MCA — Melbourne Cricket Association · Winter 2026
   Astrocare-inspired clean, modern design
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Light theme foundations */
  --bg:           #ffffff;
  --bg-light:     #f8fafc;
  --bg-dark:      #101827;
  --bg-dark-alt:  #1e293b;
  --surface:      #ffffff;
  --card-bg:      #ffffff;
  --card-border:  #e2e8f0;
  --card-shadow:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --card-shadow-hover: 0 10px 40px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
  --text:         #0f172a;
  --text-dim:     #64748b;
  --text-light:   #e2e8f0;
  --text-light-dim: #94a3b8;
  --border:       #e2e8f0;
  --border-light: rgba(255,255,255,0.1);

  /* Brand Colors */
  --gold:     #eab308;
  --gold-dark:#ca8a04;
  --green:    #16a34a;
  --green-light: #22c55e;
  --orange:   #c2410c;
  --blue:     #2563eb;
  --maroon:   #9f1239;
  --radius:   0.75rem;
  --radius-lg: 1rem;

  /* Hero + dark-surface tokens, so those sections follow the theme instead
     of staying dark when the page is switched back to light. */
  --hero-1:      #eef2ff;
  --hero-2:      #f8fafc;
  --hero-ink:    #0f172a;
  --hero-dim:    rgba(15,23,42,0.62);
  --hero-line:   rgba(15,23,42,0.10);
  --hero-glass:  rgba(255,255,255,0.62);
  --hero-glassb: rgba(15,23,42,0.10);
  --mesh-a: rgba(245,158,11,0.20);
  --mesh-b: rgba(22,163,74,0.13);
  --mesh-c: rgba(37,99,235,0.16);
  --mesh-d: rgba(234,88,12,0.11);
  --title-1: #78350f;
  --title-2: #0b1220;
  --surface-deep: #eaeff6;
  --surface-deep-ink: #0f172a;
  --surface-deep-dim: rgba(15,23,42,0.62);
  --surface-deep-line: rgba(15,23,42,0.10);
  --surface-deep-card: rgba(255,255,255,0.7);
}

/* Dark theme — same tokens, re-pointed. Toggled via data-theme on <html>. */
[data-theme="dark"] {
  --hero-1:      #070c17;
  --hero-2:      #0c1327;
  --hero-ink:    #ffffff;
  --hero-dim:    rgba(255,255,255,0.70);
  --hero-line:   rgba(255,255,255,0.07);
  --hero-glass:  rgba(255,255,255,0.05);
  --hero-glassb: rgba(255,255,255,0.10);
  --mesh-a: rgba(245,158,11,0.26);
  --mesh-b: rgba(22,163,74,0.20);
  --mesh-c: rgba(59,130,246,0.26);
  --mesh-d: rgba(234,88,12,0.16);
  --title-1: #fbbf24;
  --title-2: #ffffff;
  --surface-deep: #0b1220;
  --surface-deep-ink: #e8edf6;
  --surface-deep-dim: rgba(255,255,255,0.62);
  --surface-deep-line: rgba(255,255,255,0.10);
  --surface-deep-card: rgba(255,255,255,0.05);

  --bg:           #0b1220;
  --bg-light:     #111a2b;
  --surface:      #111a2b;
  --card-bg:      #162033;
  --card-border:  rgba(255,255,255,0.10);
  --card-shadow:  0 1px 3px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.4);
  --card-shadow-hover: 0 12px 40px rgba(0,0,0,0.55), 0 4px 12px rgba(0,0,0,0.4);
  --text:         #e8edf6;
  --text-dim:     #9aa8bd;
  --border:       rgba(255,255,255,0.10);
}

/* Header glass has to follow the theme too */
[data-theme="dark"] .header { background: rgba(11,18,32,0.75); }
[data-theme="dark"] .header.scrolled {
  background: rgba(11,18,32,0.94);
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
[data-theme="dark"] .chat-msg-bot code,
[data-theme="dark"] .chat-cite-tag { background: rgba(255,255,255,0.08); }
[data-theme="dark"] .chat-msg-bot th { background: rgba(255,255,255,0.05); }
[data-theme="dark"] .fee-extra { background: var(--bg-light); }

/* Theme toggle button */
.theme-toggle {
  display: inline-flex;
  margin-left: auto;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  margin-left: 1rem;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
  background: transparent;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.theme-toggle:hover { color: var(--gold); border-color: var(--gold); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-icon-moon { display: none; }
[data-theme="dark"] .theme-icon-sun  { display: none; }
[data-theme="dark"] .theme-icon-moon { display: block; }

/* ---- Hero entrance + drift ---------------------------------------------- */
@keyframes heroRise {
  0%   { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: none; }
}
@keyframes kenBurns {
  0%   { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.16) translate(-2%, 1.2%); }
}

.hero-rise   { animation: 1s cubic-bezier(.16,1,.3,1) both heroRise; }
.hero-rise-2 { animation: 1s cubic-bezier(.16,1,.3,1) .15s both heroRise; }
.hero-rise-3 { animation: 1s cubic-bezier(.16,1,.3,1) .3s both heroRise; }
.hero-rise-4 { animation: 1s cubic-bezier(.16,1,.3,1) .45s both heroRise; }

/* Optional hero photograph. Drop photos/hero.jpg in and it appears behind the
   gradient with a slow drift; with no file the gradient simply shows through. */

@media (prefers-reduced-motion: reduce) {
  .hero-rise, .hero-rise-2, .hero-rise-3, .hero-rise-4 { animation: none; }
  .hero-photo, .live-dot { animation: none; }
}

html { scroll-behavior: smooth; }
/* The bar is fixed, so an anchored section has to stop below it or its
   heading lands underneath the menu. */
section[id] { scroll-margin-top: 6.5rem; }
@media (max-width: 1024px) { section[id] { scroll-margin-top: 6.2rem; } }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,h2,h3,h4,h5,h6 {
  font-family: 'Bebas Neue', cursive;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.container { width: 90%; max-width: 1200px; margin: 0 auto; }

/* --- Scroll Progress Bar --- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--gold), var(--orange), var(--gold));
  z-index: 9999;
  transition: width 0.05s linear;
}

/* ============================================================
   Header
   ============================================================ */
/* The bar is navy in both themes — a pale grey header washed out against the
   hero photo. The 3px strip along the bottom carries the competition colours. */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 0.9rem 0 0.62rem;
  background:
    linear-gradient(90deg, var(--green) 0%, var(--gold) 48%, var(--orange) 100%) bottom left / 100% 3px no-repeat,
    linear-gradient(180deg, #12233f 0%, #0b1729 100%);
  box-shadow: 0 2px 20px rgba(4,10,20,0.28);
  transition: padding 0.3s, box-shadow 0.3s;
}

.header.scrolled {
  padding: 0.45rem 0 0.45rem;
  box-shadow: 0 4px 26px rgba(4,10,20,0.4);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.logo { flex-shrink: 0; }

/* Circular, the same treatment as the avatar in the chat window. The artwork
   is square (743x748), so a round crop loses nothing off the shield. */
.logo img {
  height: 64px;
  width: 64px;
  border-radius: 50%;
  background: #fff;
  object-fit: contain;
  padding: 3px;
  transition: height 0.3s, width 0.3s;
}
.header.scrolled .logo img { height: 48px; width: 48px; }

.nav-list {
  display: flex;
  gap: 1.15rem;
}

.nav-link {
  white-space: nowrap;
  font-size: 0.74rem;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  transition: color 0.2s, background 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.nav-link:hover { color: var(--gold); }

.nav-link-assistant { color: var(--gold); }
.nav-link-assistant:hover { color: #fff; }

.nav-cta { margin-left: auto; white-space: nowrap; }
.nav-cta + .theme-toggle { margin-left: 1rem; }

/* "Ask MCA" on the bar — the same panel the bottom-right launcher opens */
.ask-mca {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  height: 34px;
  padding: 0 0.8rem;
  border: 1px solid rgba(234,179,8,0.55);
  border-radius: 999px;
  background: rgba(234,179,8,0.14);
  color: var(--gold);
  font-family: 'Inter', sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.ask-mca:hover { background: rgba(234,179,8,0.3); color: #fff; }
.ask-mca svg { flex-shrink: 0; }

/* Hamburger — the full menu, on top of the few links that fit on the bar */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  z-index: 1301;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* The bar's own short links. Desktop uses the full .nav instead. */
.quicknav { display: none; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.75rem 1.75rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.btn:hover { transform: translateY(-2px); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #fff;
  box-shadow: 0 4px 14px rgba(245,158,11,0.3);
}
.btn-gold:hover { box-shadow: 0 6px 24px rgba(245,158,11,0.45); }

.btn-outline {
  background: transparent;
  color: var(--hero-ink);
  border: 2px solid var(--hero-glassb);
  backdrop-filter: blur(6px);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

/* Mobile nav — a handful of short links sit on the bar itself and share the
   width equally so nothing is ever clipped or half-hidden. The full menu is
   behind the burger. */
@media (max-width: 1024px) {
  .nav, .nav-cta { display: none; }
  .hamburger { display: flex; }

  .header { padding: 0.5rem 0 0; }
  .header.scrolled { padding: 0.35rem 0 0; }
  .header-inner { flex-wrap: wrap; row-gap: 0.4rem; column-gap: 0.5rem; }
  .logo { margin-right: auto; }
  .logo img { height: 46px; width: 46px; padding: 2px; }
  .header.scrolled .logo img { height: 40px; width: 40px; }
  .theme-toggle { margin-left: 0.25rem; width: 34px; height: 34px; }
  .ask-mca { height: 32px; padding: 0 0.65rem; font-size: 0.68rem; gap: 0.32rem; }

  .quicknav {
    order: 3;
    display: flex;
    flex: 0 0 100%;
    min-width: 0;
    gap: 0.3rem;
    padding-bottom: 0.5rem;
  }
  .quicknav-link {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.36rem 0.2rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.09);
    color: rgba(255,255,255,0.92);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-align: center;
    /* Every label fits; this is a guard, not the normal state */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .quicknav-link:active { background: rgba(234,179,8,0.28); }

  /* Under 400px five labels cannot fit without truncating "Fixtures", and a
     half-word is worse than one fewer link — Competitions stays in the menu. */
  @media (max-width: 400px) {
    .quicknav-optional { display: none; }
    .quicknav-link { font-size: 0.6rem; padding-left: 0.15rem; padding-right: 0.15rem; }
  }

  /* ---- The full menu, opened by the burger ----
     backdrop-filter on .header would make it the containing block for fixed
     children and trap this overlay inside the header strip, so the bar uses a
     plain background and the overlay can mean the viewport by inset: 0. */
  .header.nav-open { box-shadow: none; }

  .header.nav-open .nav {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: var(--bg);
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    padding: 5.5rem 1.5rem 2rem;
    overflow-y: auto;
  }
  .header.nav-open .nav-list {
    flex-direction: column;
    gap: 0;
    width: 100%;
    max-width: 26rem;
    margin: 0 auto;
  }
  .header.nav-open .nav-list li { border-bottom: 1px solid var(--card-border); }
  .header.nav-open .nav-list li:last-child { border-bottom: none; }
  .header.nav-open .nav-link {
    display: block;
    padding: 1.05rem 0.25rem;
    font-size: 1.05rem;
    letter-spacing: 0.06em;
    color: var(--text);
    background: none;
    border-radius: 0;
  }
  .header.nav-open .nav-link-assistant {
    color: var(--gold-dark);
    border: none;
  }

  /* Burger becomes the close control, above the overlay */
  .header.nav-open .hamburger span { background: var(--text); }
  .header.nav-open .hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .header.nav-open .hamburger span:nth-child(2) { opacity: 0; }
  .header.nav-open .hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Keep the bar's own controls usable while the menu is open */
  .header.nav-open .logo,
  .header.nav-open .ask-mca,
  .header.nav-open .theme-toggle { position: relative; z-index: 1300; }
  .header.nav-open .quicknav { visibility: hidden; }
}

/* ============================================================
   Hero — Dark section
   ============================================================ */
.hero {
  position: relative;
  min-height: 92vh;
  min-height: 92dvh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  padding: 8rem 0 4.5rem;
  background: #0a1018;
  color: #fff;
  isolation: isolate;
}

/* Full-bleed photograph, drifting almost imperceptibly */
.hero-photo {
  position: absolute;
  inset: -4%;
  z-index: -2;
  background: url('photos/hero.jpg') center 38% / cover no-repeat;
  animation: kenBurns 30s ease-in-out infinite alternate;
  will-change: transform;
}

/* Scrim: dark from the bottom-left so the copy always has a bed to sit on */
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top, rgba(6,10,16,0.95) 0%, rgba(6,10,16,0.72) 34%, rgba(6,10,16,0.25) 66%, rgba(6,10,16,0.45) 100%),
    linear-gradient(105deg, rgba(6,10,16,0.86) 0%, rgba(6,10,16,0.45) 46%, rgba(6,10,16,0.05) 78%);
}
.hero-grain {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.16;
  mix-blend-mode: overlay;
  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.55'/%3E%3C/svg%3E");
}

.hero-inner { width: 90%; max-width: 1200px; margin: 0 auto; }
.hero-copy { max-width: 44rem; }

/* Status pill with a live dot */
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.92);
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(10px);
  padding: 0.42rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1.4rem;
}
.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34,197,94,0.7);
  animation: livePulse 2s ease-out infinite;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.65); }
  70%  { box-shadow: 0 0 0 9px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* Editorial headline: tight, left aligned, not a stacked monument */
.hero-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.04;
  font-size: clamp(2.1rem, 5.2vw, 4.1rem);
  color: #fff;
  margin-bottom: 1.15rem;
  text-wrap: balance;
}

.hero-lede {
  font-size: clamp(0.98rem, 1.5vw, 1.14rem);
  line-height: 1.65;
  color: rgba(255,255,255,0.82);
  max-width: 36rem;
  margin-bottom: 2rem;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.75rem;
}
.btn-glass {
  background: rgba(255,255,255,0.10);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.26);
  backdrop-filter: blur(10px);
}
.btn-glass:hover { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.45); }

/* Stats as a clean rule-separated row rather than a floating slab */
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
  border-top: 1px solid rgba(255,255,255,0.16);
  padding-top: 1.4rem;
}
.hero-stats .stat {
  padding-right: 2.4rem;
  margin-right: 2.4rem;
  border-right: 1px solid rgba(255,255,255,0.14);
}
.hero-stats .stat:last-child { border-right: none; margin-right: 0; padding-right: 0; }
.hero-stats dd { margin: 0; }
.hero-stats .stat-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 0.25rem;
}
.hs-num, .stat-plus, .stat-dollar {
  font-family: 'Bebas Neue', 'Inter', sans-serif;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  line-height: 1;
  color: #fff;
}
.stat-plus, .stat-dollar { color: var(--gold); }

@media (max-width: 720px) {
  .hero { padding: 7rem 0 3.5rem; align-items: flex-end; }
  /* Four stats will not fit one line on a phone, and wrapping orphans the
     last one, so lay them out evenly instead. */
  .hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 0;
    padding-top: 1.1rem;
  }
  .hero-stats .stat {
    padding: 0 0 0 0.9rem;
    margin: 0;
    border-right: none;
    border-left: 2px solid rgba(255,255,255,0.18);
  }
  .hero-stats .stat:last-child { padding-left: 0.9rem; }
  .hero-stats .stat-label { font-size: 0.62rem; }
}

/* Hero content */

.hero-ctas {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

/* Stats bar */
.stat { text-align: center; }
.hs-num, .stat-plus, .stat-dollar {
  font-family: 'Bebas Neue', cursive;
  font-size: 2.25rem;
  color: var(--gold);
}
.stat-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--hero-dim);
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 0.9rem;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.55;
  pointer-events: none;
}
.mouse {
  width: 26px;
  height: 40px;
  border: 2px solid var(--hero-line);
  border-radius: 13px;
  display: flex;
  justify-content: center;
  padding-top: 6px;
}
.mouse-wheel {
  width: 3px;
  height: 8px;
  background: var(--gold);
  border-radius: 3px;
  animation: scrollWheel 1.8s ease-in-out infinite;
}
@keyframes scrollWheel {
  0%   { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(12px); }
}

/* ============================================================
   Ticker
   ============================================================ */

/* ============================================================
   Sections (shared)
   ============================================================ */
.section { padding: 5rem 0; }

.section-white { background: var(--bg); }
.section-light { background: var(--bg-light); }

.section-dark {
  background: var(--surface-deep);
  color: var(--surface-deep-ink);
}
.section-dark .section-title { color: var(--surface-deep-ink); }
.section-dark .section-subtitle { color: var(--surface-deep-dim); }

.section-title {
  font-size: clamp(2rem, 5vw, 3rem);
  text-align: center;
  margin-bottom: 0.75rem;
  color: var(--text);
}
.section-subtitle {
  text-align: center;
  color: var(--text-dim);
  max-width: 640px;
  margin: 0 auto 3rem;
  font-size: 1.05rem;
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   About — Feature cards
   ============================================================ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--card-shadow);
  transition: transform 0.35s, box-shadow 0.35s;
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
}

.feature-icon { margin-bottom: 1rem; }
.feature-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.feature-card p {
  font-size: 0.925rem;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ============================================================
   Gallery
   ============================================================ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 240px;
  gap: 1rem;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #e2e8f0;
  cursor: pointer;
  box-shadow: var(--card-shadow);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}
.gallery-item:hover img { transform: scale(1.08); }

.gallery-item-wide { grid-column: span 2; }

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15,23,42,0.85) 0%, transparent 50%);
  display: flex;
  align-items: flex-end;
  padding: 1.25rem;
  opacity: 0;
  transition: opacity 0.35s;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-overlay span {
  font-family: 'Bebas Neue', cursive;
  font-size: 1.25rem;
  color: var(--gold);
  letter-spacing: 0.04em;
}

/* Placeholder state */
.gallery-ph-content {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
  padding: 1rem;
  background: var(--bg-light);
}
.gallery-ph-content p { font-size: 0.8rem; color: var(--text-dim); }
.gallery-ph-content code {
  background: rgba(0,0,0,0.06);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.75rem;
}

.gallery-placeholder img { display: none; }
.gallery-placeholder .gallery-overlay { display: none; }
.gallery-placeholder .gallery-ph-content {
  display: flex;
  border: 2px dashed var(--card-border);
  border-radius: var(--radius-lg);
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 180px;
  }
}
@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 200px;
  }
  .gallery-item-wide { grid-column: span 1; }
}

/* ============================================================
   Competitions
   ============================================================ */
.comp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.comp-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform 0.35s, box-shadow 0.35s;
}
.comp-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
}

.comp-header {
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.comp-header h3 { font-size: 1.75rem; color: #fff; }
.comp-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255,255,255,0.2);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  color: #fff;
}

.comp-header-orange { background: linear-gradient(135deg, var(--orange), #c2410c); }
.comp-header-blue   { background: linear-gradient(135deg, var(--blue), #1d4ed8); }
.comp-header-maroon { background: linear-gradient(135deg, var(--maroon), #881337); }
.comp-header-green  { background: linear-gradient(135deg, var(--green), #15803d); }

.comp-body { padding: 1.5rem 2rem 2rem; }

.comp-details {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}
.comp-details li {
  font-size: 0.9rem;
  color: var(--text-dim);
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--bg-light);
}
.comp-details li:last-child { border-bottom: none; padding-bottom: 0; }
.comp-details li strong { color: var(--text); }
.prize-up { color: var(--green); font-size: 0.8rem; font-weight: 600; }

.comp-btn { width: 100%; justify-content: center; }

/* ============================================================
   Calendar / Timeline
   ============================================================ */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}
.cal-card {
  display: flex;
  flex-direction: column;
  padding: 1.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
}
.cal-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}
.cal-card-top h3 { font-size: 1rem; font-weight: 700; line-height: 1.3; }
.cal-status {
  flex-shrink: 0;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.cal-status-now { background: rgba(22,163,74,0.14); color: #15803d; }
.cal-status-done { background: rgba(100,116,139,0.16); color: var(--text-dim); }
[data-theme="dark"] .cal-status-now { background: rgba(22,163,74,0.24); color: #4ade80; }

.cal-dl { margin: 0 0 1rem; }
.cal-dl > div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.42rem 0;
  border-bottom: 1px solid var(--card-border);
}
.cal-dl > div:last-child { border-bottom: none; }
.cal-dl dt {
  flex-shrink: 0;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-dim);
}
.cal-dl dd {
  margin: 0;
  text-align: right;
  font-size: 0.82rem;
  color: var(--text);
}
.cal-card > a {
  margin-top: auto;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold-dark);
}
.cal-card > a:hover { text-decoration: underline; }

.cal-note {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.84rem;
  color: var(--text-dim);
}


/* ============================================================
   Fees
   ============================================================ */
.fees-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.fee-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform 0.35s, box-shadow 0.35s;
}
.fee-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
}

.fee-header {
  padding: 1.5rem 2rem;
  text-align: center;
}
.fee-header h3 { font-size: 1.5rem; color: #fff; }
.fee-total {
  font-family: 'Bebas Neue', cursive;
  font-size: 2.5rem;
  color: #fff;
  margin-top: 0.25rem;
}
.fee-total span { font-size: 1rem; opacity: 0.7; }

.fee-header-orange { background: linear-gradient(135deg, var(--orange), #c2410c); }
.fee-header-blue   { background: linear-gradient(135deg, var(--blue), #1d4ed8); }
.fee-header-maroon { background: linear-gradient(135deg, var(--maroon), #881337); }

.fee-list { padding: 1.5rem 2rem; }
.fee-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--bg-light);
  font-size: 0.9rem;
  color: var(--text-dim);
}
.fee-list li:last-child { border-bottom: none; }
.fee-list li span:last-child { color: var(--text); font-weight: 600; }

.fee-extra {
  padding: 1rem 2rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
  border-top: 1px solid var(--bg-light);
  background: var(--bg-light);
}

.fees-note {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
  max-width: 700px;
  margin: 0 auto;
}

/* ============================================================
   Rules
   ============================================================ */
.rules-card {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 2.5rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  flex-wrap: wrap;
  transition: transform 0.35s, box-shadow 0.35s;
}
.rules-card + .rules-card { margin-top: 1.5rem; }
.rules-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
}

.rules-icon { flex-shrink: 0; }
.rules-text { flex: 1; min-width: 200px; }
.rules-text h3 { font-size: 1.75rem; margin-bottom: 0.5rem; color: var(--text); }
.rules-text p { font-size: 0.9rem; color: var(--text-dim); }
.rules-btn { flex-shrink: 0; }

/* ============================================================
   Register
   ============================================================ */
.register-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

@media (max-width: 768px) {
  .register-grid { grid-template-columns: 1fr; }
}

.register-checklist h3 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}
.register-checklist ul { display: flex; flex-direction: column; gap: 1rem; }
.register-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: var(--text-dim);
}
.register-checklist li svg { flex-shrink: 0; margin-top: 2px; }

.qr-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--card-shadow);
}
.qr-card h3 { font-size: 1.5rem; margin-bottom: 1.5rem; color: var(--text); }
.qr-image { width: 220px; height: 220px; margin: 0 auto 1rem; border-radius: 0.5rem; }

.qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.qr-box {
  width: 220px;
  height: 220px;
  border: 2px dashed var(--card-border);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-placeholder p { font-size: 0.85rem; color: var(--text-dim); }
.qr-placeholder code {
  background: rgba(0,0,0,0.05);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

.qr-sub { font-size: 0.85rem; color: var(--text-dim); }

/* ============================================================
   Contact — Dark section
   ============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.5rem 2rem;
  background: var(--surface-deep-card);
  border: 1px solid var(--surface-deep-line);
  border-radius: var(--radius-lg);
  transition: transform 0.35s, box-shadow 0.35s, border-color 0.35s, background 0.35s;
}
.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  border-color: rgba(245,158,11,0.3);
  background: rgba(255,255,255,0.08);
}

.contact-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.contact-icon-gold   { background: rgba(245,158,11,0.15); color: var(--gold); }
.contact-icon-green  { background: rgba(22,163,74,0.15); color: var(--green); }
.contact-icon-blue   { background: rgba(37,99,235,0.15); color: var(--blue); }
.contact-icon-orange { background: rgba(234,88,12,0.15); color: var(--orange); }
.contact-icon-red    { background: rgba(220,38,38,0.14); color: #dc2626; }

.contact-card h3 { font-size: 1.5rem; color: var(--surface-deep-ink); }
.contact-role {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--surface-deep-dim);
  margin-bottom: 0.5rem;
}
.contact-detail { font-size: 0.95rem; color: var(--gold); }

/* ============================================================
   Footer — Dark
   ============================================================ */
.footer {
  background: var(--surface-deep);
  color: var(--surface-deep-ink);
  padding: 0;
}

.footer-gradient-border {
  height: 4px;
  background: linear-gradient(90deg, var(--gold), var(--orange), var(--green), var(--blue));
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  padding: 4rem 0 3rem;
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
}

.footer-logo { height: 56px; margin-bottom: 1rem; }
.footer-brand p { font-size: 0.875rem; color: var(--surface-deep-dim); max-width: 320px; }

.footer-links h4, .footer-contact h4 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--surface-deep-ink);
}
.footer-links ul { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links a { font-size: 0.875rem; color: var(--surface-deep-dim); transition: color 0.2s; }
.footer-links a:hover { color: var(--gold); }

.footer-contact p { font-size: 0.875rem; color: var(--surface-deep-dim); margin-bottom: 0.4rem; }
.footer-contact a { color: var(--gold); transition: color 0.2s; }
.footer-contact a:hover { color: #fff; }

.footer-bottom {
  padding: 1.5rem 0;
  border-top: 1px solid var(--surface-deep-line);
  text-align: center;
  font-size: 0.8rem;
  color: var(--surface-deep-dim);
}

/* ============================================================
   Fixtures & Ladders
   ============================================================ */
.fixtures-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, #12233f 0%, #0b1729 100%);
  box-shadow: 0 18px 40px rgba(4,10,20,0.22);
  color: #fff;
}
.fixtures-main-text { flex: 1 1 22rem; min-width: 0; }
.fixtures-main-text h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.65rem;
  letter-spacing: 0.03em;
  margin-bottom: 0.4rem;
}
.fixtures-main-text p {
  color: rgba(255,255,255,0.78);
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 0;
}
.fixtures-cta { flex-shrink: 0; }

.fixtures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.fixture-card {
  padding: 1.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  transition: transform 0.2s, box-shadow 0.2s;
}
.fixture-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0,0,0,0.10); }
.fixture-card h4 {
  font-size: 1.02rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.fixture-card p {
  color: var(--text-dim);
  font-size: 0.88rem;
  line-height: 1.55;
  margin-bottom: 0.7rem;
}
.fixture-card a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold-dark);
}
.fixture-card a:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .fixtures-main { padding: 1.25rem; }
  .fixtures-cta { width: 100%; }
}

/* ============================================================
   Emoji and brand marks
   ============================================================ */
/* Emoji sit beside a heading, never inside the letterforms — a fixed inline
   box keeps the text baseline where it was. */
.section-emoji {
  display: inline-block;
  margin-right: 0.5rem;
  font-size: 0.85em;
  line-height: 1;
  vertical-align: baseline;
  /* Colour emoji ignore the heading's gradient/colour, which is what we want */
  -webkit-text-fill-color: initial;
}
.card-emoji {
  display: inline-block;
  margin-right: 0.4rem;
  font-size: 1em;
  line-height: 1;
}

.link-youtube {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.link-youtube svg { color: #ff0000; flex-shrink: 0; }

@media (max-width: 640px) {
  .section-emoji { margin-right: 0.35rem; font-size: 0.8em; }
}

/* ============================================================
   Chatbot Widget
   ============================================================ */
/* Chat launcher — pinned to the bottom right of every page, icon and label
   together, on every screen size. z-index sits under the mobile nav overlay
   (1200) so an open menu covers it, and under the panel (1999). */
.chat-launch {
  position: fixed;
  right: 1.25rem;
  right: max(1.25rem, env(safe-area-inset-right));
  bottom: 1.25rem;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  z-index: 1100;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  height: 52px;
  padding: 0 1.15rem;
  max-width: calc(100vw - 2.5rem);
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0,0,0,0.22), 0 2px 8px rgba(202,138,4,0.35);
  transition: box-shadow 0.2s, transform 0.2s;
}
/* The label is the point of the button — it never collapses to a bare icon */
.chat-launch-label { display: inline; }
.chat-launch:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0,0,0,0.26), 0 4px 16px rgba(202,138,4,0.45); }
/* The assistant page is the chat, so the floating launcher would open what is
   already open. The header keeps its Ask MCA pill so both pages look the same;
   there it reads as "you are here" and puts the cursor in the box. */
body[data-chat-page] .chat-launch { display: none; }
.ask-mca-here {
  background: rgba(234,179,8,0.28);
  border-color: var(--gold);
  color: #fff;
}
.ask-mca-here:hover { background: rgba(234,179,8,0.4); }
/* The header is its own stacking context at z-index 1000, so the menu overlay
   inside it can never paint above the launcher — hide the launcher instead. */
.header.nav-open ~ #chatbot .chat-launch { opacity: 0; pointer-events: none; }
.chat-launch svg { flex-shrink: 0; }
.chat-launch .chatbot-icon-close { display: none; }
.chat-launch.active .chatbot-icon-open { display: none; }
.chat-launch.active .chatbot-icon-close { display: block; }

/* ============================================================
   Season Information
   ============================================================ */
.season-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 820px) {
  .season-grid { grid-template-columns: 1fr; }
}

.season-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--card-shadow);
}
.season-card h3 {
  font-size: 1.6rem;
  margin: 0.6rem 0 0.7rem;
  color: var(--text);
}
.season-card p {
  font-size: 0.92rem;
  color: var(--text-dim);
  margin-bottom: 0.8rem;
}
.season-card .btn { margin-top: 0.3rem; }

.season-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}
.season-badge-closed {
  background: rgba(220,38,38,0.1);
  color: #b91c1c;
}
.season-badge-next {
  background: rgba(22,163,74,0.1);
  color: var(--green);
}

.season-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.3rem;
}

/* Outline button that reads on a light background */
.btn-outline-dark {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--card-border);
}
.btn-outline-dark:hover {
  border-color: var(--gold);
  color: var(--gold-dark);
}

.season-note {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-dim);
}
.season-note a { color: var(--gold-dark); text-decoration: underline; }

.rules-ask {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-dim);
}
.rules-ask a { color: var(--gold-dark); font-weight: 600; text-decoration: underline; }

/* ============================================================
   Standalone chat page (chat.html)
   ============================================================ */
.chat-page {
  padding: 7rem 0 3rem;
  background: var(--bg-light);
  min-height: 100vh;
}
.chat-page-inner { max-width: 780px; }

.chat-page-intro { margin-bottom: 1.5rem; }
.chat-page-intro h1 {
  font-size: clamp(2rem, 6vw, 3rem);
  margin-bottom: 0.6rem;
}
.chat-page-intro p {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-bottom: 0.6rem;
}
.chat-page-intro a { color: var(--gold-dark); text-decoration: underline; }
.chat-page-note { font-size: 0.85rem !important; }

.chat-page-foot {
  margin-top: 1.25rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: center;
}
.chat-page-foot a {
  color: var(--gold-dark);
  text-decoration: underline;
  margin-left: 0.4rem;
  white-space: nowrap;
}

/* The panel becomes the page's main content rather than a floating bubble */
.chatbot-panel.chatbot-panel-page {
  position: static;
  width: 100%;
  max-width: none;
  height: min(68vh, 640px);
  max-height: none;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
}

@media (max-width: 640px) {
  .chat-page { padding-top: 5.5rem; }
  .chatbot-panel.chatbot-panel-page { height: min(72vh, 560px); }
}

.chatbot-panel {
  position: fixed;
  bottom: 6rem;
  right: 1.5rem;
  z-index: 1999;
  width: 380px;
  max-width: calc(100vw - 2rem);
  /* Tall enough that the welcome, the beta notice and four starter chips all
     fit without the conversation being squeezed to a couple of lines. */
  height: 580px;
  max-height: calc(100vh - 8rem);
  max-height: calc(100dvh - 8rem);
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
.chatbot-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, var(--bg-dark), #1e1b4b);
  color: #fff;
  flex-shrink: 0;
}
.chatbot-header-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.chatbot-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  flex-shrink: 0;
}
.chatbot-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 2px;
}

.chatbot-header h4 {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0;
}
.chatbot-status {
  font-size: 0.75rem;
  color: var(--text-light-dim);
}

.chatbot-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-msg {
  max-width: 85%;
  padding: 0.65rem 1rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  word-wrap: break-word;
}
.chat-msg-bot {
  background: var(--bg-light);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.chat-msg-user {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
/* Markdown rendered inside bot replies */
.chat-msg-bot p { margin: 0 0 0.6rem; }
.chat-msg-bot p:last-child { margin-bottom: 0; }
.chat-msg-bot strong { font-weight: 700; color: var(--text); }
.chat-msg-bot a { color: var(--gold-dark); text-decoration: underline; }
.chat-msg-bot a:hover { color: var(--orange); }
.chat-msg-bot code {
  background: rgba(0,0,0,0.06);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  font-size: 0.85em;
}
.chat-msg-bot ul,
.chat-msg-bot ol {
  margin: 0 0 0.6rem;
  padding-left: 1.1rem;
  list-style-position: outside;
}
.chat-msg-bot ul { list-style: none; padding-left: 0; }
.chat-msg-bot ol { list-style: decimal; }
.chat-msg-bot li { margin-bottom: 0.3rem; }
.chat-msg-bot ul:last-child,
.chat-msg-bot ol:last-child { margin-bottom: 0; }

/* Rule-book citation block, built by the widget with real PDF links */
.chat-cite {
  margin-top: 0.85rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--card-border);
}
.chat-cite-head {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}
.chat-cite-group { margin-bottom: 0.55rem; }
.chat-cite-group:last-child { margin-bottom: 0; }

.chat-cite-book {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold-dark);
  text-decoration: underline;
}
.chat-cite-book::before { content: '\2193'; font-weight: 700; }
.chat-cite-book:hover { color: var(--orange); }

.chat-cite-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.35rem;
}
.chat-cite-tag {
  font-size: 0.72rem;
  line-height: 1.3;
  padding: 0.16rem 0.5rem;
  border-radius: 4px;
  background: rgba(0,0,0,0.05);
  color: var(--text-dim);
}
.chat-cite-note {
  font-size: 0.75rem !important;
  color: var(--text-dim);
  margin: 0 !important;
}

/* Tables scroll inside the bubble rather than widening it */
.chat-table-wrap {
  overflow-x: auto;
  margin: 0 0 0.6rem;
  -webkit-overflow-scrolling: touch;
}
.chat-table-wrap:last-child { margin-bottom: 0; }
.chat-msg-bot table {
  border-collapse: collapse;
  font-size: 0.8rem;
  min-width: 100%;
}
.chat-msg-bot th,
.chat-msg-bot td {
  padding: 0.35rem 0.55rem;
  border-bottom: 1px solid var(--card-border);
  text-align: left;
  white-space: nowrap;
}
.chat-msg-bot th {
  font-weight: 700;
  background: rgba(0,0,0,0.03);
}
.chat-msg-bot tr:last-child td { border-bottom: none; }

/* Voice input */
.chatbot-mic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: 1px solid var(--card-border);
  border-radius: 50%;
  background: var(--card-bg);
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.chatbot-mic:hover { color: var(--gold-dark); border-color: var(--gold); }
.chatbot-mic.listening {
  color: #fff;
  background: var(--orange);
  border-color: var(--orange);
  animation: micPulse 1.4s ease-in-out infinite;
}
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(234,88,12,0.45); }
  50%      { box-shadow: 0 0 0 7px rgba(234,88,12,0); }
}

.chatbot-input:disabled,
.chatbot-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Phones: the panel becomes a full-width sheet ---------------------- */
@media (max-width: 640px) {
  .chatbot-panel {
    left: 0.6rem;
    right: 0.6rem;
    bottom: 5.2rem;
    width: auto;
    max-width: none;
    height: auto;
    /* dvh tracks the iOS keyboard and toolbars; vh is the fallback */
    max-height: calc(100vh - 7.5rem);
    max-height: calc(100dvh - 7.5rem);
  }
  /* Give the conversation room to breathe on a small screen */
  .chatbot-panel .chatbot-messages { min-height: 40vh; min-height: 40dvh; }
  /* ...but not on the standalone page, where the panel is a fixed height and
     the floor would shove the composer out through the bottom. */
  .chatbot-panel.chatbot-panel-page .chatbot-messages { min-height: 0; }
  .chatbot-messages { padding: 0.85rem 0.9rem; }
  .chat-msg { max-width: 92%; }

  .chatbot-input-area { padding: 0.6rem; gap: 0.4rem; }
  /* 16px stops iOS zooming the page when the field is focused */
  .chatbot-input { padding: 0.55rem 0.7rem; }
  .chatbot-mic, .chatbot-send { width: 38px; height: 38px; }

  .chat-launch { height: 48px; padding: 0 1rem; font-size: 0.85rem; gap: 0.45rem; }
  /* Keep the last footer line clear of the floating launcher */
  .footer-bottom { padding-bottom: 4.5rem; }
}

/* The standalone chat page manages its own height, so keep it out of the
   floating-panel overrides above. */
@media (max-width: 640px) {
  .chatbot-panel.chatbot-panel-page {
    position: static;
    left: auto; right: auto; bottom: auto;
    height: min(72vh, 560px);
    height: min(72dvh, 560px);
    max-height: none;
  }
}

/* Divider between a restored conversation and whatever is asked next */
.chat-resumed {
  align-self: center;
  margin: 0.35rem 0 0.15rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: var(--bg-light);
  color: var(--text-dim);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
}

/* Header controls */
.chatbot-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-left: auto;
  margin-right: 0.4rem;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.chatbot-clear:hover { background: rgba(255,255,255,0.22); color: #fff; }

/* Beta notice — shown the moment the chat is opened, and it stays put */
.chat-disclaimer {
  flex-shrink: 0;
  margin: 0;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--card-border);
  background: rgba(234, 179, 8, 0.10);
  color: var(--text-dim);
  font-size: 0.72rem;
  line-height: 1.45;
}
.chat-disclaimer-tag {
  display: inline-block;
  margin-right: 0.4rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--gold-dark);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: 1px;
}

/* Suggested question chips */
.chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-self: flex-start;
  max-width: 100%;
  margin-bottom: 0.25rem;
}
.chat-chips-label {
  width: 100%;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 0.15rem;
}
.chat-chip {
  font-family: 'Inter', sans-serif;
  max-width: 100%;
  font-size: 0.78rem;
  line-height: 1.3;
  text-align: left;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--gold);
  background: rgba(245, 158, 11, 0.08);
  color: var(--gold-dark);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.chat-chip:hover {
  background: var(--gold);
  color: #fff;
  transform: translateY(-1px);
}

.chat-typing {
  display: flex;
  gap: 4px;
  padding: 0.75rem 1rem;
  align-self: flex-start;
}
.chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
  animation: typingDot 1.2s ease-in-out infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.chatbot-input-area {
  display: flex;
  padding: 0.75rem;
  border-top: 1px solid var(--card-border);
  gap: 0.5rem;
  background: var(--card-bg);
  flex-shrink: 0;
}
.chatbot-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--card-border);
  border-radius: 0.5rem;
  padding: 0.6rem 0.85rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  background: var(--bg-light);
}
.chatbot-input:focus {
  border-color: var(--gold);
}
.chatbot-input::placeholder { color: var(--text-dim); }

.chatbot-send {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: none;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}
.chatbot-send:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(245,158,11,0.3);
}

/* ============================================================
   Responsive tweaks
   ============================================================ */
@media (max-width: 640px) {
  .hs-num, .stat-plus, .stat-dollar { font-size: 1.75rem; }
  .features-grid { grid-template-columns: 1fr; }
  .comp-grid { grid-template-columns: 1fr; }
  .fees-grid { grid-template-columns: 1fr; }
  .rules-card { flex-direction: column; text-align: center; }
  .rules-btn { width: 100%; }
  .chatbot-panel { width: calc(100vw - 2rem); right: 1rem; bottom: 5.5rem; }
}

/* ============================================================
   Depth: 3D tilt on hover
   ============================================================ */
.features-grid, .comp-grid, .fees-grid, .season-grid, .contact-grid { perspective: 1000px; }

.feature-card, .comp-card, .fee-card, .contact-card, .season-card {
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(.16,1,.3,1), box-shadow 0.45s, border-color 0.3s;
}
.feature-card:hover, .fee-card:hover, .season-card:hover {
  transform: translateY(-8px) rotateX(3deg) rotateY(-3deg) scale(1.015);
  box-shadow: 0 28px 60px rgba(0,0,0,0.16);
}
.comp-card:hover, .contact-card:hover {
  transform: translateY(-8px) rotateX(2.5deg) scale(1.012);
  box-shadow: 0 28px 60px rgba(0,0,0,0.18);
}
[data-theme="dark"] .feature-card:hover,
[data-theme="dark"] .comp-card:hover,
[data-theme="dark"] .fee-card:hover,
[data-theme="dark"] .season-card:hover,
[data-theme="dark"] .contact-card:hover {
  box-shadow: 0 28px 60px rgba(0,0,0,0.6);
}

@media (prefers-reduced-motion: reduce) {
  .hero-photo, .live-dot { animation: none; }
  .feature-card:hover, .comp-card:hover, .fee-card:hover,
  .contact-card:hover, .season-card:hover { transform: translateY(-4px); }
}

/* Close control in the chat header */
.chatbot-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
}
.chatbot-close:hover { background: rgba(255,255,255,0.26); }

/* ---- Phones: the chat becomes a full-screen sheet ---------------------- */
@media (max-width: 640px) {
  .chatbot-panel {
    position: fixed;
    inset: 0;
    left: 0; right: 0; top: 0; bottom: 0;
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    z-index: 2100;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(.16,1,.3,1), opacity 0.2s;
  }
  .chatbot-panel.open { transform: translateY(0); }

  /* The standalone page keeps its inline panel */
  .chatbot-panel.chatbot-panel-page {
    position: static;
    inset: auto;
    height: min(72dvh, 560px);
    border-radius: var(--radius-lg);
    transform: none;
    z-index: auto;
  }

  /* Stop the page scrolling behind the sheet */
  body.chat-open { overflow: hidden; }

  /* Launcher hides once the sheet is up */
  body.chat-open .chat-launch { opacity: 0; pointer-events: none; }

  .chatbot-header { padding: 1rem 1rem; padding-top: max(1rem, env(safe-area-inset-top)); }
  .chatbot-input-area { padding-bottom: max(0.6rem, env(safe-area-inset-bottom)); }
}

/* Suggestion chips dock above the composer instead of scrolling away with
   the conversation — the pattern used on astrocare.com.au */
.chat-chips-dock {
  flex-shrink: 0;
  background: var(--card-bg);
  /* Chips wrap onto as many rows as they need; the dock scrolls rather than
     letting them run off the right edge or shove the composer off-screen. */
  max-height: 38%;
  overflow-y: auto;
}
.chat-chips-dock:not(:empty) { border-top: 1px solid var(--card-border); }
.chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.7rem 1rem;
}
.chat-chips-label {
  width: 100%;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.1rem;
}
@media (max-width: 640px) {
  .chat-chips { padding: 0.6rem 0.75rem; gap: 0.35rem; }
  .chat-chips-label { display: none; }
  .chat-chip { font-size: 0.74rem; padding: 0.4rem 0.65rem; }
}

/* On a phone the assistant page is an app screen, not a document. Everything
   above the panel was squeezing the conversation down to a couple of lines on
   a smaller handset, so only a one-line heading survives and the panel takes
   the rest of the screen. */
@media (max-width: 900px) {
  .chat-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    padding: 0;
  }
  .chat-page-inner {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    width: 94%;
    padding-top: 6.2rem;
    padding-bottom: max(0.6rem, env(safe-area-inset-bottom));
  }

  .chat-page-intro { flex: 0 0 auto; margin-bottom: 0.45rem; }
  .chat-page-intro h1 {
    font-size: 1.15rem;
    line-height: 1.2;
    margin-bottom: 0;
  }
  /* The panel's own header and beta strip already say what this is */
  .chat-page-intro p,
  .chat-page-foot { display: none; }

  .chatbot-panel.chatbot-panel-page {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
  }

  /* The conversation keeps a floor; the chips give way instead */
  .chatbot-panel-page .chatbot-messages { min-height: 6rem; }
  .chatbot-panel-page .chat-chips-dock { max-height: 30%; }

  /* Fade the last row so a capped list reads as scrollable rather than cut */
  .chat-chips-dock {
    -webkit-mask-image: linear-gradient(180deg, #000 84%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 84%, transparent 100%);
  }

  /* Trim the panel's own furniture so more of the screen is the conversation */
  .chatbot-panel-page .chatbot-header { padding: 0.7rem 0.9rem; }
  .chatbot-panel-page .chatbot-avatar { width: 32px; height: 32px; }
  .chat-disclaimer { padding: 0.45rem 0.9rem; font-size: 0.68rem; }
}

/* Short screens — a 5.5" handset with the Safari bars showing has barely
   500px to work with, so the heading goes too. */
@media (max-width: 900px) and (max-height: 700px) {
  .chat-page-intro { display: none; }
  .chat-page-inner { padding-top: 5.9rem; }
  .chatbot-panel-page .chat-chips-dock { max-height: 26%; }
}

/* ============================================================
   iOS zoom guard — must stay last
   Safari zooms the whole page when a focused field is under 16px, and the
   page stays zoomed afterwards, which crops the right-hand side. This has
   to sit after the base .chatbot-input rule or the 14px there wins.
   ============================================================ */
@media (max-width: 900px) {
  .chatbot-input,
  input[type="text"],
  input[type="search"],
  input[type="email"],
  input[type="tel"],
  textarea,
  select {
    font-size: 16px;
  }
}
