
:root {
  --bg: #0b110e;
  --panel: #101915;
  --text: #f5f6f3;
  --muted: #a9b3ad;
  --soft: #d8ded9;
  --accent: #f0d33d;
  --accent-dark: #29250b;
  --line: rgba(255,255,255,.16);
  --radius: 20px;
  --transition: 420ms ease;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

body {
  overflow-x: hidden;
}

button, a { font: inherit; }

.screen {
  width: 100%;
  min-height: 100vh;
  padding: 14px 18px 12px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  background:
    radial-gradient(circle at 85% 0%, rgba(240,211,61,.11), transparent 26%),
    var(--bg);
}

.topbar,
.bottombar {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.topbar {
  min-height: 58px;
}

.brand {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #11170f;
  font-size: 1.45rem;
  font-weight: 950;
}

.brand-copy strong {
  display: block;
  letter-spacing: .12em;
  font-size: 1.05rem;
}

.brand-copy small {
  display: block;
  margin-top: -2px;
  color: var(--muted);
}

.top-actions {
  display: flex;
  gap: 9px;
}

.icon-button,
.pause-button,
.action {
  border: 0;
  cursor: pointer;
  font-weight: 850;
}

.icon-button,
.pause-button {
  color: white;
  background: rgba(255,255,255,.075);
  border: 1px solid var(--line);
}

.icon-button {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 1.25rem;
}

.pause-button {
  min-width: 126px;
  padding: 11px 17px;
  border-radius: 999px;
}

#pause-icon { margin-right: 7px; }

.stage {
  width: 100%;
  min-height: 0;
  aspect-ratio: 16 / 8.1;
  max-height: calc(100vh - 138px);
  align-self: center;
  display: grid;
  grid-template-columns: 52% 48%;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 26px 90px rgba(0,0,0,.42);
  opacity: 1;
  transform: translateY(0);
  transition: opacity var(--transition), transform var(--transition);
}

.stage.is-changing {
  opacity: 0;
  transform: translateY(8px);
}

.visual {
  position: relative;
  min-width: 0;
  min-height: 0;
  background:
    linear-gradient(135deg, rgba(255,255,255,.06), rgba(255,255,255,0)),
    #223029;
  overflow: hidden;
}

.article-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 40px;
  text-align: center;
  color: #c3cdc6;
  font-size: clamp(1rem, 1.5vw, 1.35rem);
  font-weight: 750;
  z-index: 0;
}

.visual-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 68%, rgba(11,17,14,.42)),
    linear-gradient(0deg, rgba(11,17,14,.35), transparent 32%);
  pointer-events: none;
}

.boundary-badge {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 3;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-dark);
  box-shadow: 0 8px 25px rgba(0,0,0,.28);
  font-size: .78rem;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.story {
  min-width: 0;
  padding: clamp(34px, 4vw, 74px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    linear-gradient(135deg, rgba(255,255,255,.025), transparent 35%),
    var(--panel);
}

.article-meta {
  margin-bottom: 18px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .09em;
  font-size: clamp(.72rem, .9vw, .9rem);
  font-weight: 900;
}

h1 {
  margin: 0 0 24px;
  max-width: 16ch;
  color: white;
  font-size: clamp(2.35rem, 4vw, 5.3rem);
  line-height: 1.01;
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
}

.article-summary {
  margin: 0;
  max-width: 44em;
  color: var(--soft);
  font-size: clamp(1.03rem, 1.45vw, 1.52rem);
  line-height: 1.52;
}

.story-actions {
  display: flex;
  gap: 13px;
  flex-wrap: wrap;
  margin-top: clamp(28px, 4vh, 48px);
}

.action {
  padding: 13px 20px;
  border-radius: 999px;
  transition: transform .16s ease;
}

.action:hover,
.pause-button:hover,
.icon-button:hover {
  transform: translateY(-2px);
}

.action.primary {
  background: var(--accent);
  color: var(--accent-dark);
}

.action.secondary {
  color: white;
  background: transparent;
  border: 1px solid rgba(255,255,255,.34);
}

.bottombar {
  min-height: 36px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  font-size: .88rem;
}

.footer-meta {
  display: flex;
  gap: 16px;
  white-space: nowrap;
}

#article-counter {
  color: var(--accent);
  font-weight: 950;
}

#countdown-label,
.keyboard-hint {
  color: var(--muted);
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
}

.progress-bar {
  width: 100%;
  height: 100%;
  background: var(--accent);
  transform: scaleX(1);
  transform-origin: left center;
}

.keyboard-hint {
  white-space: nowrap;
}

dialog {
  width: min(980px, calc(100% - 28px));
  max-height: 91vh;
  padding: 0;
  border: 0;
  border-radius: 20px;
  box-shadow: 0 34px 100px rgba(0,0,0,.58);
}

dialog::backdrop {
  background: rgba(1,5,3,.83);
  backdrop-filter: blur(6px);
}

.dialog-card {
  position: relative;
  padding: clamp(30px, 6vw, 68px);
  color: #18211d;
  background: #fffefa;
}

.dialog-close {
  position: absolute;
  top: 17px;
  right: 17px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #d9dcd6;
  background: white;
  cursor: pointer;
  font-size: 1.7rem;
}

.dialog-meta {
  margin-bottom: 16px;
  color: #68746c;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 850;
  font-size: .8rem;
}

.dialog-title {
  margin: 0 0 22px;
  color: #18211d;
  font-size: clamp(2rem, 4.2vw, 4rem);
  line-height: 1.05;
  letter-spacing: -.04em;
}

.dialog-subtitle {
  margin-bottom: 26px;
  color: #536057;
  font-size: 1.2rem;
}

.dialog-image {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 30px;
}

.article-text p {
  margin: 0 0 1.15em;
  font-size: 1.06rem;
  line-height: 1.72;
}

.article-text h3 {
  margin: 1.8em 0 .55em;
  font-size: 1.45rem;
}

.source-box {
  margin-top: 34px;
  padding: 20px;
  border-radius: 12px;
  background: #eeede6;
}

.source-box a {
  color: #13231c;
  font-weight: 850;
}

@media (max-width: 1050px) {
  .stage {
    aspect-ratio: auto;
    max-height: none;
    grid-template-columns: 1fr;
  }

  .visual {
    min-height: 42vh;
  }

  .story {
    min-height: 44vh;
  }

  h1 {
    max-width: none;
  }

  .bottombar {
    grid-template-columns: 1fr;
  }

  .keyboard-hint {
    display: none;
  }
}

@media (max-width: 650px) {
  .screen {
    padding: 8px;
  }

  .brand-copy small,
  #pause-label {
    display: none;
  }

  .pause-button {
    min-width: 46px;
    width: 46px;
    height: 46px;
    padding: 0;
  }

  #pause-icon {
    margin: 0;
  }

  .visual {
    min-height: 34vh;
  }

  .story {
    padding: 26px 22px 30px;
    min-height: 0;
  }

  h1 {
    font-size: clamp(2rem, 10.5vw, 3.3rem);
  }

  .article-summary {
    font-size: 1.03rem;
  }

  .story-actions {
    margin-top: 26px;
  }

  .action {
    width: 100%;
  }

  .footer-meta {
    width: 100%;
    justify-content: space-between;
    font-size: .8rem;
  }
}

/* Z-Panel 4.0: flüssigere, GPU-gestützte Artikelübergänge */
.stage {
  will-change: opacity, transform;
  backface-visibility: hidden;
  transform: translate3d(0, 0, 0);
  transition:
    opacity 360ms ease,
    transform 360ms ease;
}

.stage.is-changing {
  opacity: 0;
  transform: translate3d(0, 6px, 0);
}

.article-image {
  display: block;
  will-change: opacity;
  backface-visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .stage,
  .stage.is-changing {
    transition: none;
    transform: none;
  }
}

/* BEGIN Z-PANEL 5.0 */
/* Z-PANEL 5.0 – größere Lesbarkeit, sichtbare Quelle und redaktionelle Zwischenscreens */
[hidden] {
  display: none !important;
}

.story h1 {
  margin-bottom: 20px;
  font-size: clamp(2.25rem, 3.55vw, 4.75rem);
  line-height: 1.03;
}

.article-summary {
  max-width: 42em;
  font-size: clamp(1.2rem, 1.78vw, 1.92rem);
  line-height: 1.43;
  white-space: pre-line;
}

.article-source {
  margin-top: 20px;
  color: var(--muted);
  font-size: clamp(.9rem, 1.05vw, 1.08rem);
  line-height: 1.4;
  font-weight: 720;
}

.article-connection {
  margin-top: 13px;
  padding-left: 15px;
  border-left: 3px solid rgba(240, 211, 61, .72);
  color: #dfe4df;
  font-size: clamp(.92rem, 1.08vw, 1.13rem);
  line-height: 1.45;
}

.story-actions {
  margin-top: clamp(22px, 3vh, 38px);
}

.stage.is-editorial {
  grid-template-columns: 38% 62%;
}

.stage.is-editorial .visual {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 25%, rgba(240, 211, 61, .24), transparent 33%),
    linear-gradient(145deg, #1d2b24, #0b110e 72%);
}

.stage.is-editorial .visual::before {
  content: "Z";
  position: absolute;
  z-index: 1;
  color: var(--accent);
  font-size: clamp(10rem, 21vw, 24rem);
  line-height: 1;
  font-weight: 950;
  opacity: .18;
}

.stage.is-editorial .visual-shade {
  background:
    linear-gradient(90deg, transparent 55%, rgba(11,17,14,.55)),
    linear-gradient(0deg, rgba(11,17,14,.35), transparent 38%);
}

.stage.is-editorial .image-status {
  position: relative;
  inset: auto;
  z-index: 2;
  padding: 30px;
  color: white;
  font-size: clamp(1.8rem, 3.1vw, 3.7rem);
  line-height: 1;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-weight: 950;
}

.stage.is-editorial .story {
  background:
    linear-gradient(135deg, rgba(240, 211, 61, .07), transparent 42%),
    var(--panel);
}

.stage.is-editorial h1 {
  max-width: 19ch;
  font-size: clamp(2.5rem, 4.2vw, 5.3rem);
}

.stage.is-editorial .article-summary {
  max-width: 48em;
  font-size: clamp(1.15rem, 1.52vw, 1.68rem);
  line-height: 1.48;
}

.stage.is-editorial .story-actions {
  margin-top: 24px;
}

@media (max-width: 1050px) {
  .stage.is-editorial {
    grid-template-columns: 1fr;
  }

  .stage.is-editorial .visual {
    min-height: 24vh;
  }
}

@media (max-width: 650px) {
  .article-summary {
    font-size: 1.12rem;
  }

  .article-source,
  .article-connection {
    font-size: .94rem;
  }

  .stage.is-editorial .article-summary {
    font-size: 1.05rem;
  }
}
/* END Z-PANEL 5.0 */

/* Z-PANEL 5.1 GRUNDLAGEN START */
.stage.is-explainer .story {
  background:
    linear-gradient(135deg, rgba(75, 163, 150, .09), transparent 44%),
    var(--panel);
  box-shadow: inset 5px 0 0 rgba(75, 163, 150, .78);
}

.stage.is-explainer #boundary-badge {
  letter-spacing: .13em;
  text-transform: uppercase;
}

.stage.is-explainer .article-meta {
  letter-spacing: .055em;
}

.stage.is-explainer .visual {
  background:
    radial-gradient(circle at 50% 42%, rgba(213, 231, 224, .16), transparent 58%),
    #15201c;
}

.stage.is-explainer .article-image {
  object-position: center center;
}

@media (max-width: 760px) {
  .stage.is-explainer .story {
    box-shadow: inset 0 5px 0 rgba(75, 163, 150, .78);
  }
}
/* Z-PANEL 5.1 GRUNDLAGEN ENDE */

/* Z-PANEL 5.2: Themenauswahl vor der Endlosschleife */
.topic-button {
  min-height: 46px;
  max-width: min(34vw, 320px);
  padding: 10px 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.075);
  color: white;
  cursor: pointer;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-button:hover {
  transform: translateY(-2px);
}

.topic-selector {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: clamp(18px, 4vw, 54px);
  background:
    radial-gradient(circle at 18% 12%, rgba(240,211,61,.16), transparent 28rem),
    rgba(5, 9, 7, .96);
  backdrop-filter: blur(10px);
}

.topic-selector-card {
  width: min(1120px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: clamp(28px, 5vw, 64px);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 26px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.045), transparent 38%),
    #101915;
  box-shadow: 0 32px 100px rgba(0,0,0,.55);
}

.topic-selector-kicker {
  margin-bottom: 14px;
  color: var(--accent);
  font-size: .82rem;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.topic-selector h1 {
  max-width: 19ch;
  margin-bottom: 18px;
  font-size: clamp(2.3rem, 5vw, 5.4rem);
}

.topic-selector-intro {
  max-width: 56rem;
  margin: 0 0 28px;
  color: var(--soft);
  font-size: clamp(1.1rem, 1.6vw, 1.55rem);
  line-height: 1.48;
}

.topic-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 13px;
}

.topic-option {
  min-height: 92px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 16px;
  background: rgba(255,255,255,.055);
  color: white;
  cursor: pointer;
  text-align: left;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.topic-option:hover,
.topic-option:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(240,211,61,.72);
  background: rgba(240,211,61,.09);
  outline: none;
}

.topic-option.is-all {
  border-color: rgba(240,211,61,.58);
  background: rgba(240,211,61,.12);
}

.topic-option-label {
  font-size: clamp(1.08rem, 1.4vw, 1.35rem);
  font-weight: 900;
  line-height: 1.2;
}

.topic-option-count {
  flex: 0 0 auto;
  min-width: 44px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  color: var(--accent);
  font-weight: 950;
  text-align: center;
}

.topic-selector-note {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.45;
}

@media (max-width: 650px) {
  .topic-button {
    max-width: 46px;
    width: 46px;
    padding: 0;
    font-size: 0;
  }

  .topic-button::before {
    content: "☰";
    font-size: 1.2rem;
  }

  .topic-selector {
    padding: 8px;
  }

  .topic-selector-card {
    max-height: calc(100vh - 16px);
    padding: 26px 20px;
    border-radius: 18px;
  }

  .topic-option {
    min-height: 76px;
  }
}

/* Z-PANEL 5.25: kompakte Live-Vorschau für die ZUSTAND-Landingpage.
   Aufruf: index.html?mode=homepage */
html.homepage-mode,
body.homepage-mode {
  min-height: 0;
  background: transparent;
}

body.homepage-mode .screen {
  min-height: 0;
  padding: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 9px;
  background: transparent;
}

body.homepage-mode .topbar,
body.homepage-mode .topic-selector,
body.homepage-mode #topic-button,
body.homepage-mode #fullscreen-button,
body.homepage-mode .keyboard-hint,
body.homepage-mode #countdown-label {
  display: none !important;
}

body.homepage-mode .stage {
  min-height: 520px;
  max-height: none;
  aspect-ratio: 16 / 8.5;
  border-radius: 16px;
}

body.homepage-mode .story {
  padding: clamp(26px, 3.2vw, 54px);
}

body.homepage-mode h1 {
  font-size: clamp(2rem, 3.4vw, 4.1rem);
}

body.homepage-mode .article-summary {
  font-size: clamp(1rem, 1.2vw, 1.3rem);
}

body.homepage-mode .story-actions {
  margin-top: clamp(20px, 3vh, 34px);
}

body.homepage-mode .bottombar {
  min-height: 24px;
  grid-template-columns: auto 1fr;
  gap: 14px;
}

body.homepage-mode .footer-meta {
  gap: 0;
}

@media (max-width: 760px) {
  body.homepage-mode .stage {
    min-height: 0;
    aspect-ratio: auto;
  }

  body.homepage-mode .visual {
    min-height: 270px;
  }

  body.homepage-mode .story {
    padding: 25px 22px 28px;
  }

  body.homepage-mode .bottombar {
    padding: 0 4px;
  }
}
