/* Gemeinsamer Stil für Startseite, Dashboard, Admin und Rechtstexte – angelehnt an das Overlay.
   Bewusst ohne externe Schriften (keine Anfragen an Dritte), daher System-Schriften. */
:root {
  --bg: #f4f1ea; --paper: #fff7e8; --surface: #fff; --surface-2: #faf8f3;
  --text: #1b1530; --muted: #6b6280; --line: #1b1530;
  --tag: #ffd23f; --tag-text: #1b1530; --hot: #ff5a5f; --mint: #2ec4b6;
  --code: #efe9db; --shadow: 6px 6px 0 var(--line);
  --check-a: #ddd; --check-b: #f4f4f4;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14111d; --paper: #1f1a2d; --surface: #1f1a2d; --surface-2: #191526;
    --text: #f1ecff; --muted: #a69cc0; --line: #4b4166; --code: #2c2540;
    --shadow: 6px 6px 0 #0b0912; --check-a: #26203a; --check-b: #1d1830;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14111d; --paper: #1f1a2d; --surface: #1f1a2d; --surface-2: #191526;
  --text: #f1ecff; --muted: #a69cc0; --line: #4b4166; --code: #2c2540;
  --shadow: 6px 6px 0 #0b0912; --check-a: #26203a; --check-b: #1d1830;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--tag); outline-offset: 2px; }
main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
h1, h2, h3 { line-height: 1.15; margin: 0; }
h1 { font-size: clamp(32px, 6vw, 56px); font-weight: 900; letter-spacing: -.03em; }
h2 { font-size: 22px; font-weight: 800; margin-bottom: 12px; }
h3 { font-size: 17px; font-weight: 800; }
p { margin: 0 0 10px; }
small, .muted { color: var(--muted); }
code { background: var(--code); padding: 2px 6px; border-radius: 5px; font-size: .92em; word-break: break-all; }

/* Kopfzeile */
.topbar { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 3px solid var(--line); }
.topbar .inner { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand { font-weight: 900; font-size: 22px; letter-spacing: -.02em; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand span { background: var(--tag); color: var(--tag-text); border: 3px solid var(--line); border-radius: 10px; padding: 0 8px; transform: rotate(-2deg); display: inline-block; }
.topbar .spacer { flex: 1; }
.topbar .who { font-weight: 700; }

/* Karten & Knöpfe */
.card { background: var(--surface); border: 3px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); }
.card.paper { background: var(--paper); }
.btn { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 800; text-decoration: none; border: 3px solid var(--line); border-radius: 12px; padding: 10px 18px; background: var(--tag); color: var(--tag-text); cursor: pointer; }
.btn.sec { background: var(--surface); color: var(--text); }
.btn.danger { background: var(--hot); color: #fff; }
.btn.small { padding: 6px 12px; font-size: 14px; }
.btn.big { font-size: 20px; padding: 14px 26px; box-shadow: 4px 4px 0 var(--line); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.twitch { background: #9146ff; color: #fff; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.badge { display: inline-block; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 2px 10px; border-radius: 99px; background: var(--text); color: var(--surface); }
.badge.ok { background: var(--mint); color: #1b1530; }
.badge.warn { background: var(--tag); color: #1b1530; }
.badge.off { background: var(--hot); color: #fff; }
.notice { border: 3px dashed var(--line); border-radius: 12px; padding: 12px 16px; background: var(--surface-2); }
.notice.err { border-color: var(--hot); }
.notice.ok { border-color: var(--mint); }
[hidden] { display: none !important; }
/* Beim Scrollen zu einem Abschnitt nicht unter der festen Kopfzeile verschwinden */
section, .confirm, details, .notice { scroll-margin-top: 90px; }

/* Formulare */
label { font-weight: 700; }
input[type=text], input[type=number], select { font: inherit; font-weight: 600; padding: 8px 10px; border: 3px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); min-width: 0; }
.field { display: grid; gap: 4px; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
details { border: 3px solid var(--line); border-radius: 12px; padding: 0 16px; background: var(--surface-2); }
details + details { margin-top: 10px; }
details summary { cursor: pointer; font-weight: 800; padding: 12px 0; }
details[open] { padding-bottom: 16px; }

/* Startseite */
.hero { display: grid; gap: 14px; }
.hero .lead { font-size: 20px; font-weight: 600; max-width: 720px; }
.hero h1 span { background: var(--tag); color: var(--tag-text); padding: 0 12px; border: 4px solid var(--line); border-radius: 14px; display: inline-block; transform: rotate(-2deg); }
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.game { display: grid; gap: 4px; align-content: start; }
.game .em { font-size: 34px; line-height: 1; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; counter-reset: s; }
.step { counter-increment: s; position: relative; padding-top: 34px; }
.step::before { content: counter(s); position: absolute; top: -14px; left: 16px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--tag); color: var(--tag-text); border: 3px solid var(--line); font-weight: 900; font-size: 22px; }
footer { max-width: 1100px; margin: 0 auto; padding: 0 16px 32px; display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-weight: 600; }
/* Sprachauswahl in der Kopfzeile */
.langmenu, .langmenu[open] { position: relative; border: 0; padding: 0; background: none; border-radius: 0; }
.langmenu > summary { list-style: none; user-select: none; padding: 6px 12px; }
.langmenu > summary::-webkit-details-marker { display: none; }
.langmenu > summary::after { content: '▾'; font-size: 12px; margin-left: 2px; }
.flag { width: 21px; height: 14px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.25); object-fit: cover; flex: none; }
.langmenu ul { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; margin: 0; padding: 6px; list-style: none; min-width: 170px; background: var(--surface); border: 3px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.langmenu li a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 700; }
.langmenu li a:hover, .langmenu li a:focus-visible { background: var(--surface-2); }
.langmenu li a[aria-current] { background: var(--tag); color: var(--tag-text); }
@media (max-width: 560px) { .langmenu .lname { display: none; } }
.translation-note { border-left: 4px solid var(--hot); padding: 6px 12px; margin: 0 0 14px; color: var(--muted); }

/* Rechtstexte */
.legal h2 { margin-top: 18px; }
.placeholder { background: repeating-linear-gradient(135deg, #fff3b0 0 12px, #ffe680 12px 24px); color: #1b1530; border: 3px solid #1b1530; border-radius: 10px; padding: 10px 14px; font-weight: 700; }
span.placeholder { display: inline; padding: 0 6px; border-width: 2px; border-radius: 6px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* Tabellen (Admin) */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 2px solid var(--line); vertical-align: middle; }
th { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

/* Startseite: Beta-Hinweis und häufige Fragen */
.hero .beta { justify-self: start; font-size: 14px; padding: 4px 14px; border: 3px solid var(--line); }
.faq details p { margin: 0; max-width: 760px; }
.demo { min-width: 0; }
.demo video { display: block; width: 100%; max-width: 100%; height: auto; aspect-ratio: 16 / 9; border: 3px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); background: #1b1530; }

/* Spiel-Vorschau am Mauszeiger (public/js/game-preview.js) */
.gamepeek { position: fixed; left: 0; top: 0; z-index: 50; width: min(460px, 42vw); pointer-events: none; opacity: 0; transition: opacity .12s ease; will-change: transform; }
.gamepeek img { display: block; width: 100%; height: auto; filter: drop-shadow(0 10px 18px rgba(20, 12, 40, .28)); }
.gamepeek.on.ready { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .gamepeek { transition: none; } }
