


.spensada-container {
    max-width: 480px;
    margin: 0 auto;
    font-family: 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif;
    padding: 24px 12px;   
    box-sizing: border-box;
}


.countdown-area {
    text-align: center;
}

.sp-countdown-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 0 20px;
    flex-wrap: nowrap;   
}

.cd-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #1e293b;
    border-radius: 12px;
    padding: clamp(8px, 2.5vw, 14px) clamp(10px, 3vw, 18px);
    min-width: clamp(52px, 15vw, 68px);  
    box-shadow: 0 4px 16px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.06);
}

.cd-unit b {
    font-size: clamp(1.4rem, 5vw, 2rem);  
    font-weight: 800;
    color: #f1f5f9;
    line-height: 1;
    letter-spacing: -1px;
    font-variant-numeric: tabular-nums;
}

.cd-unit small {
    font-size: clamp(0.5rem, 1.5vw, 0.6rem);
    color: #7FDBFF;
    margin-top: 4px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 600;
}

.cd-sep {
    font-size: clamp(1.4rem, 5vw, 2rem);  
    font-weight: 800;
    color: #111;
    line-height: 1;
    margin-bottom: 16px;
    opacity: 0.7;
    flex-shrink: 0;
}


.sp-open-banner {
    padding: 14px 20px;
    background: none;                /* transparan (latar putih) */
    border: none;
    border-radius: 14px;
    color: #d32f2f;                  /* teks merah elegan */
    font-size: clamp(1rem, 4vw, 1.2rem);
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: none;
    margin-bottom: 20px;
    
    /* Animasi soft pulse dengan white glow */
    animation: softWhitePulse 3.8s infinite ease-in-out;
    
    /* base minimal white glow */
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.3);
}

/* Keyframes: white glow yang bernapas lembut di sekitar teks merah */
@keyframes softWhitePulse {
    0% {
        text-shadow: 
            0 0 0px rgba(255, 255, 255, 0),
            0 0 2px rgba(255, 255, 255, 0.15),
            0 0 5px rgba(255, 255, 255, 0.1);
        color: #d32f2f;
    }
    40% {
        text-shadow: 
            0 0 2px rgba(255, 255, 255, 0.5),
            0 0 6px rgba(255, 255, 255, 0.65),
            0 0 12px rgba(255, 255, 255, 0.5),
            0 0 20px rgba(255, 255, 255, 0.3);
        color: #e53935;             /* sedikit lebih terang */
    }
    70% {
        text-shadow: 
            0 0 3px rgba(255, 255, 255, 0.7),
            0 0 9px rgba(255, 255, 255, 0.85),
            0 0 18px rgba(255, 255, 255, 0.65),
            0 0 30px rgba(255, 255, 255, 0.4);
        color: #ef4444;
    }
    100% {
        text-shadow: 
            0 0 0px rgba(255, 255, 255, 0),
            0 0 2px rgba(255, 255, 255, 0.15),
            0 0 5px rgba(255, 255, 255, 0.1);
        color: #d32f2f;
    }
}


.nisn-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    animation: fadeInUp 0.5s ease;
}

.sp-form-hint {
    margin: 0 0 4px;
    font-size: 0.88rem;
    color: #111 !important;
    letter-spacing: 0.3px;
    text-align: center;
    padding: 0 8px;
}


.sp-nisn-boxes {
    display: flex;
    gap: clamp(2px, 0.8vw, 6px);   
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    padding: 4px 0 2px;
    width: 100%;
}

.sp-digit-box {
    
    width:  clamp(22px, 7.2vw, 40px);
    height: clamp(38px, 10.5vw, 54px);
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    color: #1e293b;
    font-size: clamp(0.88rem, 3vw, 1.35rem);
    font-weight: 800;
    text-align: center;
    outline: none;
    caret-color: transparent;
    transition: border-color .18s, box-shadow .18s, transform .12s, background .18s;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    -webkit-appearance: none;
    appearance: none;
    flex-shrink: 0;
}


.sp-digit-box[data-idx="5"] {
    margin-left: clamp(4px, 1.5vw, 12px);
}

.sp-digit-box:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124,58,237,.18), 0 2px 8px rgba(0,0,0,.1);
    transform: translateY(-2px) scale(1.06);
    background: #faf5ff;
    z-index: 1;
    position: relative;
}

.sp-digit-filled {
    border-color: #2563eb;
    background: #f0f4ff;
    color: #1d4ed8;
}

.sp-digit-filled:focus {
    border-color: #7c3aed;
    background: #faf5ff;
    color: #7c3aed;
}


#check-nisn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 15px clamp(28px, 8vw, 44px);
    border-radius: 10px;
    border: none;
    background: linear-gradient(0deg, #111111 0%, #001f3f 100%);
    color: #fff;
    font-size: clamp(0.95rem, 3.5vw, 1rem);
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.5px;
    box-shadow: 0 6px 24px rgba(124,58,237,0.4);
    transition: transform 0.15s, box-shadow 0.15s;
    min-height: 52px;       
    touch-action: manipulation;
}

#check-nisn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(124,58,237,0.5);
}

#check-nisn:active:not(:disabled) { transform: translateY(0); }

#check-nisn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.sp-btn-icon { font-size: 1.1em; }


.sp-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 40px 20px;
    color: #64748b;
    font-size: 0.92rem;
}

.sp-spinner-ring {
    position: relative;
    width: 48px;
    height: 48px;
}

.sp-spinner-ring div {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-radius: 50%;
    animation: sp-ring 1.1s cubic-bezier(0.5,0,0.5,1) infinite;
}

.sp-spinner-ring div:nth-child(1) { border-top-color: #7c3aed; animation-delay: -0.45s; }
.sp-spinner-ring div:nth-child(2) { border-top-color: #2563eb; animation-delay: -0.3s;  }
.sp-spinner-ring div:nth-child(3) { border-top-color: #0891b2; animation-delay: -0.15s; }
.sp-spinner-ring div:nth-child(4) { border-top-color: #7c3aed; }


.sp-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9990;
}

.sp-backdrop.active {
    display: block;
    animation: fadeIn 0.25s ease;
}


.result-card {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9995;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    padding: 16px 12px !important;    
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.result-card.visible {
    display: flex;
    animation: fadeInUp 0.45s cubic-bezier(0.2, 0.9, 0.4, 1.05);
}


#sp-card-snapshot {
    width: 100%;
    max-width: 320px;
    border-radius: 5px !important;
    overflow: hidden;
    background: #ffffff;
    box-shadow:
        0 30px 70px rgba(0,0,0,0.55),
        0 0 0 1px rgba(255,255,255,0.06);
    position: relative;
    flex-shrink: 0;
    padding-top: 50px;
    box-sizing: border-box;
}

.sp-card-accent { display: none; }

.photo-frame {
    position: relative;
    width: 100%;
    overflow: visible;
    background: transparent;
    display: block;
}

.photo-frame img {
    width: 100%;
    height: auto;          
    display: block;
}

.photo-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    border: 2px dashed rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: rgba(255,255,255,0.3);
    margin: 40px auto;
}

.photo-frame-overlay { display: none; }

.card-body {
    position: relative;
    margin-top: -150px;   
    background: transparent;
    padding: 0 18px 18px;
    text-align: center;
    z-index: 2;
}


.student-name {
    font-size: clamp(1.1rem, 4.5vw, 1.1rem) !important;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.25;
    margin-bottom: 4px;
    letter-spacing: -0.2px;
    
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.95), -2px 2px 0 rgba(0, 0, 0, 0.95), 2px -2px 0 rgba(0, 0, 0, 0.95), -2px -2px 0 rgba(0, 0, 0, 0.95), 1px 1px 0 rgba(0, 0, 0, 0.8), -1px 1px 0 rgba(0, 0, 0, 0.8), 0 0 8px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 0, 0, 0.6);
    -webkit-text-stroke: 0.3px rgba(0, 0, 0, 0.5);
    
    
    word-break: break-word; 
    overflow-wrap: break-word;
}

.class-info {
    font-size: clamp(0.72rem, 2.5vw, 0.82rem);
    color: rgba(255,255,255,0.95);
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 10px;
    text-shadow:
        1px  1px 0  rgba(0,0,0,0.9),
        -1px  1px 0  rgba(0,0,0,0.9),
        1px -1px 0  rgba(0,0,0,0.9),
        -1px -1px 0  rgba(0,0,0,0.9),
        0    0   6px rgba(0,0,0,0.8);
}


.status-section { margin: 0 0 6px; }

.status-badge-lulus,
.status-badge-tl {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: clamp(8px, 2.5vw, 11px) clamp(20px, 6vw, 30px);
    border-radius: 50px;
    font-weight: 800;
    font-size: clamp(0.85rem, 3.2vw, 1rem);
    letter-spacing: 2.5px;
    text-transform: uppercase;
}

.status-badge-lulus {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
    box-shadow: 0 4px 20px rgba(16,185,129,0.4);
}

.status-badge-tl {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: #fff;
    box-shadow: 0 4px 20px rgba(220,38,38,0.35);
}

.sp-status-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 900;
    flex-shrink: 0;
}


.achievement-badges { display: none !important; }
.badge              { display: none !important; }



.card-footer {
    position: relative;
    background: #2563eb;           
    border-top: 7px solid #1e3a8a !important; 
    padding: 9px 20px 11px !important;
    color: #ffffff;
    font-size: clamp(0.7rem, 2.4vw, 0.78rem);
    font-weight: 800;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0,0,0,0.25);
    
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
}


#sp-card-snapshot.has-bg {
    background-size: cover;
    background-position: center top; 
}


#sp-card-snapshot.has-bg .card-body {
    background: transparent; 
}

#sp-card-snapshot.has-bg .card-footer {
    background: #2563eb;
    border-top-color: #1e3a8a;
}


#sp-card-snapshot.glowing {
    animation: cardGlow 2.5s ease-in-out infinite alternate;
}


.sp-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    z-index: 9996;
    position: relative;
    width: 100%;
    max-width: 320px;
    padding: 0 4px;
    box-sizing: border-box;
}

.sp-card-actions button {
    
    padding: clamp(10px, 3vw, 13px) clamp(14px, 4.5vw, 22px);
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.08);
    color: #e2e8f0;
    font-weight: 600;
    font-size: clamp(0.78rem, 2.8vw, 0.85rem);
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
    backdrop-filter: blur(4px);
    letter-spacing: 0.3px;
    white-space: nowrap;
    min-height: 44px;          
    touch-action: manipulation;
    flex: 1 1 auto;            
    min-width: 100px;
    text-align: center;
}

.sp-card-actions button:hover {
    background: rgba(255,255,255,0.16);
    transform: translateY(-1px);
}

.sp-card-actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.sp-btn-download {
    background: linear-gradient(135deg, rgba(124,58,237,0.7), rgba(37,99,235,0.7)) !important;
    border-color: rgba(124,58,237,0.5) !important;
    box-shadow: 0 4px 16px rgba(124,58,237,0.35);
}

.sp-btn-download:hover {
    box-shadow: 0 6px 20px rgba(124,58,237,0.5) !important;
}


.error-card {
    width: 100%;
    max-width: 300px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(239,68,68,0.4);
    border-radius: 18px;
    padding: 24px 20px;
    color: #fca5a5;
    text-align: center;
    backdrop-filter: blur(8px);
}

.error-card .err-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(239,68,68,0.15);
    border: 2px solid rgba(239,68,68,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 900;
    color: #ef4444;
    margin: 0 auto 14px;
}

.error-card p {
    margin: 0 0 18px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #cbd5e1;
}

.sp-btn-retry {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.08);
    color: #e2e8f0;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.15s;
    min-height: 44px;
    touch-action: manipulation;
}

.sp-btn-retry:hover {
    background: rgba(255,255,255,0.15);
}


.sp-lottery-overlay {
    position: fixed;
    inset: 0;
    z-index: 9997;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;             
}

.sp-lottery-box {
    background: linear-gradient(160deg, #0b0f1a 0%, #131929 100%);
    border: 1px solid rgba(124,58,237,.45);
    border-radius: 24px;
    
    padding: clamp(24px, 6vw, 36px) clamp(20px, 7vw, 44px) clamp(20px, 5vw, 32px);
    text-align: center;
    width: 100%;
    max-width: 320px;
    box-sizing: border-box;
    box-shadow:
        0 0 0 1px rgba(255,255,255,.04),
        0 32px 80px rgba(0,0,0,.75),
        0 0 60px rgba(124,58,237,.18);
    animation: sp-lot-appear .35s cubic-bezier(.22,.9,.4,1.05);
}

@keyframes sp-lot-appear {
    from { opacity: 0; transform: scale(.88) translateY(20px); }
    to   { opacity: 1; transform: scale(1)  translateY(0); }
}

.sp-lot-eyebrow {
    font-size: .6rem;
    color: #475569;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.sp-lot-name {
    font-size: clamp(0.9rem, 3.5vw, 1.05rem);
    font-weight: 700;
    color: #e2e8f0;
    letter-spacing: .3px;
    min-height: 26px;
    margin-bottom: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-lot-sublabel {
    font-size: .6rem;
    color: #475569;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    margin-bottom: 12px;
    min-height: 14px;
    transition: color .2s;
}

.sp-lot-drum {
    background: #060a12;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 14px;
    padding: clamp(14px, 4vw, 22px) 12px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-lot-drum::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px, transparent 3px,
        rgba(0,0,0,.09) 3px, rgba(0,0,0,.09) 4px
    );
    pointer-events: none;
    z-index: 1;
}

.sp-lot-drum::after {
    content: '';
    position: absolute;
    left: 12px; right: 12px;
    top: 50%; transform: translateY(-50%);
    height: 2px;
    background: rgba(124,58,237,.25);
    border-radius: 1px;
    pointer-events: none;
    z-index: 2;
}

.sp-lot-value {
    font-size: clamp(1rem, 4.5vw, 1.55rem);
    font-weight: 900;
    letter-spacing: 3px;
    text-transform: uppercase;
    position: relative;
    z-index: 3;
    transition: color .06s;
    line-height: 1;
}

.sp-lot-track {
    background: #1e293b;
    border-radius: 4px;
    height: 4px;
    overflow: hidden;
}

.sp-lot-fill {
    height: 100%;
    background: linear-gradient(90deg, #7c3aed, #2563eb, #06b6d4);
    width: 0%;
    border-radius: 4px;
}

.sp-lot-locked .sp-lot-drum {
    animation: sp-lot-pulse 0.5s ease 2;
}

@keyframes sp-lot-pulse {
    0%, 100% { box-shadow: none; }
    50%       { box-shadow: 0 0 0 3px rgba(124,58,237,.5), 0 0 30px rgba(124,58,237,.3); }
}


.hidden { display: none !important; }
body.sp-modal-open { overflow: hidden; }


@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(28px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes sp-ring {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes gradientSlide {
    0%   { background-position: 0%   50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0%   50%; }
}

@keyframes cardGlow {
    0%   {
        box-shadow:
            0 30px 70px rgba(0,0,0,0.55),
            0 0 0 2px rgba(16,185,129,0.25);
    }
    100% {
        box-shadow:
            0 30px 70px rgba(0,0,0,0.55),
            0 0 0 3px rgba(16,185,129,0.75),
            0 0 50px rgba(16,185,129,0.2);
    }
}


@media (max-width: 767px) {
    .spensada-container {
        padding: 16px 8px;
    }

    
    .sp-digit-box {
        width:  clamp(20px, 6.8vw, 28px);
        height: clamp(34px, 10vw, 42px);
        border-radius: 8px;
        font-size: 0.85rem;
        border-width: 1.5px;
    }

    .sp-digit-box[data-idx="5"] {
        margin-left: 4px;
    }

    .sp-nisn-boxes {
        gap: 2px;
    }

    
    .cd-unit {
        padding: 7px 8px;
        border-radius: 10px;
    }

    .cd-sep {
        margin-bottom: 12px;
        opacity: 0.6;
    }

    
    .sp-card-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .sp-card-actions button {
        min-width: unset;
        flex: none;
    }
}


@media (max-height: 500px) and (orientation: landscape) {
    .result-card {
        padding: 10px 12px;
        gap: 10px;
    }

    .photo-frame {
        
        margin: 0; 
    }

    .card-body {
        padding: 0 14px 12px;
        margin-top: -60px; 
    }

    .sp-lottery-box {
        padding: 16px 24px;
    }

    .sp-lot-drum {
        min-height: 52px;
    }
}