* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
}

/* Sky ist auf bg zu hell für 4,5:1, deshalb Links in forest mit Unterstreichung. */
a { color: var(--forest); }
p { max-width: 65ch; }
img { max-width: 100%; }

h1, h2 { font-family: var(--font-display); font-weight: 800; color: var(--forest); }
h1 { font-size: 40px; line-height: 1; margin: 0 0 8px; }
h1:focus { outline: none; }
h2 { font-size: 30px; line-height: 1.05; margin: 32px 0 12px; }

:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.page { flex: 1; padding-top: 24px; padding-bottom: 48px; }
.narrow { max-width: 420px; }
.muted { color: var(--muted); }
.small { font-size: 14px; line-height: 1.45; }
.label { font-family: var(--font-ui); font-weight: 600; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; min-height: 72px; padding-top: 8px; padding-bottom: 8px; }
.brand { display: inline-flex; align-items: center; gap: 12px; min-height: 48px; color: var(--forest); font-family: var(--font-display); font-weight: 800; font-size: 26px; line-height: 1; text-decoration: none; }
.brand img { width: 48px; height: 48px; }
.main-nav, .account-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0 16px; }
.account-nav { margin-left: auto; }
.account-nav form { margin: 0; }
.main-nav a, .account-nav > a:not(.button), .account-nav .link-button {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--fg); font-family: var(--font-ui); font-weight: 500; text-decoration: none;
}
.main-nav a.active { color: var(--forest); box-shadow: inset 0 -3px 0 var(--sun); }

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 8px 20px;
  border: 0; border-radius: var(--r-md);
  background: var(--forest); color: var(--on-forest);
  font-family: var(--font-ui); font-weight: 600; font-size: 17px;
  text-decoration: none; cursor: pointer;
}
.button-action { background: var(--sun); color: var(--on-sun); font-weight: 700; }
.button-danger { background: var(--danger); color: var(--surface); }
.button-secondary { background: none; color: var(--fg); border: 2px solid var(--line); }
.button-secondary:hover, .button-secondary:focus-visible { color: var(--forest); border-color: var(--forest); }
.link-button { min-height: 44px; padding: 0; border: 0; background: none; color: var(--forest); font-family: var(--font-ui); font-weight: 500; font-size: 16px; cursor: pointer; text-decoration: underline; }
.link-button.danger { color: var(--danger); }

.hero { padding: 16px 0 8px; }
.hero h1 { font-size: clamp(40px, 8vw, 64px); line-height: .95; }
.hero p { color: var(--muted); margin-top: 8px; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; margin: 24px 0; }
.stat-value { font-family: var(--font-display); font-weight: 800; font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; }

.medal-speeder { list-style: none; padding: 0; margin: 8px 0 0; }
.medal-speeder li { padding: 8px 0; border-top: 1px solid var(--line); font-family: var(--font-body); color: var(--fg); }
.medal-speeder li:first-child { border-top: none; }

.map { display: block; height: 340px; margin: 16px 0; border-radius: var(--r-lg); overflow: hidden; }
.map-large { height: 440px; }
.track-item { margin: 12px 0 20px; }
.elevation { margin: 4px 0 0; }
.elevation svg { display: block; background: var(--chip); border-radius: var(--r-md); }
.elevation figcaption { margin-top: 4px; }

.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 0 32px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; gap: 4px; padding: 16px; background: var(--surface); border-radius: var(--r-lg); color: inherit; text-decoration: none; }
.card strong { font-family: var(--font-ui); font-weight: 600; font-size: 19px; }
.card:hover strong { color: var(--forest); }

/* Regionen als Pills, die aktuelle in forest */
.region-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 24px; padding: 0; list-style: none; }
.region-list a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--chip); color: var(--fg); font-family: var(--font-ui); font-weight: 500; text-decoration: none; }
.region-list a:hover { color: var(--forest); }
.region-list a[aria-current="page"] { background: var(--forest); color: var(--on-forest); }
.region-count { font-variant-numeric: tabular-nums; color: var(--muted); }
.region-list a[aria-current="page"] .region-count { color: inherit; }

.table-scroll { overflow-x: auto; background: var(--surface); border-radius: var(--r-lg); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:last-child td, tfoot tr:last-child > * { border-bottom: 0; }
th { font-family: var(--font-ui); font-weight: 600; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.actions { display: flex; gap: 16px; justify-content: flex-end; align-items: center; }
.total { font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--fg); letter-spacing: 0; text-transform: none; }

.rank { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.rank-first::before { content: ""; width: 10px; height: 10px; border-radius: 999px; background: var(--sun); }

.target-number { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 999px; background: var(--forest); color: var(--on-forest); font-family: var(--font-ui); font-weight: 600; }

.zone-chip { display: inline-block; min-width: 30px; padding: 0 8px; border-radius: 999px; color: var(--on-zone); font-family: var(--font-ui); font-weight: 600; font-size: 14px; text-align: center; }
.zone-kk { background: var(--zone-kk); }
.zone-gk { background: var(--zone-gk); }
.zone-k { background: var(--zone-k); }
.zone-m { background: var(--zone-m); }

.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 150px) 1fr 56px; align-items: center; gap: 12px; }
.bar-track { height: 10px; background: var(--chip); border-radius: 4px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--leaf); border-radius: 0 4px 4px 0; }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; }

.game-list, .comment-list, .plain-list { list-style: none; margin: 0; padding: 0; }
.game-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.game-list a { display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.game-list a strong { font-family: var(--font-ui); font-weight: 600; }
.scores { display: flex; flex-wrap: wrap; gap: 4px 12px; font-variant-numeric: tabular-nums; }
.plain-list li { padding: 8px 0; }

.comment-list { display: grid; gap: 16px; margin-top: 16px; }
.comment-list li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 999px; background: var(--chip); color: var(--fg); font-family: var(--font-ui); font-weight: 600; }
.bubble { padding: 12px 16px; background: var(--surface); border-radius: 4px 14px 14px 14px; }
.bubble p { margin: 4px 0; }
.bubble img { display: block; max-height: 240px; margin: 8px 0; border-radius: var(--r-md); }

.photo-row { display: flex; gap: 8px; overflow-x: auto; margin: 12px 0; }
.photo-row img { height: 180px; border-radius: var(--r-md); }

.badge { padding: 2px 10px; border-radius: 999px; background: var(--chip); color: var(--fg); font-family: var(--font-ui); font-weight: 500; font-size: 14px; }
.alert { padding: 10px 14px; border: 2px solid var(--danger); border-radius: var(--r-md); color: var(--danger); }
.notice { padding: 10px 14px; border-radius: var(--r-md); background: var(--chip); color: var(--fg); }

/* Öffentlich / Privat: an in leaf, aus in muted, immer mit Textlabel */
.switch { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0; border: 0; background: none; color: var(--fg); font-family: var(--font-ui); font-weight: 500; font-size: 16px; cursor: pointer; }
.switch-track { position: relative; width: 40px; height: 24px; border-radius: 999px; background: var(--muted); }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 999px; background: var(--surface); }
.switch[aria-checked="true"] .switch-track { background: var(--leaf); }
.switch[aria-checked="true"] .switch-track::after { left: 19px; }

.empty-state { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; overflow: hidden; background: var(--surface); border-radius: var(--r-lg); }
.empty-state p { margin: 0; }
.empty-state svg { display: block; width: calc(100% + 32px); height: 72px; margin: 0 -16px -16px; }

.filter-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 16px 0; }
.stack { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; max-width: 560px; }
label { display: flex; flex-direction: column; gap: 4px; font-family: var(--font-ui); font-weight: 500; font-size: 15px; color: var(--muted); }
input, select, textarea { min-height: 48px; padding: 10px 12px; border: 2px solid var(--line); border-radius: var(--r-md); background: var(--chip); color: var(--fg); font-family: var(--font-body); font-size: 17px; }
select, input[type="search"] { max-width: 100%; }

.forest-band { display: block; width: 100%; height: 120px; margin-top: 16px; }
.hill-1 { fill: var(--hill-1); }
.hill-2 { fill: var(--hill-2); }
.hill-3 { fill: var(--hill-3); }

.site-footer { padding: 16px 0 24px; background: var(--hill-3); color: var(--fg); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px; }
.legal-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0 16px; }
.legal-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--fg); }
.language-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0 16px; }
.language-nav a, .language-nav span { display: inline-flex; align-items: center; min-height: 44px; color: var(--fg); }
.language-nav span { font-weight: 700; }
.legal h2 { margin-top: 32px; }
.legal h3 { font-family: var(--font-ui); font-weight: 600; font-size: 22px; line-height: 1.2; color: var(--fg); margin: 24px 0 8px; }
.legal td { white-space: normal; }

.slogan { font-family: var(--font-hand); font-weight: 700; font-size: 26px; line-height: 1.1; }

@media (max-width: 600px) {
  h1 { font-size: 34px; }
  h2 { font-size: 26px; }
  .account-nav { margin-left: 0; }
  .map, .map-large { height: 280px; }
}

/* Newsletter-Verwaltung und Archiv */
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--forest); }
fieldset { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 16px; display: grid; gap: 8px; }
legend { font-family: var(--font-ui); font-weight: 600; padding: 0 6px; }
.pre-line { white-space: pre-line; }

/* ---------- Mitmachen: Projekt-Hinweis und Tickets ---------- */
.project-note { margin: 16px 0 24px; padding: 20px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); max-width: 760px; }
.project-note h2 { margin-top: 0; }
.project-note p + p { margin-top: 8px; }
.feedback-form { margin-bottom: 32px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.ticket-list { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 12px; max-width: 760px; }
.ticket { padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.ticket-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ticket-head strong { font-family: var(--font-ui); font-weight: 600; flex: 1 1 200px; }
.ticket-number { font-family: var(--font-ui); font-weight: 600; color: var(--muted); }
.ticket-text { white-space: pre-line; margin-top: 8px; }
.ticket-reply { white-space: pre-line; margin-top: 8px; padding: 10px 14px; border-left: 4px solid var(--leaf); background: var(--chip); border-radius: 0 var(--r-md) var(--r-md) 0; }
.badge.status-open { background: var(--chip); }
.badge.status-inProgress { background: var(--chip); color: var(--sky); box-shadow: inset 0 0 0 1px var(--sky); }
.badge.status-done { background: var(--forest); color: var(--on-forest); }
.badge.status-declined { background: var(--line); color: var(--muted); }
.danger-link { color: var(--danger); }
/* Bewertungen: volle Sterne in sun, leere als Umriss-Farbe muted, die Zahl steht immer daneben */
.stars { display: inline-flex; align-items: center; gap: 1px; white-space: nowrap; }
.star { color: var(--muted); font-size: 17px; line-height: 1; }
.star.full { color: var(--sun); }
.star.half { background: linear-gradient(90deg, var(--sun) 50%, var(--muted) 50%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stars-number { margin-left: 6px; font-family: var(--font-ui); font-weight: 600; font-variant-numeric: tabular-nums; }
.card-rating { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.review-summary { display: grid; gap: 10px; max-width: 640px; margin: 8px 0 16px; }
.review-bar { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(80px, 2fr) auto; gap: 4px 12px; align-items: center; }
.review-bar .muted.small { grid-column: 1 / -1; margin-top: -4px; }
.review-bar-label { font-family: var(--font-ui); font-weight: 600; }
.review-bar-track { height: 8px; border-radius: 999px; background: var(--chip); overflow: hidden; }
.review-bar-fill { display: block; height: 100%; background: var(--sun); }
/* Pfeil-Meldungen: vermisst in sun mit dunkler Schrift, gefunden in forest. Das Wort steht immer dabei. */
.arrow-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.badge.arrow-lost { background: var(--sun); color: var(--on-sun); }
.badge.arrow-found { background: var(--forest); color: var(--on-forest); }
.badge.arrow-resolved { background: var(--chip); color: var(--muted); }
.actions-left { display: flex; gap: 12px; }
.ai-note { flex-basis: 100%; margin: 0; color: var(--muted); }
/* Häkchen und Auswahlknöpfe neben dem Text, nicht darüber */
label.check { flex-direction: row; color: var(--fg); }

/* Netzwerk-Profil /@name: lange Adressen dürfen umbrechen */
.network-address { font-family: var(--font-ui); font-size: 20px; color: var(--forest); overflow-wrap: anywhere; }
