/* Gemeinsamer Stil für Startseite, Impressum und Datenschutz (automatisch hell/dunkel) */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("fonts/archivo-latin.woff2") format("woff2");
}
:root {
  color-scheme: light;
  --bg: #EFF1F7;
  --surface: #FFFFFF;
  --ink: #12141C;
  --muted: #5A6070;
  --line: #D6DAE4;
  --accent: #1F4FD8;
  --tile: #E9EDFB;
  --badge: #FFF1D6; --badge-ink: #7A4B00;
  --p1: #1F4FD8; --p2: #7C9BEE; --p3: #C9D5F7;
  --c0: #1F4FD8; --c1: #0E9F8E; --c2: #D67F00; --c3: #B23A7A; --c4: #6A4FD8;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0D1017; --surface: #151922; --ink: #E9EDF5; --muted: #97A0B2; --line: #262C38;
    --accent: #7BA0FF; --tile: #1B2440;
    --badge: #3A2C10; --badge-ink: #F2C46B;
    --p1: #7BA0FF; --p2: #3E5CAB; --p3: #232F57;
    --c0: #7BA0FF; --c1: #3FCDBA; --c2: #F2A93B; --c3: #E070A8; --c4: #A18BFF;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0D1017; --surface: #151922; --ink: #E9EDF5; --muted: #97A0B2; --line: #262C38;
  --accent: #7BA0FF; --tile: #1B2440;
  --badge: #3A2C10; --badge-ink: #F2C46B;
  --p1: #7BA0FF; --p2: #3E5CAB; --p3: #232F57;
  --c0: #7BA0FF; --c1: #3FCDBA; --c2: #F2A93B; --c3: #E070A8; --c4: #A18BFF;
}
* { box-sizing: border-box; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.wrap {
  max-width: 920px; margin: 0 auto;
  padding: calc(20px + env(safe-area-inset-top, 0px)) 16px calc(48px + env(safe-area-inset-bottom, 0px));
}

/* Kopfzeile */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.brand { font-weight: 800; font-stretch: 115%; font-size: 20px; letter-spacing: -0.01em; text-decoration: none; }
.tools { display: flex; gap: 8px; }
.pill {
  appearance: none; font: inherit; font-size: 14px; font-weight: 650; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 99px;
  padding: 6px 12px; cursor: pointer; min-height: 36px; display: inline-flex; align-items: center;
}
.pill:hover { border-color: var(--accent); }
.pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Symbolknöpfe in der Kopfzeile (wie in den Spielen) */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 13px; font-weight: 750; letter-spacing: .02em; cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Pfeil nach oben: erscheint erst nach etwas Scrollen */
.to-top {
  position: fixed; right: 16px; bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
  cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.to-top.visible { opacity: .85; visibility: visible; transform: none; }
.to-top.visible:hover, .to-top.visible:focus-visible { opacity: 1; border-color: var(--accent); color: var(--accent); }
.to-top svg { width: 18px; height: 18px; }
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; } }

/* Das Muster: die einzige grosse Gestaltung der Seite */
#banner { display: block; width: 100%; height: auto; border-radius: 12px; margin-bottom: 28px; }
#banner .a { fill: var(--p1); }
#banner .b { fill: var(--p2); }
#banner .c { fill: var(--p3); }

h1 {
  font-size: clamp(30px, 6.6vw, 48px);
  font-weight: 780; font-stretch: 112%;
  line-height: 1.06; letter-spacing: -0.015em;
  margin: 0 0 12px; text-wrap: balance;
}
h2 { font-size: 22px; font-weight: 750; font-stretch: 108%; margin: 0 0 4px; letter-spacing: -0.01em; }

/* Rechtstexte: schmale Lesespalte */
.legal { max-width: 68ch; }
.legal h1 { font-size: clamp(28px, 5.6vw, 40px); }
.legal h2 { font-size: 19px; margin-top: 32px; }
.legal p, .legal li { color: var(--ink); }
.legal .muted { color: var(--muted); }
.legal ul { padding-left: 1.2em; }
.legal li { margin: 4px 0; }
.legal address { font-style: normal; }

/* Nur die gewählte Sprache zeigen (Abschnitte mit lang="de" / lang="en") */
html[data-lang="de"] [data-only="en"], html[data-lang="en"] [data-only="de"] { display: none; }

/* Fusszeile */
footer { margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.links { display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* ---------- Werkzeuge (Strom, QR): Kopfzeile mit Zurück-Taste, Panels, Formulare ---------- */
.top .left { display: flex; align-items: center; gap: 10px; min-width: 0; }
a.icon-btn { text-decoration: none; }
.tool h1 { font-size: clamp(26px, 5.4vw, 38px); margin-bottom: 6px; }
.tool .sub { color: var(--muted); margin: 0 0 24px; max-width: 56ch; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.panel + .panel { margin-top: 14px; }
.panel h2 { font-size: 18px; margin: 0 0 14px; }
.tool label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.tool input[type=text], .tool input[type=password], .tool input[type=number], .tool select {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; width: 100%; min-width: 0;
}
.tool input:focus-visible, .tool select:focus-visible, .tool button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tool input:disabled { opacity: .5; }
.hint { font-size: 13px; color: var(--muted); margin-top: 5px; }
.btn {
  font: inherit; font-weight: 650; cursor: pointer; border-radius: 10px; padding: 10px 16px; min-height: 42px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--surface);
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { background: var(--line); border-color: var(--line); color: var(--muted); cursor: not-allowed; filter: none; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); font-weight: 550; }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); filter: none; }
.note { color: var(--muted); font-size: 13px; margin-top: 16px; }
