:root {
  --forest: #315f50;
  --forest-dark: #173c32;
  --leaf: #74b875;
  --mint: #dcefe1;
  --mint-soft: #f2f8f3;
  --ink: #17221e;
  --muted: #66736d;
  --line: #d3dfd7;
  --gold: #e0b94f;
  --pink: #f04486;
  --cyan: #28bce7;
  --white: #fff;
  --shadow: 0 16px 45px rgba(24, 69, 56, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #e9f5ec 0, #f8fbf8 260px, #f4f7f5 100%);
  font-family: Inter, system-ui, sans-serif;
  min-height: 100vh;
}

.masthead {
  position: relative;
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 12% 10%, rgba(116,184,117,.35), transparent 32%),
    linear-gradient(125deg, var(--forest-dark), var(--forest) 58%, #467962);
  border-bottom: 5px solid var(--leaf);
}
.masthead::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  background: linear-gradient(90deg, var(--cyan), var(--pink), #65d477, var(--cyan));
}
.brand-lockup {
  max-width: 1180px;
  margin: auto;
  padding: 24px 22px 28px;
  display: grid;
  grid-template-columns: 150px 1fr 150px;
  align-items: center;
  gap: 28px;
}
.logo-box {
  height: 130px;
  display: grid;
  place-items: center;
  overflow: visible;
  background: transparent;
}
.logo-box img { width: 100%; height: 100%; object-fit: contain; }
.student-logo img { transform: scale(1.04); }
.muni-logo img { transform: scale(.96); }
.brand-copy { text-align: center; }
.eyebrow, .section-kicker {
  margin: 0 0 7px;
  text-transform: uppercase;
  letter-spacing: .13em;
  font-size: .78rem;
  font-weight: 800;
}
h1, h2, h3 { font-family: "Barlow Condensed", Impact, sans-serif; }
h1 { margin: 0; font-size: clamp(2.3rem, 5vw, 4.4rem); line-height: .88; text-transform: uppercase; }
h1 span { color: #dff5e2; }
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px;
  background: rgba(255,255,255,.11);
  font-size: .82rem;
  font-weight: 700;
}
.live-pill i { width: 8px; height: 8px; border-radius: 50%; background: #8cef85; box-shadow: 0 0 0 5px rgba(140,239,133,.15); }

main { width: min(1180px, calc(100% - 28px)); margin: 24px auto 50px; }
.home-menu, .toolbar, .panel, .status {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.95);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.home-menu { padding: clamp(24px, 5vw, 48px); text-align: center; }
.home-menu h2 { font-size: clamp(2rem, 5vw, 3.5rem); }
.home-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 920px; margin: 30px auto 4px; }
.home-choice {
  min-height: 230px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px;
  border: 0;
  border-radius: 22px;
  color: white;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(23,60,50,.18);
  transition: transform .18s ease, box-shadow .18s ease;
}
.home-choice:hover { transform: translateY(-3px); box-shadow: 0 18px 34px rgba(23,60,50,.24); }
.home-choice:focus-visible { outline: 4px solid rgba(40,188,231,.45); outline-offset: 3px; }
.home-choice > span:not(.choice-icon) { font-family: "Barlow Condensed", Impact, sans-serif; font-size: clamp(1.7rem, 4vw, 2.35rem); font-weight: 800; line-height: .95; text-transform: uppercase; }
.home-choice small { max-width: 290px; font-size: .86rem; line-height: 1.45; opacity: .88; }
.choice-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: rgba(255,255,255,.16); font-size: 2rem; font-weight: 800; }
.challenger-choice { background: linear-gradient(145deg, #96710f, #c29a2e 60%, #e0b94f); }
.sports-choice { background: linear-gradient(145deg, var(--forest-dark), var(--forest) 62%, #4f866d); }
.calendar-choice { background: linear-gradient(145deg, #245f5b, #327d72 62%, #68ad8d); }
.regulation-choice { background: linear-gradient(145deg, #173c32, #315f50 62%, #5f8f77); }
.news-feed {
  max-width: 920px;
  margin: 42px auto 0;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  text-align: left;
}
.news-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.news-heading h2 { font-size: clamp(2rem, 4vw, 2.8rem); }
.news-source {
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--forest-dark);
  background: var(--mint);
  font-size: .76rem;
  font-weight: 800;
}
.news-card {
  display: grid;
  grid-template-columns: minmax(320px, 1.08fr) minmax(240px, .92fr);
  align-items: stretch;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: white;
  box-shadow: 0 14px 30px rgba(23,60,50,.1);
}
.news-copy { display: flex; flex-direction: column; justify-content: center; padding: clamp(24px, 4vw, 42px); background: linear-gradient(145deg, var(--mint-soft), white 72%); }
.news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 16px; color: var(--muted); font-size: .76rem; font-weight: 700; }
.news-label {
  display: inline-block;
  margin: 0;
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--forest);
  background: var(--mint);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.news-copy h3 { margin: 0; color: var(--forest-dark); font-size: clamp(1.75rem, 3vw, 2.35rem); line-height: 1; text-transform: uppercase; }
.news-copy p { margin: 16px 0 24px; color: var(--muted); font-size: 1rem; line-height: 1.65; }
.news-copy a, .photo-story-copy a { display: inline-flex; align-self: flex-start; align-items: center; gap: 7px; color: white; background: var(--forest); border-radius: 12px; padding: 11px 14px; font-size: .86rem; font-weight: 800; text-decoration: none; }
.news-copy a:hover, .photo-story-copy a:hover { background: var(--forest-dark); }
.news-copy a:focus-visible, .photo-story-copy a:focus-visible { outline: 4px solid rgba(40,188,231,.35); outline-offset: 3px; }
.instagram-frame { min-height: 720px; overflow: hidden; border-right: 1px solid var(--line); background: #f7f7f7; }
.instagram-frame iframe { display: block; width: 100%; height: 720px; border: 0; }
.photo-story {
  display: grid;
  grid-template-columns: minmax(360px, 1.22fr) minmax(240px, .78fr);
  margin-top: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: white;
  box-shadow: 0 14px 30px rgba(23,60,50,.1);
}
.photo-carousel { position: relative; aspect-ratio: 1 / 1; min-width: 0; overflow: hidden; background: #10261f; touch-action: pan-y; }
.photo-carousel:focus-visible { outline: 4px solid rgba(40,188,231,.5); outline-offset: -4px; }
.carousel-track { display: flex; height: 100%; transition: transform .55s cubic-bezier(.22,.61,.36,1); }
.carousel-slide { flex: 0 0 100%; height: 100%; margin: 0; display: grid; place-items: center; }
.carousel-slide img { display: block; width: 100%; height: 100%; object-fit: contain; }
.carousel-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0 0 4px;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 50%;
  color: white;
  background: rgba(23,60,50,.78);
  font: 700 2rem/1 Inter, sans-serif;
  cursor: pointer;
  transform: translateY(-50%);
  backdrop-filter: blur(6px);
}
.carousel-arrow:hover { background: var(--forest-dark); }
.carousel-arrow:focus-visible { outline: 3px solid white; outline-offset: 2px; }
.carousel-prev { left: 14px; }
.carousel-next { right: 14px; }
.carousel-status { position: absolute; right: 14px; bottom: 14px; left: 14px; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.carousel-counter { flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; color: white; background: rgba(23,60,50,.8); font-size: .75rem; font-weight: 800; backdrop-filter: blur(6px); }
.carousel-dots { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; padding: 8px 10px; border-radius: 999px; background: rgba(23,60,50,.72); backdrop-filter: blur(6px); }
.carousel-dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.48); cursor: pointer; }
.carousel-dot[aria-current="true"] { background: white; transform: scale(1.35); }
.carousel-dot:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.photo-story-copy { display: flex; flex-direction: column; justify-content: center; padding: clamp(24px, 4vw, 42px); background: linear-gradient(145deg, #eef7f0, white 76%); }
.photo-story-copy h3 { margin: 0; color: var(--forest-dark); font-family: "Barlow Condensed", Impact, sans-serif; font-size: clamp(1.8rem, 3vw, 2.45rem); line-height: 1; text-transform: uppercase; }
.photo-story-copy p { margin: 16px 0 24px; color: var(--muted); font-size: 1rem; line-height: 1.65; }
.toolbar { padding: 20px; }
.toolbar-top { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.toolbar-actions { display: flex; gap: 8px; }
.section-kicker { color: var(--forest); }
h2 { margin: 0; color: var(--forest-dark); font-size: clamp(1.75rem, 4vw, 2.6rem); text-transform: uppercase; }
.refresh, .home-link {
  border: 1px solid var(--line);
  background: var(--mint-soft);
  color: var(--forest-dark);
  border-radius: 12px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.refresh:hover, .home-link:hover { background: var(--mint); }
.sport-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 16px 2px 2px; scrollbar-width: thin; }
.sport-tabs[hidden] { display: none; }
.sport-tab {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: white;
  color: var(--forest-dark);
  border-radius: 999px;
  padding: 9px 13px;
  font: inherit;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
}
.sport-tab[aria-selected="true"] { color: white; border-color: var(--forest); background: var(--forest); }
.sport-tab.general[aria-selected="true"] { background: #8b6a11; border-color: #8b6a11; }

.status { display: none; margin-top: 18px; padding: 18px 20px; color: var(--muted); }
.status.show { display: block; }
.status.error { color: #7b2f2f; border-color: #e8c4c4; background: #fff7f7; }
.content { display: grid; gap: 18px; margin-top: 18px; }
.panel { overflow: hidden; }
.panel-head { padding: 16px 18px; background: linear-gradient(90deg, var(--forest-dark), var(--forest)); color: white; }
.panel-head h3 { margin: 0; font-size: 1.45rem; text-transform: uppercase; letter-spacing: .02em; }
.panel-body { padding: 0; overflow-x: auto; }
.ranking-cards { display: none; padding: 14px; gap: 10px; }
.rank-card { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.place { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: white; background: var(--forest); font-weight: 800; }
.rank-card:first-child .place { color: #553f00; background: var(--gold); }
.team { font-weight: 800; }
.points { text-align: right; font-weight: 800; color: var(--forest); }
.points small { display:block; color: var(--muted); font-weight: 500; font-size: .7rem; }

table { width: 100%; border-collapse: collapse; min-width: 760px; font-size: .86rem; }
th { position: sticky; top: 0; z-index: 1; padding: 11px 9px; color: white; background: #5f9b70; text-align: center; white-space: nowrap; }
td { padding: 10px 9px; border-bottom: 1px solid #e3ebe5; text-align: center; }
tbody tr:nth-child(even) { background: var(--mint-soft); }
tbody tr:hover { background: var(--mint); }
td:first-child, th:first-child { text-align: left; font-weight: 700; }
.empty-cell { color: #a2ada7; }
.match-list { display: none; padding: 12px; gap: 10px; }
.match-card { padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.match-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .75rem; margin-bottom: 10px; }
.match-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; font-weight: 800; }
.match-teams span:last-child { text-align: right; }
.match-score-box { display: inline-grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-width: 88px; overflow: hidden; border: 2px solid var(--forest); border-radius: 10px; color: white; background: var(--forest-dark); text-align: center; box-shadow: 0 4px 10px rgba(23,60,50,.13); }
.match-score-box strong { min-width: 32px; padding: 8px 7px; font-size: 1rem; line-height: 1; }
.match-score-box span { color: #bfe2c7; font-weight: 800; }
.match-teams.has-padel-score { grid-template-columns: minmax(0,1fr) minmax(164px,190px) minmax(0,1fr); }
.padel-scoreboard { overflow: hidden; border: 1px solid var(--forest); border-radius: 9px; color: var(--forest-dark); background: white; text-align: center; }
.padel-score-head, .padel-score-total { display: grid; grid-template-columns: 1fr 1fr; }
.padel-score-head span { padding: 4px 3px; border-bottom: 1px solid var(--forest); background: var(--mint); font-size: .62rem; font-weight: 800; letter-spacing: .04em; }
.padel-score-head span + span, .padel-score-total strong + strong, .padel-games > div + div { border-left: 1px solid var(--forest); }
.padel-score-total strong { padding: 4px; border-bottom: 1px solid var(--forest); font-size: 1rem; line-height: 1; }
.padel-games { display: grid; grid-template-columns: 1fr 1fr; }
.padel-games > div { display: grid; grid-template-columns: repeat(3, 1fr); }
.padel-games span { padding: 4px 2px; font-size: .72rem; line-height: 1; }
.padel-games span + span { border-left: 1px solid var(--line); }
.scoreboard-cell { width: 190px; padding: 7px 10px; }
.padel-results table { min-width: 820px; }
.standard-results table { min-width: 980px; }
.standard-results .scoreboard-cell { width: 120px; }
.note { padding: 16px 18px; color: var(--muted); font-size: .84rem; }
.calendar-intro { margin: 0; padding: 16px 18px; color: var(--muted); background: var(--mint-soft); border-bottom: 1px solid var(--line); font-size: .92rem; line-height: 1.5; }
.calendar-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 18px; }
.calendar-day { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: white; }
.calendar-day-head { display: flex; align-items: center; gap: 13px; padding: 13px 15px; color: var(--forest-dark); background: var(--mint); border-bottom: 1px solid var(--line); }
.calendar-date { display: grid; place-items: center; flex: 0 0 54px; min-height: 54px; border-radius: 14px; color: white; background: var(--forest); font-family: "Barlow Condensed", Impact, sans-serif; font-size: 1.8rem; font-weight: 800; line-height: 1; }
.calendar-date small { display: block; font: 700 .62rem/1 Inter, sans-serif; letter-spacing: .08em; }
.calendar-day-head h4 { margin: 0; font-family: "Barlow Condensed", Impact, sans-serif; font-size: 1.45rem; text-transform: uppercase; }
.calendar-day-head p { margin: 2px 0 0; color: var(--muted); font-size: .78rem; }
.calendar-badge { margin-left: auto; padding: 6px 9px; border-radius: 999px; color: white; background: var(--forest); font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.calendar-block { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 13px 15px; }
.calendar-block + .calendar-block { border-top: 1px solid #e3ebe5; }
.calendar-shift { color: var(--forest); font-size: .76rem; font-weight: 800; text-transform: uppercase; }
.calendar-events { display: grid; gap: 5px; }
.calendar-event { font-size: .88rem; font-weight: 700; line-height: 1.35; }
.calendar-event::before { content: "•"; margin-right: 7px; color: var(--leaf); }
.calendar-day.stage-day .calendar-day-head { background: #e8f3ec; }
.calendar-day.final-day { border-color: #d2ad46; box-shadow: 0 10px 24px rgba(150,113,15,.13); }
.calendar-day.final-day .calendar-day-head { color: #553f00; background: #f5e7b6; }
.calendar-day.final-day .calendar-date, .calendar-day.final-day .calendar-badge { color: #553f00; background: var(--gold); }

footer { padding: 24px; color: white; background: var(--forest-dark); text-align: center; font-size: .82rem; }
footer p { margin: 3px; }

@media (max-width: 700px) {
  .brand-lockup { grid-template-columns: 72px 1fr 72px; gap: 10px; padding: 16px 12px 22px; }
  .logo-box { height: 72px; border-radius: 15px; }
  .eyebrow { font-size: .62rem; letter-spacing: .07em; }
  h1 { font-size: clamp(1.65rem, 8vw, 2.45rem); }
  .live-pill { margin-top: 10px; padding: 5px 9px; font-size: .7rem; }
  main { width: min(100% - 18px, 1180px); margin-top: 12px; }
  .home-menu { padding: 24px 15px; border-radius: 16px; }
  .home-actions { grid-template-columns: 1fr; gap: 12px; margin-top: 22px; }
  .home-choice { min-height: 170px; padding: 22px 16px; }
  .news-feed { margin-top: 30px; padding-top: 24px; }
  .news-heading { align-items: start; flex-direction: column; gap: 10px; }
  .news-card { grid-template-columns: 1fr; }
  .news-copy { padding: 26px 22px 30px; }
  .instagram-frame { min-height: 650px; border-right: 0; border-bottom: 1px solid var(--line); }
  .instagram-frame iframe { height: 650px; }
  .photo-story { grid-template-columns: 1fr; }
  .photo-story-copy { padding: 26px 22px 30px; }
  .carousel-arrow { width: 42px; height: 42px; }
  .carousel-prev { left: 10px; }
  .carousel-next { right: 10px; }
  .carousel-status { right: 10px; bottom: 10px; left: 10px; }
  .carousel-dots { max-width: 210px; }
  .toolbar { padding: 15px; border-radius: 16px; }
  .refresh span, .home-link span { display: none; }
  .ranking-cards, .match-list { display: grid; }
  .desktop-table.mobile-hide { display: none; }
  .panel-head { padding: 13px 15px; }
  .panel-head h3 { font-size: 1.25rem; }
  .calendar-grid { grid-template-columns: 1fr; padding: 12px; }
  .calendar-block { grid-template-columns: 76px 1fr; padding: 12px; }
  table { min-width: 680px; }
}

@media (max-width: 410px) {
  .match-teams.has-padel-score { grid-template-columns: minmax(0,1fr) 150px minmax(0,1fr); gap: 5px; }
  .match-teams.has-padel-score > span { font-size: .82rem; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
