/* CSS khusus untuk halaman Beranda */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px 20px;
}

/* Heading */
h2 {
    color: #ffd700;
    margin: 30px 0 20px;
    text-align: center;
    position: relative;
    font-size: 24px;
}

h2:after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: #ffd700;
}

/* Result list grid */
.result-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

/* Result card styling */
.result-card {
    border-radius: 10px;
    background: rgba(196, 151, 86, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

/* Logo row - perbaikan untuk bentuk petak dan posisi tengah */
.loto-row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    padding: 8px 0;
    width: 100%;
}

.loto-img {
    display: block;
    width: 80px;
    height: 80px;
    object-fit: contain;
    background-color: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Countdown */
.countdown {
    font-weight: bold;
    color: #ffd700;
    background: rgba(0,0,0,0.2);
    padding: 6px 10px;
    border-radius: 5px;
    margin-top: 10px;
    margin-bottom: 8px;
}

/* Pasaran name & time */
.pasaran {
    font-weight: bold;
    color: #ffd700;
    font-size: 18px;
    margin: 5px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tanggal {
    color: #ffd79a;
    font-size: 14px;
    margin-bottom: 15px;
}

/* Numbers panel */
.numbers-panel {
    background-color: #201505;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
}

/* Prize titles - KHUSUS INDEX */
.home-prize-title {
    text-align: center;
    margin: 5px 0;
    font-size: 14px;
    font-weight: bold;
}

.home-prize-title.prize-1 {
    color: #ffd700;
}

.home-prize-title.prize-2 {
    color: #c0c0c0;
}

.home-prize-title.prize-3 {
    color: #cd7f32;
}

/* Number display containers */
/* PERBAIKAN: Extra results section (prize 2 & 3) */
.extra-results {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top;
    overflow: hidden;
}

/* Mobile - kontrol dengan JavaScript (SPECIFICITY TINGGI) */
@media (max-width: 768px) {
    /* FORCE HIDE extra-results di mobile */
    .result-list .result-card .extra-results {
        max-height: 0px !important;
        opacity: 0 !important;
        visibility: hidden !important;
        margin-top: 0px !important;
        margin-bottom: 0px !important;
        padding-top: 0px !important;
        padding-bottom: 0px !important;
        border: none !important;
        transform: scaleY(0) !important;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
        overflow: hidden !important;
        height: 0 !important;
    }
    
    /* FORCE SHOW ketika ada class show-extra */
    .result-list .result-card.show-extra .extra-results {
        max-height: 500px !important;
        opacity: 1 !important;
        visibility: visible !important;
        margin-top: 15px !important;
        margin-bottom: 10px !important;
        padding-top: 15px !important;
        padding-bottom: 10px !important;
        border-top: 1px dashed #3e2a0e !important;
        transform: scaleY(1) !important;
        height: auto !important;
    }
    
    /* FORCE SHOW button toggle di mobile */
    .result-list .result-card .btn-mobile-toggle {
        display: block !important;
        width: 100% !important;
        padding: 12px 15px !important;
        margin-top: 15px !important;
        margin-bottom: 5px !important;
        background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%) !important;
        color: #201505 !important;
        border: 1px solid #ffd700 !important;
        border-radius: 6px !important;
        font-size: 14px !important;
        font-weight: 600 !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        text-align: center !important;
    }
    
    .result-list .result-card .btn-mobile-toggle:hover,
    .result-list .result-card .btn-mobile-toggle:focus {
        background: linear-gradient(135deg, #ffed4e 0%, #ffd700 100%) !important;
        transform: translateY(-1px) !important;
    }
    
    .result-list .result-card .btn-mobile-toggle:active {
        transform: translateY(0) !important;
    }
}

/* Desktop - selalu tampil */
@media (min-width: 769px) {
    .result-list .result-card .extra-results {
        max-height: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        margin-top: 15px !important;
        padding-top: 15px !important;
        border-top: 1px dashed #3e2a0e !important;
        transform: scaleY(1) !important;
        height: auto !important;
    }
    
    .result-list .result-card .btn-mobile-toggle {
        display: none !important;
    }
}

/* Button styling */
.btn-mobile-toggle,
.btn-history {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    text-align: center;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.btn-result,
.btn-mobile-toggle {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #201505;
    border: 1px solid #ffd700;
    font-size: 14px;
    font-weight: 600;
}

.btn-history {
    background-color: #5e4a2e;
    color: #ffd700;
    text-decoration: none;
}

.btn-result:hover,
.btn-mobile-toggle:hover {
    background: linear-gradient(135deg, #ffed4e 0%, #ffd700 100%);
    transform: translateY(-1px);
}

.btn-history:hover {
    background-color: #ffd700;
    color: #201505;
}

/* Digit styling untuk bola emas */
.digit-gold {
    display: inline-flex; /* Ubah dari inline-block ke inline-flex */
    align-items: center; /* Center vertikal */
    justify-content: center; /* Center horizontal */
    width: 32px;
    height: 32px;
    text-align: center;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #201505;
    border-radius: 50%;
    margin: 0 2px;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    line-height: 1; /* Reset line-height */
    vertical-align: middle; /* Alignment dengan element sekitar */
}

/* Digit images */
.digit-img {
    width: 30px;
    height: 40px;
    margin: 0 1px;
}

/* Styles for modal open state */
body.modal-open {
  overflow: hidden;
}

@media (max-width: 414px) {
    .digit-img {
        width: 24px;
        height: 32px;
    }
    
    .digit-gold {
        display: inline-flex; /* Pastikan konsisten di mobile */
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        line-height: 1; /* Reset line-height */
        font-size: 14px;
        vertical-align: middle;
    }
    
    .home-prize-title {
        font-size: 12px;
    }
}

/* Perbaikan container nomor untuk alignment yang lebih baik */
.nomor-img {
    text-align: center;
    margin: 5px 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px; /* Spacing konsisten antar digit */
}