/* Kap Arkona TV – TV-Layout fuer 1920x1080, wird als Ganzes auf den Bildschirm skaliert (app.js: fitStage) */
@font-face {
  font-family: 'Cabin';
  src: url(fonts/cabin.woff2) format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: block;
}

:root {
  --night: #0B1D2E;
  --slate: #132A3E;
  --sand: #F4EFE6;
  --sand-dim: rgba(244, 239, 230, .72);
  --gold: #E09F3E;
  --teal: #3A8E9E;
  --warn: #D9534F;
  --bar-h: 120px;
  --fade: 1s;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100vw; height: 100vh; overflow: hidden;
  background: var(--night); color: var(--sand);
  cursor: none; user-select: none;
  font-family: 'Cabin', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Fester Rahmen: schneidet die grosse Buehne ab, damit mobile Browser die Seite nicht auf 1920 px verbreitern */
#screen { position: fixed; inset: 0; overflow: hidden; background: var(--night); }
#stage {
  position: absolute; left: 0; top: 0;
  width: 1920px; height: 1080px;
  transform-origin: 0 0;
  background: var(--night);
  overflow: hidden;
}

/* ---------------- Slides ---------------- */
#slides { position: absolute; inset: 0 0 var(--bar-h) 0; overflow: hidden; background: var(--slate); }
.slide {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity var(--fade) ease-in-out;
  overflow: hidden;
}
.slide.on { opacity: 1; }

.bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
}
.slide.on .bg.drift { animation: drift 16s ease-out forwards; }
@keyframes drift { from { transform: scale(1.0); } to { transform: scale(1.06); } }

.shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11,29,46,.94) 0%, rgba(11,29,46,.82) 42%, rgba(11,29,46,.25) 75%, rgba(11,29,46,.05) 100%); }
.shade.full { background: linear-gradient(180deg, rgba(11,29,46,.55), rgba(11,29,46,.85)); }

.content {
  position: absolute; left: 120px; top: 150px; bottom: 80px; width: 1120px;
  display: flex; flex-direction: column; justify-content: center; gap: 34px;
}

.kicker { font-size: 34px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.title  { font-size: 76px; font-weight: 700; line-height: 1.06; color: var(--sand); text-wrap: balance; }
.text   { font-size: 40px; line-height: 1.32; color: var(--sand-dim); max-width: 1060px; }

.bullets { list-style: none; display: flex; flex-direction: column; gap: 22px; }
.bullets li { font-size: 40px; line-height: 1.25; padding-left: 52px; position: relative; }
.bullets li::before {
  content: ''; position: absolute; left: 0; top: .42em;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 6px rgba(224,159,62,.22);
}

.facts { display: flex; gap: 70px; }
.fact .v { font-size: 104px; font-weight: 700; line-height: 1; color: var(--gold); white-space: nowrap; }
.fact .l { font-size: 32px; color: var(--sand-dim); margin-top: 10px; }

/* Split: Bild links, Text rechts */
.split .pic { position: absolute; left: 0; top: 0; bottom: 0; width: 46%; }
.split .pic .bg { -webkit-mask-image: linear-gradient(90deg, #000 78%, transparent); mask-image: linear-gradient(90deg, #000 78%, transparent); }
.split .content { left: 960px; width: 860px; }
.split .title { font-size: 72px; }

/* QR: Text links, QR-Karte rechts */
.qrcard {
  position: absolute; right: 130px; top: 50%; transform: translateY(-46%);
  width: 500px; padding: 40px 40px 34px; border-radius: 28px;
  background: var(--sand); color: var(--night); text-align: center;
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
}
.qrcard .code { width: 420px; height: 420px; margin: 0 auto; display: flex; align-items: center; justify-content: center; }
.qrcard .code img, .qrcard .code canvas { width: 420px !important; height: 420px !important; image-rendering: pixelated; }
.qrcard .code .fallback { font-size: 34px; font-weight: 700; word-break: break-all; }
.qrcard .lbl { font-size: 36px; font-weight: 700; margin-top: 22px; }
.qrcard .sub { font-size: 30px; color: #3d5266; margin-top: 4px; word-break: break-all; }
.qr .content, .wifi .content { width: 1080px; }

/* Handy-Slide ohne Foto: Text gross und zentriert (mit Foto: Layout "split" = Bild links, Text rechts) */
.textonly { background: radial-gradient(circle at 50% 30%, #1f4562 0%, var(--slate) 60%, var(--night) 100%); }
.textonly .content { left: 160px; right: 160px; width: auto; align-items: center; text-align: center; }
.textonly .title { font-size: 92px; }
.textonly .text { font-size: 48px; max-width: 1400px; color: var(--sand); }

/* Warnung */
.warning { background: radial-gradient(circle at 80% 40%, #1d3a54 0%, var(--slate) 60%); }
.warning .stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 26px; background: repeating-linear-gradient(-45deg, var(--gold) 0 30px, var(--night) 30px 60px); }
.warning .bigicon { position: absolute; right: 190px; top: 50%; transform: translateY(-50%); width: 440px; height: 440px; }
.warning .kicker { color: var(--warn); }
.warning .bullets li::before { background: var(--warn); box-shadow: 0 0 0 6px rgba(217,83,79,.25); }

/* ---------------- Wetter-Slide ---------------- */
.weather { background: radial-gradient(circle at 75% 20%, #1f4562 0%, var(--slate) 55%, var(--night) 100%); }
.weather .content { width: 1700px; top: 165px; justify-content: flex-start; gap: 40px; }
.wnow { display: flex; align-items: center; gap: 60px; }
.wnow .ico { width: 230px; height: 230px; }
.wnow .temp { font-size: 190px; font-weight: 700; line-height: .9; }
.wnow .desc { font-size: 48px; font-weight: 700; }
.wnow .meta { font-size: 36px; color: var(--sand-dim); margin-top: 10px; line-height: 1.35; }
.wnow .side { margin-left: auto; display: flex; flex-direction: column; gap: 22px; }
.pill { background: rgba(244,239,230,.08); border: 1px solid rgba(244,239,230,.16); border-radius: 22px; padding: 18px 30px; min-width: 380px; }
.pill .k { font-size: 30px; color: var(--sand-dim); }
.pill .v { font-size: 46px; font-weight: 700; color: var(--sand); }
.pill .v small { font-size: 32px; color: var(--teal); font-weight: 700; margin-left: 10px; }
.hours { display: grid; grid-template-columns: repeat(6, 1fr); gap: 22px; }
.hour { background: rgba(244,239,230,.07); border-radius: 22px; padding: 22px 10px; text-align: center; }
.hour .h { font-size: 32px; color: var(--sand-dim); }
.hour .ico { width: 84px; height: 84px; margin: 8px auto; }
.hour .t { font-size: 50px; font-weight: 700; }
.hour .r { font-size: 30px; color: #8fc9d4; }
.wnone { font-size: 44px; color: var(--sand-dim); }

/* ---------------- Webcam-Slide ---------------- */
.webcam { background: #000; }
.webcam .bg.cam { background-size: cover; }
.webcam.contain .bg.cam { background-size: contain; background-position: left center; background-repeat: no-repeat; }
.webcam:not(.contain)::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(11,29,46,.92) 0%, rgba(11,29,46,.35) 34%, transparent 55%); }
.camcap { position: absolute; left: 90px; bottom: 60px; z-index: 2; max-width: 1180px; display: flex; flex-direction: column; gap: 12px; }
.webcam.contain .camcap { left: 1330px; right: 60px; bottom: auto; top: 160px; max-width: none; }
.webcam.contain .camcap .title { font-size: 60px; }
.camcap .title { font-size: 72px; }
.camcap .text { font-size: 36px; }
.camcap .live { font-size: 30px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--sand); display: flex; align-items: center; gap: 16px; }
.camcap .live span { width: 18px; height: 18px; border-radius: 50%; background: var(--warn); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.camcap .wline { font-size: 40px; font-weight: 700; color: var(--gold); margin-top: 6px; }
.camqr { position: absolute; right: 70px; bottom: 60px; z-index: 2; background: var(--sand); color: var(--night); border-radius: 22px; padding: 18px 18px 12px; text-align: center; font-size: 30px; font-weight: 700; }
.camqr .code, .camqr .code img, .camqr .code canvas { width: 210px !important; height: 210px !important; }
.camqr .code .fallback { font-size: 22px; width: 210px; word-break: break-all; }
.webcam.contain .camqr { right: auto; left: 1330px; bottom: 50px; }

/* ---------------- FeWo-Slides ---------------- */
.fewo { background: radial-gradient(circle at 85% 30%, #1d4659 0%, var(--slate) 55%, var(--night) 100%); }
.fewo .tag { display: inline-block; align-self: flex-start; font-size: 30px; font-weight: 700; padding: 10px 24px; border-radius: 40px; background: rgba(58,142,158,.25); color: #9fd6df; }
.wifi .cred { display: grid; grid-template-columns: auto 1fr; gap: 14px 34px; font-size: 40px; align-items: baseline; }
.wifi .cred .k { color: var(--sand-dim); font-size: 32px; }
.wifi .cred .v { font-weight: 700; font-size: 52px; letter-spacing: .02em; }

/* ---------------- Fortschritt ---------------- */
#progress { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(244,239,230,.08); z-index: 5; }
#progressBar { height: 100%; width: 100%; background: linear-gradient(90deg, var(--teal), var(--gold)); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------------- Logo ---------------- */
#logo {
  position: absolute; top: 38px; left: 52px; z-index: 10;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 26px 12px 20px; border-radius: 40px;
  background: rgba(11,29,46,.55); backdrop-filter: blur(6px);
  font-size: 30px; font-weight: 700; letter-spacing: .14em; color: var(--sand);
}
#logo b { color: var(--gold); }
.logo-icon { width: 30px; height: 48px; }
.logo-icon .tower { fill: var(--sand); }
.logo-icon .band { fill: var(--warn); }
.logo-icon .roof { fill: var(--sand); }
.logo-icon .lamp { fill: var(--gold); }
.logo-icon .beam { fill: var(--gold); opacity: .35; }

/* ---------------- Statusleiste ---------------- */
#bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--bar-h); z-index: 10;
  display: grid; grid-template-columns: 420px 1fr; align-items: center;
  background: var(--night); border-top: 2px solid rgba(224,159,62,.55);
}
#bar > div { height: 100%; display: flex; align-items: center; padding: 0 40px; border-right: 1px solid rgba(244,239,230,.1); }
#clock { gap: 24px; }
#time { font-size: 56px; font-weight: 700; font-variant-numeric: tabular-nums; }
#date { font-size: 30px; color: var(--sand-dim); line-height: 1.15; white-space: nowrap; }
/* Wetter oben rechts */
#wx {
  position: absolute; top: 32px; right: 52px; z-index: 10;
  display: flex; align-items: center; gap: 18px;
  padding: 12px 30px 12px 18px; border-radius: 26px;
  background: rgba(11,29,46,.62); backdrop-filter: blur(6px);
  white-space: nowrap; transition: opacity .6s;
}
#wx[hidden] { display: none; }
.wxslide #wx { opacity: 0; }
#wxIcon svg { width: 72px; height: 72px; display: block; }
#wxText { display: flex; align-items: center; gap: 18px; }
#wxText b { font-size: 60px; font-weight: 700; line-height: 1; }
#wxText .wxl { display: flex; flex-direction: column; font-size: 30px; line-height: 1.2; }
#wxText .wxl span:last-child { color: var(--sand-dim); }
#ticker { overflow: hidden; border-right: 0 !important; padding: 0 !important; position: relative;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 60px, #000 calc(100% - 60px), transparent);
          mask-image: linear-gradient(90deg, transparent, #000 60px, #000 calc(100% - 60px), transparent); }
#tickerTrack { display: flex; white-space: nowrap; font-size: 34px; will-change: transform; }
#tickerTrack span { padding-right: 90px; }
#tickerTrack span::before { content: '◆'; color: var(--gold); font-size: 24px; margin-right: 26px; vertical-align: 4px; }

#offline { position: absolute; left: 40px; top: 40px; z-index: 11; font-size: 26px; padding: 8px 18px; border-radius: 20px; background: rgba(217,83,79,.85); }

/* Wetter-Icons */
.wi .sun { fill: var(--gold); }
.wi .ray { stroke: var(--gold); stroke-width: 4; stroke-linecap: round; }
.wi .cloud { fill: var(--sand); }
.wi .cloud2 { fill: #b9c4cf; }
.wi .drop { stroke: #6fc1d1; stroke-width: 4; stroke-linecap: round; }
.wi .flake { fill: #e6f3f7; }
.wi .bolt { fill: var(--gold); }
.wi .fog { stroke: var(--sand-dim); stroke-width: 4; stroke-linecap: round; }
.wi .moon { fill: #e8dcc0; }

/* ================= Hochformat (Handy, hochkant montierter Monitor): Buehne 1080x1920 ================= */
html.portrait #bar { grid-template-columns: 410px 1fr; }
html.portrait #time { font-size: 52px; }
html.portrait #date { font-size: 26px; }
html.portrait #logo { left: 40px; top: 36px; font-size: 26px; padding: 10px 22px 10px 16px; }
html.portrait .logo-icon { width: 26px; height: 42px; }
html.portrait #wx { right: 40px; top: 30px; padding: 10px 24px 10px 14px; gap: 12px; }
html.portrait #wxIcon svg { width: 60px; height: 60px; }
html.portrait #wxText b { font-size: 52px; }
html.portrait #wxText .wxl { font-size: 26px; }

html.portrait .content { left: 70px; right: 70px; width: auto; top: 190px; bottom: 90px; gap: 30px; }
html.portrait .title { font-size: 76px; }
html.portrait .text, html.portrait .bullets li { font-size: 42px; }
html.portrait .facts { flex-wrap: wrap; gap: 30px 60px; }
html.portrait .fact .v { font-size: 100px; }

/* Bild-Folien: Bild oben, Text unten */
html.portrait .hero { background: var(--slate); }
html.portrait .hero .bg { bottom: auto; height: 50%; -webkit-mask-image: linear-gradient(180deg, #000 75%, transparent); mask-image: linear-gradient(180deg, #000 75%, transparent); }
html.portrait .hero .shade { background: linear-gradient(180deg, rgba(11,29,46,.35) 0%, transparent 18%); }
html.portrait .hero .content { top: 50%; justify-content: flex-start; padding-top: 20px; }
html.portrait .split .pic { left: 0; right: 0; top: 0; width: auto; height: 46%; bottom: auto; }
html.portrait .split .pic .bg { -webkit-mask-image: linear-gradient(180deg, #000 80%, transparent); mask-image: linear-gradient(180deg, #000 80%, transparent); }
html.portrait .split .content { left: 70px; width: auto; top: 46%; justify-content: flex-start; padding-top: 30px; }
html.portrait .split .title { font-size: 76px; }

/* QR-Folien: Text oben, QR-Karte unten mittig */
html.portrait .qr .content, html.portrait .wifi .content { width: auto; bottom: 760px; justify-content: flex-end; }
html.portrait .qrcard { right: auto; left: 50%; top: auto; bottom: 90px; transform: translateX(-50%); }

/* Warnung: Symbol oben, Text darunter */
html.portrait .warning .bigicon { right: auto; left: 50%; top: 210px; transform: translateX(-50%); width: 360px; height: 360px; }
html.portrait .warning .content { top: 640px; justify-content: flex-start; }

/* Wetter: alles untereinander, Stunden 3x2 */
html.portrait .weather .content { width: auto; top: 200px; gap: 46px; }
html.portrait .wnow { flex-wrap: wrap; gap: 30px 50px; }
html.portrait .wnow .ico { width: 200px; height: 200px; }
html.portrait .wnow .temp { font-size: 170px; }
html.portrait .wnow .side { margin-left: 0; width: 100%; flex-direction: row; }
html.portrait .pill { flex: 1; min-width: 0; }
html.portrait .hours { grid-template-columns: repeat(3, 1fr); }

/* Webcam: Kamerabild oben (volle Breite), Text darunter */
html.portrait .webcam .bg.cam { bottom: auto; height: 980px; background-position: center; }
html.portrait .webcam:not(.contain)::after { top: 0; bottom: auto; height: 980px; background: linear-gradient(0deg, var(--night) 0%, transparent 35%); }
html.portrait .webcam .camcap, html.portrait .webcam.contain .camcap { left: 70px; right: 70px; top: 1000px; bottom: auto; transform: none; max-width: none; }
html.portrait .webcam .camcap .title { font-size: 72px; }
html.portrait .webcam.contain .bg.cam { background-position: center top; background-size: contain; height: 980px; }
html.portrait .camqr, html.portrait .webcam.contain .camqr { left: auto; right: 70px; bottom: 70px; }

/* Handy-Slides ohne Foto */
html.portrait .textonly .content { left: 80px; right: 80px; }
html.portrait .textonly .title { font-size: 84px; }

/* Ticker im Hochformat etwas kleiner */
html.portrait #tickerTrack { font-size: 32px; }

/* ================= Handy: Bedienung ================= */
html.handy, html.handy body { cursor: auto; }
html.handy #stage { touch-action: pan-y; }
html.handy body { overscroll-behavior: none; }
.qrcard[data-href], .camqr[data-href] { cursor: pointer; }
.qrcard .tap { font-size: 30px; font-weight: 700; color: var(--teal); margin-top: 10px; }
#stage.paused::after {
  content: '❚❚  Pausiert – antippen zum Fortsetzen'; position: absolute; left: 50%; top: 150px; transform: translateX(-50%); z-index: 12;
  font-size: 30px; font-weight: 700; padding: 14px 30px; border-radius: 40px; background: rgba(11,29,46,.85); border: 2px solid var(--gold); white-space: nowrap;
}
#hint { position: absolute; left: 50%; bottom: 160px; transform: translateX(-50%); z-index: 12; font-size: 30px; padding: 14px 30px; border-radius: 40px; background: rgba(11,29,46,.88); border: 2px solid var(--teal); white-space: nowrap; }
#hint[hidden] { display: none; }

/* Hochformat: Textblock im freien Bereich senkrecht und waagerecht zentrieren
   (Aufzaehlungen als Block mittig, Zeilen linksbuendig - liest sich besser) */
html.portrait .hero .content, html.portrait .split .content, html.portrait .warning .content,
html.portrait .qr .content, html.portrait .wifi .content, html.portrait .fewo .content, html.portrait .weather .content {
  justify-content: center; align-items: center; text-align: center; padding-top: 0;
}
html.portrait .hero .content { top: 50%; }
html.portrait .split .content { top: 46%; }
html.portrait .content .bullets { align-self: center; text-align: left; max-width: 100%; }
html.portrait .facts { justify-content: center; }
html.portrait .fewo .tag { align-self: center; }
html.portrait .wifi .cred { justify-content: center; text-align: left; }
html.portrait .wnow { justify-content: center; text-align: left; }
html.portrait .hours { width: 100%; }
/* Webcam: Bildunterschrift im Bereich zwischen Kamerabild und QR-Code zentriert */
html.portrait .webcam .camcap, html.portrait .webcam.contain .camcap { top: 980px; bottom: 380px; justify-content: center; align-items: center; text-align: center; }
html.portrait .webcam .camcap .live { justify-content: center; }
/* Hochformat QR-Folien: Text und QR-Karte als eine Gruppe gemeinsam mittig */
html.portrait .slide.qr, html.portrait .slide.wifi { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 56px; padding: 190px 70px 90px; }
html.portrait .slide.qr .content, html.portrait .slide.wifi .content { position: static; width: 100%; flex: none; }
html.portrait .slide.qr .qrcard, html.portrait .slide.wifi .qrcard { position: static; transform: none; flex: none; }
/* Handy: Link-Knopf statt QR-Code */
.linkbtn {
  position: absolute; right: 130px; top: 50%; transform: translateY(-50%); z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 640px;
  padding: 40px 60px; border-radius: 28px; background: var(--gold); color: var(--night);
  font-size: 50px; font-weight: 700; text-align: center; cursor: pointer;
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
}
.linkbtn span { font-size: 32px; font-weight: 400; opacity: .8; word-break: break-all; }
.linkbtn:active { transform: translateY(-50%) scale(.97); }
html.portrait .slide.qr .linkbtn, html.portrait .slide.wifi .linkbtn { position: static; transform: none; width: 100%; max-width: none; }
html.portrait .slide.qr .linkbtn:active { transform: scale(.97); }
.linkbtn.cam { top: auto; bottom: 60px; right: 70px; transform: none; font-size: 38px; padding: 26px 40px; }
.linkbtn.cam:active { transform: scale(.97); }
html.portrait .webcam .camcap, html.portrait .webcam.contain .camcap { bottom: 240px; }

/* Bild ganz zeigen (Admin: "Plakat, Tafel"): nichts abschneiden, Rand mit unscharfer Kopie fuellen */
.pic .bg.blur { filter: blur(38px) brightness(.5) saturate(1.2); transform: scale(1.18); }
.pic .bg.fit { background-size: contain; background-repeat: no-repeat; background-position: center; inset: 40px; }
.split.ganz .pic { overflow: hidden; }
.split.ganz .pic .bg { -webkit-mask-image: none; mask-image: none; }
.split.ganz .pic::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, transparent 80%, var(--slate)); }
html.portrait .split.ganz .pic::after { background: linear-gradient(180deg, transparent 82%, var(--slate)); }
html.portrait .pic .bg.fit { inset: 30px 40px; }
/* Uebergang zum Text nur ueber dem unscharfen Hintergrund, das ganze Bild bleibt vollstaendig sichtbar */
.split.ganz .pic::after { z-index: 1; }
.split.ganz .pic .bg.fit { z-index: 2; }
