:root {
    --violet: #5b3e96;
    --violet-light: #a48ce0;
    --violet-dark: #2a1a4a;
    --violet-night: #150c28;
    --ivoire: #f7f4fb;
    --pill-bg: rgba(15, 8, 30, 0.55);
    --pill-bg-active: rgba(99, 66, 168, 0.92);
    --card-border: rgba(255, 255, 255, 0.14);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--violet-night);
    color: var(--ivoire);
    font-family: 'Lato', sans-serif;
}

/* ─── Persistent background ─── */

#kiosk-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    background-color: var(--violet-night);
    background-image: linear-gradient(160deg, var(--violet-dark) 0%, var(--violet-night) 100%);
}

/* Dims the persistent background only while the diaporama is showing (toggled in kiosk.js). */
#kiosk-bg.kiosk-bg--dimmed::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(20, 10, 40, 0.55);
}

/* ─── Blackout: covers everything (background included) — used during the prayer itself,
   nothing at all should be visible on screen. ─── */

#kiosk-blackout {
    position: fixed;
    inset: 0;
    z-index: 2;
    background: #000;
    display: none;
}

/* ─── Shell ─── */

#kiosk-shell {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    padding: 3.5vh 3.5vw;
    gap: 2vh;
}

#kiosk-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 6vh;
}

#kiosk-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 0;
    overflow: hidden;
}

#kiosk-bottom {
    display: flex;
    justify-content: center;
}

#kiosk-footer {
    text-align: center;
    font-size: 1.8vh;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(247, 244, 251, 0.5);
    min-height: 3vh;
}

/* ─── Top: mosque bar (horaires state) ─── */

.kiosk-mosque-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.kiosk-mosque-name {
    font-family: 'Cormorant Garant', serif;
    font-size: 4vh;
    font-weight: 700;
    color: var(--ivoire);
}

/* ─── Top: compact pills (other states) ─── */

.kiosk-pill {
    background: var(--pill-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 999px;
    padding: 1.4vh 2.4vw;
    font-size: 2.8vh;
    font-weight: 700;
    color: var(--ivoire);
    font-variant-numeric: tabular-nums;
}

.kiosk-pill--countdown {
    background: var(--pill-bg-active);
}

/* ─── Top: admin-configurable title, fixed-size box between the countdown and the clock —
   long text scrolls smoothly in an infinite loop instead of resizing the box ─── */

.kiosk-title-pill {
    width: 50vw;
    max-width: 50vw;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pill-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 999px;
    padding: 1.4vh 2.4vw;
    font-size: 2.8vh;
    font-weight: 700;
    color: var(--ivoire);
    overflow: hidden;
    white-space: nowrap;
}

.kiosk-title-track {
    display: inline-flex;
    white-space: nowrap;
}

.kiosk-title-pill--marquee {
    justify-content: flex-start;
}

.kiosk-title-pill--marquee .kiosk-title-track {
    animation-name: kiosk-title-scroll;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.kiosk-title-track span {
    padding-right: 6vw;
}

@keyframes kiosk-title-scroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

/* ─── Center: horaires clock block ─── */
/* One unified bar (Chourouk | divider | clock | divider | Jumua) with the countdown
   banner grid-aligned under the clock segment only, so everything stays symmetric
   whether or not the Jumua segment has content (non-Fridays keep its slot, hidden). */

.kiosk-info-grid {
    display: grid;
    grid-template-columns: minmax(14vw, auto) 1px auto 1px minmax(14vw, auto);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    border-radius: 24px;
    overflow: hidden;
}

.kiosk-info-segment {
    grid-row: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8vh;
    padding: 2.4vh 2.4vw;
    background: rgba(20, 10, 40, 0.6);
}

.kiosk-info-segment span {
    font-size: 2.1vh;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(247, 244, 251, 0.6);
}

.kiosk-info-segment strong {
    font-family: 'Cormorant Garant', serif;
    font-size: 6vh;
    font-weight: 700;
    color: var(--ivoire);
    font-variant-numeric: tabular-nums;
}

.kiosk-info-divider {
    grid-row: 1;
    background: rgba(255, 255, 255, 0.18);
}

.kiosk-info-segment--main {
    background: var(--pill-bg-active);
    padding: 3vh 6vw;
}

.kiosk-clockbox-time {
    font-family: 'Cormorant Garant', serif;
    font-size: 11vh;
    font-weight: 700;
    line-height: 1;
    color: var(--ivoire);
    font-variant-numeric: tabular-nums;
}

.kiosk-clockbox-date {
    margin-top: 1.2vh;
    font-size: 2.4vh;
    color: rgba(247, 244, 251, 0.8);
}

.kiosk-countdown-banner {
    grid-column: 3;
    grid-row: 2;
    margin-top: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2vw;
    background: rgba(10, 5, 20, 0.7);
    border-radius: 0 0 999px 999px;
    padding: 1.8vh 3.2vw;
    font-size: 3.4vh;
    font-weight: 700;
    color: var(--ivoire);
}

/* ─── Center: hadith / invocation ─── */

.kiosk-hadith {
    max-width: 92vw;
    height: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3vh;
}

.kiosk-hadith-text {
    flex: 1;
    width: 100%;
    min-height: 0;
    font-family: 'Amiri', 'Cormorant Garant', serif;
    direction: rtl;
    font-size: 6vh;
    line-height: 1.4;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 3px 18px rgba(0, 0, 0, 0.75);
}

.kiosk-hadith-source {
    font-size: 2.6vh;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--violet-light);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

/* ─── Center: diaporama — Swiper carousel, center image big, sides small ─── */

.kiosk-swiper {
    width: 100%;
    height: 100%;
}

.kiosk-swiper .swiper-wrapper {
    align-items: center;
}

.kiosk-swiper .swiper-slide {
    height: 68%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: rgba(255, 255, 255, 0.04);
    border-radius: 14px;
    transition: height 0.5s ease, box-shadow 0.5s ease;
}

.kiosk-swiper .swiper-slide-active {
    height: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* ─── Center: focus (pre-adhan / iqama-wait) & salah ─── */

.kiosk-focus-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--pill-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 32px;
    padding: 4vh 6vw;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.kiosk-adhan-blink {
    font-family: 'Amiri', serif;
    font-size: 4.5vh;
    font-weight: 700;
    color: var(--violet-light);
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7);
    animation: kiosk-adhan-blink 1.1s ease-in-out infinite;
}

@keyframes kiosk-adhan-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.2;
    }
}

.kiosk-focus-label,
.kiosk-salah-fr {
    font-size: 2.6vh;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(247, 244, 251, 0.75);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.kiosk-focus-ar,
.kiosk-salah-ar {
    font-family: 'Amiri', serif;
    font-size: 11vh;
    color: #ffffff;
    line-height: 1;
    margin: 2vh 0;
    text-shadow: 0 3px 18px rgba(0, 0, 0, 0.75);
}

.kiosk-focus-fr {
    font-size: 3.2vh;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(247, 244, 251, 0.85);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.kiosk-focus-timer {
    margin-top: 5vh;
    font-family: 'Cormorant Garant', serif;
    font-size: 17vh;
    font-weight: 700;
    line-height: 1;
    color: var(--ivoire);
    font-variant-numeric: tabular-nums;
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
}

.kiosk-focus-timer.gold {
    color: var(--violet-light);
}

.kiosk-salah-note {
    margin-top: 2vh;
    font-size: 2.4vh;
    color: rgba(247, 244, 251, 0.6);
    font-style: italic;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

/* ─── Bottom: big prayer grid (horaires state) ─── */

.kiosk-prayers-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.6vw;
    width: 100%;
    max-width: 1900px;
}

.kiosk-prayer-card {
    background: var(--pill-bg);
    border-radius: 16px;
    padding: 2.8vh 0.6vw 3.4vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.4vh;
}

.kiosk-prayer-card.active {
    background: var(--pill-bg-active);
}

.kiosk-prayer-fr {
    font-size: 3.6vh;
    font-weight: 700;
    color: rgba(247, 244, 251, 0.9);
}

.kiosk-prayer-times {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8vh;
}

.kiosk-prayer-time {
    font-family: 'Cormorant Garant', serif;
    font-size: 7.4vh;
    font-weight: 700;
    line-height: 1;
    color: var(--ivoire);
    font-variant-numeric: tabular-nums;
}

/* ─── Bottom: compact strip (other states) ─── */

.kiosk-strip {
    display: flex;
    gap: 0.6vw;
    justify-content: center;
    width: 100%;
}

.kiosk-strip-pill {
    background: var(--pill-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 16px;
    padding: 1.6vh 0;
    width: 15vw;
    text-align: center;
    font-family: 'Cormorant Garant', serif;
    font-size: 3.4vh;
    font-weight: 700;
    color: var(--ivoire);
    font-variant-numeric: tabular-nums;
}

.kiosk-strip-pill.active {
    background: var(--pill-bg-active);
}