/* playlocalcourts.com — the public front door */
:root {
  --green: #1f6b43;
  --green-dark: #164f31;
  --ball: #d4e83a;
  --paddle: #2f7fd1;
  --ink: #17231c;
  --muted: #5b6b61;
  --bg: #f4f6f2;
  --card: #ffffff;
  --line: #dfe5dc;
  --radius: 18px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--green); }
img { max-width: 100%; display: block; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

/* top bar */
.bar { background: var(--green); color: #fff; }
.bar .wrap { display: flex; align-items: center; gap: 10px; min-height: 60px; }
.brand { color: #fff; text-decoration: none; font-weight: 800; font-size: 19px; display: flex; align-items: center; gap: 10px; }
.brand .dot { width: 22px; height: 22px; border-radius: 50%; background: var(--ball); box-shadow: inset -3px -3px 0 rgba(0,0,0,.12); }
.bar .spacer { flex: 1; }
.bar a.link { color: #fff; text-decoration: none; font-weight: 600; opacity: .9; }

/* hero */
.hero { background: radial-gradient(120% 90% at 50% 0%, #2b8a57 0%, var(--green) 55%, var(--green-dark) 100%); color: #fff; text-align: center; padding: 40px 0 56px; overflow: hidden; }
.hero h1 { font-size: clamp(48px, 12vw, 88px); line-height: 1; margin: 6px 0 14px; letter-spacing: -0.03em; font-weight: 900; }
.hero p.lede { font-size: clamp(18px, 4.6vw, 22px); max-width: 560px; margin: 0 auto; opacity: .95; }
.rackets { width: min(300px, 78vw); height: auto; margin: 0 auto; display: block; }

/* choose your sport */
.choose { margin: -34px auto 0; position: relative; }
.choose .card { background: var(--card); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(15, 40, 25, .14); padding: 22px; text-align: center; }
.choose h2 { margin: 0 0 14px; font-size: 24px; }
.sports { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sport {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px 10px; border-radius: 16px; border: 2px solid var(--line);
  text-decoration: none; color: var(--ink); font-weight: 800; font-size: 20px;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.sport:hover, .sport:focus-visible { transform: translateY(-2px); border-color: var(--green); box-shadow: 0 6px 16px rgba(15,40,25,.12); outline: none; }
.sport svg { width: 64px; height: 64px; }
.sport small { font-weight: 500; color: var(--muted); font-size: 14px; }

/* how it works */
section.how { padding: 56px 0 24px; }
section.how h2 { text-align: center; font-size: clamp(28px, 6vw, 38px); margin: 0 0 8px; letter-spacing: -0.02em; }
section.how p.sub { text-align: center; color: var(--muted); max-width: 600px; margin: 0 auto 34px; }
.phones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.phone-item { text-align: center; }
.phone {
  width: 100%; max-width: 260px; margin: 0 auto 16px; border-radius: 34px; padding: 10px;
  background: #111; box-shadow: 0 18px 40px rgba(15, 40, 25, .22);
}
.phone img { border-radius: 25px; width: 100%; aspect-ratio: 390 / 844; object-fit: cover; object-position: top; background: #fff; }
.phone-item h3 { margin: 0 0 4px; font-size: 20px; }
.phone-item p { margin: 0 auto; color: var(--muted); max-width: 280px; font-size: 16px; }
@media (max-width: 760px) {
  .phones { grid-template-columns: 1fr; gap: 40px; }
  .phone { max-width: 250px; }
}

/* feature list */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 44px 0 0; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.feature b { display: block; margin-bottom: 2px; }
.feature span { color: var(--muted); font-size: 15px; }

.cta { text-align: center; padding: 40px 0 56px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--green); color: #fff; text-decoration: none; font-weight: 700;
  border-radius: 14px; padding: 14px 24px; min-height: 52px; font-size: 18px; border: 0; cursor: pointer;
}
.button:hover { background: var(--green-dark); }
.button.ghost { background: #fff; color: var(--green); border: 2px solid var(--green); }

footer { color: var(--muted); font-size: 14px; text-align: center; padding: 24px 0 40px; border-top: 1px solid var(--line); }

/* find page */
.find-head { padding: 26px 0 14px; }
.find-head h1 { margin: 0 0 4px; font-size: clamp(28px, 7vw, 40px); letter-spacing: -0.02em; }
.find-head p { margin: 0; color: var(--muted); }
.tabs { display: inline-flex; background: #e6ebe3; border-radius: 999px; padding: 4px; margin: 16px 0 0; }
.tabs a { padding: 8px 18px; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 700; }
.tabs a.on { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12); color: var(--green); }
#map { height: min(56vh, 460px); border-radius: var(--radius); border: 1px solid var(--line); background: #e8ede6; z-index: 0; }
.map-tools { display: flex; justify-content: flex-end; margin: 10px 0 0; }
.small-btn { font: inherit; font-size: 15px; font-weight: 600; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; cursor: pointer; color: var(--ink); }
.groups { margin: 18px 0 40px; display: grid; gap: 14px; }
.group { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; gap: 14px; align-items: flex-start; }
.group .icon { width: 48px; height: 48px; flex: none; border-radius: 12px; background: #eaf4ee; display: flex; align-items: center; justify-content: center; font-size: 26px; }
.group h3 { margin: 0; font-size: 20px; }
.group .where { color: var(--muted); margin: 2px 0 8px; }
.group .next { font-size: 15px; margin: 0 0 12px; }
.group .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.group .button { min-height: 44px; padding: 10px 18px; font-size: 16px; }
.empty-card { background: var(--card); border: 1px dashed #b9c6b6; border-radius: var(--radius); padding: 22px; text-align: center; }
.empty-card h3 { margin: 0 0 6px; }
.empty-card p { color: var(--muted); margin: 0 0 14px; }
.leaflet-popup-content { font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.leaflet-popup-content b { font-size: 16px; }

/* group page */
.group-page { padding: 18px 20px 40px; max-width: 680px; }
.group-page .back { margin: 0 0 16px; }
.group-hero { display: flex; gap: 14px; align-items: center; }
.group-hero .icon { width: 64px; height: 64px; flex: none; border-radius: 16px; background: #eaf4ee; display: flex; align-items: center; justify-content: center; font-size: 34px; }
.group-hero h1 { margin: 0; font-size: clamp(28px, 7vw, 38px); letter-spacing: -0.02em; line-height: 1.1; }
.group-hero .where { color: var(--muted); margin-top: 4px; }
.member-count { display: inline-block; margin: 18px 0 0; background: #eaf4ee; color: var(--green); font-weight: 700; border-radius: 999px; padding: 6px 14px; }
.about { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 18px 0; }
.about h2 { margin: 0 0 6px; font-size: 18px; }
.about p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.join-box { text-align: center; }
.join-box .button { width: 100%; max-width: 360px; }
.small-note { color: var(--muted); font-size: 14px; margin: 10px 0 0; }
.group .count { font-size: 15px; margin: 0 0 12px; color: var(--green); font-weight: 600; }

/* home page map card */
.card.finder { text-align: left; padding: 18px; }
.card.finder h2 { text-align: center; margin: 0 0 4px; }
.card.finder .tabs { display: flex; width: 100%; margin: 10px 0 14px; }
.card.finder .tabs a { flex: 1; text-align: center; font-size: 17px; padding: 10px 12px; }
.card.finder #map { height: min(52vh, 420px); }
.map-tools { align-items: center; gap: 10px; }
.map-hint { flex: 1; color: var(--muted); font-size: 14px; }
.card.finder .groups { margin: 14px 0 0; }
html { scroll-padding-top: 12px; }

/* header stays at the top while scrolling */
.bar { position: sticky; top: 0; z-index: 1000; box-shadow: 0 1px 0 rgba(0,0,0,.08); }
.bar-links { display: flex; gap: 16px; }
.bar a.link { white-space: nowrap; }
html { scroll-padding-top: 72px; }
@media (max-width: 420px) {
  .bar .wrap { padding: 0 12px; gap: 8px; }
  .brand { font-size: 16px; gap: 7px; }
  .brand .dot { width: 18px; height: 18px; }
  .bar-links { gap: 10px; }
  .bar a.link { font-size: 14px; }
}
.brand { white-space: nowrap; }
@media (max-width: 420px) {
  .brand { font-size: 15px; }
  .bar a.link { font-size: 13px; }
  .bar-links { gap: 9px; }
}

/* group landing page (what the flyer's QR code opens) */
.group-page { max-width: 1040px; }
.group-page > .group-hero, .group-page > .member-count, .group-page > .about, .group-page > .join-box, .group-page > .back, .where-we-play { max-width: 680px; margin-left: auto; margin-right: auto; }
.group-page > .member-count { display: block; width: fit-content; }
.where-we-play { margin-top: 34px; }
.where-we-play h2, .app-pics h2 { font-size: 24px; margin: 0 0 10px; letter-spacing: -0.01em; }
#group-map { height: 300px; border-radius: var(--radius); border: 1px solid var(--line); z-index: 0; }
.where-we-play .small-note { text-align: right; }
.app-pics { margin-top: 40px; text-align: center; }
.app-pics .sub { color: var(--muted); margin: 0 auto 26px; }
.join-box.bottom { margin: 34px auto 10px; }

/* "Sign into this page" on group pages */
.join-box .signin-btn { margin-top: 12px; font-family: inherit; }
.signin-form { max-width: 440px; margin: 12px auto 0; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.signin-form label { display: block; font-size: 15px; margin-bottom: 8px; }
.signin-row { display: flex; gap: 8px; }
.signin-row input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.signin-row .button { min-height: 44px; padding: 8px 14px; font-size: 15px; white-space: nowrap; }
.signin-msg { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.signin-msg:empty { display: none; }
.signin-msg.ok { color: var(--green); font-weight: 600; }
.signin-msg.error { color: #b3261e; font-weight: 600; }
@media (max-width: 420px) { .signin-row { flex-direction: column; } }
/* keep "Email my link" small so the email box gets the room */
.join-box .signin-row .button { width: auto; max-width: none; flex: none; }
@media (max-width: 420px) { .join-box .signin-row .button { width: 100%; } }

/* ladders */
.type-tag { display: inline-block; vertical-align: middle; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 9px; background: #eaf4ee; color: var(--green); margin-left: 4px; }
.type-tag.ladder { background: #fff3d6; color: #8a5a00; }
.group-hero .type-tag { margin: 4px 0 2px; }
.pop-group { margin-top: 6px; }
.pop-type { color: #5b6b61; font-size: 13px; }
.ladder-how { max-width: 680px; margin: 34px auto 0; }
.ladder-how h2 { font-size: 24px; margin: 0 0 10px; }
.how-steps { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 18px 40px; margin: 0; }
.how-steps li { margin: 8px 0; }

/* group / ladder icons */
.type-pin { background: none; border: 0; }
.type-pin svg { filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
.group .icon.type-icon, .group-hero .icon { color: #fff; }
.map-key { display: flex; gap: 16px; margin-top: 10px; font-size: 14px; color: var(--muted); }
.map-key > span { display: inline-flex; align-items: center; gap: 6px; }
.key-badge { display: inline-flex; width: 22px; height: 22px; border-radius: 6px; align-items: center; justify-content: center; }
.pop-head { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.pop-badge { display: inline-flex; width: 26px; height: 26px; border-radius: 7px; align-items: center; justify-content: center; flex: none; }

/* PlayLocalCourts.com logo in the header */
.brand .logo { width: 30px; height: 30px; flex: none; display: block; }
@media (max-width: 420px) { .brand .logo { width: 24px; height: 24px; } .brand { font-size: 14.5px; } }
.ladder-list { max-width: 680px; margin: 0 auto 12px; }
