/* ── Meine Ergebnisse + Rekordbuch – mobile first ── */

@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/open-sans-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/open-sans-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/montserrat-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/montserrat-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/montserrat-latin-700-normal.woff2') format('woff2');
}

:root {
  --bg: #f3efe6;
  --surface: #ffffff;
  --surface-2: #f8f5ee;
  --ink: #1c2a20;
  --muted: #647067;
  --line: #e4ddce;
  --forest: #1f3d27;
  --forest-2: #2f5d3a;
  --leaf: #6a9f3a;
  --gold: #c8962e;
  --gold-soft: #f6ead0;
  --accent-text: #2f5d3a;      /* green text on light and dark backgrounds */
  --up: #2e7d32;
  --down: #c0392b;
  --shadow: 0 1px 2px rgba(28, 42, 32, 0.06), 0 6px 20px rgba(28, 42, 32, 0.06);
  --radius: 18px;
  --gutter: 10px;
  --font-head: 'Montserrat', system-ui, sans-serif;
  --font-body: 'Open Sans', system-ui, sans-serif;
  color-scheme: light;
}

/* dark mode: switched with the toggle (js/theme.js), light is the default */
:root[data-theme="dark"] {
  --bg: #0e1511;
  --surface: #16211a;
  --surface-2: #1b281f;
  --ink: #eaf0e8;
  --muted: #9aaa9e;
  --line: #26362b;
  --forest: #1a3322;
  --forest-2: #2a5234;
  --leaf: #8cc063;
  --gold: #e0b555;
  --gold-soft: #2e2716;
  --accent-text: #8cc063;
  --up: #7ccf7f;
  --down: #ff8a7a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

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

/* base size +10 % – every rem below scales with it */
html { -webkit-text-size-adjust: 100%; font-size: 110%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
  min-height: 100vh;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}


[hidden] { display: none !important; }

button { font: inherit; color: inherit; cursor: pointer; }

/* Top bar, menu and sheets: css/nav.css */

/* ── Coach ── */
.coach-btn {
  position: relative;
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--gold-soft);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--gold) 55%, transparent);
  display: grid;
  place-items: center;
  animation: coach-wave 2.8s ease-in-out 1s 2;
}
.coach-btn[aria-expanded="true"] { box-shadow: inset 0 0 0 2px var(--gold); }
@keyframes coach-wave {
  0%, 100% { transform: rotate(0); }
  10% { transform: rotate(-10deg); }
  20% { transform: rotate(8deg); }
  30% { transform: rotate(0); }
}
.coach-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #d7263d;
  box-shadow: 0 0 0 2px var(--bg);
}

/* Ringo introduces himself: small bubble under his button, once per device */
.ringo-hello {
  position: fixed;
  z-index: 40;
  top: calc(60px + env(safe-area-inset-top));
  right: 12px;
  width: min(260px, calc(100vw - 24px));
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--gold);
  box-shadow: 0 12px 30px rgba(28, 42, 32, 0.2);
  font-size: 0.86rem;
  animation: hello-in 0.3s ease-out;
}
.ringo-hello[hidden] { display: none; }
.ringo-hello::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 64px;
  width: 12px;
  height: 12px;
  background: var(--surface);
  border-left: 1px solid var(--gold);
  border-top: 1px solid var(--gold);
  transform: rotate(45deg);
}
.ringo-hello strong { font-family: var(--font-head); }
.ringo-hello button {
  margin-top: 8px;
  padding: 5px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--forest-2);
  color: #fff;
  font-weight: 600;
  font-size: 0.8rem;
}
@keyframes hello-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

/* Ringo's window: fullscreen, content centred on wide screens */
.coach-bubble {
  position: fixed;
  inset: 0;
  z-index: 200;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0 max(14px, calc((100% - 600px) / 2)) calc(24px + env(safe-area-inset-bottom));
  background: var(--bg);
  animation: bubble-in 0.2s ease-out;
}
@keyframes bubble-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.coach-bubble-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 -2px 10px;
  padding: calc(10px + env(safe-area-inset-top)) 2px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.coach-bubble-head .coach-face { flex-shrink: 0; border-radius: 50%; background: var(--gold-soft); box-shadow: 0 0 0 2px var(--gold); }
.coach-bubble-head strong { flex: 1; font-family: var(--font-head); font-size: 1.1rem; }
body.coach-open { overflow: hidden; }
.coach-close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 1.2rem;
  line-height: 1;
}
.coach-tips { display: flex; flex-direction: column; gap: 8px; }
.coach-section {
  margin: 4px 2px 0;
  font-family: var(--font-head);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.coach-tip {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  background: var(--surface-2);
}
.coach-tip-icon { font-size: 1.3rem; line-height: 1.3; }
.coach-tip strong { display: block; font-size: 0.95rem; font-family: var(--font-head); }
.coach-tip p { font-size: 0.88rem; color: var(--muted); }
/* Ringo: „Warum?“ in the coach bubble */
.ringo-why { margin-top: 6px; }
.ringo-why summary { cursor: pointer; font-size: 0.78rem; font-weight: 600; color: var(--accent-text); list-style: none; }
.ringo-why summary::-webkit-details-marker { display: none; }
.ringo-why summary::before { content: "▸ "; }
.ringo-why[open] summary::before { content: "▾ "; }
.ringo-why p { margin-top: 4px; font-size: 0.8rem; color: var(--ink); line-height: 1.5; }
.coach-tip .ringo-why p { color: var(--muted); }

/* Ringo: „Deine Entwicklung“ */
.dev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.dev-card { padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border-left: 4px solid var(--line); }
.dev-card.good { border-left-color: var(--leaf); }
.dev-head { display: flex; align-items: center; gap: 8px; }
.dev-head strong { font-family: var(--font-head); font-size: 0.92rem; }
.dev-card p { margin-top: 4px; font-size: 0.84rem; color: var(--muted); line-height: 1.45; }
.dev-chart { display: block; width: 100%; max-width: 360px; height: auto; margin-top: 8px; overflow: visible; }
.dev-chart .base { stroke: var(--line); stroke-width: 1; }
.dev-chart .area { fill: var(--accent-text); opacity: 0.12; }
.dev-chart .line { fill: none; stroke: var(--accent-text); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.dev-chart .dot { fill: var(--surface); stroke: var(--accent-text); stroke-width: 2; }
.dev-chart .dot.last { fill: var(--gold); stroke: var(--surface); }
.dev-chart text { font-family: var(--font-body); text-anchor: middle; }
.dev-chart text.m { font-size: 10px; fill: var(--muted); }
.dev-chart text.v { font-size: 11px; font-weight: 600; fill: var(--muted); }
.dev-chart text.v.strong { fill: var(--ink); font-size: 12px; }
.dev-chart text.avgl { text-anchor: start; fill: var(--gold); }
.dev-chart .bar { fill: var(--line); }
.dev-chart .bar.recent { fill: var(--accent-text); opacity: 0.8; }
.dev-chart .avg { stroke: var(--gold); stroke-width: 1.5; stroke-dasharray: 4 3; }
.dev-lage { max-width: 320px; margin-left: auto; margin-right: auto; }
.dev-lage .ax { stroke: var(--line); stroke-width: 1; }
.dev-lage .ring { fill: none; stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 3; }
.dev-lage .mdot { fill: var(--accent-text); stroke: var(--surface-2); stroke-width: 1.5; }
.dev-lage .mdot.last { fill: var(--gold); stroke: var(--ink); }
.dev-lage text.strong { fill: var(--ink); font-weight: 700; }
.dev-note { margin-top: 6px; font-size: 0.72rem; color: var(--muted); }
.season-head small { font-family: var(--font-body); font-weight: 400; font-size: 0.72rem; color: var(--muted); margin-left: 6px; text-transform: none; letter-spacing: 0; }

.coach-trainer { margin-top: 10px; padding: 8px 12px; border-radius: 12px; background: var(--gold-soft); font-size: 0.8rem; font-weight: 600; color: var(--ink); text-align: center; }
.coach-foot { margin-top: 8px; font-size: 0.7rem; color: var(--muted); text-align: center; }

/* ── Admin picker ── */
.admin-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 560px;
  margin: 10px auto 0;
  padding: 0 var(--gutter);
  font-size: 0.85rem;
  color: var(--muted);
}
.admin-picker select {
  flex: 1;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

/* ── Page ── */
.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 10px var(--gutter) 20px;
}

.state { text-align: center; padding: 64px 12px; color: var(--muted); }
.state h2 { font-family: var(--font-head); color: var(--ink); margin: 12px 0 6px; }
.state p { margin-bottom: 20px; }
.empty-icon { font-size: 3rem; }

.spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--leaf);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* toggle (left) + share (right) above the green overview */
.controls-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; }
.share-top-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--forest-2);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.84rem;
  box-shadow: 0 4px 12px rgba(31, 61, 39, 0.25);
}

/* ── Hero ── */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 12px 12px 12px;
  color: #fff;
  background:
    radial-gradient(circle at 115% -20%, rgba(255, 255, 255, 0.10) 0 22%, transparent 22.3%),
    radial-gradient(circle at 115% -20%, rgba(255, 255, 255, 0.06) 0 38%, transparent 38.3%),
    radial-gradient(circle at 115% -20%, rgba(255, 255, 255, 0.04) 0 54%, transparent 54.3%),
    linear-gradient(150deg, var(--forest) 0%, var(--forest-2) 100%);
  box-shadow: 0 14px 34px rgba(31, 61, 39, 0.28);
  touch-action: pan-y;
  scroll-margin-top: 64px;
}


.hero-top { display: flex; align-items: center; gap: 8px; }
.hero-when { flex: 1; text-align: center; display: flex; flex-direction: column; }
.hero-kicker {
  height: 1.2em; /* same height with or without text – the block must not jump */
  line-height: 1.2;
  font-family: var(--font-head);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e7c46a;
}
.hero-date { font-family: var(--font-head); font-weight: 600; font-size: 0.98rem; }
.hero-series { margin-top: 2px; font-size: 0.8rem; font-weight: 600; color: #f3dc9c; }

.nav-arrow {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 0;
  display: grid;
  place-items: center;
}
.nav-arrow svg { display: block; }
.nav-arrow:disabled { opacity: 0.25; cursor: default; }

/* discipline row: same fixed height for tabs and the single label – the green block never jumps */
.disc-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  margin: 10px -12px 0;
  padding: 0 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.disc-tab:first-child { margin-left: auto; }
.disc-tab:last-child { margin-right: auto; }
.disc-tabs::-webkit-scrollbar { display: none; }
.disc-tab {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.8rem;
  font-weight: 600;
}
.disc-tab.active { background: #fff; color: var(--forest); border-color: #fff; }
.disc-count { min-width: 20px; padding: 0 6px; border-radius: 999px; background: rgba(0, 0, 0, 0.14); font-size: 0.72rem; }
.disc-single {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  margin-top: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

/* toggle for the green overview – sits above it, right-aligned */
.mode-toggle {
  display: flex;
  flex-shrink: 0;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.mode-toggle button {
  border: 0;
  padding: 6px 11px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
}
.mode-toggle button[aria-pressed="true"] { background: var(--forest-2); color: #fff; }

.hero-body {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.hero-score { display: flex; flex-direction: column; min-width: 0; }
.hero-big {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(4rem, 21vw, 5.6rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.hero-big.long { font-size: clamp(3rem, 15vw, 4.2rem); }
.hero-label { font-size: 0.78rem; color: rgba(255, 255, 255, 0.82); white-space: nowrap; }
.hero-dec { min-height: 1.3em; font-size: 0.76rem; color: rgba(255, 255, 255, 0.62); }

.hero-compare { display: flex; flex-wrap: wrap; gap: 6px; min-height: 44px; margin-top: 8px; }
.pill {
  display: inline-flex;
  flex-direction: column;
  padding: 4px 9px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.15;
}
.pill small { font-family: var(--font-body); font-weight: 400; font-size: 0.64rem; opacity: 0.8; }
.pill.up { color: #b7f09a; }
.pill.down { color: #ffc2b8; }

.hero-target-col {
  width: clamp(140px, 54vw, 260px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.hero-target {
  position: relative;
  overflow: visible;
  border: 0;
  padding: 0;
  background: transparent;
  border-radius: 50%;
}
.hero-target canvas {
  display: block;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.08), 0 10px 24px rgba(0, 0, 0, 0.3);
}
.replay-label { font-size: 0.68rem; color: rgba(255, 255, 255, 0.75); text-align: center; min-height: 1.2em; font-variant-numeric: tabular-nums; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 10px;
}
.stat-row div {
  display: flex;
  flex-direction: column-reverse;
  padding: 7px 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.09);
  text-align: center;
}
.stat-row .stat-btn {
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.stat-row .stat-btn:active { transform: scale(0.96); }
.stat-row .stat-btn.active { background: #e7c46a; border-color: #e7c46a; color: #1f3a28; }
.stat-row .stat-btn.active dt { color: rgba(31, 58, 40, 0.8); }
.stat-row .stat-btn:focus-visible { outline: 2px solid #e7c46a; outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .stat-row .stat-btn:not(.active):hover { background: rgba(255, 255, 255, 0.16); }
}
.stat-row dt { font-size: 0.62rem; color: rgba(255, 255, 255, 0.7); }
.stat-row dd { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; }

/* ── Highlights ── */
.highlights {
  display: flex;
  gap: 8px;
  margin: 10px calc(-1 * var(--gutter)) 0;
  padding: 2px var(--gutter) 4px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}
.highlights::-webkit-scrollbar { display: none; }
.badge {
  flex: 0 0 auto;
  width: min(250px, 76vw);
  scroll-snap-align: start;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--gold-soft);
  border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent);
}
.badge-icon { font-size: 1.4rem; line-height: 1.2; }
.badge-text { display: flex; flex-direction: column; }
.badge-text strong { font-family: var(--font-head); font-size: 0.9rem; }
.badge-text small { font-size: 0.78rem; color: var(--muted); }

/* ── Cards ── */
.card {
  margin-top: 10px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
#series-card { scroll-margin-top: 70px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.card-head h2 { font-family: var(--font-head); font-size: 1rem; font-weight: 700; }
.card-sub { font-size: 0.76rem; color: var(--muted); text-align: right; }
.muted { color: var(--muted); font-size: 0.9rem; }

/* ── Series ── */
.series-list { display: flex; flex-direction: column; gap: 8px; }
.series {
  padding: 10px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.series.best { border-color: color-mix(in srgb, var(--gold) 60%, transparent); background: var(--gold-soft); }
.series.partial { opacity: 0.75; }
.series[data-index] { cursor: pointer; }
.series.selected { border-color: var(--leaf); box-shadow: 0 0 0 2px var(--leaf); }
.series:focus-visible { outline: 2px solid var(--leaf); outline-offset: 2px; }
.series-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.series-no { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
/* trophy = best series of the evening (target corner + "Deine Serien") */
.best-trophy {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  font-size: 1.5rem;
  line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
}
.best-tag {
  margin-left: 4px;
  font-size: 1.25rem;
  line-height: 1;
  vertical-align: -0.15em;
}
.series-score { font-family: var(--font-head); font-weight: 700; font-size: 1.5rem; line-height: 1; font-variant-numeric: tabular-nums; }
.shots {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 3px;
}
.shot {
  padding: 5px 0;
  border-radius: 7px;
  text-align: center;
  font-size: clamp(0.6rem, 2.9vw, 0.72rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--c) 16%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  white-space: nowrap;
  overflow: hidden;
}
.series-meta { margin-top: 6px; font-size: 0.72rem; color: var(--muted); }

/* ── Form chart ── */
.form-svg { width: 100%; height: auto; display: block; overflow: visible; }
.form-svg .grid { stroke: var(--line); stroke-width: 1; }
.form-svg .axis { fill: var(--muted); font-size: 10px; font-family: var(--font-body); }
.form-svg .axis.sel { fill: var(--ink); font-weight: 600; }
.form-svg .sel-band { fill: color-mix(in srgb, var(--leaf) 14%, transparent); }
.form-svg .avg-area { fill: color-mix(in srgb, var(--leaf) 12%, transparent); }
.form-svg .avg-line { fill: none; stroke: var(--leaf); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.form-svg .avg-dot { fill: var(--surface); stroke: var(--leaf); stroke-width: 2.5; }
.form-svg .avg-dot.sel { fill: var(--leaf); }
.form-svg .best-dot { fill: var(--gold); }
.form-svg .hit { fill: transparent; cursor: pointer; }
.legend { display: flex; gap: 16px; margin-top: 6px; font-size: 0.74rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.lg-avg { border: 2.5px solid var(--leaf); }
.lg-best { background: var(--gold); }

/* ── Evenings ── */
.evening-list { display: flex; flex-direction: column; }
.season-head {
  margin: 12px 0 4px;
  font-family: var(--font-head);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.season-head:first-child { margin-top: 0; }
.evening-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 6px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
}
.evening-row + .evening-row { border-top: 1px solid var(--line); border-top-left-radius: 0; border-top-right-radius: 0; }
.evening-row.active { background: color-mix(in srgb, var(--leaf) 12%, transparent); }
.er-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: start;
  padding: 7px 2px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.er-wd { font-size: 0.62rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.er-dm { font-family: var(--font-head); font-weight: 700; font-size: 0.82rem; }
.er-mid { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.er-comp { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.er-comp-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.er-disc {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 600;
  font-size: 0.84rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.er-sum { font-family: var(--font-head); font-weight: 700; font-size: 0.78rem; color: var(--muted); }
.er-chips { display: flex; flex-wrap: wrap; gap: 3px; }
.er-chip {
  min-width: 28px;
  padding: 1px 5px;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.er-chip.best { background: var(--gold-soft); border-color: color-mix(in srgb, var(--gold) 55%, transparent); }
.er-chip.partial { opacity: 0.6; }
.er-score { display: flex; flex-direction: column; align-items: flex-end; }
.er-value {
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.3rem;
  font-variant-numeric: tabular-nums;
}
.er-value small { font-size: 0.7rem; font-weight: 700; }
.er-caption { font-size: 0.64rem; color: var(--muted); }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--muted); }

.footnote { margin: 16px 8px 0; font-size: 0.76rem; color: var(--muted); text-align: center; }

/* ── Buttons ── */
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 22px;
  border: 0;
  border-radius: 16px;
  background: var(--forest-2);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(31, 61, 39, 0.3);
}
.primary-btn:active { transform: scale(0.98); }
.ghost-btn {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  text-decoration: none;
  line-height: 44px;
}
.ghost-btn.danger { color: var(--down); }

.segmented {
  display: flex;
  padding: 3px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.segmented button {
  flex: 1;
  border: 0;
  padding: 7px 10px;
  border-radius: 9px;
  background: transparent;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }


/* ── Share sheet (base sheet styles: css/nav.css) ── */
.share-options { margin-bottom: 10px; }
.share-opt-row { display: flex; flex-wrap: wrap; gap: 6px; }
.share-opt-label { margin: 10px 0 6px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.share-opt {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 0.84rem;
  font-weight: 600;
}
.share-opt.small { padding: 5px 10px; font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.share-opt[aria-pressed="true"] { background: var(--forest-2); border-color: var(--forest-2); color: #fff; }
.share-preview {
  display: grid;
  place-items: center;
  min-height: 240px;
  border-radius: 16px;
  background: var(--surface-2);
  overflow: hidden;
}
.share-preview img { width: 100%; max-width: 340px; height: auto; display: block; margin: 0 auto; }
.share-preview.story img { max-width: 230px; }
.share-actions { display: flex; flex-direction: column; margin-top: 12px; }
.share-actions .primary-btn { width: 100%; }
.share-hint { margin-top: 10px; font-size: 0.74rem; color: var(--muted); text-align: center; }

/* ── Toast ── */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 60;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.88rem;
  font-weight: 600;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* ── Rekordbuch ── */
body.rekorde { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.chip-row {
  display: flex;
  gap: 6px;
  margin: 0 calc(-1 * var(--gutter)) 4px;
  padding: 2px var(--gutter);
  overflow-x: auto;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.84rem;
  font-weight: 600;
}
.chip[aria-pressed="true"] { background: var(--forest-2); border-color: var(--forest-2); color: #fff; }
.rec-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 16px 4px 8px;
  font-family: var(--font-head);
  font-size: 1.05rem;
}
.rec-section-title small { font-family: var(--font-body); font-weight: 400; font-size: 0.76rem; color: var(--muted); }
.rec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.rec-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 12px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-align: left;
  min-width: 0;
}
.rec-card.top {
  grid-column: 1 / -1;
  color: #fff;
  border-color: transparent;
  background:
    radial-gradient(circle at 115% -30%, rgba(255, 255, 255, 0.12) 0 30%, transparent 30.5%),
    linear-gradient(150deg, var(--forest) 0%, var(--forest-2) 100%);
}
.rec-icon { font-size: 1.3rem; }
.rec-title { margin-top: 2px; font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.rec-card.top .rec-title { color: rgba(255, 255, 255, 0.8); }
.rec-value {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.8rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.rec-card.top .rec-value { font-size: 2.6rem; }
.rec-meta { font-size: 0.74rem; color: var(--muted); }
.rec-card.top .rec-meta { color: rgba(255, 255, 255, 0.75); }
.rec-actions { display: flex; gap: 6px; margin-top: 8px; }
.rec-actions a,
.rec-actions button {
  flex: 1;
  min-height: 34px;
  padding: 0 4px;
  border-radius: 10px;
  white-space: nowrap;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 600;
  text-decoration: none;
  display: grid;
  place-items: center;
}
.rec-card.top .rec-actions a,
.rec-card.top .rec-actions button {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.rec-target { position: absolute; top: 14px; right: 14px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18); }
.rec-card.has-target .rec-title,
.rec-card.has-target .rec-value,
.rec-card.has-target .rec-meta { margin-right: 112px; }
.rec-new {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--gold);
  color: #1c1c1c;
  font-family: var(--font-body);
  font-size: 0.66rem;
  font-weight: 700;
  vertical-align: 2px;
}
.rec-new-corner { position: absolute; top: 10px; right: 10px; z-index: 1; }
.rec-card.has-target .rec-new-corner { top: auto; right: auto; left: 44px; top: 14px; }
.ms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.ms-tile { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border: 1px dashed var(--line); }
.ms-tile.reached { background: var(--surface); border-style: solid; box-shadow: var(--shadow); }
.ms-icon { font-size: 1.4rem; flex: none; }
.ms-tile:not(.reached) .ms-icon { filter: grayscale(1); opacity: 0.6; }
.ms-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ms-text strong { font-family: var(--font-head); font-size: 0.86rem; }
.ms-text small { font-size: 0.74rem; color: var(--muted); }
.ms-bar { display: block; height: 5px; margin-top: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.ms-bar i { display: block; height: 100%; background: var(--accent-text); border-radius: 3px; }
.ms-scale { display: flex; justify-content: space-between; margin-top: 3px; font-size: 0.68rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ms-scale span:last-child { font-weight: 600; color: var(--ink); }

/* ── Larger screens ── */
@media (min-width: 600px) {
  :root { --gutter: 16px; }
  .page { padding-top: 20px; }
  .hero { padding: 18px; }
  .highlights { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; flex-wrap: wrap; }
  .badge { width: calc(50% - 4px); }
    .rec-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

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

/* ── Datenstand at the end of the page (time of the import, "Neu laden") ── */
.data-stand-line { margin: 18px 0 8px; text-align: center; font-size: 0.8rem; color: var(--muted); }
.data-stand-line[hidden] { display: none; }
.link-btn { padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--forest-2); text-decoration: underline; cursor: pointer; touch-action: manipulation; }
:root[data-theme="dark"] .link-btn { color: #a9d38a; }
