* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #000; color: #fff; font-family: 'Segoe UI', Arial, sans-serif; user-select: none; }
#stars { position: fixed; inset: 0; z-index: 0; }

#app {
    position: relative; z-index: 1;
    display: grid;
    grid-template-rows: auto auto 1fr auto auto;
    height: 100vh;
    padding: 8px 16px 6px;
    gap: 5px;
}

/* ── TOP BAR ─────────────────────────────────── */
.topbar { display: flex; align-items: center; justify-content: space-between; }
.online { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: #aaa; min-width: 70px; }
.online .dot { width: 9px; height: 9px; background: #4caf50; border-radius: 50%; box-shadow: 0 0 6px #4caf50; }
.title-area { display: flex; align-items: center; gap: 12px; font-size: clamp(1.4rem,3.2vw,2.4rem); font-weight: 700; white-space: nowrap; }
.title-area img { height: 50px; width: 50px; object-fit: contain; }
.weather { font-size: 1.1rem; color: #ddd; min-width: 70px; text-align: right; }

/* ── BANNER ──────────────────────────────────── */
.next-banner {
    background: linear-gradient(90deg, transparent, rgba(180,130,0,.16) 20%, rgba(200,155,0,.28) 50%, rgba(180,130,0,.16) 80%, transparent);
    border-top: 1px solid rgba(200,155,0,.28); border-bottom: 1px solid rgba(200,155,0,.28);
    border-radius: 8px; padding: 5px 20px;
    display: flex; align-items: center; justify-content: center; gap: 12px;
    font-size: clamp(.9rem,1.8vw,1.35rem); font-weight: 700;
    animation: bannerPulse 3s ease-in-out infinite;
}
@keyframes bannerPulse { 0%,100%{box-shadow:0 0 10px rgba(200,155,0,.1)} 50%{box-shadow:0 0 22px rgba(200,155,0,.25)} }
.nb-label { color: #999; font-weight: 400; font-size: .9em; }
.nb-name  { color: #e8c97a; letter-spacing: 1px; font-size: 1.1em; }
.nb-dot   { color: rgba(255,255,255,.25); }
.nb-in    { color: #888; }
.nb-time  { color: #fff; font-variant-numeric: tabular-nums; font-size: 1.1em; letter-spacing: 1px; }

/* ── STAGE ───────────────────────────────────── */
.stage { position: relative; min-height: 0; overflow: hidden; }

.clock-layer, .news-layer {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}

/* ─── UHR-LAYER ──────────────────────────────── */
.clock-layer {
    z-index: 2;
    transition: top .8s cubic-bezier(0.4,0,0.2,1),
                justify-content .0s,
                transform .8s cubic-bezier(0.4,0,0.2,1);
}

.clock-box {
    background: linear-gradient(160deg,#1a0808,#0d0404);
    border: 1px solid rgba(180,20,20,.45);
    border-radius: 20px;
    box-shadow: 0 0 60px rgba(180,20,20,.22), inset 0 0 30px rgba(0,0,0,.4);
    padding: clamp(18px,3vh,36px) clamp(32px,5vw,72px);
    text-align: center;
    min-width: clamp(280px,55vw,800px);
    transition: padding .8s cubic-bezier(0.4,0,0.2,1),
                min-width .8s cubic-bezier(0.4,0,0.2,1),
                border-radius .8s ease,
                box-shadow .8s ease,
                width .8s cubic-bezier(0.4,0,0.2,1),
                transform .65s cubic-bezier(0.34,1.18,0.64,1);
}

/* Uhr-Elemente */
.ck-row { display: flex; align-items: baseline; justify-content: center; gap: 2px; }
.ck-label {
    display: none; font-size: clamp(.58rem,.9vw,.8rem); font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.8px; color: rgba(255,255,255,.5);
    margin-right: 10px; flex-shrink: 0; align-self: center;
}
.ck-hm {
    font-size: clamp(4.5rem,11vw,10rem); font-weight: 900;
    font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -2px;
    transition: font-size .8s cubic-bezier(0.4,0,0.2,1), letter-spacing .8s ease;
}
.ck-sep {
    font-size: clamp(2.5rem,6vw,5.5rem); color: rgba(255,255,255,.28); margin: 0 2px;
    transition: font-size .8s ease;
    animation: blink 1s step-end infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.12} }
.ck-s {
    font-size: clamp(2.2rem,5.5vw,5rem); font-weight: 700;
    font-variant-numeric: tabular-nums; color: rgba(255,255,255,.5);
    transition: font-size .8s ease, opacity .8s ease;
}
.ck-meta {
    overflow: hidden; max-height: 80px; opacity: 1; margin-top: 10px;
    transition: max-height .8s cubic-bezier(0.4,0,0.2,1), opacity .5s ease, margin-top .8s ease;
}
.ck-date  { font-size: clamp(.9rem,1.8vw,1.4rem); color: rgba(255,255,255,.6); letter-spacing: .5px; }
.ck-hijri { font-size: clamp(.65rem,1.1vw,.95rem); color: rgba(255,255,255,.28); margin-top: 4px; }

/* ── Mini-Uhr (phase-list) ───────────────────── */
.stage.phase-list .clock-layer { justify-content: flex-start; top: 0; }
.stage.phase-list .clock-box {
    padding: 6px 20px;
    min-width: 0; width: 100%;
    border-radius: 0 0 16px 16px;
    border-top: none;
    box-shadow: 0 3px 15px rgba(180,20,20,.12);
}
.stage.phase-list .ck-label { display: inline-block; }
.stage.phase-list .ck-hm    { font-size: clamp(1.4rem,2.6vw,2.2rem); letter-spacing: 0; }
.stage.phase-list .ck-sep   { font-size: clamp(.8rem,1.5vw,1.3rem); }
.stage.phase-list .ck-s     { font-size: clamp(.7rem,1.3vw,1.1rem); opacity: .35; }
.stage.phase-list .ck-meta  { max-height: 0; opacity: 0; margin-top: 0; }

/* ── Übergangs-Phasen (Uhr) ──────────────────── */
.stage.phase-pre-list .clock-box  { transform: translateY(-14px) scale(0.98); }
.stage.phase-post-list .clock-box { transform: translateY(-38px); }

/* ─── NEWS-LAYER ─────────────────────────────── */
.news-layer {
    z-index: 1;
    justify-content: center;
    padding-top: 55px;
    opacity: 0;
    transform: translateY(-35px);
    pointer-events: none;
    transition: opacity .55s ease .08s,
                transform .55s cubic-bezier(0.34,1.18,0.64,1) .08s,
                filter .6s ease;
}
.stage.phase-list .news-layer { opacity: 1; transform: translateY(0); pointer-events: auto; }
.stage.phase-zoom .news-layer {
    opacity: .10; pointer-events: none; filter: blur(2px);
    transition: opacity .5s ease, filter .5s ease, transform .5s ease;
}
.stage.phase-park .news-layer { opacity: 0; transform: translateY(-20px); pointer-events: none; }
.stage.phase-news-exit .news-layer {
    opacity: 0;
    transform: translateY(-45px);
    transition: opacity .38s cubic-bezier(0.4,0,1,1),
                transform .38s cubic-bezier(0.55,0,0.8,1);
    pointer-events: none;
}

/* ── Nachrichten-Box ─────────────────────────── */
.news-box {
    background: linear-gradient(155deg,#0e0718,#060310);
    border: 1px solid rgba(140,70,220,.28);
    border-radius: 20px;
    box-shadow: 0 0 50px rgba(140,70,220,.14), inset 0 0 25px rgba(0,0,0,.4);
    padding: 14px 20px;
    width: clamp(300px,62vw,880px);
    display: flex; flex-direction: column; overflow: hidden;
    overflow-y: auto; scrollbar-width: none;
}
.news-box::-webkit-scrollbar { display: none; }
.news-hdr {
    font-size: clamp(.58rem,.95vw,.84rem); text-transform: uppercase;
    letter-spacing: 2.5px; font-weight: 700; color: #b07ae8;
    padding-bottom: 7px; margin-bottom: 10px;
    border-bottom: 1px solid rgba(140,70,220,.2);
    display: flex; align-items: center; justify-content: center; gap: 7px; flex-shrink: 0;
}

/* Ticker */
.ticker-wrap  { overflow: hidden; margin-bottom: 8px; flex-shrink: 0; }
.ticker-inner { display: inline-block; white-space: nowrap; animation: tickerScroll 22s linear infinite; }
@keyframes tickerScroll { 0%{transform:translateX(100%)} 100%{transform:translateX(-100%)} }
.ticker-text  { font-size: clamp(.6rem,.9vw,.8rem); color: #c8a84b; font-weight: 600; }

/* Nachrichten-Abschnittsüberschrift */
.news-section-hdr {
    font-size: clamp(.48rem,.76vw,.66rem); text-transform: uppercase;
    letter-spacing: 2.2px; font-weight: 700;
    color: rgba(255,255,255,.22);
    margin: 4px 0 5px; flex-shrink: 0;
}

/* Nachrichten-Karten */
.news-list { display: flex; flex-direction: column; gap: 6px; }
.news-card {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px; padding: 8px 12px;
    cursor: default;
    transition: background .4s ease, border-color .4s ease, transform .4s ease, box-shadow .4s ease;
}
.news-card.highlight  { background: rgba(140,70,220,.1); border-color: rgba(140,70,220,.28); }
.news-card.selecting  {
    background: rgba(140,70,220,.28) !important;
    border-color: rgba(200,120,255,.85) !important;
    box-shadow: 0 0 32px rgba(160,80,255,.55), 0 0 8px rgba(200,140,255,.3) !important;
    transform: scale(1.05);
    z-index: 2;
}
.nc-tag  { font-size: clamp(.48rem,.78vw,.66rem); color: #b07ae8; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.nc-text { font-size: clamp(.62rem,1vw,.85rem); color: rgba(255,255,255,.65); margin-top: 3px; line-height: 1.4; }

/* Feed-Slides */
.feed-slides-wrap { flex-shrink: 0; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.06); }
.slides-box { position: relative; width: 100%; height: clamp(95px,14vh,145px); }
.feed-slide {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    opacity: 0; transform: translateY(8px);
    transition: opacity .6s, transform .6s;
    pointer-events: none; text-align: center;
}
.feed-slide.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.fs-tag       { font-size: clamp(.55rem,.85vw,.78rem); color: rgba(255,255,255,.32); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 5px; }
.fs-time      { font-size: clamp(2.6rem,5.5vw,5rem); font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; }
.fs-name      { font-size: clamp(.85rem,1.5vw,1.25rem); font-weight: 700; color: #e8c97a; margin-top: 7px; }
.fs-countdown { font-size: clamp(.7rem,1.1vw,.95rem); color: rgba(232,201,122,.6); margin-top: 4px; font-variant-numeric: tabular-nums; }
.fs-sub       { font-size: clamp(.6rem,.9vw,.82rem); color: rgba(255,255,255,.28); margin-top: 4px; }
.feed-dots    { display: flex; justify-content: center; gap: 6px; margin-top: 7px; }
.feed-dot     { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.15); transition: background .3s; }
.feed-dot.on  { background: #e8c97a; box-shadow: 0 0 5px #e8c97a; }

/* ── Zoom-Overlay ────────────────────────────── */
#zoom-overlay {
    position: absolute; inset: 0; z-index: 10;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
    background: rgba(0,0,0,.45);
    opacity: 0;
    transition: opacity .5s ease;
}
#zoom-overlay.visible { opacity: 1; pointer-events: auto; }
#zoom-overlay.shrink  { opacity: 0; transition: opacity .5s ease; }

#zoom-card {
    background: linear-gradient(135deg,rgba(120,50,210,.42),rgba(50,5,100,.38));
    border: 1.5px solid rgba(200,120,255,.75);
    border-radius: 10px;
    padding: clamp(20px,3.5vh,44px) clamp(28px,5vw,64px);
    width: clamp(300px,65vw,900px);
    box-shadow: 0 0 100px rgba(140,70,220,.55), 0 0 40px rgba(180,100,255,.3), inset 0 0 30px rgba(0,0,0,.35);
    text-align: center;
    transform: scale(0.25) translateY(80px);
    transform-origin: center center;
    transition: transform .65s cubic-bezier(0.34,1.45,0.64,1), border-radius .5s ease;
}
#zoom-overlay.visible #zoom-card { transform: scale(1) translateY(0); border-radius: 22px; }
#zoom-overlay.shrink  #zoom-card {
    transform: scale(0.25) translateY(80px); border-radius: 10px;
    transition: transform .5s cubic-bezier(0.4,0,0.6,1), border-radius .4s ease;
}
#zoom-card .zc-tag  { font-size: clamp(.6rem,1vw,.9rem); color: #d0a0ff; text-transform: uppercase; letter-spacing: 2px; font-weight: 700; margin-bottom: 14px; }
#zoom-card .zc-text { font-size: clamp(1.15rem,2.3vw,2rem); font-weight: 700; color: #fff; line-height: 1.45; }

/* Parkende Karte */
#parked-card { display: none; }

/* ── Flyer-Overlay ───────────────────────────── */
#flyer-overlay {
    position: absolute; inset: 0; z-index: 11;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: rgba(0,0,0,.82);
    opacity: 0; pointer-events: none;
    transition: opacity .75s ease;
    padding: 20px;
}
#flyer-overlay.visible { opacity: 1; pointer-events: auto; }
#flyer-img {
    max-width: 90%; max-height: 78vh;
    object-fit: contain; border-radius: 14px;
    box-shadow: 0 0 80px rgba(0,0,0,.7), 0 0 30px rgba(140,70,220,.15);
}
#flyer-caption {
    margin-top: 14px;
    font-size: clamp(.85rem,1.5vw,1.15rem);
    color: rgba(255,255,255,.65);
    letter-spacing: .5px; text-align: center;
}

/* ── Gebet-Kacheln ───────────────────────────── */
.prayer-row { display: grid; grid-template-columns: repeat(6,1fr); gap: 4px; }
.p-tile { text-align: center; padding: 6px 4px 8px; border-radius: 14px; }
.p-tile.active { background: linear-gradient(160deg,#8b1515,#5a0a0a); box-shadow: 0 0 22px rgba(180,20,20,.45); animation: tileGlow 2s ease-in-out infinite; }
@keyframes tileGlow { 0%,100%{box-shadow:0 0 22px rgba(180,20,20,.45)} 50%{box-shadow:0 0 36px rgba(220,30,30,.6)} }
.p-name { font-size: clamp(.9rem,1.9vw,1.45rem); font-weight: 700; }
.p-de   { font-size: clamp(.45rem,.8vw,.68rem); color: rgba(255,255,255,.42); margin-top: 1px; }
.p-ar   { font-size: clamp(.45rem,.8vw,.68rem); color: rgba(255,255,255,.38); direction: rtl; }
.p-time { font-size: clamp(1.5rem,3.8vw,3rem); font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 4px; }

/* ── Footer ──────────────────────────────────── */
.footer { text-align: center; font-size: clamp(.58rem,1vw,.85rem); color: #3d3d3d; border-top: 1px solid rgba(255,255,255,.05); padding: 2px 0 0; }
.err    { grid-column: 1/-1; text-align: center; color: #555; font-size: .85rem; padding: 20px; }
