/* ============================================================
   Footbag Platform
   Design system matching footbagworldwide.com aesthetic:
   flat UI, green/teal accent, card layout, Inter sans-serif
   ============================================================ */

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

:root {
  --primary:    #1bb36b;
  --primary-dk: #16985b;
  --secondary:  #0b5e6b;
  --text:       #333333;
  --text-muted: #666666;
  --bg:         #ffffff;
  --bg-light:   #f7f8f9;
  --border:     #e5e5e5;
  --shadow-sm:  0 2px 6px rgba(0,0,0,0.06);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:  0 8px 24px rgba(0,0,0,0.10);
  --radius:     10px;
  --radius-sm:  6px;
}

/* ── Base ───────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dk); text-decoration: underline; }

img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }

/* ── Typography ─────────────────────────────────────────────── */
h1 { font-size: 2.4rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 0.5rem; }
h2 { font-size: 1.8rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; margin-bottom: 0.5rem; }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.4; margin-bottom: 0.4rem; }
h4 { font-size: 1rem;    font-weight: 600; margin-bottom: 0.3rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* ── Layout ─────────────────────────────────────────────────── */
.wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 40px 0; }
section + section { border-top: 1px solid var(--border); }

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  display: flex;
  align-items: center;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.site-header .wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.site-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.site-logo:hover { color: var(--primary); text-decoration: none; }
.site-logo span { color: var(--primary); }

.main-nav { display: flex; gap: 8px; align-items: center; }
.main-nav a {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text);
  transition: background 0.15s, color 0.15s;
}
.main-nav a:hover { background: var(--bg-light); color: var(--primary); text-decoration: none; }
.main-nav a.active { color: var(--primary); }

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
  color: #fff;
  text-align: center;
  padding: 72px 24px;
}

.hero h1 { color: #fff; margin-bottom: 0.75rem; }
.hero p  { font-size: 1.15rem; opacity: 0.9; margin-bottom: 0; }
.hero .text-muted { color: rgba(255, 255, 255, 0.75); }
.hero-eyebrow { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255, 255, 255, 0.72); margin-bottom: 4px; }
.hero-subtitle { font-size: 0.95rem; margin-top: 2px; color: rgba(255, 255, 255, 0.9); }
.hero.hero-sm { padding: 36px 24px; }
.hero.hero-sm h1 { margin-bottom: 0; }

.year-page-nav {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.hero-year-arrow {
  display: inline-block;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s;
}
.hero-year-arrow:hover { color: var(--primary); text-decoration: none; }
.hero-year-arrow--disabled { opacity: 0.3; cursor: default; }

/* ── Hero stats strip ───────────────────────────────────────── */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.hero-stats span {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 20px;
  padding: 5px 16px;
  font-size: 0.9rem;
  font-weight: 500;
}

/* ── Player nickname ────────────────────────────────────────── */
.player-nickname {
  font-size: 0.65em;
  font-weight: 400;
  opacity: 0.85;
  letter-spacing: 0.01em;
}

/* ── Back link ──────────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}
.back-link:hover { color: var(--primary); text-decoration: none; }

/* ── Player event blocks ────────────────────────────────────── */
.player-event-block {
  margin-bottom: 40px;
}
.player-event-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
}
.player-event-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}
.player-event-title:hover { color: var(--primary); text-decoration: none; }
.player-event-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.player-results-table {
  max-width: 600px;
}

/* ── Sortable table headers ─────────────────────────────────── */
th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
th.sortable::after {
  content: ' ↕';
  opacity: 0.3;
  font-size: 0.75em;
}
th.sortable.sort-asc::after  { content: ' ↑'; opacity: 0.8; }
th.sortable.sort-desc::after { content: ' ↓'; opacity: 0.8; }
th.sortable:hover { color: var(--primary); }

/* ── Player search bar ──────────────────────────────────────── */
.player-search-bar {
  margin-bottom: 24px;
}
.player-search-bar input {
  width: 100%;
  max-width: 420px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.player-search-bar input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27,179,107,0.12);
}
.player-search-empty {
  color: var(--text-muted);
  padding: 32px 0;
  text-align: center;
}

/* ── Section headings ───────────────────────────────────────── */
.section-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 28px;
}
.section-heading h2 { margin-bottom: 0; }
.section-count {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 10px;
}

/* ── Card grid ──────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.card-grid-3col { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}
.card .btn { margin-top: auto; align-self: flex-start; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.card-title { margin-bottom: 6px; }
.card-title a { color: var(--text); font-weight: 600; font-size: 1.05rem; }
.card-title a:hover { color: var(--primary); text-decoration: none; }

.card-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 10px;
}

.card-description {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Status badge ───────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-published      { background: #e6f9f0; color: #1a7a4a; }
.badge-registration_full { background: #fff3e0; color: #b06000; }
.badge-closed         { background: #f0f0f0; color: #555; }
.badge-completed      { background: #e8eaf6; color: #3949ab; }

/* ── Featured event card ────────────────────────────────────── */
.card-featured {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
  border-color: transparent;
  color: #fff;
}
.card-featured .card-title a { color: #fff; font-size: 1.15rem; }
.card-featured .card-title a:hover { color: rgba(255,255,255,0.85); text-decoration: none; }
.card-featured .card-meta { color: rgba(255,255,255,0.75); }
.card-featured .card-description { color: rgba(255,255,255,0.9); }
.btn-white { background: #fff; color: var(--secondary); }
.btn-white:hover { background: rgba(255,255,255,0.9); color: var(--secondary); }

/* ── Home section cards ─────────────────────────────────────── */
.home-sections {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.home-section-card {
  display: flex;
  flex-direction: column;
  color: var(--text);
  text-decoration: none;
}
.home-section-card:hover { text-decoration: none; }
.home-section-card h2 { margin-bottom: 8px; }
.home-section-card p  { color: var(--text-muted); flex: 1; }
.home-section-icon {
  font-size: 2.2rem;
  margin-bottom: 16px;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: background 0.15s, transform 0.1s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dk); color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }

/* ── Archive year nav ───────────────────────────────────────── */
.year-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.year-pill {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 20px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.year-pill:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  text-decoration: none;
}


/* ── Year archive event list ─────────────────────────────────── */
.event-list { border-top: 1px solid var(--border); }
.event-list-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition: color 0.12s;
}
.event-list-row:hover { text-decoration: none; }
.event-list-main { min-width: 0; }
.event-list-title {
  display: block;
  font-weight: 600;
  font-size: 0.975rem;
  color: var(--primary);
}
.event-list-row:hover .event-list-title { color: var(--primary-dk); }
.event-list-host {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.event-list-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
}
.event-list-date { font-size: 0.875rem; color: var(--text-muted); white-space: nowrap; }
.event-list-location { font-size: 0.82rem; color: var(--text-muted); white-space: nowrap; }

/* ── Event detail layout ─────────────────────────────────────── */
.event-detail { max-width: 860px; }

.event-header { margin-bottom: 32px; }
.event-header h1 { margin-bottom: 12px; }

.event-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.event-meta-row strong { color: var(--text); }

.event-external-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
}

/* ── Disciplines list ───────────────────────────────────────── */
.disciplines-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.discipline-tag {
  display: inline-block;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* ── Results section ─────────────────────────────────────────── */
.results-section { margin-bottom: 40px; }

.results-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
}
.results-section-header h3 { margin-bottom: 0; }
.discipline-meta { font-size: 0.8rem; color: var(--text-muted); font-weight: 400; }

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.results-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.results-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--bg-light);
  vertical-align: top;
}
.results-table tr:last-child td { border-bottom: none; }
.results-table tr:hover td { background: var(--bg-light); }

.placement-num {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  width: 40px;
}
.placement-num.gold   { color: #b8860b; }
.placement-num.silver { color: #707070; }
.placement-num.bronze { color: #8b4513; }

.participants-list { list-style: none; padding: 0; }
.participants-list li { padding: 1px 0; }

.score-text { color: var(--text-muted); font-size: 0.85rem; }

/* ── No-results notice ──────────────────────────────────────── */
.no-results-notice {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 28px 20px;
  color: var(--text-muted);
}
.empty-state p { font-size: 1.05rem; }

/* ── Login form ─────────────────────────────────────────────── */
.login-form { max-width: 340px; margin-top: 20px; }
.login-form .form-field { margin-bottom: 16px; }
.login-form label { display: block; margin-bottom: 4px; font-weight: 500; }
.login-form input[type="text"],
.login-form input[type="password"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
}
.login-form input:focus { outline: 2px solid var(--primary); outline-offset: 2px; border-color: var(--primary); }
.form-notice { color: #1e40af; background: #eff6ff; border-left: 4px solid #3b82f6; border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 16px; font-size: 0.95rem; }

/* ── Error pages ─────────────────────────────────────────────── */
.error-page {
  max-width: 560px;
  margin: 80px auto;
  text-align: center;
  padding: 0 24px;
}
.error-code {
  font-size: 5rem;
  font-weight: 700;
  color: var(--border);
  line-height: 1;
  margin-bottom: 8px;
}
.error-page h2 { margin-bottom: 12px; }
.error-page p  { color: var(--text-muted); margin-bottom: 24px; }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  background: #111;
  color: #aaa;
  padding: 48px 0 32px;
  margin-top: 40px;
  font-size: 0.875rem;
}
.site-footer .wrapper {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
}
.footer-brand { color: #fff; font-weight: 600; font-size: 1rem; margin-bottom: 6px; }
.footer-tagline { color: #777; font-size: 0.8rem; }
.footer-links { display: flex; flex-direction: column; gap: 6px; }
.footer-links a { color: #aaa; }
.footer-links a:hover { color: #fff; }
.footer-copy {
  border-top: 1px solid #222;
  margin-top: 40px;
  padding-top: 24px;
  text-align: center;
  color: #555;
  font-size: 0.8rem;
}

/* ── Breadcrumb ──────────────────────────────────────────────── */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep {
  margin: 0 4px;
  opacity: 0.5;
}
/* Hero has a dark gradient — breadcrumb must use white */
.hero .breadcrumb,
.hero .breadcrumb a,
.hero .breadcrumb span {
  color: rgba(255, 255, 255, 0.75);
}
.hero .breadcrumb a:hover {
  color: #fff;
}
.hero .breadcrumb-sep {
  color: rgba(255, 255, 255, 0.4);
}

/* ── Clubs directory ─────────────────────────────────────────── */
/* world map */
#clubs-map { margin: 24px 0 8px; border-radius: var(--radius); overflow: hidden; background: var(--bg-light); line-height: 0; }
.clubs-map-svg { width: 100%; height: auto; display: block; max-height: 420px; }
.clubs-map-svg path { fill: #d0d6dc; stroke: #fff; stroke-width: 0.4; }
.clubs-map-svg path#n242 { fill: none; stroke: none; }
.clubs-map-svg path.has-clubs { fill: var(--primary); cursor: pointer; transition: fill 0.12s; }
.clubs-map-svg path.has-clubs:hover { fill: var(--primary-dk); }
.clubs-map-tooltip { position: fixed; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 5px 10px; font-size: 0.82rem; box-shadow: var(--shadow-md); pointer-events: none; z-index: 200; white-space: nowrap; }

/* index page — country list */
.club-country-index {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 4px 16px;
}
.club-country-index-entry {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-light, #f0f0f0);
}
.club-country-index-link {
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
}
.club-country-index-link:hover { color: var(--primary); text-decoration: underline; }

/* detail page */
.hero .hero-hashtag {
  font-size: 0.85rem;
  font-family: inherit;
  color: rgba(255, 255, 255, 0.72);
  opacity: 1;
  margin-top: 6px;
}
.club-detail {
  max-width: 680px;
  padding: 32px 0 48px;
}
.club-detail-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 20px;
  font-size: 0.95rem;
  margin-bottom: 24px;
}
.club-detail-meta dt {
  font-weight: 600;
  color: var(--text-muted);
}
.club-detail-meta dd {
  margin: 0;
  color: var(--text);
}
.club-detail-description {
  line-height: 1.7;
  color: var(--text);
}
.club-members { margin-top: 32px; }
.club-members-heading { font-size: 1rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 12px; }
.club-member-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--border); }
.club-member-entry { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.95rem; color: var(--text); }
.club-members-gate {
  margin-top: 32px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  color: var(--text-muted);
}
.club-back-link {
  margin-top: 32px;
}


.club-country-nav {
  margin: 24px 0 32px;
}
.club-country-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.club-country-nav-list a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
}
.club-country-nav-list a:hover {
  border-color: var(--primary);
  background: var(--primary-light, #f0fdf4);
}
.club-country-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}
.club-section {
  padding: 28px 0;
  border-top: 1px solid var(--border);
}
.club-region-heading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 20px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.club-list {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
}
.club-entry {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-light, #f0f0f0);
  flex-wrap: wrap;
}
.club-name {
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
}
.club-name:hover { text-decoration: underline; }
.club-location {
  font-size: 0.875rem;
  color: var(--text-muted);
}
.club-hashtag {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: monospace;
}
.club-external-link {
  font-size: 0.8rem;
  color: var(--primary);
  margin-left: auto;
}

/* ── Member profile ────────────────────────────────────────── */
.profile-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  align-items: start;
}

.profile-sidebar {
  position: sticky;
  top: 88px;
}

.profile-avatar-card {
  text-align: center;
  padding: 32px 24px;
}
.profile-avatar-card:hover { transform: none; }

.profile-avatar-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--bg-light);
  border: 3px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  margin: 0 auto 16px;
  color: var(--text-muted);
}

.profile-avatar-img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--border);
  object-fit: cover;
  margin: 0 auto 16px;
  display: block;
}

.profile-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.profile-location {
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.profile-honor-badge {
  color: var(--secondary);
  font-weight: 500;
  font-size: 0.9rem;
  margin-top: 4px;
}

.profile-edit-btn {
  width: 100%;
  text-align: center;
  margin-top: 16px;
}

.profile-main {
  min-width: 0;
}

.profile-section {
  padding-bottom: 28px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.profile-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.profile-section-heading {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}

.profile-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.profile-link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 16px;
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
}
.profile-link-card:hover {
  text-decoration: none;
  color: var(--primary);
  border-color: var(--primary);
}
.profile-link-card.disabled {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

.profile-link-icon {
  font-size: 1.8rem;
}

.profile-link-label {
  font-size: 0.9rem;
  font-weight: 500;
}

.profile-account-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.profile-account-list li {
  border-bottom: 1px solid var(--bg-light);
}
.profile-account-list li:last-child {
  border-bottom: none;
}
.profile-account-list a {
  display: block;
  padding: 10px 0;
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}
.profile-account-list a:hover {
  color: var(--primary);
  text-decoration: none;
}

.profile-account-list .disabled {
  display: block;
  padding: 10px 0;
  font-size: 0.95rem;
  color: var(--text);
  opacity: 0.45;
  cursor: default;
}

/* ── Forms (general) ───────────────────────────────────────── */
.form-block {
  max-width: 560px;
  margin-top: 16px;
}

.form-field {
  margin-bottom: 14px;
}
.form-field label {
  display: block;
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--text);
}
.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="password"],
.form-field input[type="tel"],
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27,179,107,0.12);
}
.form-field textarea {
  resize: vertical;
  min-height: 100px;
}
.form-field select {
  appearance: auto;
}

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.form-error-banner {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid #c0392b;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: #991b1b;
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.form-fieldset {
  border: none;
  padding: 0;
  margin: 0 0 20px;
}
.form-fieldset legend {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-bottom: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  width: 100%;
}

.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 480px) {
  .form-row-2col { grid-template-columns: 1fr; }
}

/* ── Nav utilities ──────────────────────────────────────────── */
.nav-logout {
  display: inline;
  margin: 0;
  padding: 0;
}
.nav-logout-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.875rem;
  padding: 6px 12px;
}
.nav-logout-btn:hover {
  color: var(--primary);
}

/* ── Form utilities ────────────────────────────────────────── */
.form-hint {
  display: block;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 4px;
}

/* ── Profile edit: identity block ──────────────────────────── */
.profile-identity-block {
  background: var(--card-bg, #f9fafb);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 24px;
  max-width: 560px;
}
.identity-fields {
  display: grid;
  gap: 8px;
  margin: 0;
}
.identity-row {
  display: flex;
  gap: 12px;
}
.identity-row dt {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  min-width: 90px;
  flex-shrink: 0;
}
.identity-row dd {
  margin: 0;
  font-size: 0.9rem;
}
.identity-note {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 12px 0 0;
}

/* ── Profile edit: avatar inline ──────────────────────────── */
.avatar-edit-row {
  display: flex;
  align-items: center;
  gap: 20px;
}
.avatar-edit-thumb {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.avatar-edit-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.avatar-edit-form {
  flex: 1;
}
.form-error {
  color: #c0392b;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

/* ── Notice ────────────────────────────────────────────────── */
.notice {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 8px;
}

/* ── Dividers & helpers ──────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.mt-4  { margin-top: 1rem; }
.mb-4  { margin-bottom: 1rem; }
.mb-8  { margin-bottom: 2rem; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.4rem; }
  .hero { padding: 48px 20px; }
  .card-grid { grid-template-columns: 1fr; }
  .site-footer .wrapper { flex-direction: column; }
  .main-nav a { padding: 6px 10px; font-size: 0.875rem; }
  #clubs-map { display: none; }
  .profile-layout { grid-template-columns: 1fr; gap: 24px; }
  .profile-sidebar { position: static; }
  .profile-avatar-card { display: flex; flex-direction: row; align-items: center; gap: 20px; text-align: left; padding: 20px 24px; }
  .profile-avatar-placeholder { width: 80px; height: 80px; font-size: 2rem; margin: 0; flex-shrink: 0; }
  .profile-edit-btn { width: auto; margin-top: 8px; }
}

@media (max-width: 480px) {
  .wrapper { padding: 0 16px; }
  section { padding: 28px 0; }

  /* Profile edit: stack identity rows and avatar on narrow screens */
  .identity-row { flex-direction: column; gap: 2px; }
  .identity-row dt { min-width: 0; }
  .profile-identity-block { padding: 16px; }
  .avatar-edit-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .results-table th, .results-table td { padding: 8px 6px; }

  /* Nav: wrap below logo on small screens */
  .site-header { height: auto; padding: 8px 0; }
  .site-header .wrapper { flex-wrap: wrap; gap: 6px; justify-content: center; }
  .main-nav { flex-wrap: wrap; justify-content: center; }

  /* Event list: stack title above meta on mobile */
  .event-list-row { grid-template-columns: 1fr; gap: 2px; }
  .event-list-meta { flex-direction: row; align-items: center; gap: 8px; flex-wrap: wrap; text-align: left; }

  /* Tables: scroll horizontally rather than blowing out the page */
  .results-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
