/* RitschyRigz Hauptseite — Tech-Chaos bei Nacht im Comic-Look.
   Markenfarben wie die Songseite (Gold/Rosé auf Nachtschwarz), dazu Tinte, Papier und Raster. */
@font-face {
  font-family: "Bangers";
  src: url("fonts/Bangers-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --night: #171126;
  --night-2: #221a38;
  --ink: #0d0a08;
  --paper: #fff4dc;
  --paper-2: #f7e6c2;
  --text: #f4ede1;
  --text-ink: #241a10;
  --muted-ink: #5e4c36;
  --gold: #e7b54a;
  --gold-2: #f6d37f;
  --rose: #e8a3b0;
  --rose-2: #f6c7cf;
  --neon: #ffd479;
  --stroke: 3px;
  --shadow: 6px 6px 0 var(--ink);
  --radius: 16px;
  --comic: "Bangers", "Impact", "Arial Black", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--night);
  color: var(--text);
  font: 17px/1.5 var(--body);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

/* Tapete: Nachtblau mit Sternen-Raster und warmem Lampenlicht */
.wall {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 212, 121, .16), transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(232, 163, 176, .14), transparent 45%),
    radial-gradient(rgba(255, 255, 255, .07) 1.2px, transparent 1.6px) 0 0 / 22px 22px,
    linear-gradient(180deg, var(--night-2), var(--night));
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

/* ---------- Comic-Grundbausteine ---------- */
.panel {
  position: relative;
  border: var(--stroke) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.caption {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 12px 2px;
  font: 20px/1.1 var(--comic);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--neon);
  border: var(--stroke) solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-2deg);
}

.bubble {
  position: relative;
  margin: 0;
  padding: 10px 14px;
  font: 19px/1.15 var(--comic);
  letter-spacing: .03em;
  color: var(--text-ink);
  background: #fff;
  border: var(--stroke) solid var(--ink);
  border-radius: 22px;
  box-shadow: 3px 3px 0 var(--ink);
}
.bubble::after {
  content: "";
  position: absolute;
  left: 28px; bottom: -16px;
  width: 22px; height: 18px;
  background: #fff;
  border-right: var(--stroke) solid var(--ink);
  border-bottom: var(--stroke) solid var(--ink);
  clip-path: polygon(0 0, 100% 0, 100% 100%);
  transform: skewX(-20deg);
}

.btn {
  display: inline-block;
  padding: 12px 22px 9px;
  font: 22px/1 var(--comic);
  letter-spacing: .05em;
  text-decoration: none;
  color: var(--ink);
  border: var(--stroke) solid var(--ink);
  border-radius: 999px;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn-primary { background: linear-gradient(180deg, var(--gold-2), var(--gold)); }
.btn-secondary { background: linear-gradient(180deg, var(--rose-2), var(--rose)); }
.btn:hover, .btn:focus-visible { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
:focus-visible { outline: 3px solid var(--neon); outline-offset: 3px; }

/* ---------- Hero: das Zimmer als Szenenbild ----------
   Das Bild traegt die Buehne; Sprechblasen sitzen in Prozent des Bildes (siehe export.render_hero). */
.hero {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 0;
  overflow: hidden;
  background: var(--ink);
}
.title a { color: inherit; text-decoration: none; }
.scroll-cue { display: none; }
.scene {
  position: relative;
  aspect-ratio: var(--ar);
  overflow: hidden;
}
.scene-inner {
  position: absolute; inset: 0;
  container-type: inline-size;
}
.scene-img { width: 100%; height: 100%; object-fit: cover; }
/* Abdunklung unten, wo der Titel sitzt (kein Raster ueber dem Bild — Richard 29.09.) */
.scene-inner::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent 70%, rgba(13, 10, 8, .85) 100%);
}
.scene-bubble {
  position: absolute;
  z-index: 1;
  font-size: clamp(13px, 1.55cqw, 22px);
  padding: .55em .8em;
  animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both;
}
.scene-bubble.bubble-lisa { animation-delay: .9s; }
.scene-bubble[data-who] { cursor: pointer; user-select: none; }
.bubble-lisa, .bubble-lisa::after { background: var(--rose-2); }
.bubble.tail-right::after { left: auto; right: 22%; transform: scaleX(-1) skewX(-20deg); }

/* Titelband unter dem Bild: das Zimmer bleibt frei, der Neon-Schriftzug ist Teil der Buehne */
.hero-copy {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "logo text actions";
  align-items: center;
  gap: 8px 28px;
  margin-top: -56px;
  padding: 0 28px 24px;
}
.hero-copy .hero-logo { grid-area: logo; }
.hero-text { grid-area: text; }
.hero-copy .actions { grid-area: actions; flex-direction: column; align-items: stretch; }
.hero-logo {
  width: clamp(88px, 11vw, 140px); height: auto;
  border-radius: 50%;
  border: var(--stroke) solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink), 0 0 40px rgba(255, 212, 121, .35);
  animation: bob 5s ease-in-out infinite;
}
.title {
  margin: 4px 0 10px;
  font: clamp(52px, 7vw, 92px)/.9 var(--comic);
  letter-spacing: .03em;
  color: var(--gold-2);
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  text-shadow: 5px 5px 0 var(--ink), 0 0 30px rgba(255, 212, 121, .45);
  transform: rotate(-2deg);
}
.lead {
  max-width: 46ch;
  margin: 0;
  font-size: clamp(16px, 1.5vw, 19px);
  color: var(--text);
  text-shadow: 0 2px 6px rgba(0, 0, 0, .9);
}
.actions { display: flex; flex-wrap: wrap; gap: 14px; }

@keyframes pop {
  from { opacity: 0; transform: scale(.4) rotate(-6deg); }
  to { opacity: 1; transform: none; }
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ---------- Abschnitte ---------- */
.section { margin-top: 64px; scroll-margin-top: 24px; }
.section:first-child { margin-top: 40px; }
.section-title {
  margin: 0 0 22px;
  font: clamp(36px, 6vw, 56px)/1 var(--comic);
  letter-spacing: .03em;
  color: var(--text);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 4px 4px 0 var(--ink);
}
.section-lead { margin: -8px 0 22px; max-width: 60ch; color: var(--text); font-size: 18px; }
.soon .section-lead { color: var(--text-ink); }
.grid { display: grid; gap: 26px; }
.grid-team { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid-portals { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-soon { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* Team-Karten: Papier-Panels mit Raster */
.member {
  padding: 18px 20px 22px;
  color: var(--text-ink);
  background:
    radial-gradient(rgba(36, 26, 16, .09) 1.2px, transparent 1.6px) 0 0 / 9px 9px,
    var(--paper);
}
.member:nth-child(odd) { transform: rotate(-1deg); }
.member:nth-child(even) { transform: rotate(1deg); }
.member-pic {
  aspect-ratio: 1;
  margin-bottom: 18px;
  overflow: hidden;
  border: var(--stroke) solid var(--ink);
  border-radius: 12px;
}
.member-pic img { width: 100%; height: 100%; object-fit: cover; }
.accent-gold .member-pic { background: radial-gradient(circle at 50% 40%, var(--gold-2), var(--gold) 70%); }
.accent-rose .member-pic { background: radial-gradient(circle at 50% 40%, var(--rose-2), var(--rose) 70%); }
.accent-ink .member-pic { background: radial-gradient(circle at 50% 40%, #5a4a2c, #1c1812 70%); }
.member .bubble { margin: -52px 0 18px 36%; font-size: 17px; }
.member .bubble.is-long { font-size: 15px; }
.member .bubble.is-new { animation: pop .45s cubic-bezier(.2, 1.6, .4, 1) both; }
.member .bubble cite {
  display: block;
  margin-top: 4px;
  font: 12px/1.2 var(--body, sans-serif);
  font-style: normal;
  letter-spacing: 0;
  opacity: .65;
}
.member h3 {
  margin: 0;
  font: 40px/1 var(--comic);
  letter-spacing: .04em;
  color: var(--ink);
}
.member .role {
  margin: 2px 0 10px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted-ink);
}
.member p { margin: 0; }

/* Portal-Karten: Sticker zum Anklicken */
.portal {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 14px;
  align-items: center;
  padding: 16px 18px;
  text-decoration: none;
  color: var(--text-ink);
  background: var(--paper);
  transition: transform .12s ease, box-shadow .12s ease;
}
.portal.accent-gold { background: linear-gradient(135deg, var(--paper) 55%, var(--gold-2)); }
.portal.accent-rose { background: linear-gradient(135deg, var(--paper) 55%, var(--rose-2)); }
.portal:hover, .portal:focus-visible { transform: translate(-3px, -3px) rotate(-1deg); box-shadow: 9px 9px 0 var(--ink); }
.portal-icon {
  grid-row: 1 / 3;
  display: grid; place-items: center;
  width: 56px; height: 56px;
  font-size: 28px;
  background: #fff;
  border: var(--stroke) solid var(--ink);
  border-radius: 50%;
}
.portal-title { font: 28px/1 var(--comic); letter-spacing: .04em; color: var(--ink); }
.portal-text { grid-column: 2; font-size: 15px; color: var(--muted-ink); }
.portal-go { grid-row: 1 / 3; grid-column: 3; font: 30px/1 var(--comic); color: var(--ink); }

/* Wochenplan: Hochformat-Bild + Text */
.weekly {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: 22px;
  color: var(--text-ink);
  background:
    radial-gradient(rgba(36, 26, 16, .08) 1.2px, transparent 1.6px) 0 0 / 9px 9px,
    var(--paper);
}
.weekly-pic img {
  width: 100%; height: auto;
  border: var(--stroke) solid var(--ink);
  border-radius: 12px;
  box-shadow: 5px 5px 0 var(--ink);
  transform: rotate(-1.5deg);
  transition: transform .15s ease;
}
.weekly-pic:hover img { transform: rotate(0) scale(1.02); }
.weekly-text p { font-size: 18px; max-width: 42ch; }
@media (max-width: 700px) {
  .weekly { grid-template-columns: 1fr; }
  .weekly-pic { max-width: 320px; margin: 0 auto; }
}

/* Baustelle */
.soon {
  padding: 44px 24px 28px;
  color: var(--text-ink);
  background:
    radial-gradient(rgba(36, 26, 16, .1) 1.2px, transparent 1.6px) 0 0 / 9px 9px,
    var(--paper-2);
  overflow: hidden;
}
.soon .section-title { color: var(--gold-2); }
.tape {
  position: absolute; left: -20px; right: -20px; top: 10px;
  height: 20px;
  background: repeating-linear-gradient(-45deg, var(--neon) 0 18px, var(--ink) 18px 36px);
  border-block: 2px solid var(--ink);
  transform: rotate(-1deg);
}
.soon-card {
  padding: 16px;
  border: var(--stroke) dashed var(--ink);
  border-radius: 12px;
  background: rgba(255, 255, 255, .55);
}
.soon-card .portal-icon { width: 48px; height: 48px; font-size: 24px; margin-bottom: 10px; }
.soon-card h3 { margin: 0 0 4px; font: 26px/1 var(--comic); letter-spacing: .04em; color: var(--ink); }
.soon-card p { margin: 0; font-size: 15px; color: var(--muted-ink); }

/* Unterseiten (Impressum): Kopf, Textkaesten, Pflichtangaben */
.page-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 0;
  padding: 20px 24px;
  background:
    radial-gradient(rgba(255, 255, 255, .06) 1.2px, transparent 1.6px) 0 0 / 9px 9px,
    var(--night-2);
}
.page-head .section-title { margin: 0; }
.page-home img { border-radius: 50%; border: var(--stroke) solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.page-talk { position: relative; margin: 0; display: flex; align-items: center; gap: 12px; max-width: 460px; }
.page-talk img { width: 120px; height: 120px; border-radius: 12px; border: var(--stroke) solid var(--ink); object-fit: cover; }
.page-talk .bubble { font-size: 17px; }
.page-talk .bubble::after { left: -14px; bottom: 18px; transform: rotate(90deg) skewX(-20deg); }
.prose, .legal {
  padding: 22px 24px;
  color: var(--text-ink);
  background:
    radial-gradient(rgba(36, 26, 16, .08) 1.2px, transparent 1.6px) 0 0 / 9px 9px,
    var(--paper);
}
.prose .section-title, .legal .section-title { color: var(--ink); -webkit-text-stroke: 0; text-shadow: 3px 3px 0 var(--gold); }
.prose p { margin: 0 0 10px; max-width: 70ch; }
.legal { border-width: 4px; background: #fff; }
.legal dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; font-size: 18px; }
.legal dt { font-weight: 800; }
.legal dd { margin: 0; }
.legal a { color: #7a4b00; font-weight: 700; }
.legal-note { margin: 14px 0 0; color: var(--muted-ink); font-style: italic; }

/* Offizieller KI-Hinweis (Startseite + alle Unterseiten) */
.ai-notice {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px;
  max-width: 760px;
  margin: 0 auto 18px;
  padding: 12px 16px;
  text-align: left;
  color: var(--text-ink);
  background: var(--neon);
  border: var(--stroke) solid var(--ink);
  border-radius: 12px;
  box-shadow: 4px 4px 0 var(--ink);
}
.ai-notice b { font: 22px/1 var(--comic); letter-spacing: .04em; color: var(--ink); }
.ai-notice span { flex: 1 1 320px; font-size: 15px; }
.ai-notice a { color: var(--ink); font-weight: 800; }

/* Footer */
.footer {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 30px 16px 40px;
  text-align: center;
  font-size: 15px;
  color: #b3a792;
}
.footer img { border-radius: 50%; border: 2px solid var(--ink); }
.footer p { margin: 0; }
.footer a { color: var(--gold-2); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ---------- Handy ---------- */
@media (max-width: 900px) {
  .hero-copy {
    grid-template-columns: 1fr;
    grid-template-areas: "logo" "text" "actions";
    justify-items: center;
    text-align: center;
    margin-top: -44px;
    padding: 0 20px 26px;
  }
  .hero-copy .actions { flex-direction: row; justify-content: center; }
  .page-head { grid-template-columns: auto minmax(0, 1fr); }
  .page-talk { grid-column: 1 / -1; max-width: none; }
  .page-talk img { width: 84px; height: 84px; }
  .legal dl { grid-template-columns: 1fr; gap: 2px; }
  .legal dd { margin-bottom: 8px; }
  .lead { margin-inline: auto; }
  .member .bubble { margin-left: 22%; }
}
@media (max-width: 640px) {
  /* Handy: linken Bildteil abschneiden, Blasen bleiben an den Figuren */
  .scene { aspect-ratio: var(--ar-mobile); }
  .scene-inner { right: auto; width: calc(100% / var(--keep, 1)); transform: translateX(calc(var(--crop) * -100%)); }
  .countdown { left: var(--mx) !important; top: var(--my) !important; width: var(--mw) !important; font-size: clamp(8px, 1.6cqw, 14px); }
  /* Live-Abzeichen mittig auf dem sichtbaren Ausschnitt */
  .live-badge { left: calc((var(--crop) + var(--keep, 1) / 2) * 100%) !important; top: 4% !important; font-size: clamp(9px, 2.2cqw, 16px); }
  .scene-bubble { font-size: clamp(11px, 2cqw, 16px); }
}

/* ---------- Grosse Querformat-Schirme: Bild fuellt den ganzen Bildschirm ----------
   Die innere Buehne behaelt das Bildformat und deckt den Schirm ab (wie cover), damit die
   Sprechblasen-Prozente weiter auf die Figuren zeigen. */
@media (min-width: 901px) and (min-aspect-ratio: 4/3) {
  .hero.panel {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100svh;
    margin: 0;
    border: 0;
    border-bottom: var(--stroke) solid var(--ink);
    border-radius: 0;
    box-shadow: none;
  }
  .scene { position: absolute; inset: 0; aspect-ratio: auto; }
  .scene-inner {
    inset: auto;
    left: 50%; top: 50%;
    width: max(100vw, 100svh * var(--ar));
    aspect-ratio: var(--ar);
    transform: translate(-50%, -50%);
  }
  .scene-inner::after {
    background:
      radial-gradient(ellipse 70% 55% at 0% 100%, rgba(13, 10, 8, .92), transparent 70%),
      linear-gradient(180deg, transparent 75%, rgba(13, 10, 8, .6) 100%);
  }
  /* Titelband links unten, rechts bleiben Bruno und Lisa frei */
  .hero-copy {
    position: absolute;
    left: 0; bottom: 0;
    width: min(980px, 56vw);
    margin: 0;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "logo text" ". actions";
    align-items: end;
    padding: 0 0 calc(4svh + 40px) 4vw;
  }
  .hero-copy .actions { flex-direction: row; }
  .scroll-cue {
    position: absolute; z-index: 3;
    left: 50%; bottom: 14px;
    transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 0;
    font: 18px/1 var(--comic);
    letter-spacing: .06em;
    color: var(--gold-2);
    text-decoration: none;
    text-shadow: 2px 2px 0 var(--ink);
  }
  .scroll-cue b { font-size: 26px; animation: nudge 1.6s ease-in-out infinite; }
  .scroll-cue:hover { color: var(--rose-2); }
}
@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ---------- Szenen: normal vs. live (hero.js setzt .is-live) ---------- */
.scene-live { display: none; }
.hero.is-live .scene-default { display: none; }
.hero.is-live .scene-live { display: block; }
.scene-link { display: block; color: inherit; text-decoration: none; cursor: pointer; }

/* Countdown-Schild, an zwei Schnueren unter dem Hochbett aufgehaengt */
.countdown {
  position: absolute;
  z-index: 1;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: .15em;
  padding: .55em .7em .5em;
  font-size: clamp(10px, 1.2cqw, 18px);
  text-align: center;
  color: var(--neon);
  background: linear-gradient(180deg, #1d1726, #120e18);
  border: var(--stroke) solid var(--ink);
  border-radius: 10px;
  box-shadow: 4px 4px 0 var(--ink), 0 0 24px rgba(255, 212, 121, .25);
  transform: rotate(var(--rot, 0deg));
  transform-origin: top center;
  animation: sway 6s ease-in-out infinite;
}
.countdown.is-ready { display: flex; }
.countdown::before, .countdown::after {
  content: "";
  position: absolute;
  top: -1.6em;
  width: 2px; height: 1.6em;
  background: rgba(244, 237, 225, .55);
}
.countdown::before { left: 18%; }
.countdown::after { right: 18%; }
.countdown-label { font: 1em/1 var(--comic); letter-spacing: .08em; text-transform: uppercase; color: var(--rose-2); }
.countdown-time {
  font: 2.1em/1 var(--comic);
  letter-spacing: .06em;
  color: var(--neon);
  text-shadow: 0 0 10px rgba(255, 212, 121, .7);
  font-variant-numeric: tabular-nums;
}
.countdown-game { font-size: .85em; font-weight: 700; color: #e6dccb; }
@keyframes sway {
  0%, 100% { transform: rotate(var(--rot, 0deg)); }
  50% { transform: rotate(calc(var(--rot, 0deg) + 1.5deg)); }
}

/* Live-Abzeichen */
.live-badge {
  position: absolute;
  z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  transform: translateX(-50%);
  font-size: clamp(12px, 1.6cqw, 24px);
  text-align: center;
}
.live-badge b {
  display: inline-flex; align-items: center; gap: .45em;
  padding: .35em .9em .25em;
  font: 1.9em/1 var(--comic);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
  background: #e0243a;
  border: var(--stroke) solid var(--ink);
  border-radius: 999px;
  box-shadow: 4px 4px 0 var(--ink);
  animation: livepulse 1.6s ease-in-out infinite;
}
.live-badge b::before {
  content: "";
  width: .55em; height: .55em;
  border-radius: 50%;
  background: #fff;
  animation: blink 1.6s steps(2, start) infinite;
}
.live-badge small {
  margin-top: .45em;
  padding: .2em .6em;
  font-weight: 700;
  color: var(--text-ink);
  background: var(--neon);
  border: 2px solid var(--ink);
  border-radius: 8px;
}
.scene-link:hover .live-badge b { background: #ff3049; }
@keyframes livepulse {
  0%, 100% { transform: scale(1); box-shadow: 4px 4px 0 var(--ink), 0 0 0 0 rgba(224, 36, 58, .6); }
  50% { transform: scale(1.06); box-shadow: 4px 4px 0 var(--ink), 0 0 0 12px rgba(224, 36, 58, 0); }
}
@keyframes blink { to { visibility: hidden; } }

/* Bildfuellend + live: Titelband weicht, damit Bruno und Lisa am Rechner frei sind */
@media (min-width: 901px) and (min-aspect-ratio: 4/3) {
  .hero.is-live .hero-copy { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
