@import url('https://fonts.googleapis.com/css2?family=Mulish:ital,wght@0,300;0,400;0,600;0,800;0,900;1,800;1,900&display=swap');

:root {
  --navy: #013154;
  --magenta: #d7005f;
  --light-bg: #eceef0;
  --text-dark: #1a2a3a;
  --text-dim: #5a6a7a;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--light-bg);
  font-family: 'Mulish', sans-serif;
  color: var(--text-dark);
}

.screen-shell {
  position: relative;
  width: 1920px;
  height: 1080px;
  overflow: hidden;
}

.bg-light,
.bg-diagonal-navy,
.bg-diagonal-magenta {
  position: absolute;
  inset: 0;
}

.bg-light {
  background: var(--light-bg);
}

.bg-diagonal-navy {
  background: var(--navy);
  clip-path: polygon(97.2% 0, 100% 0, 100% 100%, 83.5% 100%);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.bg-diagonal-magenta {
  background: var(--magenta);
  clip-path: polygon(94.8% 0, 97.6% 0, 83.5% 100%, 78.5% 100%);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.screen-shell.media-focus .bg-diagonal-navy,
.screen-shell.media-focus .bg-diagonal-magenta {
  transform: translateX(220px) scale(0.985);
  opacity: 0;
}

.screen-shell.stream-focus .bg-light,
.screen-shell.stream-focus .bg-diagonal-navy,
.screen-shell.stream-focus .bg-diagonal-magenta,
.screen-shell.stream-focus .top-bar,
.screen-shell.stream-focus .header,
.screen-shell.stream-focus .slide-indicators,
.screen-shell.stream-focus .progress-bar {
  opacity: 0;
  pointer-events: none;
}

.screen-shell.stream-focus .slide-container {
  inset: 0;
}

.screen-shell.stream-focus .slide.stream-slide {
  padding: 0;
  transform: none;
  filter: none;
}

.screen-shell.stream-focus .slide.stream-slide .media-figure {
  width: 100%;
  min-height: 100%;
  height: 100%;
  padding: 0;
  border-radius: 0;
  background: #000;
  box-shadow: none;
}

.screen-shell.stream-focus .slide.stream-slide .media-figure video,
.screen-shell.stream-focus .slide.stream-slide .media-figure .stream-iframe {
  width: 100%;
  height: 100%;
  border-radius: 0;
  object-fit: cover;
}

.screen-shell.stream-focus .slide.stream-slide .media-meta {
  display: none;
}

.screen-shell.stream-focus .logo-area {
  z-index: 30;
}

.top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--magenta);
  z-index: 10;
}

.header {
  position: absolute;
  top: 28px;
  left: 50px;
  right: 95px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 10;
}

.header-title {
  font-size: 20px;
  font-weight: 800;
}

.header-subtitle,
.header-date-line {
  font-size: 14px;
  color: var(--text-dim);
}

.header-right {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-right: 50px;
}

.header-clock {
  font-size: 28px;
  font-weight: 800;
  text-align: right;
}

.connection-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 10px;
  background: #28a745;
  box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.15);
}

.connection-indicator.offline {
  background: #dc3545;
  box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.15);
}

.slide-container {
  position: absolute;
  inset: 90px 0 65px 0;
  z-index: 5;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  padding: 0 70px;
  display: flex;
  align-items: center;
}

.slide.active {
  opacity: 1;
  transform: translateX(0);
}

.welcome-slide,
.notice-slide,
.custom-slide {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.welcome-title,
.notice-title,
.custom-title {
  font-size: 74px;
  font-weight: 900;
  font-style: italic;
  line-height: 1.06;
  margin-bottom: 16px;
  max-width: 900px;
}

.welcome-sub,
.notice-text,
.custom-content {
  font-size: 28px;
  line-height: 1.55;
  max-width: 860px;
}

.welcome-sub,
.notice-text {
  color: var(--text-dim);
}

.custom-content {
  color: inherit;
  white-space: pre-line;
}

.overview-slide {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.ov-heading,
.notice-badge,
.prog-category {
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-weight: 800;
  color: var(--magenta);
  margin-bottom: 20px;
}

.ov-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 1180px;
}

.ov-row {
  display: grid;
  grid-template-columns: 76px 145px 1fr 250px;
  gap: 18px;
  padding: 16px 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  font-size: 24px;
  line-height: 1.2;
}

.ov-time {
  font-size: 26px;
  font-weight: 800;
  color: var(--navy);
  font-style: italic;
}

.program-slide {
  display: grid;
  grid-template-columns: 220px 4px minmax(0, 820px);
  gap: 42px;
  max-width: 1220px;
}

.prog-time {
  font-size: 84px;
  font-weight: 900;
  font-style: italic;
  color: var(--navy);
}

.prog-location {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--magenta);
  font-weight: 700;
}

.prog-separator {
  background: linear-gradient(180deg, var(--magenta), var(--navy));
  border-radius: 999px;
}

.prog-title {
  font-size: 60px;
  font-weight: 900;
  font-style: italic;
  line-height: 1.08;
  margin-bottom: 16px;
  max-width: 820px;
}

.prog-desc {
  font-size: 25px;
  color: var(--text-dim);
  line-height: 1.5;
  max-width: 820px;
}

.notice-badge {
  padding: 8px 18px;
  border-radius: 8px;
  color: var(--white);
  background: var(--navy);
}

.notice-slide.warning .notice-badge {
  background: var(--magenta);
}

.media-slide {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  transform: scale(1.03);
  filter: blur(8px);
  transition: opacity 1.45s ease, transform 1.45s cubic-bezier(0.22, 1, 0.36, 1), filter 1.45s ease;
}

.media-slide.active {
  transform: scale(1);
  filter: blur(0);
}

.media-figure {
  position: relative;
  margin: 0;
  width: min(100%, 1760px);
  min-height: 920px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  padding: 6px;
  box-shadow: 0 20px 54px rgba(1, 49, 84, 0.08);
  overflow: hidden;
  transform: translateY(16px);
  transition: transform 1.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 1.35s ease;
}

.media-slide.active .media-figure {
  transform: translateY(0);
  box-shadow: 0 26px 64px rgba(1, 49, 84, 0.12);
}

.media-figure img,
.media-figure video {
  display: block;
  width: 100%;
  height: min(88vh, 980px);
  max-width: 100%;
  object-fit: contain;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
}
.media-figure video {
  background: #000;
}

.stream-iframe {
  display: block;
  width: 100%;
  height: min(88vh, 980px);
  border: none;
  border-radius: 22px;
  background: #000;
}

.stream-video {
  background: #000;
  /* Eigene GPU-Compositing-Ebene erzwingen – reduziert Tearing/Flackern auf Raspberry Pi */
  transform: translateZ(0);
  backface-visibility: hidden;
  will-change: transform;
}

.media-meta {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 28px;
  max-width: 960px;
  padding: 16px 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 24px rgba(1, 49, 84, 0.12);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.9s ease 0.08s, transform 0.9s ease 0.08s;
}

.media-slide.active .media-meta {
  opacity: 1;
  transform: translateY(0);
}

.media-caption-title {
  font-size: 34px;
  font-weight: 900;
  font-style: italic;
  margin-bottom: 4px;
  color: var(--navy);
}

.media-caption-text {
  font-size: 22px;
  color: var(--text-dim);
  line-height: 1.45;
  max-width: 100%;
}

.custom-slide {
  width: 100%;
}

.custom-slide.with-images {
  padding: 0 20px;
}

.custom-slide-panel {
  width: min(100%, 1640px);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 32px;
  align-items: center;
  padding: 34px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 40px rgba(1, 49, 84, 0.08);
}

.custom-copy {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 620px;
}

.custom-image-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.custom-image-grid.count-1 {
  grid-template-columns: 1fr;
}

.custom-image-card {
  min-height: 220px;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 28px rgba(1, 49, 84, 0.14);
}

.custom-image-card img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 220px;
  max-height: 360px;
  object-fit: cover;
}

.custom-slide.left {
  align-items: flex-start;
}

.custom-slide.fullscreen {
  justify-content: center;
  text-align: center;
  align-items: center;
}

.custom-slide.fullscreen .custom-slide-panel {
  grid-template-columns: 1fr;
}

.custom-slide.fullscreen .custom-copy {
  max-width: 100%;
  margin: 0 auto;
}

.logo-area {
  position: absolute;
  right: 55px;
  bottom: 35px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.logo-area img {
  display: block;
  width: auto;
  max-width: 260px;
  max-height: 100px;
  object-fit: contain;
}

.logo-text {
  color: rgba(255, 255, 255, 0.75);
  font-weight: 900;
  font-style: italic;
  font-size: 22px;
  line-height: 1.1;
}

.slide-indicators {
  position: absolute;
  left: 70px;
  bottom: 18px;
  display: flex;
  gap: 6px;
  z-index: 10;
}

.slide-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(1, 49, 84, 0.2);
  transition: all 0.3s ease;
}

.slide-dot.active {
  width: 28px;
  background: var(--magenta);
}

.progress-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 5px;
  width: 0;
  background: linear-gradient(90deg, var(--magenta), var(--navy));
  z-index: 10;
}
