/* ============================================================
   base.css — Reset, Typografie, Layout, Navigation, Footer, UI-Primitives
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  /* Platz für die Bottom-Tab-Bar (mobil) */
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
@media (min-width: 860px) { body { padding-bottom: 0; } }

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: var(--pitch-deep); text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
a:hover { color: var(--pitch); }

/* --- Typografie --- */
h1, h2 { font-family: var(--font-display); font-weight: 400; line-height: 1.02; letter-spacing: .01em; text-transform: uppercase; }
h3, h4 { font-family: var(--font-ui); font-weight: 800; line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { max-width: 65ch; }
.lead { font-size: 1.15rem; color: var(--ink-soft); }
.caption { font-size: var(--fs-caption); color: var(--ink-soft); letter-spacing: .02em; }
.eyebrow {
  font-family: var(--font-ui); font-weight: 700; font-size: .75rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--pitch-deep);
}
.hand { color: var(--edding); font-weight: 600; }
.num { font-variant-numeric: tabular-nums slashed-zero; }

/* --- Layout-Primitives --- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--sp-4); }
.container.narrow { max-width: var(--maxw-narrow); }
@media (min-width: 720px) { .container { padding-inline: var(--sp-6); } }
.section { padding-block: var(--sp-12); }
.stack > * + * { margin-top: var(--sp-4); }
.stack-lg > * + * { margin-top: var(--sp-8); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.grid-auto { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }

/* Spielfeld-Hairline als Trenner */
.pitch-rule { border: 0; height: 1px; background: var(--line); margin-block: var(--sp-8); }
.pitch-rule.center {
  position: relative; background: var(--line);
}
.pitch-rule.center::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 46px; height: 46px;
  transform: translate(-50%,-50%); border: 1px solid var(--line); border-radius: 50%;
}

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: 11px 18px; border-radius: var(--r-btn); font-weight: 600;
  border: 1.5px solid transparent; transition: transform var(--dur-fast) var(--ease), background var(--dur-fast), box-shadow var(--dur-fast);
  text-decoration: none; line-height: 1; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--pitch); color: #fff; box-shadow: var(--shadow-card); }
.btn-primary:hover { background: var(--pitch-deep); color: #fff; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--pitch); color: var(--pitch-deep); }
.btn-sm { padding: 8px 13px; font-size: var(--fs-small); }
.btn-block { display: flex; width: 100%; justify-content: center; }

/* Spotify-CTA — markentreu (Spotify-Grün + offizielles Glyph), Pill-Form */
.btn-spotify {
  gap: 9px; padding: 11px 20px 11px 16px; border-radius: var(--r-pill);
  background: #1ED760; color: #0A1A10; font-weight: 700; letter-spacing: -.01em;
  box-shadow: 0 1px 2px rgba(28,27,25,.10), 0 6px 18px rgba(30,215,96,.22);
}
.btn-spotify:hover { background: #1FDF64; color: #0A1A10; transform: translateY(-1px); }
.btn-spotify:active { transform: translateY(0); }
.btn-spotify.btn-sm { padding: 8px 16px 8px 12px; }
.spotify-glyph { width: 1.25em; height: 1.25em; flex: none; }
.btn-spotify.btn-sm .spotify-glyph { width: 1.15em; height: 1.15em; }

/* „↳ Wie funktioniert das?"-Erklär-Chip */
.explain-link {
  display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-small);
  font-weight: 600; color: var(--pitch-deep); background: var(--pitch-tint);
  padding: 6px 12px; border-radius: var(--r-pill); text-decoration: none;
  border: 1px solid transparent;
}
.explain-link:hover { border-color: var(--pitch); }

/* --- Badges / Chips --- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-caption);
  font-weight: 700; padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--surface-alt); color: var(--ink-soft); white-space: nowrap;
}
.badge--mint { background: var(--mint); color: var(--pitch-deep); }
.badge--honesty { background: #FBF1D8; color: #8a6d12; }
.badge--honesty::before { content: "⚠"; }
.badge--corrected { background: var(--edding-tint); color: var(--edding); }
.badge--corrected::before { content: "✎"; }
.badge--live { background: var(--edding-tint); color: var(--edding); }
.badge--live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--edding); }
.badge--done { background: var(--mint); color: var(--pitch-deep); }
.badge--done::before { content: "✓"; font-weight: 800; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px;
  border-radius: var(--r-pill); border: 1.5px solid var(--line); background: var(--surface);
  font-size: var(--fs-small); font-weight: 600; color: var(--ink-soft); cursor: pointer;
  transition: border-color var(--dur-fast), color var(--dur-fast), background var(--dur-fast);
}
.chip:hover { border-color: var(--pitch); color: var(--ink); }
.chip[aria-pressed="true"], .chip.is-active { background: var(--pitch); border-color: var(--pitch); color: #fff; }

/* --- Flaggen-Chip (Sticker-Optik) --- */
.flag {
  --sz: 34px; width: var(--sz); height: var(--sz); border-radius: 50%; flex: none;
  background: var(--surface-alt); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line);
  object-fit: cover; display: grid; place-items: center; overflow: hidden;
  font-weight: 800; font-size: calc(var(--sz) * .3); color: var(--ink-soft); letter-spacing: .02em;
}
.flag img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   Top-Navigation
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h);
  display: flex; align-items: center; gap: var(--sp-4);
  padding-inline: var(--sp-4); background: rgba(250,246,238,.86);
  backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid var(--line);
}
.nav__brand { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: var(--ink); text-decoration: none; }
.nav__brand img { width: 26px; height: 26px; border-radius: 7px; }
.nav__brand img.nav__crest { border-radius: 0; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(28,27,25,.18)); }
.nav__brand b { color: var(--pitch-deep); }
.nav__links { display: none; gap: 2px; margin-left: var(--sp-4); }
.nav__spacer { flex: 1; }
.nav__link { padding: 8px 12px; border-radius: var(--r-btn); font-weight: 600; font-size: var(--fs-small); color: var(--ink-soft); text-decoration: none; }
.nav__link:hover { background: var(--surface-alt); color: var(--ink); }
.nav__link[aria-current="page"] { color: var(--pitch-deep); background: var(--pitch-tint); }
@media (min-width: 860px) { .nav__links { display: flex; } }

/* ============================================================
   Bottom-Tab-Bar (mobil) — Daumenzone
   ============================================================ */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: rgba(255,255,255,.92); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
}
@media (min-width: 860px) { .tabbar { display: none; } }
.tabbar__item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: .68rem; font-weight: 700; color: var(--ink-soft); text-decoration: none; padding-top: 6px;
}
.tabbar__item svg { width: 22px; height: 22px; }
.tabbar__item[aria-current="page"] { color: var(--pitch-deep); }
.tabbar__cta {
  align-self: stretch; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: #fff; text-decoration: none; font-size: .66rem; font-weight: 800;
}
.tabbar__cta .pill {
  display: grid; place-items: center; width: 52px; height: 52px; margin-top: -18px; border-radius: 50%;
  background: var(--pitch); color: #fff; box-shadow: var(--shadow-pop); border: 3px solid var(--bg);
  font-size: 1.3rem;
}

/* ============================================================
   Footer
   ============================================================ */
.footer { background: var(--surface-alt); border-top: 1px solid var(--line); margin-top: var(--sp-16); }
.footer__inner { display: grid; gap: var(--sp-6); padding-block: var(--sp-12); }
.footer__cols { display: grid; gap: var(--sp-8); grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer__cols { grid-template-columns: 1.5fr 1fr; } }
.footer h4 { font-family: var(--font-ui); font-size: var(--fs-caption); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: var(--sp-3); }
.footer a { display: block; color: var(--ink); text-decoration: none; padding: 4px 0; font-size: var(--fs-small); }
.footer a:hover { color: var(--pitch-deep); }
/* Buttons im Footer nicht als vollbreiter Block rendern (überschreibt .footer a).
   WICHTIG: padding-inline mit setzen — sonst nullt das spezifischere
   `.footer a { padding: 4px 0 }` das linke/rechte Padding des Buttons (Text klebt am Rand). */
.footer .btn { display: inline-flex; width: auto; margin-top: 14px; padding-block: 10px; padding-inline: 16px 20px; color: #0A1A10; }
.footer .btn:hover { color: #0A1A10; }
.footer__legal { display: flex; flex-wrap: wrap; gap: var(--sp-4); border-top: 1px solid var(--line); padding-top: var(--sp-4); font-size: var(--fs-caption); color: var(--ink-soft); }

/* --- Utilities --- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.text-center { text-align: center; }
.muted { color: var(--ink-soft); }
.skeleton { background: linear-gradient(90deg, var(--surface-alt) 25%, var(--line-soft) 37%, var(--surface-alt) 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r-chip); }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

:where(a, button, .chip, input, select):focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
