:root {
    --bg-color: #f4f1ea; /* Soft cream/milktea background */
    --panel-bg: #ffffff;
    --text-dark: #2d3436;
    --shadow: 0 8px 24px rgba(0,0,0,0.08);
    --border-radius: 24px;
}

body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-dark);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    margin: 0;
    padding: 40px 20px;
    background-image: radial-gradient(#d1ccc0 1px, transparent 1px);
    background-size: 20px 20px;
    box-sizing: border-box;
}

.lab-container {
    display: flex;
    gap: 30px;
    max-width: 1000px;
    width: 100%;
}

/* --- PANEL KIRI (Bob & Visual Preview) --- */
.left-panel { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    gap: 20px; 
    position: sticky; 
    top: 40px; 
    height: fit-content; 
}

/* Kotak Dialog Bob */
.bob-box {
    background: var(--panel-bg); border-radius: var(--border-radius); padding: 20px;
    box-shadow: var(--shadow); display: flex; align-items: center; gap: 15px; border: 3px solid #e0e0e0;
}
.bob-face { font-size: 3em; background: var(--bg-color); border-radius: 50%; padding: 10px; line-height: 1; }
.bob-bubble { background: #f1f2f6; padding: 12px 20px; border-radius: 16px; border-bottom-left-radius: 4px; font-weight: 700; font-size: 1.1em; color: #57606f; flex: 1; transition: all 0.3s ease; }

/* Area Preview Mekanik */
.preview-box {
    background: var(--panel-bg); border-radius: var(--border-radius); height: 400px;
    box-shadow: var(--shadow); position: relative; display: flex; justify-content: center; align-items: center; overflow: hidden; border: 3px solid #e0e0e0;
}

#prevc { position: relative; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center;}

/* Auto-Centering Sempurna untuk Gambar Layer */
#caseslot { position: absolute; width: 250px; z-index: 0; left: 50%; transform: translateX(-50%); }
.key { position: absolute; width: 150px; z-index: 1; left: 50%; transform: translateX(-50%); transition: top 0.3s ease; }
.word { position: absolute; z-index: 10; font-weight: 900; font-size: 1.8em; left: 50%; transform: translateX(-50%); transition: top 0.3s ease; text-transform: uppercase; text-align: center; width: 80px;}

/* --- PANEL KANAN (Kontrol, Tab & Keranjang) --- */
.right-panel { flex: 1; display: flex; flex-direction: column; gap: 20px; }

.control-box {
    background: var(--panel-bg); border-radius: var(--border-radius); padding: 30px;
    box-shadow: var(--shadow); border: 3px solid #e0e0e0; display: flex; flex-direction: column; gap: 20px;
}

.tab-buttons { display: flex; gap: 10px; background: #f1f2f6; padding: 8px; border-radius: 20px; }
.tab-btn { flex: 1; padding: 12px; border: none; border-radius: 14px; font-weight: 700; font-size: 1em; cursor: pointer; background: transparent; color: #747d8c; transition: all 0.2s; }
.tab-btn.active { background: white; color: var(--text-dark); box-shadow: 0 4px 10px rgba(0,0,0,0.05); }

h3 { margin: 0 0 15px 0; font-size: 1.2em; color: #2f3542; }

.selector-group { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.slot-btn { width: 50px; height: 50px; border-radius: 15px; border: 2px solid #dfe4ea; background: white; font-weight: 900; font-size: 1.2em; cursor: pointer; transition: 0.2s; }
.slot-btn.active { background: #ffeaa7; border-color: #fdcb6e; transform: scale(1.05); }

.color-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.color-btn { width: 100%; aspect-ratio: 1; border-radius: 12px; border: 2px solid rgba(0,0,0,0.1); cursor: pointer; transition: 0.2s; }
.color-btn:hover { transform: scale(1.1); }
.color-btn.active { border: 3px solid var(--text-dark); transform: scale(1.1); box-shadow: 0 4px 8px rgba(0,0,0,0.2);}

.input-box { width: 100%; padding: 15px; border-radius: 15px; border: 2px solid #dfe4ea; font-size: 1.2em; font-weight: 900; text-align: center; margin-bottom: 20px; box-sizing: border-box; font-family: 'Nunito', sans-serif; text-transform: uppercase; }

/* --- AREA CHECKOUT & KERANJANG --- */
.checkout-box { background: var(--panel-bg); padding: 25px; border-radius: var(--border-radius); border: 3px solid #e0e0e0; box-shadow: var(--shadow); }

.price-display { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.current-price { font-size: 1.5em; font-weight: 900; color: #ff6b81; }
#format { font-family: monospace; font-size: 0.85em; color: #7f8fa6; margin-bottom: 15px; word-break: break-all; background: #f8f9fa; padding: 10px; border-radius: 10px;}

.btn-add { width: 100%; padding: 15px; border: none; border-radius: 15px; background: #eccc68; color: #2d3436; font-size: 1.1em; font-weight: 900; cursor: pointer; transition: 0.2s; margin-bottom: 20px; box-shadow: 0 4px 0px #fbc531; }
.btn-add:active { transform: translateY(4px); box-shadow: none; }

.cart-area { border-top: 2px dashed #ced6e0; padding-top: 20px; margin-top: 10px; }
.cart-list { max-height: 180px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; margin-bottom: 15px; padding-right: 5px; }

/* Custom Scrollbar untuk Keranjang */
.cart-list::-webkit-scrollbar { width: 6px; }
.cart-list::-webkit-scrollbar-track { background: #f1f2f6; border-radius: 10px; }
.cart-list::-webkit-scrollbar-thumb { background: #ced6e0; border-radius: 10px; }

.cart-item { display: flex; justify-content: space-between; background: #f1f2f6; padding: 10px 15px; border-radius: 10px; font-size: 0.9em; font-weight: 700; align-items: center; gap: 10px;}
.cart-item-format { font-family: monospace; color: #57606f; font-size: 0.85em; flex: 1; word-break: break-all;}
.btn-remove { background: #ff4757; color: white; border: none; border-radius: 6px; padding: 5px 10px; font-weight: bold; cursor: pointer; }

.total-price { font-size: 1.3em; font-weight: 900; text-align: right; margin-bottom: 15px; color: #2f3542; }

.btn-wa { width: 100%; padding: 15px; border: none; border-radius: 15px; background: #2ed573; color: white; font-size: 1.2em; font-weight: 900; cursor: pointer; transition: 0.2s; box-shadow: 0 4px 15px rgba(46, 213, 115, 0.4); }
.btn-wa:hover { background: #26ae60; transform: translateY(-2px); }

.hidden { display: none !important; }

/* ==========================================================================
    RESPONSIVE CONFIGURATION (HP & TABLET SCREEN)
    ========================================================================== */
@media (max-width: 768px) {
    body {
        padding: 15px 10px;
    }

    .lab-container {
        flex-direction: column; /* Mengubah susunan menyamping menjadi urutan ke bawah */
        gap: 20px;
    }

    .left-panel {
        position: static; /* Mematikan efek sticky di HP agar tidak melompat berantakan */
        width: 100%;
    }

    

    .control-box {
        padding: 20px;
    }

    .color-grid {
        /* Grid warna otomatis membungkus sempurna sesuai dengan sisa lebar layar HP */
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); 
    }
    
    .bob-box {
        padding: 15px;
    }
    
    .bob-face { font-size: 2.5em; padding: 8px; }
    .bob-bubble { font-size: 1em; padding: 10px 15px; }
}

/* =========================================
   TOMBOL CUSTOM EMOJI/FOTO
   ========================================= */
.btn-image-toggle {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 3px dashed #74b9ff; /* Warna biru soft */
    background: #f1f2f6;
    color: #0984e3; /* Biru lebih gelap untuk teks */
    font-size: 1em;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 20px;
    font-family: 'Nunito', sans-serif;
}

.btn-image-toggle:hover {
    background: #74b9ff;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(116, 185, 255, 0.3);
}

.btn-image-toggle:active {
    transform: translateY(2px);
    box-shadow: none;
}

