:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-card: #1a1a1a;
    --accent: #dc2626;
    --accent-light: #ef4444;
    --accent-dark: #991b1b;
    --gold: #d4af37;
    --gold-light: #f4cf47;
    --neon-cyan: #00f7ff;
    --neon-pink: #ff00ff;
    --text-primary: #ffffff;
    --text-secondary: #a3a3a3;
    --text-muted: #737373;
    --border: #2a2a2a;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.font-display { font-family: 'Bebas Neue', sans-serif; }

/* Background */
.bg-with-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('https://images.unsplash.com/photo-1518770660439-4636190af475?w=1920&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: -1;
}
.bg-with-overlay::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(180deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.9) 50%, rgba(0,0,0,0.95) 100%);
}

/* Header & Navbar */
.header {
    background: linear-gradient(180deg, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.8) 100%);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
/* Update logo class untuk mendukung image */
.logo {
    width: 45px; 
    height: 45px;
    background: transparent;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* Fallback untuk text logo */
.logo-text {
    width: 45px; 
    height: 45px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 24px;
    color: white;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
}
.btn-red {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: white;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}
.btn-red:hover { transform: translateY(-2px); box-shadow: 0 6px 25px rgba(220, 38, 38, 0.5); }
.btn-red:disabled { background: #444; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-outline {
    background: transparent;
    color: var(--text-primary);
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    cursor: pointer;
}
.btn-outline:hover { background: rgba(255,255,255,0.1); border-color: var(--text-secondary); }

.navbar { background: rgba(0,0,0,0.6); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.nav-link { color: var(--text-secondary); text-decoration: none; padding: 12px 16px; transition: all 0.3s ease; display: inline-block; }
.nav-link:hover { color: var(--text-primary); }
.nav-link.active { color: var(--accent-light); }

/* Form & Cards */
.input-field {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 18px;
    color: var(--text-primary);
    width: 100%;
    transition: all 0.3s ease;
    font-size: 15px;
}
.input-field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2); }

.card {
    background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

/* User Info */
.info-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-secondary); font-size: 14px; }
.info-value { font-weight: 600; color: var(--text-primary); }
.badge { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: 600; }
.badge-success { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
.badge-error { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

/* Ketupat Visual */
.ketupat-visual { display: flex; align-items: center; gap: 4px; justify-content: center;}
.ketupat-item { width: 28px; height: 28px; transition: all 0.3s ease; }
.ketupat-item.collected { filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.8)); }
.ketupat-item.uncollected { opacity: 0.25; filter: grayscale(100%); }

/* Mystery Box Grid */
.mystery-box-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    perspective: 1000px;
}
@media (max-width: 640px) {
    .mystery-box-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

/* Mystery Box Card */
.mystery-box {
    aspect-ratio: 2.5/3.5;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}
.mystery-box.flipped { transform: rotateY(180deg); }
.mystery-box.disabled { pointer-events: none; opacity: 0.6; }
.mystery-box.selected { transform: rotateY(180deg) scale(1.05); z-index: 20; }

/* Shuffle Animation */
.mystery-box.shuffle-active {
    animation: shufflePulse 0.4s ease-in-out;
    z-index: 10;
}
@keyframes shufflePulse {
    0% { transform: scale(1); z-index: 1; }
    50% { transform: scale(1.15); z-index: 10; box-shadow: 0 0 30px rgba(0, 247, 255, 0.6), 0 0 60px rgba(255, 0, 255, 0.4); }
    100% { transform: scale(1); z-index: 1; }
}

.box-face {
    position: absolute;
    width: 100%; height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid var(--border);
}

/* Front: Sampul Kotak */
.box-front {
    background: #111;
    flex-direction: column;
}
.box-cover-img { width: 100%; height: 100%; object-fit: cover; opacity: 0.7; }
.box-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.8) 100%);
    display: flex; align-items: center; justify-content: center;
}
.box-question-mark { font-family: 'Bebas Neue', sans-serif; font-size: 80px; color: white; text-shadow: 0 0 20px var(--neon-cyan); }

/* Back: Hadiah */
.box-back {
    background: linear-gradient(145deg, #2a1a1a 0%, #1a0a0a 100%);
    transform: rotateY(180deg);
    border-color: var(--accent);
    padding: 10px;
}
.prize-content {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    background: rgba(0,0,0,0.5);
    padding: 10px; border-radius: 8px; width: 100%; height: 100%;
}
.prize-img-small { width: 90px; height: 90px; object-fit: contain; border-radius: 8px; }
.prize-name-small { font-weight: 700; font-size: 15px; text-align: center; color: white; line-height: 1.2; }
.prize-value-small { font-size: 12px; color: var(--gold-light); text-align: center; }

/* Control Buttons */
.control-btn {
    padding: 14px 32px; border-radius: 10px; font-weight: 700; font-size: 15px;
    text-transform: uppercase; letter-spacing: 1px; transition: all 0.3s ease;
    border: none; cursor: pointer;
}
.control-btn.start { background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); color: white; }
.control-btn.stop { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%); color: white; }
.control-btn:disabled { background: #444; cursor: not-allowed; opacity: 0.7; }

/* Modal */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); display: flex; align-items: center; justify-content: center;
    z-index: 1000; opacity: 0; visibility: hidden; transition: all 0.3s ease; padding: 20px;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-content {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px;
    padding: 40px; max-width: 420px; width: 100%; text-align: center;
    transform: scale(0.9); transition: all 0.3s ease;
}
.modal-overlay.active .modal-content { transform: scale(1); }

/* Confetti */
.confetti-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1001; overflow: hidden; }
.confetti { position: absolute; width: 10px; height: 10px; opacity: 0; }
@keyframes confettiFall {
    0% { transform: translateY(-100%) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Misc */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-secondary); }
.progress-bar { height: 8px; background: var(--bg-secondary); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-light)); transition: width 0.5s ease; }

.fade-in { animation: fadeIn 0.5s ease forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }