:root {
  --green-950: #0b2e1f;
  --green-800: #14532d;
  --green-600: #1d7a44;
  --green-500: #22c55e;
  --fairway: #e9f7ee;
  --gold: #f5b301;
  --gold-dark: #d99a00;
  --ink: #101613;
  --muted: #5b6b60;
  --card: #ffffff;
  --line: #dbe7de;
  --red: #c62f3b;
  --shadow: 0 10px 30px rgba(11, 46, 31, 0.14);
  --radius: 16px;
}

/* The hidden attribute always wins. Without this rule, any element that
   also gets a display value (the modal backdrop is flex) stays visible
   even when hidden is set, which is what jammed the popup open. */
[hidden] { display: none !important; }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 18px;
  color: var(--ink);
  background: #dfe9e1;
  padding-bottom: calc(86px + env(safe-area-inset-bottom));
}

/* ---------- app frame ---------- */

.screen {
  max-width: 560px;
  margin: 0 auto;
  background: var(--fairway);
  min-height: 100vh;
  box-shadow: 0 0 44px rgba(11, 46, 31, 0.18);
  padding: 18px 16px 30px;
}

/* ---------- app bar ---------- */

.appbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(11, 46, 31, 0.97);
  color: #fff;
}

.appbar-inner {
  max-width: 560px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand { display: flex; align-items: center; gap: 9px; font-family: "Archivo", sans-serif; font-weight: 900; font-size: 19px; }
.brand-flag { font-size: 22px; }

.appbar-book {
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 15px;
  border: 0;
  border-radius: 999px;
  padding: 9px 16px;
  background: var(--gold);
  color: #221a00;
  cursor: pointer;
}
.appbar-book:active { background: var(--gold-dark); }

/* ---------- views ---------- */

.view { display: none; }
.view.active { display: block; }

/* ---------- home ---------- */

.hello { padding: 8px 2px 14px; }

.eyebrow {
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--green-600);
}

.hello h1 {
  font-family: "Archivo", sans-serif;
  font-weight: 900;
  font-size: 38px;
  line-height: 1.04;
  margin: 8px 0 0;
  color: var(--green-950);
}

.next-card {
  background: linear-gradient(135deg, var(--green-950) 0%, var(--green-800) 60%, var(--green-600) 100%);
  color: #fff;
  border-radius: 20px;
  padding: 20px;
  border-bottom: 5px solid var(--gold);
  box-shadow: var(--shadow);
}

.next-card.none { background: linear-gradient(135deg, #33463a 0%, #223528 100%); }
.next-card .btn { margin-top: 14px; }

.next-up-label {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}

.next-up-course { font-family: "Archivo", sans-serif; font-weight: 900; font-size: 27px; margin-top: 6px; line-height: 1.15; }
.next-up-when { color: #d9f2e1; margin-top: 3px; }
.next-up-count { margin-top: 9px; font-weight: 700; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 4px; }

.stat { background: #fff; border-radius: 14px; padding: 12px 8px; text-align: center; box-shadow: 0 4px 14px rgba(11, 46, 31, 0.08); }
.stat-num { font-family: "Archivo", sans-serif; font-weight: 900; font-size: 26px; color: var(--green-800); }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 2px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 22px 0 12px; }
.section-head.first { margin-top: 4px; }
.section-head h2 { font-family: "Archivo", sans-serif; font-weight: 900; font-size: 24px; margin: 0; color: var(--green-950); }

.how { margin-top: 26px; background: #fff; border-radius: 20px; padding: 18px; box-shadow: 0 4px 14px rgba(11, 46, 31, 0.08); }
.how h2 { font-family: "Archivo", sans-serif; font-weight: 900; font-size: 21px; margin: 0 0 12px; color: var(--green-950); }
.how-step { display: flex; gap: 12px; padding: 8px 0; align-items: flex-start; color: var(--ink); font-size: 16px; }
.how-num {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 999px;
  background: var(--green-800); color: #fff; font-weight: 900; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}

.mini-empty { color: var(--muted); font-size: 16px; padding: 6px 2px; }

/* ---------- buttons ---------- */

.btn {
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 16px;
  border: 0;
  border-radius: 999px;
  padding: 13px 22px;
  cursor: pointer;
  min-height: 48px;
  transition: transform 0.08s ease, background 0.15s ease;
}

.btn:active { transform: translateY(1px) scale(0.99); }

.btn-gold { background: var(--gold); color: #221a00; box-shadow: 0 6px 18px rgba(245, 179, 1, 0.35); }
.btn-green { background: var(--green-600); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); }
.btn-small { padding: 9px 15px; font-size: 14px; min-height: 42px; }

.link-btn {
  border: 0; background: transparent; cursor: pointer; font-weight: 700; font-size: 15px;
  color: var(--green-800); padding: 6px 2px;
}
.link-btn.danger { color: var(--red); }

/* ---------- tee sheet toolbar ---------- */

.toolbar { display: grid; gap: 10px; margin-bottom: 16px; }

.seg { display: flex; background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: 3px; }
.seg-btn {
  flex: 1;
  border: 0;
  background: transparent;
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 15px;
  padding: 10px 8px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
  min-height: 44px;
}
.seg-btn.active { background: var(--green-800); color: #fff; }

.search {
  font-size: 17px;
  padding: 13px 16px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
  width: 100%;
}

.search:focus, input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(34, 197, 94, 0.45);
  outline-offset: 1px;
}

.status {
  background: #fff3cd;
  border: 1px solid #ffe08a;
  color: #664d03;
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 18px;
  font-weight: 600;
}

/* ---------- cards ---------- */

.cards { display: grid; grid-template-columns: 1fr; gap: 16px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-top: 6px solid var(--green-600);
}

.card.past { border-top-color: #9db3a4; opacity: 0.88; }

.card-head { display: flex; gap: 14px; padding: 16px 16px 4px; }

.date-badge {
  flex: 0 0 auto;
  width: 70px;
  height: 70px;
  border-radius: 14px;
  background: var(--green-800);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.date-badge .dow { font-size: 11px; letter-spacing: 0.14em; font-weight: 700; text-transform: uppercase; color: var(--gold); }
.date-badge .dom { font-family: "Archivo", sans-serif; font-weight: 900; font-size: 30px; margin: 3px 0; }
.date-badge .mon { font-size: 11px; letter-spacing: 0.14em; font-weight: 700; text-transform: uppercase; }

.card-title h3 {
  font-family: "Archivo", sans-serif;
  font-weight: 900;
  font-size: 23px;
  margin: 2px 0 4px;
  color: var(--ink);
  line-height: 1.15;
}

.card-title .when { font-weight: 700; color: var(--green-800); }
.card-title .meta { color: var(--muted); font-size: 15px; }

.card-notes { padding: 0 16px; color: var(--ink); font-size: 16px; }

.meter { padding: 12px 16px 0; }
.meter-top { display: flex; justify-content: space-between; font-size: 14px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.meter-top .full { color: var(--red); }
.meter-bar { height: 12px; background: var(--line); border-radius: 999px; overflow: hidden; }
.meter-fill { height: 100%; background: linear-gradient(90deg, var(--green-500), var(--green-600)); border-radius: 999px; transition: width 0.4s ease; }
.meter-fill.full { background: linear-gradient(90deg, #e05260, var(--red)); }

.players { padding: 12px 16px 4px; display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--fairway);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 7px 8px 7px 12px;
  font-weight: 600;
  font-size: 15px;
}

.chip .ride { font-size: 15px; }
.chip .x {
  border: 0; background: transparent; cursor: pointer; font-size: 15px; color: var(--muted);
  padding: 6px; border-radius: 999px; line-height: 1; min-width: 32px; min-height: 32px;
}
.chip .x:hover { color: var(--red); }

.notgoing { padding: 2px 16px 6px; color: var(--muted); font-size: 15px; }
.notgoing s { text-decoration-thickness: 2px; }

.card-actions { margin-top: auto; padding: 12px 16px 16px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- RSVP form inside card ---------- */

.rsvp-form {
  border-top: 2px dashed var(--line);
  margin: 6px 16px 16px;
  padding-top: 14px;
  display: grid;
  gap: 10px;
}

.rsvp-form label { font-weight: 700; font-size: 14px; display: grid; gap: 5px; color: var(--ink); }

.rsvp-form input, .rsvp-form select, .rsvp-form textarea,
.modal input, .modal select, .modal textarea {
  font: inherit;
  font-size: 16px;
  padding: 11px 12px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  width: 100%;
}

.going-seg { display: flex; gap: 8px; }
.going-seg button {
  flex: 1;
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 15px;
  padding: 11px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: #fff;
  cursor: pointer;
  color: var(--muted);
  min-height: 48px;
}
.going-seg button.on-going { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.going-seg button.on-out { background: #eceff1; border-color: #b0bec5; color: var(--ink); }

.form-errors {
  background: #fdecea;
  border: 1px solid #f5c2c0;
  color: #7a121b;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
}

/* ---------- empty state / footer ---------- */

.empty { text-align: center; padding: 48px 16px; }
.empty-flag { font-size: 52px; color: var(--gold); line-height: 1; }
.empty h2 { font-family: "Archivo", sans-serif; font-weight: 900; font-size: 28px; margin: 10px 0 6px; }
.empty p { color: var(--muted); margin: 0 0 18px; }

.foot { text-align: center; color: var(--muted); padding: 26px 10px 6px; font-size: 14px; }
.foot .dot { margin: 0 8px; }

/* ---------- tab bar ---------- */

.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 560px;
  background: rgba(255, 255, 255, 0.98);
  border-top: 2px solid var(--line);
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  z-index: 30;
  box-shadow: 0 -6px 20px rgba(11, 46, 31, 0.10);
}

.tab {
  border: 0; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-family: "Archivo", sans-serif; font-weight: 700; font-size: 13px;
  color: var(--muted);
  padding: 6px 18px;
  min-height: 52px;
}
.tab-ico { font-size: 21px; }
.tab.active { color: var(--green-800); }

.tab-book {
  border: 0; cursor: pointer;
  width: 58px; height: 58px; border-radius: 999px;
  background: var(--gold); color: #221a00;
  font-size: 30px; font-weight: 900; line-height: 1;
  box-shadow: 0 8px 20px rgba(245, 179, 1, 0.45);
  margin-top: -22px;
}
.tab-book:active { background: var(--gold-dark); }

/* ---------- bottom sheet modal ---------- */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(7, 26, 17, 0.55);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 40;
}

.modal {
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  width: min(560px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal h2 { font-family: "Archivo", sans-serif; font-weight: 900; font-size: 27px; margin: 0; }
.modal-x {
  border: 0; background: var(--fairway); color: var(--ink); cursor: pointer;
  width: 40px; height: 40px; border-radius: 999px; font-size: 17px; font-weight: 700;
}
.modal form { display: grid; gap: 12px; }
.modal label { font-weight: 700; font-size: 15px; display: grid; gap: 5px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--green-950);
  color: #fff;
  font-weight: 700;
  padding: 13px 22px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  z-index: 60;
  width: max-content;
  max-width: calc(100vw - 40px);
  text-align: center;
}

@media (max-width: 380px) {
  .row2 { grid-template-columns: 1fr; }
  .hello h1 { font-size: 33px; }
}

/* ================= DARK THEME (overrides) ================= */
:root {
  --ink: #e8f1eb;
  --muted: #9fb3a6;
  --card: #16211b;
  --line: #2c3d33;
  --fairway: #0f1814;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}
body { background: #070c09; }
.screen { background: var(--fairway); box-shadow: 0 0 44px rgba(0, 0, 0, 0.6); }
.eyebrow { color: var(--green-500); }
.hello h1, .section-head h2, .how h2 { color: #f3f8f4; }
.stat, .how { background: var(--card); border: 1px solid var(--line); box-shadow: none; }
.stat-num { color: var(--green-500); }
.seg { background: var(--card); }
.search, .rsvp-form input, .rsvp-form select, .rsvp-form textarea,
.modal input, .modal select, .modal textarea { background: #0c1410; color: var(--ink); border-color: var(--line); }
.going-seg button { background: #0c1410; color: var(--muted); border-color: var(--line); }
.going-seg button.on-out { background: #3a2a2c; border-color: #6b3b41; color: var(--ink); }
.form-errors { background: #3a1517; border-color: #7a2a30; color: #ffb3b8; }
.status { background: #3a3110; color: #ffe08a; }
.tabbar { background: rgba(10, 16, 13, 0.98); border-top-color: var(--line); }
.tab.active, .link-btn, .card-title .when { color: var(--green-500); }
.link-btn.danger { color: #ff6b77; }
.modal { background: #121b16; color: var(--ink); }
.modal-x { background: #1f2c25; color: var(--ink); }
.btn-ghost { color: var(--ink); border-color: var(--line); }
.chip { background: #0c1410; border-color: var(--line); color: var(--ink); }
.meter-bar { background: #26352c; }

/* Event cards: a clear border so each round pops off the page */
.card {
  background: var(--card);
  border: 2px solid #2f6b47;
  border-top: 6px solid var(--green-500);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.08), 0 12px 28px rgba(0, 0, 0, 0.55);
}
.card.past { border-color: #3a4a40; border-top-color: #5d7366; }

/* ================= V2: GOLF PHOTO THEME ================= */
:root { --gold: #f5c542; }
html, body { overflow-x: clip; }
body { background: #070c09; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5,10,7,0.55) 0%, rgba(5,12,8,0.62) 50%, rgba(4,8,6,0.70) 100%),
    url("img/turf.webp") center / cover no-repeat, #070c09;
}
@media (max-width: 600px) {
  body::before {
    background:
      linear-gradient(180deg, rgba(5,10,7,0.55) 0%, rgba(5,12,8,0.62) 50%, rgba(4,8,6,0.70) 100%),
      url("img/turf-mobile.webp") center / cover no-repeat, #070c09;
  }
}
.view > h2, .section-head, .section-head *, footer, .credits, .a2hs-btn, .mini-empty { text-shadow: 0 1px 6px rgba(0,0,0,0.85), 0 0 2px rgba(0,0,0,0.6); }
.a2hs-btn { background: rgba(5,12,8,0.55); color: #d6e2da; }
.credits a { color: #d6e2da; }
.screen { background: transparent; box-shadow: none; padding-top: 0; }
.appbar { background: rgba(7, 12, 9, 0.82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid rgba(245,197,66,0.18); }
.brand-name { font-family: "Archivo", sans-serif; font-weight: 900; letter-spacing: 0.04em; text-transform: uppercase; }

/* Hero */
.hero {
  position: relative;
  margin: 0 -16px 18px;
  padding: 120px 20px 30px;
  min-height: 300px;
  display: flex; flex-direction: column; justify-content: flex-end;
  background:
    linear-gradient(180deg, rgba(7,12,9,0.15) 0%, rgba(7,12,9,0.35) 45%, rgba(7,12,9,0.95) 100%),
    url("img/hero-green.webp") center 40% / cover no-repeat;
  overflow: hidden;
}
.hero .eyebrow {
  display: inline-block; align-self: flex-start;
  background: var(--gold); color: #1d1600;
  padding: 5px 12px; border-radius: 999px;
  font-size: 12px; letter-spacing: 0.12em; font-weight: 800;
}
.hero h1 {
  color: #fff !important;
  font-size: 42px; line-height: 1.02; margin-top: 12px;
  text-shadow: 0 3px 18px rgba(0,0,0,0.6);
}

/* Next-up card on a flag photo */
.next-card {
  position: relative; overflow: hidden;
  background:
    linear-gradient(100deg, rgba(6,22,14,0.96) 0%, rgba(6,22,14,0.78) 55%, rgba(6,22,14,0.25) 100%),
    url("img/flag-dusk.webp") right center / cover no-repeat;
  border: 1px solid rgba(245,197,66,0.35);
  border-bottom: 5px solid var(--gold);
  min-height: 150px;
}
.next-card.none {
  background:
    linear-gradient(100deg, rgba(6,22,14,0.96) 0%, rgba(6,22,14,0.8) 55%, rgba(6,22,14,0.3) 100%),
    url("img/flag-dusk.webp") right center / cover no-repeat;
}
.next-up-label { color: var(--gold); letter-spacing: 0.08em; text-transform: uppercase; font-size: 13px; font-weight: 800; }
.next-up-course { text-shadow: 0 2px 10px rgba(0,0,0,0.5); }

/* Golf ball stats */
.stat {
  background:
    rgba(10, 22, 15, 0.72);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.stat-num { color: #fff; }
.stat:nth-child(1) .stat-num { color: var(--gold); }
.stat:nth-child(2) .stat-num { color: var(--green-500); }

.how { border-left: 4px solid var(--gold); }
.how-num { background: var(--gold); color: #1d1600; }

/* Tee sheet banner */
.sheet-banner {
  margin: 0 -16px 16px;
  padding: 70px 20px 20px;
  background:
    linear-gradient(180deg, rgba(7,12,9,0.1) 0%, rgba(7,12,9,0.92) 100%),
    url("img/fairway-sunrise.webp") center 60% / cover no-repeat;
}
.sheet-banner .eyebrow { color: var(--gold); }
.sheet-banner h2 { font-family: "Archivo", sans-serif; font-weight: 900; font-size: 34px; margin: 4px 0 0; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,0.6); }

/* Empty state with photo */
.empty {
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(7,12,9,0.55), rgba(7,12,9,0.95)),
    url("img/flag-dusk.webp") center / cover no-repeat;
}
.mini-empty { border: 1px dashed rgba(245,197,66,0.4); border-radius: 14px; padding: 16px; color: var(--muted); }

.credits { font-size: 11px; margin-top: 8px; opacity: 0.75; }
.credits a { color: var(--muted); }

/* ================= V2: DESKTOP ================= */
@media (min-width: 900px) {
  body { padding-bottom: 110px; }
  .screen, .appbar-inner { max-width: 1160px; }
  .screen { padding: 0 32px 40px; }
  .hero {
    margin: 0 calc(50% - 50vw) 28px;
    padding: 200px max(32px, calc(50vw - 548px)) 56px;
    min-height: 480px;
    background-position: center 55%;
  }
  .hero h1 { font-size: 72px; }
  .hero .eyebrow { font-size: 14px; }
  .home-top { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: stretch; }
  .next-wrap > .next-card { height: 100%; box-sizing: border-box; min-height: 200px; padding: 28px; }
  .next-wrap > .next-card[hidden] { display: none; }
  .next-up-course { font-size: 32px; }
  .home-top .stats { grid-template-columns: 1fr; margin: 0; }
  .home-top .stat { display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px 18px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 20px; }
  .how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 24px; }
  .how h2 { grid-column: 1 / -1; margin-bottom: 0; }
  .sheet-banner { margin: 0 calc(50% - 50vw) 24px; padding: 150px max(32px, calc(50vw - 548px)) 32px; }
  .sheet-banner h2 { font-size: 52px; }
  .toolbar { display: flex; gap: 16px; align-items: center; }
  .toolbar .search { max-width: 360px; margin-left: auto; }
  .tabbar {
    bottom: 18px; max-width: 420px; border-radius: 999px;
    border: 1px solid var(--line); box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  }
  .modal-backdrop { align-items: center; }
  .modal { border-radius: 24px; padding: 28px; width: min(560px, 92vw); }
}
@media (min-width: 900px) {
  .hero { background:
    linear-gradient(180deg, rgba(7,12,9,0.15) 0%, rgba(7,12,9,0.35) 45%, rgba(7,12,9,0.95) 100%),
    url("img/hero-green-wide.webp") center 55% / cover no-repeat; }
}

/* ================= V2: COMMENTS + RESCHEDULE ================= */
.card-actions { flex-wrap: wrap; }
.modal.resched, .resched .modal { border-top: 4px solid var(--gold); }
@media (min-width: 900px) {
  .resched .modal { width: min(440px, 92vw); }
}
@media (min-width: 900px) { .cards { align-items: start; } }

/* ================= V2: PER-ROUND PHOTOS ================= */
.ph-0 { --ph: url("img/flag-dusk.webp"); }
.ph-1 { --ph: url("img/ev-hole.webp"); }
.ph-2 { --ph: url("img/ev-tee.webp"); }
.ph-3 { --ph: url("img/ev-coast.webp"); }
.ph-4 { --ph: url("img/ev-cart.webp"); }
.next-card[class*="ph-"] {
  background:
    linear-gradient(100deg, rgba(6,22,14,0.96) 0%, rgba(6,22,14,0.8) 55%, rgba(6,22,14,0.35) 100%),
    var(--ph) center / cover no-repeat;
}
.card[class*="ph-"] {
  background:
    linear-gradient(180deg, rgba(10,18,14,0.3) 0%, rgba(10,18,14,0.62) 30%, rgba(10,18,14,0.9) 60%, rgba(10,18,14,0.96) 100%),
    var(--ph) center top / 100% auto no-repeat,
    var(--card);
}
.card[class*="ph-"] .card-title h3 { text-shadow: 0 2px 10px rgba(0,0,0,0.7); }
.card[class*="ph-"] .chip { background-color: rgba(8,14,11,0.85); }
.hero-sub { color: rgba(255,255,255,0.86); font-size: 17px; margin: 10px 0 0; max-width: 34ch; text-shadow: 0 2px 10px rgba(0,0,0,0.6); }
@media (min-width: 900px) { .hero-sub { font-size: 20px; } }

/* ================= REAL TAB BUTTONS ================= */
.tabbar { align-items: center; gap: 10px; padding-left: 14px; padding-right: 14px; }
.tab {
  flex: 1; flex-direction: row; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 14px; border-radius: 14px;
  background: #16211b; border: 1.5px solid var(--line);
  color: var(--ink); font-size: 15px; letter-spacing: 0.2px;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.tab:hover { border-color: var(--green-500); }
.tab:active { transform: scale(0.97); }
.tab.active { background: var(--green-500); border-color: var(--green-500); color: #06110b; }
.tab-svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tab-book { flex: 0 0 auto; margin-top: 0; width: 54px; height: 54px; }
@media (min-width: 900px) { .tabbar { padding: 8px 10px; } .tab { border-radius: 999px; } }

/* logo */
.brand-logo { width: 36px; height: 36px; display: block; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5)); }
@media (min-width: 900px) { .brand-logo { width: 40px; height: 40px; } }

/* word art */
.brand-name.wordart { display: inline-flex; align-items: center; gap: 2px; text-transform: none; letter-spacing: 0; line-height: 1; }
.wa-bogey {
  font-family: "Yellowtail", cursive; font-weight: 400; font-size: 30px;
  background: linear-gradient(180deg, #fff3c4 0%, #ffd34d 45%, #e09b00 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 #3a2a00) drop-shadow(0 4px 8px rgba(0,0,0,0.55));
  transform: rotate(-6deg) translateY(-1px); padding: 0 4px 4px 0;
}
.wa-boys {
  font-family: "Archivo Black", "Archivo", sans-serif; font-size: 15px; letter-spacing: 0.22em;
  color: #fff; padding: 4px 6px 3px 8px; margin-left: -2px;
  background: #16a34a; border: 2px solid #ffd34d; border-radius: 6px;
  box-shadow: 0 3px 0 #0a4d24, 0 6px 12px rgba(0,0,0,0.45);
  transform: skewX(-8deg);
}
@media (min-width: 900px) { .wa-bogey { font-size: 36px; } .wa-boys { font-size: 17px; } }

/* ================= V2: WEEK CALENDAR ================= */
.weeknav { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; }
.wk-arrow {
  width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-size: 24px; line-height: 1; cursor: pointer;
}
.wk-arrow:disabled, .wk-today:disabled { opacity: 0.35; cursor: default; }
.wk-label { flex: 1; text-align: center; font: 900 19px "Archivo", sans-serif; color: #fff; }
.wk-today {
  border: 1px solid rgba(245,197,66,0.5); background: transparent; color: var(--gold);
  border-radius: 999px; padding: 9px 12px; font-weight: 700; font-size: 13px; cursor: pointer;
}
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 12px; }
.ws-day {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer;
}
.ws-dow { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; }
.ws-dom { font: 900 18px "Archivo", sans-serif; }
.ws-dot { min-height: 14px; font-size: 10px; font-weight: 800; color: #1d1600; }
.ws-day.has .ws-dot { min-width: 8px; height: 8px; min-height: 8px; border-radius: 999px; background: var(--gold); margin-top: 3px; line-height: 8px; }
.ws-day.has .ws-dot:not(:empty) { height: 14px; min-height: 14px; min-width: 14px; line-height: 14px; padding: 0 3px; }
.ws-day.today { border-color: var(--green-500); background: rgba(34,197,94,0.14); }
.ws-day.today .ws-dow { color: var(--green-500); }

.week { display: grid; gap: 18px; }
.day-head { display: flex; align-items: baseline; gap: 8px; padding: 0 2px 8px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.day-dow { font: 900 18px "Archivo", sans-serif; color: #fff; }
.day-date { color: var(--muted); font-weight: 600; font-size: 15px; }
.day-today { background: var(--green-500); color: #062012; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.05em; }
.day-add { margin-left: auto; background: none; border: 1px solid var(--line); color: var(--gold); border-radius: 999px; width: 30px; height: 30px; cursor: pointer; font-size: 16px; }
.day.today .day-dow { color: var(--green-500); }
.no-rounds {
  width: 100%; text-align: left; background: none; border: 1px dashed var(--line); border-radius: 12px;
  color: var(--muted); padding: 10px 12px; font-size: 14px; cursor: pointer; display: flex; justify-content: space-between;
}
.no-rounds span { color: var(--gold); font-weight: 700; opacity: 0.8; }
.no-rounds:hover { border-color: rgba(245,197,66,0.5); }

/* compact tiles (desktop) */
.tile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%;
  text-align: left; padding: 0 0 10px; margin-bottom: 8px; border-radius: 12px; overflow: hidden; cursor: pointer;
  background: var(--card); border: 1px solid #2f6b47; border-top: 4px solid var(--green-500); color: var(--ink);
}
.tile:hover { border-color: var(--gold); transform: translateY(-1px); }
.tile-photo { display: block; width: 100%; height: 54px; background: linear-gradient(180deg, transparent, rgba(10,18,14,0.6)), var(--ph) center / cover no-repeat; margin-bottom: 6px; }
.tile-time, .tile-course, .tile-count { padding: 0 10px; }
.tile-time { color: var(--green-500); font-weight: 800; font-size: 14px; }
.tile-course { font: 800 14px "Archivo", sans-serif; color: #fff; line-height: 1.2; overflow-wrap: anywhere; }
.tile-count { color: var(--muted); font-size: 12px; font-weight: 600; }
.tile-count.full { color: var(--gold); }

.card-dialog { align-items: center; padding: 20px; overflow-y: auto; }
.card-dialog-inner { position: relative; width: min(520px, 94vw); max-height: 90vh; overflow-y: auto; border-radius: var(--radius); }
.card-dialog-x { position: absolute; top: 12px; right: 12px; z-index: 2; }

@media (min-width: 900px) {
  .week-strip { display: none; }
  .weeknav { max-width: 520px; }
  .week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: start; }
  .day { background: rgba(22,33,27,0.55); border: 1px solid var(--line); border-radius: 14px; padding: 10px 8px; min-height: 260px; }
  .day.today { border-color: var(--green-500); box-shadow: 0 0 0 1px rgba(34,197,94,0.25); }
  .day-head { flex-wrap: wrap; gap: 4px 6px; }
  .day-dow { font-size: 16px; }
  .day-date { font-size: 13px; }
  .day-add { width: 26px; height: 26px; font-size: 14px; }
  .no-rounds { flex-direction: column; gap: 4px; font-size: 13px; padding: 10px; }
  .card-dialog-inner .card { margin: 0; }
}
@media (min-width: 900px) { .how { grid-template-columns: repeat(4, 1fr); } }

/* flying ball logo */
.ball-logo { width: 46px; height: 46px; overflow: visible; filter: drop-shadow(0 3px 6px rgba(0,0,0,0.55)); }
.ball-logo .ball { animation: ballFloat 2.4s ease-in-out infinite; transform-origin: 42px 26px; }
.ball-logo .spin { animation: ballSpin 1.6s linear infinite; transform-box: fill-box; transform-origin: center; }
.ball-logo .trails path { stroke-dasharray: 14 10; animation: trailRush 0.7s linear infinite; }
.ball-logo .trails .t2 { animation-duration: 0.9s; opacity: .8; }
.ball-logo .trails .t3 { animation-duration: 0.6s; opacity: .65; }
@keyframes ballFloat { 0%,100% { transform: translate(0,0) rotate(0deg); } 50% { transform: translate(3px,-4px) rotate(-4deg); } }
@keyframes ballSpin { to { transform: rotate(360deg); } }
@keyframes trailRush { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }
@media (min-width: 900px) { .ball-logo { width: 50px; height: 50px; } }
@media (prefers-reduced-motion: reduce) { .ball-logo .ball, .ball-logo .spin, .ball-logo .trails path { animation: none; } }

/* ================= V2: COURSE DROPDOWN ================= */
.course-field select { cursor: pointer; }
.course-field #evCourseNew { margin-top: 8px; border-color: rgba(245,197,66,0.55); }

/* ================= TRASH TALK CORNER ================= */
.tab { position: relative; }
.tab-svg .flame, .chat-head-ico .flame { fill: var(--gold); stroke: none; }
.tab.active .tab-svg .flame { fill: #7a4b00; }
.tab-badge {
  position: absolute; top: 2px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box;
  border-radius: 999px; background: #ef4444; color: #fff; font: 800 11px/18px "Inter", sans-serif; text-align: center;
  box-shadow: 0 0 0 2px #0a100d;
}
.tab.has-unread .chat-ico { animation: chatWiggle 2.4s ease-in-out infinite; transform-origin: 50% 80%; }
@keyframes chatWiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-12deg) scale(1.08); } 90% { transform: rotate(10deg) scale(1.08); } 95% { transform: rotate(-5deg); } }
@media (prefers-reduced-motion: reduce) { .tab.has-unread .chat-ico { animation: none; } }

/* mobile tab bar: icon over label so 3 tabs + Book fit at 360px */
@media (max-width: 599px) {
  .tabbar { gap: 6px; padding-left: 8px; padding-right: 8px; }
  .tab { flex-direction: column; gap: 3px; padding: 6px 4px; min-height: 52px; font-size: 11.5px; border-radius: 12px; min-width: 0; }
  .tab span:not(.tab-badge) { white-space: nowrap; }
  .tab-svg { width: 21px; height: 21px; }
  .tab-badge { top: 3px; right: calc(50% - 22px); }
  .tab-book { width: 50px; height: 50px; }
}

.chat-head { position: sticky; top: 56px; z-index: 5; margin: 0 -16px 8px; padding: 14px 16px 10px;
  background: linear-gradient(180deg, rgba(7,12,9,0.97) 70%, rgba(7,12,9,0)); }
.chat-title { display: flex; align-items: center; gap: 12px; }
.chat-head-ico { width: 40px; height: 40px; padding: 7px; box-sizing: border-box; border-radius: 12px; background: #16211b; border: 1px solid var(--line);
  fill: none; stroke: var(--green-500); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.chat-title h2 { font: 900 24px "Archivo", sans-serif; margin: 0; color: #fff; }
.chat-sub { color: var(--muted); font-size: 13px; }
.chat-who { margin-top: 6px; font-size: 13px; color: var(--muted); }
.chat-who strong { color: var(--ink); }
.chat-who .link-btn { font-size: 13px; padding: 0; }

.chat-list { display: flex; flex-direction: column; gap: 3px; padding: 4px 0 12px; }
.chat-empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.chat-day { text-align: center; margin: 14px 0 8px; }
.chat-day span { font-size: 12px; font-weight: 700; color: var(--muted); background: #16211b; border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px; }
.msg { display: flex; align-items: flex-end; gap: 8px; max-width: 86%; margin-top: 8px; }
.msg.grouped { margin-top: 2px; }
.msg.theirs { align-self: flex-start; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-av { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 999px; color: #08130d; font: 900 14px/30px "Archivo", sans-serif; text-align: center; margin-bottom: 18px; }
.msg.grouped .msg-av { visibility: hidden; }
.msg-body { display: flex; flex-direction: column; min-width: 0; }
.msg.mine .msg-body { align-items: flex-end; }
.msg-name { font-size: 16px; font-weight: 800; margin: 0 0 3px 10px; }
.bubble { position: relative; padding: 9px 13px; border-radius: 18px; font-size: 16px; line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.theirs .bubble { background: #1d2a23; border: 1px solid #2c3d33; color: var(--ink); border-bottom-left-radius: 6px; }
.msg.mine .bubble { background: linear-gradient(180deg, #2bd36a, #1fb457); color: #04140a; border-bottom-right-radius: 6px; }
.msg-time { font-size: 11px; color: var(--muted); margin: 3px 8px 0; }
.msg-sys { align-self: center; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; position: relative;
  max-width: 92%; margin: 10px 0 4px; padding: 6px 12px; border-radius: 12px; text-align: center;
  color: var(--gold); background: rgba(245,197,66,0.08); border: 1px solid rgba(245,197,66,0.3); font-size: 13px; font-weight: 700; }
.msg-sys time { color: rgba(245,197,66,0.65); font-weight: 600; font-size: 11px; }
.msg-del { display: none; position: absolute; top: -8px; width: 22px; height: 22px; border-radius: 999px; border: 1px solid var(--line);
  background: #0c1410; color: #ff8a93; font-size: 11px; cursor: pointer; padding: 0; line-height: 20px; }
.msg.theirs .msg-del { right: -10px; } .msg.mine .msg-del { left: -10px; } .msg-sys .msg-del { right: -10px; }
.bubble:hover .msg-del, .msg-sys:hover .msg-del, .show-del .msg-del { display: block; }
@media (hover: none) { .bubble:hover .msg-del, .msg-sys:hover .msg-del { display: none; } .show-del .msg-del { display: block; } }

body.on-chat .foot { display: none; }
body.on-chat { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
.chat-composer, .chat-name {
  position: fixed; left: 50%; transform: translateX(-50%); width: 100%; max-width: 560px; box-sizing: border-box;
  bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 29;
  padding: 8px 10px; background: rgba(10,16,13,0.97); border-top: 1px solid var(--line); backdrop-filter: blur(8px);
}
.chat-composer { display: flex; align-items: flex-end; gap: 8px; }
.chat-composer[hidden], .chat-name[hidden] { display: none; }
#chatText { flex: 1; resize: none; min-height: 42px; max-height: 140px; box-sizing: border-box; padding: 10px 14px; border-radius: 21px;
  border: 1px solid var(--line); background: #0c1410; color: var(--ink); font: 16px/1.35 "Inter", sans-serif; }
#chatText:focus { outline: none; border-color: var(--green-500); }
.chat-count { position: absolute; right: 92px; top: -16px; font-size: 11px; color: var(--muted); }
.chat-send { height: 42px; padding: 0 18px; border-radius: 21px; border: 0; background: var(--green-500); color: #04140a; font: 800 15px "Archivo", sans-serif; cursor: pointer; }
.chat-send:disabled { opacity: 0.5; }
.chat-name-q { font-weight: 700; margin: 2px 2px 8px; font-size: 15px; }
.chat-name-row { display: flex; gap: 8px; }
#chatNameInput { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(245,197,66,0.55); background: #0c1410; color: var(--ink); font-size: 16px; }

@media (min-width: 900px) {
  .chat-head { top: 60px; margin: 0 0 8px; padding: 22px 0 12px; }
  .chat-list, .chat-head { max-width: 760px; margin-left: auto; margin-right: auto; width: 100%; }
  .chat-composer, .chat-name { max-width: 760px; bottom: 92px; border: 1px solid var(--line); border-radius: 18px; }
  body.on-chat { padding-bottom: 190px; }
  .msg { max-width: 70%; }
}

/* 3 equal tabs, no Book in the bar */
.tabbar .tab { flex: 1 1 0; min-width: 0; }
.tab span:not(.tab-badge) { white-space: nowrap; }
@media (min-width: 900px) { .tabbar { max-width: 500px; } }

/* chat scrolls inside its own pane, like a messaging app */
body.on-chat { padding-bottom: 0; overflow: hidden; }
body.on-chat .screen { padding-bottom: 0; min-height: 0; }
.chat-head { position: static; }
.chat-list {
  height: calc(100dvh - 60px - 104px - 62px - 74px - env(safe-area-inset-bottom) - env(safe-area-inset-top));
  min-height: 200px; overflow-y: auto; overscroll-behavior: contain; padding-right: 2px;
}
@media (min-width: 900px) {
  body.on-chat { padding-bottom: 0; }
  .chat-list { height: calc(100dvh - 64px - 110px - 70px - 100px); }
}

/* line icons in RSVP chips */
.chip .ico { width: 16px; height: 16px; display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chip .ride { display: inline-flex; gap: 2px; align-items: center; color: var(--green-500); }
.chip .x { display: inline-flex; align-items: center; }
.chip .x .ico { width: 14px; height: 14px; }
.chip .ride .ico { width: 19px; height: 19px; stroke-width: 2.2; }

/* flying ball beside "Let it fly." */
.fly-line { display: inline-flex; align-items: center; gap: 0.12em; white-space: nowrap; }
.hero-ball.ball-logo { width: 1.15em; height: 1.15em; flex: 0 0 auto; }
@media (min-width: 900px) { .hero-ball.ball-logo { width: 1.15em; height: 1.15em; } }
.hero-ball.ball-logo, .fly-line .hero-ball.ball-logo { width: 1.55em; height: 1.14em; margin-left: 0.08em; }

/* members button + dialog */
.stat-btn { font: inherit; color: inherit; cursor: pointer; width: 100%; transition: border-color .15s, transform .1s; }
.stat-btn:hover { border-color: var(--green-500); }
.stat-btn:active { transform: scale(0.97); }
.stat-arrow { color: var(--gold); font-weight: 900; }
#membersModal { display: flex; justify-content: center; }
#membersModal[hidden] { display: none; }
.members-inner { background: #121b16; border: 2px solid #2f6b47; padding: 22px 18px 18px; color: var(--ink); }
.members-inner h2 { font-family: "Archivo", sans-serif; font-weight: 900; font-size: 26px; margin: 0 40px 4px 0; }
.members-sub { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.members-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.member { display: flex; align-items: center; gap: 12px; background: #0c1410; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.member-av { width: 38px; height: 38px; border-radius: 999px; display: grid; place-items: center; font-weight: 900; color: #06110b; flex: 0 0 auto; }
.member-info { display: flex; flex-direction: column; min-width: 0; }
.member-name { font-weight: 800; font-size: 16px; }
.member-meta { color: var(--muted); font-size: 13px; }

.member-idle .member-av{opacity:.55}
.member-idle .member-meta{opacity:.6;font-style:italic}

/* ---------- push notification toggle ---------- */
.notif-btn { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 12px 0 10px; border-radius: 999px; border: 1px solid var(--line); background: #111a15;
  color: var(--muted); font: 700 12.5px/1 "Archivo", system-ui, sans-serif; letter-spacing: .02em; cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, box-shadow .2s; -webkit-tap-highlight-color: transparent; }
.notif-btn:hover { color: var(--ink); border-color: #2c3d33; }
.notif-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.notif-ico { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.notif-slash { opacity: 1; transition: opacity .2s; }
.notif-btn[data-state="on"] { color: #07170e; background: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 4px rgba(255,200,60,.12); }
.notif-btn[data-state="on"] .notif-slash { opacity: 0; }
.notif-btn[data-state="on"] .notif-ico { animation: notif-ring .6s ease 1; transform-origin: 50% 15%; }
.notif-btn[data-state="blocked"] { color: #d98c7a; border-color: rgba(217,140,122,.35); }
.notif-btn[data-state="install"] { color: var(--ink); }
.notif-btn[data-state="install"] .notif-slash { opacity: 0; }
.notif-btn[data-state="busy"] { opacity: .6; pointer-events: none; }
.chat-head { position: relative; }
.chat-sub.notif-hint { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.notif-hint svg { width: 14px; height: 14px; vertical-align: -2px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.notif-hint strong { color: var(--ink); }
@keyframes notif-ring { 0%,100% { transform: rotate(0) } 25% { transform: rotate(14deg) } 50% { transform: rotate(-10deg) } 75% { transform: rotate(6deg) } }
@media (max-width: 380px) { .notif-label { display: none; } .notif-btn { padding: 0 9px; } }
@media (prefers-reduced-motion: reduce) { .notif-btn[data-state="on"] .notif-ico { animation: none; } }

/* ---------- pre-add crew picker (new round) ---------- */
.crew-pick { margin: 2px 0 14px; }
.crew-pick-head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.crew-count { font: 700 12px/1 "Archivo", system-ui, sans-serif; color: var(--muted); padding: 5px 9px; border-radius: 999px; border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.crew-count.full { color: #07170e; background: var(--gold); border-color: var(--gold); }
.crew-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.crew-chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 4px; border-radius: 999px;
  border: 1px solid var(--line); background: #111a15; color: var(--ink); font: 600 14px/1 system-ui, sans-serif; cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s, transform .1s; -webkit-tap-highlight-color: transparent; }
.crew-chip:active:not(:disabled) { transform: scale(.96); }
.crew-chip:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.crew-chip:disabled { opacity: .38; cursor: default; }
.crew-av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
  background: color-mix(in srgb, var(--av, #2c3d33) 22%, #0c1410); color: var(--av, var(--muted));
  font: 800 11.5px/1 "Archivo", system-ui, sans-serif; letter-spacing: .02em; border: 1px solid color-mix(in srgb, var(--av, #2c3d33) 45%, transparent); }
.crew-av svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.crew-chip.on { background: rgba(245,197,66,.12); border-color: var(--gold); }
.crew-chip.on .crew-av { background: var(--gold); color: #07170e; border-color: var(--gold); }
.crew-add { border-style: dashed; color: var(--muted); }
.crew-add .crew-av { background: transparent; border: none; color: var(--muted); }
.crew-add-row { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 4px 0 12px; border-radius: 999px; border: 1px solid var(--gold); background: #0c1410; }
.crew-add-row input { width: 130px; border: 0; background: transparent; color: var(--ink); font-size: 16px; outline: none; padding: 0; }
.crew-add-ok { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--gold); color: #07170e; display: grid; place-items: center; cursor: pointer; }
.crew-add-ok svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- chat header flows (no overlap on narrow phones) ---------- */
.chat-head { top: 0 !important; display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px; row-gap: 6px; flex: 0 0 auto; }
.chat-title { flex: 1 1 0; min-width: 0; }
.chat-title h2 { line-height: 1.05; }
.chat-head .chat-who { flex: 1 0 100%; margin-top: 0; }
@media (max-width: 420px) { .chat-title h2 { font-size: 21px; } .chat-head-ico { width: 36px; height: 36px; padding: 6px; } }
#viewChat.active { display: flex; flex-direction: column;
  height: calc(100dvh - 60px - 62px - 74px - env(safe-area-inset-bottom) - env(safe-area-inset-top)); }
#viewChat.active .chat-list { flex: 1 1 auto; height: auto; min-height: 0; }
@media (min-width: 900px) { #viewChat.active { height: calc(100dvh - 64px - 70px - 100px); } }

/* ---------- chat photos ---------- */
.chat-composer { flex-wrap: wrap; }
.chat-photo { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: #0c1410;
  color: var(--muted); display: grid; place-items: center; cursor: pointer; transition: color .15s, border-color .15s; -webkit-tap-highlight-color: transparent; }
.chat-photo:hover, .chat-photo:focus-visible { color: var(--gold); border-color: var(--gold); outline: none; }
.chat-photo svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.photo-chip { flex: 1 0 100%; display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 6px; border-radius: 14px;
  background: #111a15; border: 1px solid var(--line); box-sizing: border-box; }
.photo-chip[hidden] { display: none; }
.photo-chip img { width: 46px; height: 46px; object-fit: cover; border-radius: 10px; background: #1b2620; flex: 0 0 auto; }
.photo-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--muted); }
.photo-meta strong { color: var(--ink); font-size: 14px; }
.photo-meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-x { width: 32px; height: 32px; border-radius: 50%; border: 0; background: #1b2620; color: var(--ink); display: grid; place-items: center; cursor: pointer; flex: 0 0 auto; }
.photo-x svg, .lightbox-x svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.photo-chip.busy img { opacity: .5; }
.photo-chip.busy .photo-x { opacity: .4; pointer-events: none; }
.photo-spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(245,197,66,.25); border-top-color: var(--gold); animation: ph-spin .8s linear infinite; flex: 0 0 auto; }
.photo-spin[hidden] { display: none; }
@keyframes ph-spin { to { transform: rotate(360deg); } }
.bubble.has-photo { padding: 4px; display: flex; flex-direction: column; }
.bubble.has-photo .msg-text { padding: 6px 9px 5px; }
.msg-photo { display: block; width: 100%; max-width: 260px; min-width: 120px; min-height: 90px; max-height: 340px; object-fit: cover; border-radius: 14px;
  background: #1b2620; cursor: zoom-in; }
.bubble.photo-only { background: transparent !important; padding: 0; }
.bubble.photo-only .msg-photo { border-radius: 16px; border: 1px solid var(--line); }
@media (min-width: 900px) { .msg-photo { max-width: 320px; max-height: 400px; } }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(3,6,4,.94); display: flex; align-items: center; justify-content: center;
  padding: env(safe-area-inset-top) 12px env(safe-area-inset-bottom); animation: lb-in .15s ease; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 92vh; border-radius: 10px; object-fit: contain; }
.lightbox-x { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: #fff; display: grid; place-items: center; cursor: pointer; }
body.lb-open { overflow: hidden; }
@keyframes lb-in { from { opacity: 0 } to { opacity: 1 } }

/* ---------- calendar sync ---------- */
.sync-btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 11px; margin-top: 12px; border-radius: 999px;
  border: 1px solid rgba(245,197,66,.55); background: rgba(10,16,13,.7); color: #fff; font: 700 13.5px/1 "Archivo", system-ui, sans-serif;
  cursor: pointer; backdrop-filter: blur(6px); transition: background .15s, border-color .15s; -webkit-tap-highlight-color: transparent; }
.sync-btn:hover { background: rgba(245,197,66,.14); border-color: var(--gold); }
.sync-btn svg, .cal-add svg { width: 18px; height: 18px; fill: none; stroke: var(--gold); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.sync-btn-sm { margin: 0; height: 30px; padding: 0 11px 0 9px; font-size: 12.5px; }
.sync-btn-sm svg { width: 16px; height: 16px; }
.section-actions { display: flex; align-items: center; gap: 12px; }
.cal-add { margin-left: auto; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: transparent; display: grid; place-items: center; cursor: pointer; }
.cal-add:hover { border-color: var(--gold); background: rgba(245,197,66,.1); }
.sheet-backdrop { align-items: flex-end; }
.sheet-backdrop:not([hidden]) { display: flex; justify-content: center; }
.sheet { position: relative; width: 100%; max-width: 460px; box-sizing: border-box; background: #0e1612; border: 1px solid var(--line); border-bottom: 0;
  border-radius: 22px 22px 0 0; padding: 10px 18px calc(20px + env(safe-area-inset-bottom)); animation: sheet-up .22s cubic-bezier(.2,.8,.2,1); }
@media (min-width: 700px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 22px; border-bottom: 1px solid var(--line); } .sheet-grab { display: none; } }
.sheet-grab { width: 40px; height: 4px; border-radius: 4px; background: #2c3d33; margin: 0 auto 12px; }
.sheet-x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: #1b2620; color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.sheet-x svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.sheet h2 { font: 900 22px "Archivo", sans-serif; color: #fff; margin: 4px 40px 4px 0; }
.sheet-sub { color: var(--muted); font-size: 13.5px; margin: 0 0 14px; line-height: 1.4; }
.sheet-opts { display: flex; flex-direction: column; gap: 8px; }
.sheet-opt { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 14px; border: 1px solid var(--line); background: #111a15; color: var(--ink); text-decoration: none; cursor: pointer; transition: border-color .15s, background .15s; }
.sheet-opt:hover, .sheet-opt:focus-visible { border-color: var(--gold); background: #142019; outline: none; }
.opt-ico { width: 38px; height: 38px; border-radius: 11px; background: rgba(245,197,66,.1); display: grid; place-items: center; flex: 0 0 auto; }
.opt-ico svg { width: 20px; height: 20px; fill: none; stroke: var(--gold); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.opt-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.opt-txt strong { font-size: 15px; } .opt-txt small { color: var(--muted); font-size: 12.5px; }
.opt-go { color: var(--muted); font-size: 22px; }
.sheet-copy { display: flex; gap: 8px; margin-top: 14px; }
.sheet-copy input { flex: 1; min-width: 0; height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: #0a110d; color: var(--muted); font-size: 13px; }
.sheet-note { color: var(--muted); font-size: 12px; margin: 10px 0 0; }
@keyframes sheet-up { from { transform: translateY(30px); opacity: 0 } to { transform: none; opacity: 1 } }
.brand-bird { height: 26px; width: auto; flex: 0 0 auto; margin-right: -2px; filter: drop-shadow(0 1px 6px rgba(245,197,66,.25)); }
@media (min-width: 900px) { .brand-bird { height: 32px; } }
.card-head .cal-add { margin-left: auto; align-self: flex-start; flex: 0 0 auto; background: rgba(7,12,9,.55); border-color: rgba(255,255,255,.18); backdrop-filter: blur(4px); }

/* iOS Safari: % width inside a shrink-wrapped flex bubble collapses to 0; use a fixed width */
.msg-photo { width: min(260px, 68vw); height: auto; aspect-ratio: auto; }
@media (min-width: 900px) { .msg-photo { width: 320px; } }
.bubble.has-photo { align-items: stretch; }
.sync-seg { display: flex; gap: 4px; padding: 4px; margin: 6px 0 12px; border-radius: 999px; background: #0a110d; border: 1px solid var(--line); }
.sync-seg .seg-opt { flex: 1; height: 36px; border-radius: 999px; border: 0; background: transparent; color: var(--muted); font: 700 13.5px/1 "Archivo", system-ui, sans-serif; cursor: pointer; transition: background .15s, color .15s; }
.sync-seg .seg-opt.active { background: var(--gold); color: #07170e; }
.sync-name { display: flex; gap: 8px; margin: 0 0 12px; }
.sync-name[hidden] { display: none; }
.sync-name input { flex: 1; min-width: 0; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid rgba(245,197,66,.55); background: #0a110d; color: var(--ink); font-size: 16px; }
#syncOpts.disabled { opacity: .4; }
#syncSub .link-btn { font-size: 13px; padding: 0; }

/* Safari/iPad: background-clip:text + filter clip script swashes to the element box; give the glyphs room */
.wa-bogey { display: inline-block; line-height: 1.3; padding: 6px 10px 9px 8px; margin: -6px -6px -9px -8px; overflow: visible; }
.brand, .brand-name.wordart { overflow: visible; }
.brand-bird { overflow: visible; }

/* Home Screen app (black-translucent status bar): keep the header below the clock/notch */
.appbar { padding-top: env(safe-area-inset-top); padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }

/* Add to Home Screen */
.a2hs-wrap { display: flex; justify-content: center; padding: 22px 0 calc(28px + env(safe-area-inset-bottom)); }
.a2hs-wrap[hidden] { display: none; }
.a2hs-btn { display: inline-flex; align-items: center; gap: 8px; background: transparent; color: var(--muted); border: 1.5px solid var(--line); border-radius: 999px; padding: 10px 18px; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.a2hs-btn:hover, .a2hs-btn:active { color: var(--ink); border-color: var(--gold); }
.a2hs-btn svg, .a2hs-steps svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.a2hs-steps { margin: 6px 0 4px; padding-left: 22px; display: grid; gap: 12px; font-size: 16px; line-height: 1.4; }
.a2hs-steps svg { vertical-align: -3px; margin: 0 2px; color: #0a84ff; }
/* Add to Home Screen button: gold like + Tee Time */
.a2hs-btn, .a2hs-btn:hover { background: var(--gold); color: #221a00; border-color: var(--gold); text-shadow: none; font-weight: 700; }
.a2hs-btn:active { background: var(--gold-dark); border-color: var(--gold-dark); color: #221a00; }

/* ================= V3: DESKTOP / LEGIBILITY POLISH ================= */
html.bb-deciding body > *:not(.pw) { visibility: hidden !important; }
html.bb-locked, html.bb-locked body { overflow: hidden !important; height: 100%; }
#forgetPinBtn { font-size: 14px !important; opacity: 1 !important; color: #d6e2da !important; text-decoration: underline; text-underline-offset: 3px; }
.bb-footer .adm-btn { font-size: 14px; color: #d6e2da; opacity: 1; }
.credits { opacity: 0.95; font-size: 12px; }
/* tee time cards: dark scrim behind the text, readable time + capacity, 2-line course names */
.card[class*="ph-"] .card-head { background: linear-gradient(180deg, rgba(4,10,7,0.78) 0%, rgba(4,10,7,0.55) 70%, rgba(4,10,7,0) 100%); border-radius: 0; }
.card[class*="ph-"] .card-title .when { color: #ffd86b; text-shadow: 0 1px 6px rgba(0,0,0,0.8); }
.card[class*="ph-"] .card-title .meta { color: #e3ece6; text-shadow: 0 1px 6px rgba(0,0,0,0.8); }
.card-title h3 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 900px) {
  body { padding-bottom: 130px; }
  .screen, .appbar-inner { max-width: 1100px; }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch !important; }
  .cards > .card { height: 100%; }
  .cards > .card:last-child:nth-child(3n + 1) { grid-column: 2; }
  .foot { padding-bottom: 20px; }
}
@media (min-width: 900px) and (max-width: 1179px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards > .card:last-child:nth-child(3n + 1) { grid-column: auto; }
  .cards > .card:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - 10px); }
}
/* desktop (mouse, wide): no "Add to Home Screen" prompts */
@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  .a2b, .a2hs-wrap, #a2hsBtn { display: none !important; }
}
