/* LUDAVI Spieleportal – Layout. Nutzt ausschließlich Variablen aus tokens.css. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-family: var(--font-heading); font-weight: 600; line-height: 1.15; margin: 0; }
p { margin: 0; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }
img, svg { display: block; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--space-4); }
@media (min-width: 720px) { .container { padding: 0 var(--space-8); } }

.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.logo__signet { height: 46px; width: auto; }
.logo__text { display: flex; flex-direction: column; gap: 6px; }
.logo__wordmark { height: 26px; width: auto; color: currentColor; }
.logo__sub { font-family: var(--font-heading); font-size: 12px; font-weight: 500; line-height: 1; }
.logo__sub b { font-weight: 700; color: var(--hero-accent); }

/* ---------- Hero (immer dunkel, wie HORAVI-Anmeldung) ---------- */
.hero {
  background: var(--hero-bg);
  color: var(--hero-text);
  padding: calc(var(--space-6) + env(safe-area-inset-top)) 0 var(--space-16);
  position: relative;
  overflow: hidden;
}
.hero__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.hero__nav { display: none; gap: var(--space-6); }
.hero__nav a { color: var(--hero-muted); text-decoration: none; font-weight: 600; font-size: 15px; }
.hero__nav a:hover { color: var(--hero-text); }
@media (min-width: 820px) { .hero__nav { display: flex; } }

.hero__grid {
  display: grid; gap: var(--space-10); align-items: center;
  margin-top: var(--space-12);
}
@media (min-width: 900px) { .hero__grid { grid-template-columns: 1.1fr 0.9fr; margin-top: var(--space-16); } }

.hero__eyebrow { color: var(--brand-teal-60); font-weight: 700; font-size: 14px; letter-spacing: .02em; margin-bottom: var(--space-3); }
.hero h1 { font-size: var(--fs-display); max-width: 15ch; }
.hero__lead { margin-top: var(--space-5); font-size: var(--fs-lead); color: var(--hero-muted); max-width: 52ch; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: var(--space-6); padding: 0; list-style: none; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: var(--radius-pill);
  background: var(--hero-chip); color: var(--hero-text); font-size: 15px; font-weight: 600;
}
.chip svg { width: 16px; height: 16px; color: var(--brand-teal-60); }
.hero__cta { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-8); }

/* Hero-Bild: schwebende Spielkacheln */
.hero__art { position: relative; min-height: 300px; }
.tile-float {
  position: absolute; border-radius: var(--radius-xl); background: var(--surface);
  box-shadow: 0 18px 40px rgba(0,0,0,.35); display: grid; place-items: center; overflow: hidden;
}
.tile-float img { width: 100%; height: 100%; object-fit: contain; } /* nichts abschneiden */
.tile--purple { background: var(--brand-purple-20); }
.tile--teal { background: var(--brand-teal-20); }
.tile--navy { background: var(--brand-navy-15); }
.tile-float--a { width: 46%; aspect-ratio: 1; left: 4%; top: 6%; transform: rotate(-6deg); }
.tile-float--b { width: 40%; aspect-ratio: 1; right: 6%; top: 0; transform: rotate(5deg); }
.tile-float--c { width: 42%; aspect-ratio: 1; left: 30%; bottom: -4%; transform: rotate(2deg); }
@media (max-width: 899px) { .hero__art { min-height: 0; aspect-ratio: 1.4; max-width: 520px; } }
.hero__ring { position: absolute; right: -120px; top: -120px; width: 420px; height: 420px; border-radius: 50%; border: 2px dashed rgba(127, 208, 219, .18); pointer-events: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 22px; border-radius: var(--radius);
  font-family: var(--font-body); font-weight: 700; font-size: 16px; text-decoration: none;
  border: 1.5px solid transparent; cursor: pointer; transition: background .15s, color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand-purple); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); color: #fff; }
.btn--ghost-dark { border-color: rgba(255,255,255,.35); color: #fff; }
.btn--ghost-dark:hover { border-color: #fff; color: #fff; }
.btn--outline { border-color: var(--accent); color: var(--accent); background: transparent; }
.btn--outline:hover { background: var(--accent-soft); }
.btn[aria-disabled="true"] { border-color: var(--border); color: var(--muted); pointer-events: none; }
@media (prefers-color-scheme: dark) { .btn--primary { background: var(--accent); color: var(--on-accent); } .btn--primary:hover { background: var(--accent-hover); color: var(--on-accent); } }

/* ---------- Sektionen ---------- */
.section { padding: var(--space-16) 0; }
.section__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-8); }
.section__head h2 { font-size: var(--fs-h2); }
.section__head p { color: var(--muted); max-width: 56ch; margin-top: var(--space-2); }

/* ---------- Spielekarten ---------- */
.games { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); padding: 0; margin: 0; list-style: none; }
.game {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; transition: transform .15s, box-shadow .15s;
}
.game:has(a.game__link):hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }
.game__art { aspect-ratio: 16 / 11; display: grid; place-items: center; position: relative; }
.game__art img { width: 62%; height: auto; }
.game__art--purple { background: var(--tone-purple); }
.game__art--teal { background: var(--tone-teal); }
.game__art--navy { background: var(--tone-navy); }
.game__badge {
  position: absolute; top: 12px; right: 12px; font-size: 12px; font-weight: 700;
  padding: 3px 10px; border-radius: var(--radius-pill); background: var(--surface); color: var(--muted);
}
.game__badge--new { background: var(--brand-purple); color: #fff; }
.game__body { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-5); flex: 1; }
.game__body h3 { font-size: var(--fs-h3); }
.game__body p { color: var(--muted); font-size: 15px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--space-2) 0 0; padding: 0; list-style: none; }
.tag { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent); }
.tag--age { background: var(--brand-teal-20); color: var(--brand-teal-text); }
@media (prefers-color-scheme: dark) { .tag--age { background: var(--tone-teal); color: var(--brand-teal-60); } }
.game__foot { padding: 0 var(--space-5) var(--space-5); }
.game__foot .btn { width: 100%; }
.game__link::after { content: ""; position: absolute; inset: 0; } /* ganze Karte klickbar */
.game { position: relative; }

/* ---------- Für Eltern ---------- */
.section--alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.promises { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); padding: 0; margin: 0; list-style: none; }
.promise { display: flex; flex-direction: column; gap: var(--space-2); }
.promise__icon {
  width: 48px; height: 48px; border-radius: var(--radius-lg); display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: var(--space-2);
}
.promise__icon svg { width: 24px; height: 24px; }
.promise h3 { font-size: 17px; }
.promise p { color: var(--muted); font-size: 15px; }

/* ---------- Installieren ---------- */
.install { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.install__card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-6); }
.install__card h3 { font-size: 17px; margin-bottom: var(--space-3); }
.install__card ol { margin: 0; padding-left: 1.2em; color: var(--muted); }
.install__card li + li { margin-top: 6px; }
.install__card strong { color: var(--text); }

/* ---------- KI-Band ---------- */
.story { background: var(--hero-bg); color: var(--hero-text); border-radius: var(--radius-xl); padding: var(--space-10) var(--space-6); display: grid; gap: var(--space-6); align-items: center; }
@media (min-width: 820px) { .story { grid-template-columns: auto 1fr auto; padding: var(--space-10) var(--space-12); } }
.story__signet { height: 64px; width: auto; }
.story h2 { font-size: 24px; }
.story p { color: var(--hero-muted); margin-top: var(--space-2); max-width: 60ch; }

/* ---------- Footer ---------- */
.footer { padding: var(--space-10) 0 calc(var(--space-10) + env(safe-area-inset-bottom)); color: var(--muted); font-size: var(--fs-small); }
.footer__row { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; justify-content: space-between; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--text); }
.footer__links { display: flex; gap: var(--space-2); }
.footer__links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--space-3); border-radius: var(--radius-sm); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Dunkelmodus: Illustrationen (Navy-Flaechen) aufhellen, damit sie sich vom dunklen Grund abheben */
@media (prefers-color-scheme: dark) {
  .game__art img { filter: brightness(1.35) saturate(1.05); }
}

/* ---------- Korrekturen (QA 25.10.) ---------- */
.section--flush { padding-top: 0; }
.notice { margin: 0 0 var(--space-5); padding: var(--space-3) var(--space-4); background: var(--accent-soft); border-radius: var(--radius); font-weight: 600; max-width: 56ch; }
.notice[hidden] { display: none; }
/* Mobil: Hero-Kacheln innerhalb des Rahmens halten (Rotation und Badge werden nicht abgeschnitten) */
@media (max-width: 899px) {
  .hero__art { margin: 0 auto; width: 100%; padding: 0 var(--space-3); }
  .tile-float--a { left: 6%; top: 8%; }
  .tile-float--b { right: 8%; top: 2%; }
  .tile-float--c { left: 30%; bottom: 0; }
}
/* Mobil: Spielekarten niedriger (Bildfläche 2:1) */
@media (max-width: 599px) {
  .game__art { aspect-ratio: 2 / 1; min-height: 0; overflow: hidden; }
  .game__art img { position: absolute; top: 8%; left: 50%; transform: translateX(-50%); width: auto; height: 84%; max-width: 90%; }
}

/* ---------- Feedback-Kachel ---------- */
.promise__btn { align-self: flex-start; margin-top: var(--space-2); }
