/* Good2Go – Familie main-skill.ch / all-answer: gleiche Tokens, Schriften, Pixel-Welt.
   Statisch, keine externen Requests. */
:root {
  --ink: #14181a; --ink-dim: #4e5658; --ink-faint: #6b7476;
  --ground: #f7f6f2; --raise: #ffffff; --line: rgba(16,24,24,.12);
  --brand: #14584a; --brand-soft: #e4efeb; --brand-ink: #ffffff;
  --glass: rgba(255,255,255,.62); --glass-lift: rgba(255,255,255,.85);
  --halo: rgba(20,88,74,.13);
  --mesh-1: rgba(20,88,74,.16); --mesh-2: rgba(110,231,183,.16);
  --shade: 0 10px 30px rgba(16,24,24,.08);
  --ok: #1d7a4c; --mid: #a35f00; --no: #b42318;
  --go: #6ee7b7;
  --f-display: "Bricolage Grotesque", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --f-body: "Public Sans", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --gut: clamp(1rem, 4vw, 2.5rem);
  /* Pixel-Tuer, bleibt in beiden Themes gleich (Szene ist immer Nacht/Tag-Bild) */
  --door: #14584a; --door-dark: #0d3b31; --door-light: #1f7a66; --knob: #fde047;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f2f5f4; --ink-dim: #a3adac; --ink-faint: #8a9391;
    --ground: #070909; --raise: #111516; --line: rgba(255,255,255,.11);
    --brand: #6ee7b7; --brand-soft: #15241f; --brand-ink: #04120d;
    --glass: rgba(255,255,255,.05); --glass-lift: rgba(255,255,255,.11);
    --halo: rgba(110,231,183,.16);
    --mesh-1: rgba(31,95,79,.55); --mesh-2: rgba(110,231,183,.16);
    --shade: 0 18px 44px rgba(0,0,0,.38);
    --ok: #6ee7b7; --mid: #f0b44c; --no: #ff8a7a;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; overflow-x: clip; }
body {
  margin: 0; color: var(--ink);
  font: 400 clamp(1rem, .96rem + .2vw, 1.0625rem)/1.65 var(--f-body);
  -webkit-font-smoothing: antialiased; overflow-x: clip;
  background:
    radial-gradient(60rem 36rem at 8% -8%, var(--mesh-1), transparent 60%),
    radial-gradient(50rem 32rem at 100% 0%, var(--mesh-2), transparent 60%),
    var(--ground);
}
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0; letter-spacing: -.03em; line-height: 1.06; }
h1 { font-size: clamp(2.8rem, 9vw, 5.6rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 4.2vw, 2.6rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0; }
a { color: inherit; }
img, svg { max-width: 100%; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.offen { background: #ffe58a; color: #3a2d00; padding: 0 .25em; border-radius: 3px; font-size: .9em; }
.wrap { max-width: 74rem; margin-inline: auto; padding-inline: var(--gut); }

.ico { width: 22px; height: 22px; flex: none; }
.ico--lg { width: 30px; height: 30px; }
.ico--big { width: 52px; height: 52px; stroke-width: 2.6; }
.ico--door { width: 26px; height: 26px; stroke-width: 2; }

.eyebrow { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 .8rem; }

/* Kopf: schwebende Leiste wie main-skill.ch */
.top { position: sticky; top: calc(.75rem + env(safe-area-inset-top, 0px)); z-index: 50; padding-inline: var(--gut); margin-top: .75rem; }
.top__bar {
  max-width: 68rem; margin-inline: auto;
  display: flex; align-items: center; gap: .6rem;
  padding: .45rem .5rem .45rem 1rem; border-radius: 1.6rem;
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(24px) saturate(1.7); -webkit-backdrop-filter: blur(24px) saturate(1.7);
  box-shadow: var(--shade);
}
.brand { display: flex; align-items: center; gap: .55rem; font-family: var(--f-display); font-weight: 700; font-size: 1.1rem; text-decoration: none; margin-right: auto; letter-spacing: -.02em; }
.brand__dot { width: 12px; height: 12px; background: var(--go); box-shadow: 0 0 0 3px var(--halo); }
.langs { display: flex; list-style: none; margin: 0; padding: 0; }
.langs a { display: block; padding: .35rem .45rem; font-family: var(--f-mono); font-size: .75rem; text-decoration: none; color: var(--ink-faint); border-radius: 6px; }
.langs a[aria-current] { color: var(--ink); background: var(--brand-soft); font-weight: 500; }

/* Knoepfe */
.btn {
  display: inline-flex; align-items: center; gap: .6rem; padding: .85rem 1.3rem;
  font: 600 1rem var(--f-body); text-decoration: none; cursor: pointer;
  background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 999px;
  box-shadow: 0 8px 28px var(--halo);
}
.btn--small { padding: .55rem 1rem; font-size: .9rem; }
.btn--ghost { background: var(--raise); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn:hover { transform: translateY(-1px); }

/* Quiz */
.quiz { padding-block: clamp(2.5rem, 6vw, 4.5rem) 1rem; }
.chip-kicker { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--f-mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-dim); padding: .4rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: var(--glass); margin-bottom: 1.2rem; }
.chip-kicker .dot { width: 8px; height: 8px; background: var(--go); }
.quiz h1 { margin-bottom: .6rem; }
.lead { font-size: clamp(1.05rem, 1rem + .5vw, 1.3rem); color: var(--ink-dim); max-width: 40ch; }
html:not(.js) .scene { display: none; }
.noscript { margin-top: 1.5rem; font-weight: 600; }
.disclaimer { margin-top: .9rem; font-family: var(--f-mono); font-size: .72rem; letter-spacing: .08em; color: var(--ink-faint); }

.scene {
  position: relative; isolation: isolate; overflow: hidden;
  margin-top: 1.6rem; min-height: clamp(470px, 62vw, 560px);
  padding: clamp(1rem, 3vw, 1.8rem); color: #fff;
  border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--brand);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; text-align: center;
}
.scene__sky { position: absolute; inset: 0; z-index: -2; background: center bottom / cover no-repeat; image-rendering: pixelated; }
.scene__sky--night { background-image: url(/assets/img/stadt-nacht.png); }
.scene__sky--day { background-image: url(/assets/img/stadt-tag.png); opacity: 0; transition: opacity 1.2s ease; }
.scene::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(rgba(6,10,24,.55), rgba(6,10,24,.05) 55%, rgba(6,10,24,.35)); transition: background .4s; }
.scene.won .scene__sky--day { opacity: 1; }
.scene.won::after { background: linear-gradient(rgba(255,255,255,.1), rgba(255,255,255,0)); }
.scene.bonus .scene__sky--day { opacity: .45; }
.scene.note::after { background: linear-gradient(rgba(60,34,4,.6), rgba(30,18,4,.45)); }

.score { position: absolute; top: .9rem; right: .9rem; display: flex; gap: 5px; list-style: none; margin: 0; padding: 0; }
.score__pip { width: 14px; height: 14px; background: rgba(255,255,255,.28); box-shadow: inset 0 0 0 2px rgba(0,0,0,.25); }
.score__pip.on { background: var(--go); }

.round { width: 100%; }
.round:not([hidden]) { animation: pop .35s steps(4) both; }
@keyframes pop { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.round__count { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.75); margin-bottom: .4rem; }
.round__q { font-size: clamp(1.4rem, 4vw, 2.1rem); color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.4); margin-bottom: clamp(1rem, 3vw, 1.8rem); }

/* Pixel-Tueren */
.doors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.1rem, 3vw, 2.2rem); max-width: 40rem; margin-inline: auto; }
.door { display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: 0; background: none; border: 0; color: #fff; font: inherit; cursor: pointer; }
.door.open { cursor: default; }
.door__frame {
  position: relative; display: block; width: 100%; max-width: 150px; aspect-ratio: 3 / 5;
  background: #0b0d10; perspective: 700px;
  box-shadow: 0 0 0 4px #2a2f33, 0 0 0 8px #15181b, 0 8px 0 8px rgba(0,0,0,.35);
}
.door__back { position: absolute; inset: 0; display: grid; place-items: center; }
.door__back--yes { background: var(--go); color: #04120d; }
.door__back--no { background: #f0b44c; color: #2a1a00; }
.door__leaf {
  position: absolute; inset: 0; display: grid; place-items: start center; padding-top: 22%;
  background: var(--door); transform-origin: left center; transition: transform .6s steps(6);
  box-shadow: inset 0 0 0 4px var(--door-dark), inset 6px 6px 0 4px var(--door-light), inset -6px -6px 0 4px var(--door-dark);
}
.door__sign { display: grid; place-items: center; width: 52%; aspect-ratio: 1; background: var(--door-dark); color: #fff; box-shadow: inset 0 0 0 3px var(--door-light); }
.door__knob { position: absolute; right: 14%; top: 56%; width: 9px; height: 9px; background: var(--knob); box-shadow: 2px 2px 0 rgba(0,0,0,.35); }
.door:hover:not(.open) .door__frame { transform: translateY(-4px); }
.door.open .door__leaf { transform: rotateY(-105deg); }
.door__label { font-weight: 600; font-size: clamp(.78rem, 2.2vw, .98rem); line-height: 1.3; padding: .3rem .55rem; background: rgba(6,10,24,.72); max-width: 13em; }
.door:focus-visible { outline: none; }
.door:focus-visible .door__frame { outline: 3px solid var(--knob); outline-offset: 10px; }

/* Bonusrunde */
.points { position: absolute; top: .75rem; left: .9rem; margin: 0; padding: .3rem .6rem; font-family: var(--f-mono); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; background: rgba(6,10,24,.72); color: #fff; }
.points span { color: var(--go); font-weight: 500; }
.opts { display: grid; gap: .8rem; max-width: 34rem; margin: 0 auto clamp(1rem, 4vw, 2.5rem); }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .95rem 1.1rem; font: 600 1.05rem var(--f-body); text-align: left; cursor: pointer; background: var(--raise); color: var(--ink); border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--brand); }
.opt:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--brand); }
.opt__pts { font-family: var(--f-mono); font-size: .85rem; color: var(--brand); opacity: 0; }
.opt.picked { background: var(--brand); color: var(--brand-ink); }
.opt.picked .opt__pts { opacity: 1; color: var(--brand-ink); }
@media (prefers-reduced-motion: no-preference) { .opt.picked .opt__pts { animation: plus .5s steps(4) both; } @keyframes plus { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } } }

/* Ergebnis */
.result { width: min(100%, 34rem); margin: auto; padding: clamp(1.4rem, 4vw, 2.2rem); background: var(--raise); color: var(--ink); border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--brand); animation: pop .35s steps(4) both; }
.result:focus { outline: none; }
.result h2 { margin-bottom: .5rem; }
.result p { color: var(--ink-dim); font-size: 1.1rem; margin-bottom: 1.2rem; }
.result__badge { display: inline-grid; place-items: center; width: 76px; height: 76px; margin-bottom: 1rem; background: #f0b44c; color: #2a1a00; box-shadow: 4px 4px 0 var(--ink); }
.result--note { box-shadow: 6px 6px 0 #f0b44c; }
.result__score { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .6rem 1rem; font-family: var(--f-mono); font-size: .95rem; color: var(--ink); }
.bar--score i.on { background: var(--brand); }
.result--yes h2 { font-size: clamp(2.6rem, 8vw, 4rem); color: var(--brand); }
.result__cta { display: flex; flex-wrap: wrap; justify-content: center; gap: .7rem; }

/* Pixel-Figur (Streifen mit 7 Bildern) */
.sprite { position: relative; display: block; aspect-ratio: 64 / 73; overflow: hidden; }
.sprite img { position: absolute; left: 0; top: 0; height: 100%; width: auto; max-width: none; image-rendering: pixelated; }
.sprite--host { width: 96px; margin: 0 auto .6rem; }

/* Spielerkarte wie main-skill.ch */
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.card-player { display: grid; grid-template-columns: minmax(0, 15rem) 1fr; gap: clamp(1rem, 4vw, 2.5rem); align-items: center; border: 3px solid var(--ink); background: var(--raise); box-shadow: 6px 6px 0 var(--brand); padding: clamp(1rem, 3vw, 1.8rem); }
.card-player__fig { background: var(--brand-soft); padding: 1rem; }
.card-player__fig .sprite { width: min(100%, 14rem); margin-inline: auto; }
.card-player__cls { margin: .3rem 0 1.2rem; font-family: var(--f-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.stats { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.stats li { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; font-size: .95rem; }
.stats .lv0, .stats .lv1 { color: var(--ink-faint); }
.bar { display: flex; gap: 3px; }
.bar i { display: block; width: clamp(10px, 1.6vw, 16px); aspect-ratio: 1; background: var(--line); }
.bar i.on { background: var(--brand); }
.lv3 .bar i.on { background: var(--mid); }
.lv2 .bar i.on, .lv1 .bar i.on { background: var(--no); }
@media (max-width: 640px) { .card-player { grid-template-columns: 1fr; } .card-player__fig .sprite { width: 9rem; } }

/* Ablauf als Level */
.levels { list-style: none; margin: 1.6rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (min-width: 860px) { .levels { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.level { display: flex; flex-direction: column; gap: .5rem; padding: 1.1rem; background: var(--raise); border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--line); }
.level__no { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
.level__icon { display: grid; place-items: center; width: 52px; height: 52px; background: var(--brand-soft); color: var(--brand); }
.level:last-child .level__icon { background: var(--brand); color: var(--brand-ink); }
.level p { color: var(--ink-dim); font-size: .92rem; }

/* Kontakt wie main-skill.ch */
.contact { border-radius: 1.8rem; padding: clamp(2rem, 5vw, 3.2rem); text-align: center; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6); box-shadow: var(--shade); }
.contact p { color: var(--ink-dim); margin: .6rem auto 0; max-width: 44ch; }
.contact .contact__where { color: var(--ink); font-weight: 500; margin-top: 1rem; }
.contact__go { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; margin-top: 1.8rem; }
.pill { display: inline-block; font-family: var(--f-mono); font-size: clamp(.95rem, .9rem + .5vw, 1.15rem); padding: .9rem 1.6rem; border-radius: 999px; text-decoration: none; font-weight: 500; background: var(--brand); color: var(--brand-ink); box-shadow: 0 10px 32px var(--halo); overflow-wrap: anywhere; }

/* Fuss */
.foot { padding-block: 2rem 2.5rem; color: var(--ink-faint); font-size: .88rem; }
.foot__in { display: grid; gap: .3rem; }
.foot__small { font-size: .8rem; }

@media (prefers-reduced-motion: no-preference) {
  .sprite img { animation: strip .9s steps(7) infinite; }
  @keyframes strip { to { transform: translateX(-100%); } }
  .result--yes .sprite--host { animation: hopp .6s steps(3) .2s 2; }
  @keyframes hopp { 50% { transform: translateY(-14px); } }
  @supports (animation-timeline: view()) {
    .reveal { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 50%; }
    @keyframes reveal { from { opacity: .2; transform: translateY(20px); } to { opacity: 1; transform: none; } }
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .door__leaf, .scene__sky--day { transition: none; }
  .round:not([hidden]), .result { animation: none; }
}

/* Ende je nach Punkten */
.result--yes[data-tier="low"] { box-shadow: 6px 6px 0 #f0b44c; }
.result--yes[data-tier="low"] h2, .result--yes[data-tier="mid"] h2 { font-size: clamp(1.7rem, 5vw, 2.4rem); color: var(--ink); }
.result--yes[data-tier="low"] .sprite--host { display: none; }
.result--yes[data-tier="max"] .result__score { color: var(--brand); font-weight: 500; }

/* Rechtstexte */
.legal { max-width: 46rem; padding-block: clamp(2.5rem, 6vw, 4rem); }
.legal h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); margin-bottom: 1rem; }
.legal h2 { font-size: 1.35rem; margin: 2rem 0 .6rem; }
.legal p, .legal li { color: var(--ink-dim); margin-bottom: .8rem; }
.legal table { width: 100%; border-collapse: collapse; margin: .6rem 0 1rem; }
.legal td, .legal th { text-align: left; vertical-align: top; padding: .45rem .6rem .45rem 0; border-bottom: 1px solid var(--line); }
.legal td:first-child { font-weight: 600; color: var(--ink); width: 9rem; }
.legal thead { display: none; }

/* Allan-Brignoli-Seite (wie main-skill.ch / all-answer.com) */
.profil .eyebrow { color: var(--ink-faint); margin-bottom: .4rem; }
.linkliste { list-style: none; padding: 0; }
.linkliste a { display: block; padding: .7rem 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.linkliste strong { display: block; color: var(--ink); }
.linkliste span { color: var(--ink-dim); }
