/* Zika Golf — shared styles */

:root {
  --green: #1f5c3f;
  --green-dark: #10331f;
  --green-deep: #164430;
  --cream: #f8f6ef;
  --cream-2: #efe9d8;
  --gold: #b8902f;
  --gold-light: #c9a227;
  --ink: #23271f;
  --ink-soft: #5c6357;
  --border: #e3ddc9;
  --radius: 16px;
  --shadow: 0 16px 40px rgba(16, 51, 31, 0.14);
  --maxw: 1140px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-script: "Pinyon Script", "Brush Script MT", cursive;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

h1, h2, h3 { font-family: var(--font-serif); line-height: 1.15; margin: 0 0 16px; font-weight: 600; color: var(--green-dark); }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 16px; color: var(--ink-soft); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-primary { background: var(--gold); color: #fff; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(184,144,47,0.35); }
.btn-outline { background: transparent; border-color: var(--green); color: var(--green); }
.btn-outline:hover { background: var(--green); color: #fff; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(248,246,239,0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 84px; width: auto; }
.brand-text { font-family: var(--font-serif); font-weight: 700; font-size: 1.2rem; color: var(--green-dark); }
.brand-tag { display: block; font-size: 0.68rem; letter-spacing: 0.12em; color: var(--ink-soft); text-transform: uppercase; }

.nav { display: flex; align-items: center; gap: 28px; }
.nav a { font-weight: 600; font-size: 0.95rem; color: var(--ink-soft); }
.nav a:hover, .nav a.active { color: var(--gold); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; }

/* Hero */
.hero {
  background: radial-gradient(circle at 78% -8%, #2a6b4a 0%, var(--green) 40%, var(--green-dark) 100%);
  color: #fff;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 75%);
}
.hero .container { position: relative; padding: 80px 24px 96px; text-align: center; }
.hero-crest .container { padding-top: 40px; }
.hero .eyebrow { color: #d7e6da; }
.hero h1 { color: #fff; }
.hero p.lead { color: #dcebe0; font-size: 1.15rem; max-width: 56ch; margin: 0 auto 28px; }
.crest-hero { width: min(440px, 78vw); margin: 0 auto 32px; filter: drop-shadow(0 18px 40px rgba(0,0,0,0.35)); }

section { padding: 84px 0; }
.bg-soft { background: var(--cream-2); }
.section-head { max-width: 640px; margin: 0 auto 48px; text-align: center; }

.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 24px; }

.card {
  display: block;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: transform 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.card .card-img { aspect-ratio: 4/3; background: var(--cream-2); overflow: hidden; }
.card .card-img img { width: 100%; height: 100%; object-fit: cover; }
.card .card-body { padding: 22px; }
.card .meta { font-size: 0.8rem; color: var(--gold-light); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 6px; }
.card h3 { margin-bottom: 8px; }
.card p { font-size: 0.94rem; margin-bottom: 0; }
.card .action-link { pointer-events: none; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(16,22,15,0.94);
  display: flex; align-items: center; justify-content: center;
}
.lightbox[hidden] { display: none; }
.lightbox-img { max-width: 88vw; max-height: 86vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); cursor: pointer; }
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.25);
  color: #fff; border-radius: 999px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { background: rgba(255,255,255,0.28); }
.lightbox-close { top: 24px; right: 24px; width: 44px; height: 44px; font-size: 22px; }
.lightbox-prev, .lightbox-next { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; font-size: 26px; }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-counter { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); color: #dcebe0; font-size: 0.85rem; letter-spacing: 0.05em; }
@media (max-width: 700px) {
  .lightbox-prev, .lightbox-next { width: 42px; height: 42px; font-size: 20px; }
  .lightbox-close { width: 38px; height: 38px; top: 12px; right: 12px; }
}

.cta-band {
  background: radial-gradient(circle at 20% 20%, #2a6b4a 0%, var(--green-dark) 70%);
  color: #fff; border-radius: var(--radius); padding: 56px; text-align: center;
  max-width: var(--maxw); margin: 0 auto;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: #dcebe0; max-width: 50ch; margin: 0 auto 20px; }

.site-footer { background: var(--green-dark); color: #b9c9bd; padding: 56px 0 28px; }
.site-footer .container { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.site-footer .brand-text, .site-footer .brand-tag { color: #fff; }
.site-footer .brand-tag { color: #8fa294; }
.footer-cols { display: flex; gap: 56px; flex-wrap: wrap; }
.footer-col h4 { color: #fff; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 14px; }
.footer-col a, .footer-col p { display: block; color: #b9c9bd; margin-bottom: 8px; font-size: 0.92rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); margin-top: 40px; padding-top: 22px; text-align: center; font-size: 0.82rem; color: #7f9186; }

/* Countdown */
.countdown { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin: 32px 0; }
.countdown .unit { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.16); border-radius: 14px; padding: 20px 26px; min-width: 100px; text-align: center; }
.countdown .unit b { display: block; font-family: var(--font-serif); font-size: 2.4rem; color: #fff; }
.countdown .unit span { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: #cfe0d5; }

/* Tags / status pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; }
.pill-todo { background: #eee3c8; color: #8a6d1a; }
.pill-progress { background: #dcebe0; color: #1f5c3f; }
.pill-done { background: #d6ecd9; color: #1c6b34; }
.pill-declined { background: #fbe9e7; color: #b3261e; }

/* Forms (admin) */
.admin-body { background: var(--cream-2); min-height: 100vh; font-family: var(--font); }
.admin-wrap { max-width: 1040px; margin: 0 auto; padding: 32px 24px 80px; }
.admin-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; background: var(--green-dark); color: #fff; }
.admin-header a { color: #cfe0d5; font-weight: 600; font-size: 0.9rem; }
.admin-header .brand-text { color: #fff; }
.admin-nav { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.admin-nav a { padding: 8px 16px; border-radius: 999px; background: #fff; border: 1px solid var(--border); font-weight: 600; font-size: 0.88rem; color: var(--ink-soft); }
.admin-nav a.active, .admin-nav a:hover { background: var(--green); color: #fff; border-color: var(--green); }
.panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; margin-bottom: 24px; }
table.admin-table { width: 100%; border-collapse: collapse; }
table.admin-table th, table.admin-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
table.admin-table th { color: var(--ink-soft); font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
table.admin-table tr:hover td { background: var(--cream-2); }
.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-weight: 700; font-size: 0.85rem; margin-bottom: 6px; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px;
  font-family: var(--font); font-size: 0.95rem; background: var(--cream-2);
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { outline: none; border-color: var(--gold); background: #fff; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.login-card { max-width: 380px; margin: 90px auto; }
.flash { padding: 12px 16px; border-radius: 10px; font-weight: 600; font-size: 0.9rem; margin-bottom: 18px; }
.flash-error { background: #fbe9e7; color: #b3261e; }
.flash-ok { background: #e6f6ec; color: #1d7a41; }
.action-link { font-size: 0.85rem; font-weight: 700; color: var(--green); margin-right: 12px; }
.action-link.danger { color: #b3261e; }

/* ===== St Andrews 2029 — info hub ===== */

.badge-tbc, .badge-confirmed { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.badge-tbc { background: #eee3c8; color: #8a6d1a; }
.badge-confirmed { background: #d6ecd9; color: #1c6b34; }
.badge-preliminary { background: rgba(255,255,255,0.14); color: #f0e6c8; border: 1px solid rgba(240,230,200,0.4); }

.sa-subnav { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 28px 0 0; }
.sa-subnav a { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border); font-weight: 600; font-size: 0.85rem; color: var(--ink-soft); }
.sa-subnav a:hover { border-color: var(--gold); color: var(--gold); }

/* Four rounds */
.rounds-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.round-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; gap: 12px; }
.round-day { font-family: var(--font-serif); font-weight: 700; font-size: 0.95rem; color: var(--gold); letter-spacing: 0.06em; text-transform: uppercase; }
.round-card h3 { margin-bottom: 0; }
.round-subtitle { font-weight: 700; font-size: 0.82rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); margin-top: -8px; }
.round-desc { font-size: 0.92rem; margin-bottom: 0; }
.round-meta { list-style: none; margin: 8px 0 0; padding: 14px 0 0; border-top: 1px dashed var(--border); display: grid; gap: 8px; }
.round-meta li { display: flex; justify-content: space-between; gap: 10px; font-size: 0.85rem; }
.round-meta span:first-child { color: var(--ink-soft); font-weight: 600; }
.round-meta span:last-child { font-weight: 700; text-align: right; }

.round-card--final { grid-column: 1 / -1; margin-top: 8px; padding: 40px; background: radial-gradient(circle at 82% -10%, #2a6b4a 0%, var(--green) 45%, var(--green-dark) 100%); border: none; color: #fff; }
.round-card--final .round-day { color: #f0e6c8; }
.round-card--final h3 { color: #fff; font-size: 1.6rem; }
.round-card--final .round-subtitle { color: #f0e6c8; }
.round-card--final .round-desc { color: #dcebe0; }
.round-card--final .round-meta { border-top-color: rgba(255,255,255,0.22); }
.round-card--final .round-meta span:first-child { color: #cfe0d5; }
.round-card--final .round-meta span:last-child { color: #fff; }

/* Tournament format */
.format-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.format-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 0.95rem; color: var(--ink-soft); }
.format-list li::before { content: "⛳"; flex: none; }
.side-comp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 8px; }
.side-comp { background: var(--cream-2); border-radius: 12px; padding: 16px 18px; font-weight: 700; text-align: center; font-size: 0.92rem; color: var(--green-dark); }

/* Roadmap timeline */
.roadmap { position: relative; margin: 0 auto; max-width: 820px; }
.roadmap::before { content: ""; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.roadmap-step { position: relative; padding: 0 0 40px 46px; }
.roadmap-step:last-child { padding-bottom: 0; }
.roadmap-step::before { content: ""; position: absolute; left: 8px; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--border); }
.roadmap-step.is-active::before { border-color: var(--gold); background: var(--gold); }
.roadmap-year { font-family: var(--font-serif); font-weight: 700; font-size: 1.2rem; color: var(--green-dark); margin-bottom: 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.roadmap-here { background: var(--gold); color: #fff; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; }
.roadmap-body { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 20px 22px; }
.roadmap-body ul { margin: 10px 0 0; padding-left: 18px; color: var(--ink-soft); }
.roadmap-body li { margin-bottom: 4px; font-size: 0.92rem; }
.roadmap-status-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 20px; margin-top: 14px; }
.roadmap-status-grid .row { display: flex; justify-content: space-between; align-items: center; font-size: 0.88rem; font-weight: 600; padding: 6px 0; border-bottom: 1px solid var(--border); }

/* Travel */
.travel-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.travel-step { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 20px; text-align: center; }
.travel-step .meta { color: var(--gold-light); }
.travel-step h4 { font-family: var(--font-serif); font-size: 1.1rem; margin: 6px 0 10px; color: var(--green-dark); }

/* Budget */
.budget-figure { font-family: var(--font-serif); font-weight: 700; font-size: clamp(2.2rem, 5vw, 3.2rem); color: var(--green-dark); text-align: center; margin-bottom: 6px; }
.budget-note { text-align: center; }
.budget-factors { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; max-width: 640px; margin-left: auto; margin-right: auto; }
.budget-factors li { font-size: 0.9rem; color: var(--ink-soft); padding-left: 18px; position: relative; }
.budget-factors li::before { content: "–"; position: absolute; left: 0; color: var(--gold); }

/* Tournament status panel */
.status-panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 32px; }
.status-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.status-row:last-child { border-bottom: none; }
.status-row .label { font-weight: 700; color: var(--ink-soft); font-size: 0.92rem; }
.status-row .value { font-weight: 700; text-align: right; }

/* Player checklist */
.checklist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 24px; }
.checklist li { display: flex; align-items: center; gap: 10px; font-size: 0.92rem; color: var(--ink-soft); }
.checklist li::before { content: ""; flex: none; width: 18px; height: 18px; border: 2px solid var(--border); border-radius: 5px; }

/* Invite page (public, reached via personal QR code / link) */
.invite-page { min-height: 100vh; background: radial-gradient(circle at 78% -8%, #2a6b4a 0%, var(--green) 40%, var(--green-dark) 100%); display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.invite-card { background: #fff; border-radius: var(--radius); max-width: 480px; width: 100%; padding: 40px 32px; text-align: center; box-shadow: 0 24px 70px rgba(0,0,0,0.35); }
.invite-crest { width: 96px; margin: 0 auto 20px; }
.invite-avatar-preview { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; margin: 4px auto 16px; border: 3px solid var(--gold); display: block; }
.invite-actions { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; justify-content: center; }

/* Field — starting players */
.field-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 28px 20px; }
.field-card { text-align: center; }
.field-avatar-wrap { position: relative; width: 96px; height: 96px; margin: 0 auto 12px; }
.field-avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 3px solid var(--gold); display: block; }
.field-avatar-initials { background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--font-serif); font-size: 1.6rem; font-weight: 700; }
.field-trophy { position: absolute; bottom: -2px; right: -6px; background: var(--gold); color: #fff; border-radius: 999px; padding: 3px 8px; font-size: 0.72rem; font-weight: 800; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.2); white-space: nowrap; }
.field-name { font-weight: 700; color: var(--green-dark); font-size: 0.96rem; }
.field-handicap { font-size: 0.78rem; color: var(--ink-soft); margin-top: 2px; }

/* Leaderboard */
.table-wrap { overflow-x: auto; }
table.leaderboard { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.leaderboard th, table.leaderboard td { padding: 14px 18px; text-align: right; font-size: 0.92rem; }
table.leaderboard th:first-child, table.leaderboard td:first-child { text-align: left; }
table.leaderboard thead th { background: var(--green-dark); color: #fff; font-weight: 700; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; }
table.leaderboard tbody tr { border-bottom: 1px solid var(--border); }
table.leaderboard tbody tr:last-child { border-bottom: none; }
table.leaderboard tbody tr.is-leader { background: #fbf3de; }
table.leaderboard td.name { font-weight: 700; color: var(--green-dark); }
table.leaderboard td.total { font-weight: 800; color: var(--gold); }

@media (max-width: 900px) {
  .grid-3, .grid-2, .form-grid-2, .rounds-grid, .side-comp-grid, .travel-steps, .roadmap-status-grid, .budget-factors, .checklist { grid-template-columns: 1fr; }
  .round-card--final { padding: 28px; }
  .status-panel { padding: 4px 20px; }
  .nav { position: fixed; inset: 70px 0 auto 0; background: var(--cream); flex-direction: column; align-items: stretch; padding: 18px 24px; border-bottom: 1px solid var(--border); transform: translateY(-8px); opacity: 0; pointer-events: none; transition: 0.18s; }
  .nav.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav a { padding: 10px 0; border-bottom: 1px solid var(--border); }
  .nav-toggle { display: block; }
  section { padding: 56px 0; }
}
