:root {
    --bg-dark: #120429;
    --bg-gradient-top: #2c135c;
    --bg-gradient-bottom: #0a021a;
    --card-purple: #8e24aa;
    --card-border: #ba68c8;
    --btn-green: #76ff03;
    --accent-yellow: #ffcc00;
    --text-white: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--bg-dark);
    background: linear-gradient(180deg, var(--bg-gradient-top) 0%, var(--bg-gradient-bottom) 100%);
    color: white;
    height: 100vh;
    overflow: hidden; 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background 0.5s ease;
}

/* --- BACKGROUND --- */
body.bg-step1 {
    background-image: url('https://i.imgur.com/iAZephm.jpeg'); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}
body.bg-step1::before {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

/* --- HEADER --- */
.top-bar {
    position: absolute;
    top: 0; left: 0; width: 100%;
    padding: 10px 15px;
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(44, 19, 92, 0.9);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    z-index: 100;
    border-bottom: 2px solid rgba(255,255,255,0.1);
}

.server-status { font-size: 0.75rem; line-height: 1.2; }
.status-dot {
    height: 8px; width: 8px; background-color: #00ff00;
    border-radius: 50%; display: inline-block; margin-right: 4px;
    box-shadow: 0 0 5px #00ff00;
}
.online-text { color: #00ff00; font-weight: 800; }
.user-count { color: #ccc; font-size: 0.7rem; }
.game-logo-small img { height: 35px; filter: drop-shadow(0 2px 2px rgba(0,0,0,0.5)); }

/* --- CONTAINER --- */
/* Perbaikan agar konten tidak menabrak atas */
.container {
    width: 100%; 
    max-width: 420px; 
    height: 100%;
    position: relative; 
    display: flex; 
    flex-direction: column;
    justify-content: center; 
    padding-top: 80px; /* Tambahkan ini agar lebih turun */
    padding-bottom: 50px;
}

.step-content {
    display: none; 
    width: 90%; 
    margin: 20px auto; /* Tambahkan margin agar ada jarak */
    background: rgba(30, 10, 60, 0.95);
    border: 2px solid var(--card-border);
    border-radius: 20px; 
    padding: 20px; /* Kurangi sedikit padding agar lebih ramping */
    text-align: center; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    position: relative; 
    z-index: 50;
    max-height: 80vh;
    overflow-y: auto;
}

/* Sembunyikan scrollbar */
.step-content::-webkit-scrollbar { display: none; }

.step-content.active { display: block; }

/* --- POPUP CENTER FIXED --- */
#step-loading, #step3 {
    position: fixed; 
    top: 50%; left: 50%;
    transform: translate(-50%, -50%); 
    width: 90%; max-width: 350px;
    z-index: 2000; 
    margin: 0;
    background: rgba(20, 5, 40, 0.98); 
    border: 2px solid var(--btn-green);
}

#step-loading.active, #step3.active {
    display: block;
    animation: fadeInCentered 0.4s ease forwards;
}

@keyframes fadeInStandard { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes fadeInCentered { 
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); } 
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); } 
}

/* --- CUSTOM ANIMASI GENERATING --- */
.gen-box {
    position: relative;
    width: 100px; height: 100px;
    margin: 0 auto 25px;
    display: flex; align-items: center; justify-content: center;
}

.gen-ring-1 {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    border: 4px solid transparent;
    border-top: 4px solid #ffcc00;
    border-right: 4px solid #ffcc00;
    border-radius: 50%;
    animation: spinRight 2s linear infinite;
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.3);
}

.gen-ring-2 {
    position: absolute; top: 15px; left: 15px;
    width: 70px; height: 70px;
    border: 3px solid transparent;
    border-bottom: 3px solid #76ff03;
    border-left: 3px solid #76ff03;
    border-radius: 50%;
    animation: spinLeft 1.5s linear infinite;
}

@keyframes spinRight { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes spinLeft { 0% { transform: rotate(0deg); } 100% { transform: rotate(-360deg); } }

/* --- ELEMENT GAYA --- */
.profile-pic-container {
    width: 80px; height: 80px; margin: 0 auto 15px;
    border-radius: 15px; border: 3px solid var(--accent-yellow);
    overflow: hidden; box-shadow: 0 0 15px rgba(255, 204, 0, 0.2); background: #fff;
}
.profile-pic-container img { width: 100%; height: 100%; object-fit: cover; }

h2 { font-family: 'Fredoka One', cursive; margin-bottom: 15px; font-size: 1.5rem; color: #fff; text-shadow: 0 2px 0 #000; }

.input-group input {
    width: 100%; padding: 12px; border-radius: 12px; border: none;
    background: #f0f0f0; font-family: 'Nunito', sans-serif;
    font-weight: 800; font-size: 1rem; text-align: center;
    margin-bottom: 15px; outline: none; color: #333;
}

.device-selector { display: flex; justify-content: center; gap: 10px; margin-bottom: 20px; }
.device-btn {
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.3);
    border-radius: 10px; padding: 8px 15px; cursor: pointer; transition: all 0.2s;
}
.device-btn.selected { background: rgba(118, 255, 3, 0.2); border-color: var(--btn-green); }

.cta-btn {
    background: linear-gradient(to bottom, #76ff03, #4bda00);
    color: #0f3d00; font-family: 'Fredoka One', cursive; font-size: 1.2rem;
    border: none; padding: 12px 0; width: 100%; border-radius: 10px;
    cursor: pointer; box-shadow: 0 4px 0 #3db600, 0 5px 10px rgba(0,0,0,0.3);
    text-shadow: 0 1px 0 rgba(255,255,255,0.4); text-decoration: none; display: block;
    text-align: center;
}
.cta-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #3db600; }

/* Animasi tambahan agar tombol lebih menarik perhatian */
.pulse-anim {
    animation: pulseButton 2s infinite;
}
@keyframes pulseButton {
    0% { transform: scale(1); box-shadow: 0 4px 0 #3db600, 0 0 0 0 rgba(118, 255, 3, 0.7); }
    70% { transform: scale(1.03); box-shadow: 0 4px 0 #3db600, 0 0 0 10px rgba(118, 255, 3, 0); }
    100% { transform: scale(1); box-shadow: 0 4px 0 #3db600, 0 0 0 0 rgba(118, 255, 3, 0); }
}

/* --- STEP 2: SHOP --- */
#step2.step-content {
    width: 100%; max-width: 100%; height: 100%;
    background: transparent; border: none; padding: 0; box-shadow: none;
    display: none; flex-direction: column; margin-top: 0;
    position: relative; z-index: 10;
}
#step2.active { display: flex; }

.shop-header {
    background: rgba(0,0,0,0.4); padding: 8px; text-align: center;
    font-family: 'Fredoka One', cursive; font-size: 0.85rem; color: #fff;
    letter-spacing: 0.5px; margin-top: 60px; margin-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.shop-scroll-area { flex: 1; overflow-y: auto; padding: 0 10px 80px 10px; }
.shop-scroll-area::-webkit-scrollbar { display: none; }

.banner-slider-container {
    display: flex; overflow-x: auto; gap: 10px;
    padding: 5px 2px 15px 2px; scroll-snap-type: x mandatory; margin-bottom: 5px;
}
.banner-slider-container::-webkit-scrollbar { display: none; }

.banner-card {
    min-width: 90%; background: #3e1b75;
    border: 2px solid var(--card-border);
    border-radius: 12px; display: flex; flex-direction: column;
    scroll-snap-align: center; box-shadow: 0 5px 15px rgba(0,0,0,0.4);
    overflow: hidden; position: relative;
}
.banner-image-wrapper {
    width: 100%; height: 180px; background: #2c135c;
    overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.banner-img-full { width: 100%; height: 100%; object-fit: fill; display: block; }

.banner-btn-full {
    width: 100%; background: var(--btn-green); color: #0f3d00;
    border: none; padding: 10px 0; font-family: 'Fredoka One', cursive;
    font-size: 1.1rem; cursor: pointer; text-transform: uppercase;
    text-shadow: 0 1px 0 rgba(255,255,255,0.4); border-top: 1px solid rgba(255,255,255,0.3);
}
.banner-btn-full:active { background: #64db02; }

.section-title {
    font-family: 'Fredoka One', cursive; text-align: center; font-size: 1.1rem;
    margin: 15px 0 10px 0; color: #fff; text-transform: uppercase;
    letter-spacing: 1px; text-shadow: 0 2px 0 #000;
}
.section-title::before, .section-title::after {
    content: ""; display: inline-block; width: 20px; height: 3px;
    background: rgba(255,255,255,0.2); vertical-align: middle; margin: 0 10px; border-radius: 2px;
}

.shop-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.lucky-grid { grid-template-columns: 1fr 1fr !important; }

.shop-item {
    background: var(--card-purple); border: 2px solid #ce93d8;
    border-radius: 10px; padding: 0; display: flex; flex-direction: column; 
    align-items: center; justify-content: space-between; position: relative;
    box-shadow: 0 4px 0 #4a148c, 0 8px 10px rgba(0,0,0,0.3);
    overflow: hidden; transition: transform 0.1s;
}
.shop-item:active { transform: translateY(3px); box-shadow: 0 1px 0 #4a148c; }

.item-content { padding: 8px; width: 100%; display: flex; flex-direction: column; align-items: center; }
.item-amount {
    font-family: 'Fredoka One', cursive; font-size: 0.9rem;
    color: #fff; margin-bottom: 2px; text-shadow: 0 1px 2px rgba(0,0,0,0.8); z-index: 2;
}
.item-img { 
    width: 75px; height: 75px; margin: 2px 0; object-fit: contain; 
    filter: drop-shadow(0 3px 3px rgba(0,0,0,0.3));
}
.lucky-grid .item-img { width: 110px; height: 110px; filter: drop-shadow(0 5px 5px rgba(0,0,0,0.4)); }

.price-btn {
    background: var(--btn-green); color: #0f3d00; border: none; border-radius: 0;
    padding: 8px 0; width: 100%; font-family: 'Fredoka One', cursive; 
    font-size: 0.85rem; cursor: pointer; border-top: 1px solid rgba(255,255,255,0.4);
}

.badge {
    position: absolute; top: 0; right: 0; background: #ff0055; color: white; 
    font-size: 0.55rem; font-weight: bold; padding: 2px 6px; 
    border-bottom-left-radius: 8px; z-index: 10; box-shadow: -1px 1px 3px rgba(0,0,0,0.3);
}

/* --- LOADING SCREEN TEXT --- */
.console-text {
    font-family: 'Courier New', monospace; font-size: 0.85rem;
    color: var(--accent-yellow); margin-top: 10px; height: 20px;
}

/* --- FOOTER --- */
.footer {
    position: fixed; bottom: 0; left: 0; width: 100%; text-align: center;
    font-size: 0.75rem; font-weight: 700; color: #ffffff; z-index: 999;
    padding: 12px 0; background: rgba(0, 0, 0, 0.85); 
    backdrop-filter: blur(2px); border-top: 1px solid rgba(255,255,255,0.1);
    display: flex; justify-content: center; gap: 15px;
}
.footer a { color: #ffffff; text-decoration: none; opacity: 0.9; }

/* Progress Bar */
.progress-bar-bg {
    background: rgba(0,0,0,0.5); height: 15px; border-radius: 10px;
    overflow: hidden; border: 1px solid rgba(255,255,255,0.3); margin-top: 10px;
}
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, #ffcc00, #ffaa00); width: 0%; }

/* --- ICONS ANIMATION --- */
.success-icon {
    display: none; color: #76ff03; font-size: 4rem; margin: 10px auto;
    animation: bounceIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes bounceIn {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); }
}

.search-anim {
    display: none; font-size: 3.5rem; color: var(--accent-yellow); margin: 0 auto 15px;
    animation: searchingMove 1.2s infinite alternate ease-in-out;
}
@keyframes searchingMove {
    0% { transform: translateX(-20px) rotate(-15deg) scale(1); }
    100% { transform: translateX(20px) rotate(15deg) scale(1.1); }
}

/* =========================================
   COMMENTS SECTION (HANYA DI STEP 1)
   ========================================= */
.comments-section {
    margin-top: 30px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}

.comments-header {
    font-family: 'Fredoka One', cursive;
    color: var(--accent-yellow);
    font-size: 0.9rem;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-item {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.comment-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.comment-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--card-border);
    object-fit: cover;
}

.comment-body {
    flex: 1;
}

.comment-name {
    font-weight: 800;
    color: #fff;
    font-size: 0.85rem;
    margin-bottom: 3px;
}

.comment-time {
    font-weight: 400;
    color: #888;
    font-size: 0.65rem;
    margin-left: 5px;
}

.comment-text {
    color: #ddd;
    font-size: 0.8rem;
    line-height: 1.4;
}

/* =========================================
   LIVE NOTIFICATION (SOCIAL PROOF)
   ========================================= */
.live-noti-container {
    position: fixed;
    bottom: -100px;
    left: 20px;
    background: rgba(30, 10, 60, 0.95);
    border: 1px solid var(--btn-green);
    border-radius: 50px;
    padding: 8px 15px 8px 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.6);
    z-index: 1000;
    transition: bottom 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    max-width: 85%;
}

.live-noti-container.show {
    bottom: 20px;
}

.noti-img {
    width: 35px;
    height: 35px;
    background: var(--btn-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0f3d00;
    font-size: 1.2rem;
}

.noti-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.noti-text {
    color: #fff;
    font-size: 0.8rem;
    line-height: 1.2;
}

.noti-name {
    font-weight: 800;
    color: var(--accent-yellow);
}

.noti-item {
    font-weight: 800;
    color: #76ff03;
}

.noti-time {
    color: #aaa;
    font-size: 0.65rem;
    margin-top: 2px;
}