:root {
  --ink: #1c2416;
  --muted: #5c6754;
  --line: #e4dccb;
  --paper: #f7f3ea;
  --card: #fffdf8;
  --green: #1f6b45;
  --green-dark: #144a30;
  --tomato: #b8432f;
  --cream: #efe6d2;
  --shadow: 0 10px 30px rgba(40, 32, 16, 0.06);
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --sans: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 1.02rem;
  line-height: 1.55;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green-dark); }
a:hover { color: var(--tomato); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; font-weight: 700; }
p { margin: 0 0 0.8rem; }

.wrap { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }
.skip {
  position: absolute; left: -999px; top: 0;
}
.skip:focus { left: 1rem; top: 1rem; background: #fff; padding: 0.4rem 0.7rem; z-index: 9; }

.partnerbar {
  background: var(--green-dark);
  color: #f3efe4;
  font-size: 0.86rem;
}
.partnerbar .wrap { display: flex; gap: 1rem; align-items: center; min-height: 2.2rem; flex-wrap: wrap; }
.partnerbar a { color: #fff; text-decoration: none; font-weight: 650; }
.partnerbar a:hover { text-decoration: underline; }

.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 1rem; padding: 0.7rem 0; }
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: inherit; }
.brand img { width: 52px; height: 52px; object-fit: contain; }
.brand strong { display: block; font-family: var(--serif); font-size: 1.15rem; }
.brand span { color: var(--muted); font-size: 0.78rem; }
.nav { display: flex; flex-wrap: wrap; gap: 0.35rem 0.8rem; margin-left: auto; }
.nav a { text-decoration: none; color: var(--ink); font-size: 0.95rem; }
.nav a.is-active { color: var(--green); font-weight: 700; }
.langs { display: flex; gap: 0.3rem; }
.langs a { text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 0.1rem 0.45rem; background: #fff; }
.langs a.is-active { border-color: var(--green); background: #e7f3ec; }

.banner {
  display: flex; align-items: center; gap: 0.8rem;
  background: #fff4e8; border-bottom: 1px solid #f0d7c4; color: #5a311c;
  padding: 0.65rem 0;
}
.banner a.banner-link { display: flex; gap: 0.8rem; align-items: center; color: inherit; text-decoration: none; flex: 1; }
.banner .arrow { font-size: 1.5rem; line-height: 1; color: var(--tomato); }
.banner p { margin: 0; }
.banner button { border: 0; background: transparent; cursor: pointer; font-size: 1.1rem; color: inherit; }

main { padding: 1.6rem 0 3rem; }
.hero { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 1.5rem; align-items: center; margin-bottom: 1.8rem; }
.kicker { letter-spacing: 0.08em; text-transform: uppercase; color: var(--green); font-size: 0.78rem; font-weight: 700; }
.hero h1 { font-size: clamp(2rem, 4vw, 3.3rem); margin: 0.2rem 0 0.6rem; }
.lede { font-size: 1.12rem; color: #2d3826; }
.hero-card {
  background: var(--green); color: #f6fff8; border-radius: 18px; padding: 1.2rem 1.3rem;
  box-shadow: var(--shadow);
}
.hero-card a { color: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }

.btn, button.btn, input[type="submit"].btn {
  display: inline-block; background: var(--green); color: #fff; text-decoration: none;
  border: 0; border-radius: 999px; padding: 0.55rem 1rem; font: inherit; cursor: pointer;
}
.btn.secondary { background: transparent; color: var(--green-dark); border: 1px solid var(--green); }
.btn.danger { background: var(--tomato); }
.btn.small { padding: 0.25rem 0.7rem; font-size: 0.88rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.card a.title { color: inherit; text-decoration: none; }
.card .pad { padding: 0.9rem 1rem 1rem; }
.card h2, .card h3 { margin: 0.25rem 0; font-size: 1.25rem; }
.thumb {
  aspect-ratio: 4/3; background: linear-gradient(160deg, #e7f3ec, #f6e7d4);
  display: grid; place-items: center; font-size: 2.4rem;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.meta { color: var(--muted); font-size: 0.88rem; }
.badges { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.badge {
  background: var(--cream); border-radius: 999px; padding: 0.1rem 0.55rem; font-size: 0.78rem;
}
.badge.level-supereasy { background: #d9f5e4; }
.badge.level-leicht { background: #e5f0d4; }
.badge.level-mittel { background: #ffe8c2; }
.badge.level-schwer { background: #ffd9d2; }
.badge.community { background: #e7eef8; }

.category-icons { display: flex; flex-wrap: wrap; gap: 0.85rem; margin: 0 0 1rem; align-items: flex-start; }
.category-group {
  flex: 0 1 auto; max-width: 100%; padding: 0.75rem 0.85rem;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
.category-group.has-selection { border-color: #86efac; }
.category-group:first-child { flex: 1 1 100%; }
.group-title {
  display: flex; align-items: center; gap: 0.4rem; width: 100%; margin: 0; padding: 0;
  border: 0; background: none; cursor: pointer; text-align: left;
  font-size: 0.82rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em;
}
.group-title .count, .section-heading span {
  min-width: 1.25rem; padding: 0.1rem 0.4rem; border-radius: 999px; background: #f1f5f9; font-size: 0.68rem;
}
.chevron { transition: transform 0.15s ease; }
.category-group.is-collapsed .chevron { transform: rotate(-90deg); }
.category-group.is-collapsed .group-sections { display: none; }
.group-sections {
  display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.75rem; padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}
.category-section {
  flex: 0 1 auto; min-width: min(100%, 180px); padding: 0.65rem 0.75rem;
  border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc;
}
.section-heading {
  display: inline-flex; align-items: center; gap: 0.35rem; margin: 0 0 0.45rem;
  font-size: 0.78rem; font-weight: 700; color: inherit; text-decoration: none;
}
.section-heading.active { color: var(--green, #1f7a4d); }
.group-icons { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.category-btn {
  position: relative; width: 76px; min-height: 76px; padding: 0.35rem 0.2rem 0.3rem;
  border: 2px solid var(--line); border-radius: 12px; background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem;
  text-decoration: none; color: inherit; text-align: center;
}
.category-btn.active { border-color: #1f7a4d; background: #f0fdf4; }
.category-btn img { width: 36px; height: 36px; object-fit: contain; }
.category-btn .abbrev { font-weight: 700; font-size: 0.85rem; }
.category-btn .count-badge {
  position: absolute; top: 2px; right: 2px; min-width: 1.1rem; padding: 0.05rem 0.3rem;
  border-radius: 999px; background: #ecfdf5; color: #166534; font-size: 0.62rem; font-weight: 700;
}
.icon-label { font-size: 0.62rem; line-height: 1.15; max-width: 100%; }
.zoom {
  display: block; width: 100%; padding: 0; border: 0; background: #f6f3ee; cursor: zoom-in;
}
.zoom img { width: 100%; aspect-ratio: 4/3; object-fit: contain; }
.off-note {
  margin: 1rem 0; font-size: 0.82rem; color: var(--muted); line-height: 1.45;
}
.off-note p:first-child {
  margin: 0 0 0.55rem; padding: 0.55rem 0.7rem; border-radius: 8px;
  background: #fffbeb; border: 1px solid #fde68a; color: #78350f;
}
.lightbox {
  position: fixed; inset: 0; z-index: 80; display: none; place-items: center;
  background: rgba(15, 23, 20, 0.88); padding: 1rem;
}
.lightbox.is-open { display: grid; }
.lb-viewport {
  width: min(96vw, 1100px); height: min(82vh, 900px);
  display: grid; place-items: center; overflow: hidden;
  touch-action: none; cursor: zoom-in; z-index: 1;
}
.lb-viewport.is-zoomed { cursor: grab; }
.lb-viewport.is-panning { cursor: grabbing; }
.lb-viewport img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  transform-origin: center center; user-select: none; pointer-events: none;
  -webkit-user-drag: none;
}
.lb-close, .lb-prev, .lb-next {
  position: absolute; z-index: 2; border: 0; background: rgba(255,255,255,0.16); color: #fff;
  width: 44px; height: 44px; border-radius: 999px; font-size: 1.8rem; line-height: 1; cursor: pointer;
}
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; }
.lb-next { right: 1rem; top: 50%; }
.lb-hint {
  position: absolute; z-index: 2; bottom: 1rem; left: 50%; transform: translateX(-50%);
  margin: 0; color: #fff; font-size: 0.85rem; text-align: center; max-width: min(92vw, 640px);
}
@media (max-width: 700px) {
  .lightbox { padding: 0.6rem; }
}

.filters { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 0 1rem; align-items: end; }
.filters label { display: grid; gap: 0.2rem; font-size: 0.82rem; color: var(--muted); }
input, select, textarea {
  font: inherit; color: inherit; background: #fff; border: 1px solid #d9d0c0; border-radius: 10px;
  padding: 0.45rem 0.6rem;
}
textarea { width: 100%; min-height: 4.5rem; }
.section-block { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 1rem 1.1rem; margin: 0 0 1rem; }
.steps { padding-left: 1.2rem; }
.steps li { margin: 0 0 0.7rem; }
.step-img { width: min(360px, 100%); border-radius: 12px; margin-top: 0.4rem; }
.video { position: relative; padding-top: 56%; background: #111; border-radius: 16px; overflow: hidden; margin: 1rem 0; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.prose h2 { margin-top: 1.6rem; }
.prose ul { padding-left: 1.2rem; }
.note { background: #fff; border-left: 4px solid var(--green); padding: 0.7rem 0.9rem; }

.pyramid { display: grid; gap: 0.35rem; max-width: 520px; margin: 1rem auto; }
.pyramid div { margin: 0 auto; text-align: center; color: #143222; padding: 0.7rem 0.5rem; border-radius: 8px; }
.p1 { width: 100%; background: #8fbf73; }
.p2 { width: 84%; background: #c6d36a; }
.p3 { width: 68%; background: #e4c15a; }
.p4 { width: 52%; background: #e39a4a; }
.p5 { width: 36%; background: #d36b4f; color: #fff; }

.bars { display: grid; gap: 0.9rem; }
.bar-row { display: grid; grid-template-columns: 9rem 1fr; gap: 0.6rem; align-items: center; }
.track { background: #efe8da; border-radius: 999px; overflow: hidden; height: 0.85rem; }
.track span { display: block; height: 100%; background: var(--green); }
.track.mixed span { background: #c47a4a; }
.source { font-size: 0.85rem; color: var(--muted); }

#resto-map { height: 420px; border-radius: 16px; border: 1px solid var(--line); margin-bottom: 1rem; }
.preview-strip { display: flex; gap: 0.4rem; margin-top: 0.7rem; }
.preview-item {
  flex: 1 1 0; min-width: 0; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #efe8da;
}
.preview-item img { width: 100%; height: 100%; object-fit: cover; }
.pager { display: flex; gap: 0.3rem; margin-top: 1rem; flex-wrap: wrap; }
.pager a { text-decoration: none; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 0.2rem 0.55rem; }
.pager a.is-current { background: var(--green); color: #fff; }

.site-footer { border-top: 1px solid var(--line); padding: 1.4rem 0 2rem; color: var(--muted); font-size: 0.92rem; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 0.8rem; flex-wrap: wrap; }

.admin-table { width: 100%; border-collapse: collapse; background: #fff; }
.admin-table th, .admin-table td { border-bottom: 1px solid var(--line); text-align: left; padding: 0.45rem; vertical-align: top; }
.repeat { border: 1px dashed var(--line); padding: 0.6rem; margin: 0.4rem 0; border-radius: 10px; background: #fff; }
.error { color: var(--tomato); }

@media (max-width: 800px) {
  .hero, .split, .bar-row { grid-template-columns: 1fr; }
  .header-row { flex-wrap: wrap; }
  .nav { margin-left: 0; }
}
