/* ==========================================================================
   Matchplay Bad Griesbach – Stylesheet
   Modernes Golf-Layout: tiefes Pine-Gruen, Green-Hoehenlinien im Hero,
   helle Karten, Scorekarten-Ziffern im Rechner.
   ========================================================================== */

:root {
  --pine: #0a3327;
  --pine-deep: #06211a;
  --fairway: #14704a;
  --moss: #4c9d70;
  --cream: #f7f5ef;
  --sand: #eae2d1;
  --sand-soft: #f2ece0;
  --gold: #b4883a;
  --ink: #16201b;
  --ink-soft: #55635b;
  --line: #e2ddd1;
  --white: #fff;
  --focus: #1462c4;

  --r: 16px;
  --r-sm: 9px;
  --shadow: 0 1px 2px rgba(10, 51, 39, .05), 0 14px 34px -18px rgba(10, 51, 39, .3);
  --shadow-lift: 0 2px 4px rgba(10, 51, 39, .06), 0 22px 48px -20px rgba(10, 51, 39, .38);

  --shell: 74rem;
  --text: 40rem;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  font-size: 1.075rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand, .btn, .nav a, .subnav a, .stat-num, th, legend {
  font-family: Outfit, "Segoe UI", system-ui, sans-serif;
}

h1 {
  font-size: clamp(2rem, 1.4rem + 3.2vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -0.028em;
  font-weight: 600;
  margin: 0;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.35rem, 1.15rem + 1vw, 1.85rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 3rem 0 0.85rem;
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 2rem 0 0.5rem;
}

p, ul, ol, table { margin: 0 0 1.1rem; }
p, li { max-width: var(--text); }

a {
  color: var(--fairway);
  text-decoration-color: rgba(20, 112, 74, .35);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
  transition: color .15s ease, text-decoration-color .15s ease;
}
a:hover { color: var(--pine); text-decoration-color: currentColor; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 3px;
}

img { max-width: 100%; height: auto; display: block; }
strong { font-weight: 600; }

.skip {
  position: absolute; left: -9999px;
  background: var(--white); color: var(--ink);
  padding: 0.6rem 0.9rem; border-radius: var(--r-sm); z-index: 30;
}
.skip:focus { left: 1rem; top: 1rem; }

/* ---------------------------------------------------------------- Navigation */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 245, 239, .9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0.65rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--pine);
  text-decoration: none;
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  flex: 0 1 auto;
  min-width: 0;
}
.brand > span { min-width: 0; }
.brand:hover { color: var(--fairway); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 11px;
  background: var(--pine);
  color: var(--white);
  flex: 0 0 auto;
}
.brand:hover .brand-mark { background: var(--fairway); }
.brand em {
  display: block;
  font-style: normal;
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.76rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

.nav { margin-left: auto; position: relative; }
.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.15rem;
}
.nav li { max-width: none; }
.nav a {
  display: block;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
}
.nav a:hover { background: var(--sand-soft); color: var(--pine); }
.nav a[aria-current="page"], .nav a.here { background: var(--pine); color: var(--white); }
.nav .cta a { background: var(--fairway); color: var(--white); }
.nav .cta a:hover { background: var(--pine); color: var(--white); }

.nav-toggle {
  display: none;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: Outfit, sans-serif;
  font-size: 0.98rem;
  font-weight: 500;
  background: var(--white);
  color: var(--pine);
}
.nav-toggle:hover { border-color: var(--moss); }

@media (max-width: 64rem) {
  .topbar-inner { padding: 0.6rem 1.1rem; gap: 0.85rem; }
  .nav-toggle { display: inline-block; }
  .nav ul {
    position: absolute;
    right: 0;
    top: calc(100% + 0.6rem);
    min-width: 15rem;
    display: none;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--shadow-lift);
    padding: 0.5rem;
  }
  .nav ul.open { display: block; }
  .nav ul a { border-radius: var(--r-sm); padding: 0.6rem 0.75rem; }
}

@media (max-width: 32rem) {
  .brand { font-size: 1.02rem; min-width: 0; }
  .brand em { display: none; }
  .brand-mark { width: 1.95rem; height: 1.95rem; }
  .nav-toggle { padding: 0.45rem 0.8rem; font-size: 0.94rem; }
}

/* ---------------------------------------------------------------- Hero */

.hero {
  position: relative;
  background-color: var(--pine);
  color: var(--white);
  overflow: hidden;
  isolation: isolate;
}

/* Hoehenlinien wie auf einer Greenkarte */
.hero::before {
  content: "";
  position: absolute;
  inset: -35% -15% -45% 35%;
  background: repeating-radial-gradient(circle at 60% 45%,
    rgba(255, 255, 255, .085) 0 1.5px, transparent 1.5px 30px);
  z-index: -1;
}
.hero.has-photo {
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
.hero.has-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, var(--pine-deep) 6%, rgba(10, 51, 39, .86) 48%, rgba(10, 51, 39, .4));
  z-index: -2;
}
.hero.has-photo::before { opacity: .55; }

.hero-inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(2.25rem, 1.4rem + 4.5vw, 4.5rem) 1.5rem clamp(2rem, 1.2rem + 3vw, 3.5rem);
}
.hero-home .hero-inner {
  padding-top: clamp(3rem, 1.8rem + 6vw, 6rem);
  padding-bottom: clamp(3rem, 1.8rem + 5vw, 5rem);
}

.hero .crumbs {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, .7);
  margin: 0 0 1.1rem;
  max-width: none;
}
.hero .crumbs a { color: rgba(255, 255, 255, .82); text-decoration-color: rgba(255, 255, 255, .32); }
.hero .crumbs a:hover { color: var(--white); }

.hero h1 { max-width: 26ch; }

.hero-sub {
  margin: 1.15rem 0 0;
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.28rem);
  line-height: 1.5;
  color: rgba(255, 255, 255, .86);
  max-width: 46ch;
}

.hero-list {
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 1.15rem 2.5rem;
  max-width: 52rem;
  align-items: start;
}
.hero-list li {
  position: relative;
  max-width: 34ch;
  padding-left: 1.6rem;
  font-size: 1.02rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, .88);
}
.hero-list > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 2px;
  background: var(--moss);
}
.hero-list ul {
  list-style: none;
  display: grid;
  gap: 0.3rem;
  margin: 0.5rem 0 0;
  padding: 0;
}
.hero-list ul li {
  position: relative;
  max-width: none;
  padding-left: 1.05rem;
  font-size: 0.97rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, .74);
}
.hero-list ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 0.5rem;
  height: 2px;
  border-radius: 1px;
  background: rgba(255, 255, 255, .5);
}

@media (min-width: 46rem) {
  .hero-list { grid-template-columns: 1fr 1fr; }
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1.85rem 0 0;
  padding: 0;
  list-style: none;
}
.hero-meta li {
  max-width: none;
  font-size: 0.92rem;
  padding: 0.35rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  color: rgba(255, 255, 255, .9);
}

/* ---------------------------------------------------------------- Subnav */

.subnav { background: var(--white); border-bottom: 1px solid var(--line); }
.subnav-inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0.6rem 1.5rem;
  overflow-x: auto;
}
.subnav ul { list-style: none; display: flex; gap: 0.3rem; margin: 0; padding: 0; }
.subnav li { max-width: none; }
.subnav a {
  display: block;
  white-space: nowrap;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
}
.subnav a:hover { background: var(--sand-soft); color: var(--pine); }
.subnav a[aria-current="page"] { background: var(--sand); color: var(--pine); }

/* ---------------------------------------------------------------- Inhalt */

main {
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(2rem, 1.5rem + 2vw, 3.25rem) 1.5rem 5rem;
}
main > :first-child { margin-top: 0; }

.lead {
  font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.32rem);
  line-height: 1.5;
  color: var(--pine);
  max-width: 44ch;
}

.note {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: var(--r-sm);
  padding: 1rem 1.2rem;
  margin: 1.75rem 0;
  box-shadow: var(--shadow);
  max-width: 46rem;
}
.note > :last-child { margin-bottom: 0; }

.linklist {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 2rem;
  display: grid;
  gap: 0.6rem;
  max-width: 46rem;
}
.linklist li { max-width: none; }
.linklist a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0.85rem 1.15rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--pine);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.linklist a::after {
  content: "";
  width: 0.5rem; height: 0.5rem;
  border-right: 2px solid var(--moss);
  border-top: 2px solid var(--moss);
  transform: rotate(45deg);
  flex: 0 0 auto;
}
.linklist a:hover {
  border-color: var(--moss);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.winners {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  max-width: 62rem;
  margin: 1.5rem 0 2rem;
}
.winners > div {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.35rem 1.4rem 1.5rem;
  box-shadow: var(--shadow);
}
.winners h3 {
  margin: 0 0 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
  font-size: 1.05rem;
}
.winners ol { counter-reset: rank; list-style: none; padding: 0; margin: 0; }
.winners li {
  counter-increment: rank;
  display: grid;
  grid-template-columns: 1.4rem 1fr;
  gap: 0.5rem;
  padding: 0.3rem 0;
  max-width: none;
}
.winners li::before {
  content: counter(rank);
  font-family: Outfit, sans-serif;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--moss);
}
.winners li:first-child::before { color: var(--gold); }

.rules {
  list-style: none;
  counter-reset: rule;
  padding: 0;
  margin: 1.75rem 0 0;
  max-width: 52rem;
}
.rules > li {
  counter-increment: rule;
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0 1.25rem;
  padding: 1.6rem 0;
  border-top: 1px solid var(--line);
  max-width: none;
}
.rules > li::before {
  content: counter(rule);
  font-family: Outfit, sans-serif;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--moss);
  padding-top: 0.2rem;
}
.rules > li:last-child { border-bottom: 1px solid var(--line); }
.rules > li > * { grid-column: 2; }
.rules > li > h2 { font-size: 1.15rem; margin: 0 0 0.5rem; }
.rules > li > :last-child { margin-bottom: 0; }
.rules ol { padding-left: 1.3rem; }

.table-wrap {
  overflow-x: auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  max-width: 54rem;
  margin: 1.5rem 0 2rem;
}
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td {
  text-align: left;
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th { max-width: none; }
thead th {
  background: var(--pine);
  color: var(--white);
  font-weight: 500;
  font-size: 0.95rem;
  border-bottom: none;
}
tbody tr:last-child td { border-bottom: none; }
td.year, th.year {
  font-family: Outfit, sans-serif;
  font-weight: 600;
  white-space: nowrap;
  border-right: 1px solid var(--line);
}
tbody td.year { background: var(--sand-soft); }

/* ---------------------------------------------------------------- Rechner */

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-lift);
  max-width: 54rem;
  margin: 1.75rem 0 2.5rem;
  overflow: hidden;
}
.panel-head {
  margin: 0;
  background: var(--pine);
  color: var(--white);
  padding: 1rem 1.5rem;
  font-family: Outfit, sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  max-width: none;
}
.panel-body { padding: 1.5rem; }
.panel-body > :last-child { margin-bottom: 0; }

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  margin: 0 0 1.1rem;
  padding: 1rem 1.15rem 1.15rem;
  background: #fcfbf8;
}
legend { font-weight: 600; font-size: 1rem; padding: 0 0.45rem; color: var(--pine); }

.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 500; font-size: 0.95rem; margin-bottom: 0.3rem; }
.field .hint, p.hint { color: var(--ink-soft); font-size: 0.95rem; }
.field .hint { display: block; margin-bottom: 0.4rem; }
p.hint { max-width: var(--text); }
.req { color: var(--gold); }

input[type="text"], input[type="email"], input[type="number"], select, textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0.6rem 0.75rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:hover, select:hover, textarea:hover { border-color: #cfc8b6; }
input:focus, select:focus, textarea:focus {
  border-color: var(--fairway);
  box-shadow: 0 0 0 3px rgba(20, 112, 74, .14);
  outline: none;
}
input[type="number"] { font-variant-numeric: tabular-nums; }
textarea { min-height: 8.5rem; resize: vertical; }

.pair { display: grid; gap: 0 1.25rem; grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr)); }

.modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1.35rem;
  padding: 0.3rem;
  background: var(--sand-soft);
  border-radius: 999px;
  width: fit-content;
}
.modes label {
  display: block;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--ink-soft);
  max-width: none;
}
.modes label:hover { color: var(--pine); }
.modes input { position: absolute; opacity: 0; pointer-events: none; }
.modes label:has(input:checked) {
  background: var(--white);
  color: var(--pine);
  box-shadow: 0 1px 3px rgba(10, 51, 39, .16);
}
.modes label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }

.btn {
  display: inline-block;
  font-family: Outfit, sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--white);
  background: var(--fairway);
  border: 1.5px solid var(--fairway);
  border-radius: 999px;
  padding: 0.65rem 1.6rem;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--pine); border-color: var(--pine); }
.btn-quiet { background: transparent; color: var(--pine); border-color: var(--line); }
.btn-quiet:hover { background: var(--sand-soft); border-color: var(--sand); }
.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; }

/* Platzauswahl im Rechner */
.platzwahl { max-width: 24rem; }
.platzinfo { margin: 0 0 1.2rem; max-width: 26rem; }
.platzinfo .steps { margin-bottom: 0; font-size: 0.93rem; }
.steps.platzdaten th, .steps.platzdaten td { text-align: right; padding: 0.4rem 0.9rem; }
.steps.platzdaten th:first-child, .steps.platzdaten td:first-child { text-align: left; }
.steps.platzdaten thead th { font-size: 0.88rem; }

.result {
  scroll-margin-top: 5.5rem;
  margin: 1.75rem -1.5rem -1.5rem;
  padding: 1.5rem;
  background: var(--sand-soft);
  border-top: 1px solid var(--line);
}
.result[hidden] { display: none; }
.result > :first-child { margin-top: 0; }
.result h3 { font-size: 1rem; margin: 1.5rem 0 0.4rem; }

.stat {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  background: var(--pine);
  color: var(--white);
  border-radius: var(--r);
  padding: 1.15rem 1.4rem;
  margin: 0 0 1.1rem;
}
.stat-num {
  font-family: Outfit, sans-serif;
  font-size: clamp(2.4rem, 2rem + 2vw, 3.4rem);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: -0.03em;
  margin: 0;
  font-variant-numeric: tabular-nums;
  max-width: none;
}
.stat-label {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, .88);
  max-width: 28ch;
}
.stat.even { background: var(--white); color: var(--pine); border: 1px solid var(--line); }
.stat.even .stat-label { color: var(--ink-soft); }

.holes { list-style: none; display: flex; flex-wrap: wrap; gap: 0.3rem; padding: 0; margin: 0.6rem 0 1.25rem; }
.holes li {
  max-width: none;
  width: 2.5rem;
  padding: 0.3rem 0;
  text-align: center;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
  color: var(--ink-soft);
}
.holes li.on { background: var(--fairway); border-color: var(--fairway); color: var(--white); font-weight: 600; }
.holes .hole { display: block; font-size: 0.98rem; font-weight: 600; line-height: 1.15; }
.holes .idx { display: block; font-size: 0.7rem; line-height: 1.3; opacity: 0.72; }
.holes-legend {
  font-size: 0.92rem;
  color: var(--ink-soft);
  max-width: none;
  margin: 0 0 1.3rem;
}
.holes li.on .idx { opacity: 0.85; }
.strokes-tabelle td, .strokes-tabelle th { text-align: center; padding: 0.5rem 0.55rem; }
.strokes-tabelle td:first-child, .strokes-tabelle th:first-child { text-align: left; white-space: nowrap; }

.steps {
  width: 100%;
  max-width: none;
  font-size: 0.97rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.steps td { padding: 0.55rem 0.9rem; }
.steps td:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.steps tr.total td {
  border-top: 1.5px solid var(--pine);
  border-bottom: none;
  font-weight: 600;
  background: #fcfbf8;
}
.result .note { margin: 1.25rem 0 0; }
.error { color: #a8321f; font-weight: 500; }

.form-status { margin-top: 1rem; }
.form-status p { margin: 0; }

/* ---------------------------------------------------------------- Fuss */

.foot {
  background: var(--pine-deep);
  color: rgba(255, 255, 255, .78);
  padding: 3.5rem 1.5rem 3rem;
  font-size: 0.97rem;
}
.foot-inner {
  max-width: var(--shell);
  margin: 0 auto;
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}
.foot h2 {
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: var(--moss);
  margin: 0 0 0.7rem;
  font-weight: 600;
}
.foot p, .foot li { max-width: none; }
.foot p { margin: 0 0 0.4rem; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { padding: 0.15rem 0; }
.foot a { color: rgba(255, 255, 255, .88); text-decoration-color: rgba(255, 255, 255, .3); }
.foot a:hover { color: var(--white); }

@media print {
  .topbar, .subnav, .crumbs, .actions, .foot { display: none; }
  body { background: #fff; font-size: 11pt; }
  .hero { background: #fff; color: #000; }
  .hero::before, .hero::after { display: none; }
  .hero h1, .hero-sub, .hero-meta li { color: #000; }
  .panel, .note, .table-wrap { box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
