/*
==================================================
TOP RESULT CROWN LOTTO 4D
==================================================
*/

:root {
    --top-result-height: 52px;
}

/*
Membuat header utama berada di bawah bar jam.
*/
.site-header {
    top: var(--top-result-height) !important;
}

/*
==================================================
BAR JAM DAN LATEST RESULT
==================================================
*/

.top-result-bar {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    height: var(--top-result-height);
    display: flex;
    align-items: stretch;
    overflow: hidden;
    color: #ffffff;
    background:
        linear-gradient(
            90deg,
            #470000 0%,
            #2b0000 45%,
            #160000 100%
        );
    border-bottom: 1px solid rgba(255, 54, 54, 0.55);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.45);
}

/*
Bagian jam sebelah kiri.
*/
.top-result-clock {
    width: 180px;
    min-width: 180px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 5px 10px;
    border-right: 1px solid rgba(255, 62, 62, 0.38);
    background:
        linear-gradient(
            135deg,
            rgba(255, 0, 0, 0.18),
            rgba(255, 0, 0, 0.02)
        );
}

.top-clock-icon {
    color: #ff3737;
    font-size: 19px;
    line-height: 1;
    text-shadow:
        0 0 10px rgba(255, 0, 0, 0.9);
}

.top-clock-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
}

#topSiteClock {
    color: #ff6b6b;
    font-size: 16px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.3px;
}

#topSiteDate {
    margin-top: 4px;
    color: #ffb0b0;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

/*
Bagian Latest Result sebelah kanan.
*/
.top-latest-result {
    min-width: 0;
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 5px 18px;
}

.top-latest-label {
    min-height: 35px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 6px 13px;
    border-radius: 5px;
    color: #ffffff;
    background:
        linear-gradient(
            135deg,
            #e80000,
            #ff3939
        );
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
    box-shadow:
        0 0 14px rgba(255, 0, 0, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.top-latest-arrow {
    flex-shrink: 0;
    color: #ffd400;
    font-size: 25px;
    font-weight: 900;
    line-height: 1;
    animation:
        top-arrow-animation
        0.8s
        ease-in-out
        infinite;
}

@keyframes top-arrow-animation {
    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(6px);
    }
}

/*
Tempat empat bola hasil.
*/
.top-result-balls {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    gap: 8px;
}

/*
Desain setiap bola angka.
*/
.top-result-ball {
    position: relative;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    color: #ffffff;
    background:
        radial-gradient(
            circle at 30% 25%,
            #ffaaaa 0%,
            #f32121 35%,
            #b60000 68%,
            #5d0000 100%
        );
    font-size: 15px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    box-shadow:
        inset 0 5px 8px rgba(255, 255, 255, 0.2),
        inset 0 -5px 9px rgba(0, 0, 0, 0.5),
        0 0 13px rgba(255, 0, 0, 0.55);
}

/*
Efek kilauan pada bola.
*/
.top-result-ball::before {
    content: "";
    position: absolute;
    top: 5px;
    left: 8px;
    width: 8px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    transform: rotate(-25deg);
}

/*
==================================================
RESULT PLATFORM DAN DRAW IN
==================================================
*/

.result-platform-strip {
    width: 100%;
    min-height: 58px;
    display: flex;
    align-items: stretch;
    overflow: hidden;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 52, 52, 0.42);
    background:
        linear-gradient(
            90deg,
            rgba(58, 0, 0, 0.97),
            rgba(17, 0, 0, 0.98)
        );
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

/*
Teks RESULT PLATFORM sebelah kiri.
*/
.result-platform-title {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    padding: 10px 18px;
    color: #ffffff;
    font-size: 19px;
    font-weight: 900;
    letter-spacing: 0.4px;
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.8);
}

/*
Kotak countdown sebelah kanan.
*/
.top-draw-countdown {
    width: 245px;
    min-width: 245px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 15px;
    border-left: 1px solid rgba(255, 49, 49, 0.5);
    background:
        linear-gradient(
            135deg,
            rgba(122, 0, 0, 0.8),
            rgba(32, 0, 0, 0.96)
        );
}

.top-draw-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #ffd400;
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.top-draw-dot {
    width: 13px;
    height: 13px;
    display: inline-block;
    flex-shrink: 0;
    border-radius: 50%;
    background: #ffd400;
    box-shadow:
        0 0 9px rgba(255, 212, 0, 0.7);
}

#topDrawCountdown {
    color: #ffffff;
    font-size: 16px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-shadow:
        0 0 10px rgba(255, 0, 0, 0.9);
}

/*
==================================================
TAMPILAN HP
==================================================
*/

@media screen and (max-width: 600px) {
    :root {
        --top-result-height: 48px;
    }

    .top-result-clock {
        width: 116px;
        min-width: 116px;
        gap: 4px;
        padding: 4px;
    }

    .top-clock-icon {
        display: none;
    }

    #topSiteClock {
        font-size: 14px;
    }

    #topSiteDate {
        margin-top: 3px;
        font-size: 8px;
    }

    .top-latest-result {
        gap: 5px;
        padding: 4px 6px;
    }

    .top-latest-label {
        min-height: 29px;
        padding: 4px 7px;
        font-size: 9px;
    }

    .top-latest-arrow {
        display: none;
    }

    .top-result-balls {
        gap: 3px;
    }

    .top-result-ball {
        width: 26px;
        height: 26px;
        border-width: 1px;
        font-size: 11px;
    }

    .result-platform-strip {
        min-height: 52px;
    }

    .result-platform-title {
        padding: 8px;
        font-size: 14px;
    }

    .top-draw-countdown {
        width: 176px;
        min-width: 176px;
        gap: 6px;
        padding: 6px 8px;
    }

    .top-draw-label {
        font-size: 11px;
    }

    .top-draw-dot {
        width: 11px;
        height: 11px;
    }

    #topDrawCountdown {
        font-size: 13px;
    }
}

@media screen and (max-width: 380px) {
    .top-result-clock {
        width: 102px;
        min-width: 102px;
    }

    #topSiteClock {
        font-size: 13px;
    }

    #topSiteDate {
        font-size: 7px;
    }

    .top-latest-label {
        width: 48px;
        min-width: 48px;
        padding: 3px;
        font-size: 8px;
        line-height: 1.05;
        text-align: center;
        white-space: normal;
    }

    .top-result-ball {
        width: 23px;
        height: 23px;
        font-size: 10px;
    }

    .result-platform-title {
        font-size: 12px;
    }

    .top-draw-countdown {
        width: 158px;
        min-width: 158px;
        gap: 4px;
        padding: 5px;
    }

    .top-draw-label {
        font-size: 9px;
    }

    #topDrawCountdown {
        font-size: 11px;
    }
}
/* =========================================
   TEMA BIRU CROWN LOTTO 4D
========================================= */

/* Bar jam dan Latest Result */
.top-result-bar {
    border-bottom-color: rgba(39, 133, 255, 0.60);

    background:
        linear-gradient(
            90deg,
            #06245c 0%,
            #041a44 45%,
            #020d25 100%
        );

    box-shadow:
        0 5px 20px rgba(0, 0, 0, 0.45),
        0 0 18px rgba(0, 102, 255, 0.18);
}

/* Kotak jam */
.top-result-clock {
    border-right-color: rgba(54, 146, 255, 0.45);

    background:
        linear-gradient(
            135deg,
            rgba(0, 119, 255, 0.25),
            rgba(0, 55, 130, 0.08)
        );
}

/* Ikon jam */
.top-clock-icon {
    color: #3d9cff;

    text-shadow:
        0 0 10px rgba(0, 119, 255, 0.95);
}

/* Angka jam */
#topSiteClock {
    color: #62b0ff;
}

/* Tulisan tanggal */
#topSiteDate {
    color: #b6dcff;
}

/* Kotak Latest Result */
.top-latest-label {
    background:
        linear-gradient(
            135deg,
            #0069d9,
            #2d9cff
        );

    box-shadow:
        0 0 14px rgba(0, 119, 255, 0.50),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

/* Bola hasil */
.top-result-ball {
    background:
        radial-gradient(
            circle at 30% 25%,
            #bce2ff 0%,
            #258fff 35%,
            #0060c7 68%,
            #002b68 100%
        );

    box-shadow:
        inset 0 5px 8px rgba(255, 255, 255, 0.22),
        inset 0 -5px 9px rgba(0, 0, 0, 0.50),
        0 0 13px rgba(0, 119, 255, 0.65);
}

/* Result Platform */
.result-platform-strip {
    border-bottom-color: rgba(53, 144, 255, 0.48);

    background:
        linear-gradient(
            90deg,
            rgba(4, 45, 107, 0.98),
            rgba(1, 17, 47, 0.98)
        );

    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.28),
        0 0 15px rgba(0, 102, 255, 0.15);
}

/* Kotak Draw In */
.top-draw-countdown {
    border-left-color: rgba(55, 149, 255, 0.55);

    background:
        linear-gradient(
            135deg,
            rgba(0, 91, 194, 0.88),
            rgba(2, 27, 68, 0.98)
        );
}

/* Cahaya angka countdown */
#topDrawCountdown {
    text-shadow:
        0 0 10px rgba(0, 119, 255, 0.95);
}
/* ==================================================
   ANIMASI ANGKA LATEST RESULT
================================================== */

/*
Mempersiapkan bola agar animasi lebih halus.
*/
.top-result-ball {
    transform-style: preserve-3d;
    backface-visibility: hidden;
    will-change: transform, filter;
}

/*
Digunakan ketika angka sedang berputar.
*/
.top-result-ball.is-rolling {
    animation:
        latest-result-roll
        0.22s
        linear
        infinite;

    filter:
        brightness(1.25)
        drop-shadow(
            0 0 7px rgba(52, 159, 255, 0.95)
        );
}

/*
Gerakan angka naik, turun, dan berputar.
*/
@keyframes latest-result-roll {
    0% {
        transform:
            translateY(-4px)
            rotateX(0deg)
            scale(0.94);
    }

    25% {
        transform:
            translateY(1px)
            rotateX(90deg)
            scale(1);
    }

    50% {
        transform:
            translateY(4px)
            rotateX(180deg)
            scale(1.08);
    }

    75% {
        transform:
            translateY(1px)
            rotateX(270deg)
            scale(1);
    }

    100% {
        transform:
            translateY(-4px)
            rotateX(360deg)
            scale(0.94);
    }
}

/*
Animasi ketika bola berhenti pada hasil akhir.
*/
.top-result-ball.is-result-settled {
    animation:
        latest-result-settle
        0.65s
        cubic-bezier(
            0.18,
            0.89,
            0.32,
            1.35
        );
}

/*
Bola membesar sedikit saat angka akhir muncul.
*/
@keyframes latest-result-settle {
    0% {
        transform:
            scale(0.75)
            rotateX(180deg);

        filter: brightness(1.8);
    }

    55% {
        transform:
            scale(1.25)
            rotateX(360deg);

        filter: brightness(1.45);
    }

    75% {
        transform:
            scale(0.94)
            rotateX(360deg);
    }

    100% {
        transform:
            scale(1)
            rotateX(360deg);

        filter: brightness(1);
    }
}

/*
Cahaya lembut setelah semua angka selesai.
*/
.top-result-balls.result-animation-finished {
    animation:
        latest-result-group-glow
        1.2s
        ease-in-out;
}

@keyframes latest-result-group-glow {
    0%,
    100% {
        filter: none;
    }

    50% {
        filter:
            drop-shadow(
                0 0 14px rgba(55, 158, 255, 0.95)
            );
    }
}

/*
Menghormati pengaturan pengguna yang mematikan animasi.
*/
@media (prefers-reduced-motion: reduce) {
    .top-result-ball.is-rolling,
    .top-result-ball.is-result-settled,
    .top-result-balls.result-animation-finished {
        animation: none;
    }
}

/* LOGO RESPONSIVE CROWNLOTTO4D */
@media screen and (max-width: 1024px) {
    .site-logo-image { max-width: 320px; }
}
@media screen and (max-width: 600px) {
    .site-logo-image { max-width: 240px; }
}
@media screen and (max-width: 400px) {
    .site-logo-image { max-width: 200px; }
}

/* PREMIUM HEADER */
.header-inner {
    min-height: 110px;
    backdrop-filter: blur(6px);
}
.site-header {
    background: linear-gradient(90deg, #020617, #0f172a, #020617);
    border-bottom: 1px solid rgba(255,215,0,0.3);
}
