/* GLOBAL RESET & DISTRESSED FONTS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #efe9df;
    background-image: 
        repeating-linear-gradient(45deg, rgba(74, 59, 50, 0.015) 0, rgba(74, 59, 50, 0.015) 1px, transparent 0, transparent 50%),
        repeating-linear-gradient(-45deg, rgba(74, 59, 50, 0.015) 0, rgba(74, 59, 50, 0.015) 1px, transparent 0, transparent 50%);
    background-size: 10px 10px;
    color: #0a0a0a; 
    font-family: 'Nunito', sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
    position: relative;
    cursor: auto;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Lora', serif;
    color: #0a0a0a;
}

p, li, input, textarea, button {
    text-shadow: 0.5px 0.5px 0px rgba(0,0,0,0.4), -0.5px -0.5px 0px rgba(0,0,0,0.1);
    font-weight: 500;
}

/* =========================================
   MAIN CONTAINER (Retro Scanned Page)
   ========================================= */
.container {
    max-width: 800px; 
    margin: 60px auto; 
    padding: 50px 30px;
    background-color: #fffdf9;
    position: relative;
    border: 8px double #0a0a0a; 
    border-radius: 2px; 
    box-shadow: 15px 15px 0px rgba(10, 10, 10, 0.05);
    background-image: repeating-linear-gradient(45deg, rgba(74, 59, 50, 0.02) 0, rgba(74, 59, 50, 0.02) 1px, transparent 0, transparent 50%);
    background-size: 8px 8px;
}

.tape, .pin, .firefly, .blob, .ambient-light { display: none; }

/* =========================================
   PRINTED HEADERS
   ========================================= */
.printed-header {
    font-size: 3rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 5px;
    color: #d24f3b;
    text-shadow: 1px 1px 0px rgba(210, 79, 59, 0.3), -1px -1px 0px rgba(210, 79, 59, 0.1);
}

.printed-header::after { content: "."; color: #0a0a0a; }
.header-subtitle { color: #5c5043; font-size: 0.9rem; margin-bottom: 20px; font-weight: 700;}
.printed-header.header-red { color: #d24f3b; }
.printed-header.header-blue { color: #2d3e50; } 

.paper-divider {
    height: 3px;
    margin: 50px 0;
    border-top: 1px dashed rgba(10, 10, 10, 0.4);
    border-bottom: 1px dashed rgba(10, 10, 10, 0.2);
    position: relative;
}

.paper-divider::before {
    content: "✂️"; 
    position: absolute;
    top: -12px;
    left: 5px;
    font-size: 0.9rem;
    opacity: 0.5;
}

/* =========================================
   MASTER FIX: KUNCI KANVAS KOTAK 800x800
   ========================================= */
.meet-artist-canvas {
    width: 800px !important;
    height: 800px !important; 
    margin: 0 auto !important; 
    display: flex;
    justify-content: center;
    align-items: flex-end;
    position: relative;
}

.center-avatar {
    height: 700px !important; 
    max-height: 90%;
    margin-bottom: 0 !important;
    z-index: 10;
    object-fit: contain;
    filter: drop-shadow(5px 5px 0px rgba(0,0,0,0.1)); 
    pointer-events: none; 
}

/* KUNCI KOORDINAT SEMUA ELEMEN AGAR LEBIH MERAPAT KE AVATAR */
.floating-item { position: absolute; z-index: 5; }

.top-center { top: 0px !important; left: 50% !important; transform: translateX(-50%) !important; z-index: 30; } 
.top-left { top: 130px !important; left: 5px !important; } 
.retro-music-player { top: 120px !important; right: 20px !important; bottom: auto !important; left: auto !important; } 
.top-right { top: 300px !important; right: 110px !important; } 
.bottom-left { bottom: 180px !important; left: 30px !important; } 
.fun-facts-box, .bottom-left-last { bottom: 10px !important; left: 40px !important; z-index: 15; } 
.bottom-right { bottom: 20px !important; right: 50px !important; } 

/* =========================================
   GAYA KOTAK SCRAPBOOK 
   ========================================= */
/* Judul Retro Label */
.page-title {
    background-color: #fffdf9; 
    color: #d24f3b; 
    font-family: 'Lora', serif;
    font-size: 2rem; 
    font-weight: 900;
    padding: 12px 35px;
    border: 3px dashed #d24f3b; 
    box-shadow: 0 0 0 5px #fffdf9, 0 0 0 9px #0a0a0a, 12px 12px 0px rgba(0,0,0,0.2); 
    letter-spacing: 4px;
    white-space: nowrap;
}

.page-title::after {
    content: '';
    position: absolute;
    top: -18px; left: 50%;
    transform: translateX(-50%);
    width: 110px; height: 28px;
    background-color: rgba(220, 210, 190, 0.95); 
    border: 1px solid rgba(0,0,0,0.3);
    box-shadow: 2px 2px 4px rgba(0,0,0,0.15);
    z-index: 31;
}

/* ID Card */
.id-card {
    border: 6px double #0a0a0a; 
    background-color: #3b1414;
    border-radius: 12px;
    width: 360px;
    overflow: hidden;
    box-shadow: 6px 6px 0px rgba(0,0,0,0.15);
    transform: rotate(-3deg); 
    transition: transform 0.3s ease;
}

.id-card:hover { transform: rotate(0deg) scale(1.02); z-index: 20; }
.id-card-inner { display: flex; flex-direction: column; }
.id-body-split { display: flex; width: 100%; }
.id-school {
    font-family: 'Lora', serif; font-weight: 800; color: #fff; text-align: center;
    padding: 12px 10px; font-size: 1.1rem; line-height: 1.2; background-color: #3b1414;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8); border-bottom: 3px solid #0a0a0a; 
}
.id-left { width: 140px; padding: 12px 10px; display: flex; flex-direction: column; align-items: center; background-color: #2b0c0c; }
.id-photo { width: 100px; height: 125px; border: 2px solid #0a0a0a; background-color: #541f22; overflow: hidden; margin-bottom: 8px; }
.id-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.id-no { font-family: 'Nunito', sans-serif; font-size: 0.55rem; color: #fff; text-align: center; }
.id-right { flex: 1; display: flex; flex-direction: column; }
.id-info-box {
    flex: 1; background: linear-gradient(to bottom, #f4f0f0, #d1c5c5); padding: 15px 15px 25px 15px;
    display: flex; flex-direction: column; gap: 12px; border-left: 3px solid #0a0a0a;
}
.info-line { display: flex; align-items: flex-end; border-bottom: 2px solid #0a0a0a; padding-bottom: 2px; color: #0a0a0a; }
.info-line .label { font-family: 'Lora', serif; font-size: 0.85rem; font-weight: 800; margin-right: 10px; }
.info-line .value { font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 0.9rem; transform: translateY(2px); }

/* Floppy Disk */
.floppy-disk {
    background-color: #2b3138; border: 3px solid #0a0a0a; border-radius: 4px;
    width: 170px; height: 180px; padding-top: 15px; border-bottom-right-radius: 14px; 
    box-shadow: 6px 6px 0px rgba(0,0,0,0.15), inset 4px 4px 0px rgba(255,255,255,0.1), inset -4px -4px 0px rgba(0,0,0,0.2);     
    transform: rotate(-5deg); transition: transform 0.3s;
}
.floppy-disk:hover { transform: rotate(0deg) scale(1.05); z-index: 20; }
.floppy-disk::before { content: '▼'; position: absolute; top: 5px; left: 12px; color: #15181c; font-size: 0.6rem; }
.floppy-disk::after { content: ''; position: absolute; bottom: 12px; right: 12px; width: 10px; height: 10px; background-color: #efe9df; border: 2px solid #0a0a0a; border-radius: 1px; }
.floppy-label {
    width: 135px; height: 110px; margin: 0 auto; background-color: #fffdf9; border: 2px solid #0a0a0a; border-radius: 3px; position: relative; display: flex; flex-direction: column; align-items: center; overflow: hidden;
    background-image: repeating-linear-gradient(transparent, transparent 18px, rgba(125, 162, 169, 0.4) 18px, rgba(125, 162, 169, 0.4) 20px);
}
.floppy-label-header { width: 100%; height: 15px; background-color: #d24f3b; border-bottom: 2px solid #0a0a0a; }
.floppy-shutter { position: absolute; bottom: -4px; left: 25px; width: 60px; height: 40px; background-color: #d1d5db; border: 3px solid #0a0a0a; border-radius: 2px 2px 0 0; display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; }
.shutter-door { width: 12px; height: 22px; background-color: #15181c; border: 2px solid #0a0a0a; border-radius: 2px; }
.flag-icons { display: flex; justify-content: center; gap: 12px; margin-bottom: 15px; }
.flag-img { width: 45px; height: 30px; object-fit: cover; border: 2px solid #0a0a0a; border-radius: 4px; box-shadow: 2px 2px 0px rgba(0,0,0,0.15); }

/* Library Card (Likes) */
.library-card {
    border: 2px dashed #0a0a0a; border-radius: 2px 15px 5px 25px / 15px 5px 25px 2px; background-color: #fffdf9;
    width: 250px; padding: 15px; box-shadow: -4px 4px 0px rgba(0,0,0,0.15);
    transform: rotate(2deg); transition: transform 0.3s;
    background-image: repeating-linear-gradient(transparent, transparent 27px, rgba(125, 162, 169, 0.4) 27px, rgba(125, 162, 169, 0.4) 30px); background-position: 0 45px;
}
.library-card:hover { transform: rotate(0deg) scale(1.05); z-index: 20; }
.lib-header { color: #d24f3b; font-family: 'Lora', serif; font-weight: 800; font-size: 1.2rem; border-bottom: 3px solid #d24f3b; padding-bottom: 5px; margin-bottom: 12px; letter-spacing: 2px; }
.library-card ul { list-style: none; padding: 0; margin: 0; }
.library-card li { font-size: 0.9rem; font-weight: 700; line-height: 30px; color: #0a0a0a; }

/* Hell No's */
.warning-label {
    background-color: #fffdf9; border: 3px solid #0a0a0a; width: 230px;
    box-shadow: 4px 4px 0px #d24f3b, 8px 8px 0px #0a0a0a; 
    transform: rotate(1deg); transition: transform 0.3s; outline: none; 
}
.warning-label:hover { transform: rotate(0deg) scale(1.05); z-index: 20; }
.warning-header { background-color: #d24f3b; color: #fffdf9; font-family: 'Lora', serif; font-weight: 800; font-size: 1rem; text-align: center; padding: 8px; border-bottom: 4px solid #0a0a0a; letter-spacing: 1px; }
.warning-body { padding: 15px; }
.warning-body ul { list-style: none; padding: 0; margin: 0; }
.warning-body li { font-size: 0.9rem; font-weight: 700; margin-bottom: 10px; line-height: 1.3;}

/* Terminal Facts */
.fun-facts-box {
    background-color: #261a0d; border: 2px solid #4d3319; padding: 18px; width: 260px;
    transform: rotate(-2deg); box-shadow: inset 0 0 5px #000, 3px 3px 8px rgba(0,0,0,0.1); overflow: hidden;
}
.fun-facts-box::before {
    content: " "; position: absolute; top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    background-size: 100% 3px, 2px 100%; pointer-events: none; z-index: 2;
}
.fun-facts-title { font-family: 'Courier New', monospace; font-size: 0.9rem; color: #ffb400; border-bottom: 1px solid #ffb400; margin-bottom: 10px; text-shadow: 0 0 3px rgba(255, 180, 0, 0.4); }
.fun-facts-list { list-style-type: "> "; padding-left: 15px; font-family: 'Courier New', monospace; color: #ffcc66; font-size: 0.8rem; }
.fun-facts-list li { margin-bottom: 6px; line-height: 1.2; }

/* Retro Music Player */
.retro-music-player {
    background-color: #fffdf9; border: 3px solid #0a0a0a; border-radius: 4px; width: 300px;
    box-shadow: 6px 6px 0px rgba(0,0,0,0.15); transform: rotate(5deg); transition: transform 0.3s ease; color: #0a0a0a; 
}
.retro-music-player::before {
    content: ''; position: absolute; top: -10px; right: 20px; width: 60px; height: 25px;
    background-color: rgba(210, 200, 180, 0.6); transform: rotate(15deg); border: 1px solid rgba(0,0,0,0.1); z-index: 5;
}
.retro-music-player:hover { transform: rotate(0deg) scale(1.02); z-index: 25; }
.player-header { background-color: #f2e4c9; border-bottom: 3px solid #0a0a0a; padding: 4px 10px; display: flex; justify-content: space-between; align-items: center; }
.player-title { font-family: 'Lora', serif; font-weight: 800; font-size: 0.85rem; letter-spacing: 1.5px; color: #d24f3b; }
.window-controls { font-size: 0.8rem; letter-spacing: 2px; font-weight: 800; }
.player-body { padding: 10px; display: flex; gap: 12px; align-items: center; }
.album-art { width: 50px; height: 50px; border: 2px solid #0a0a0a; background-color: #efe9df; overflow: hidden; flex-shrink: 0; }
.album-art img { width: 100%; height: 100%; object-fit: cover; }
.track-details { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.song-title { font-size: 1rem; font-weight: 800; margin-bottom: 0px; color: #d24f3b; }
.artist-name { font-size: 0.8rem; font-weight: 700; color: #5c5043; margin-bottom: 6px; }
.progress-container { background-color: #efe9df; border: 2px solid #0a0a0a; height: 8px; position: relative; margin-bottom: 6px; }
.progress-bar { background-color: #d24f3b; width: 65%; height: 100%; }
.time-stamp { position: absolute; right: 0; top: -16px; font-size: 0.65rem; color: #5c5043; font-weight: 800; }
.player-controls { display: flex; justify-content: center; gap: 20px; font-size: 1.2rem; color: #0a0a0a; }
.play-btn { font-size: 1.4rem; color: #d24f3b; }

/* =========================================
   PANEL INTERAKTIF & CHAT (KOLOM KANAN)
   ========================================= */
.dialog-panel { padding: 40px 0; }
.chat-container { 
    display: flex; 
    flex-direction: column; 
    gap: 30px; 
    margin-top: 20px; 
    max-height: 380px; 
    overflow-y: auto; 
    padding-right: 15px; 
}

/* KUSTOMISASI SCROLLBAR RETRO */
.chat-container::-webkit-scrollbar { width: 6px; }
.chat-container::-webkit-scrollbar-track { background: rgba(10, 10, 10, 0.05); border-radius: 4px; }
.chat-container::-webkit-scrollbar-thumb { background: #0a0a0a; border-radius: 4px; }
.chat-container::-webkit-scrollbar-thumb:hover { background: #d24f3b; }

.chat-row { display: flex; width: 100%; align-items: flex-start; gap: 15px; }
.row-left { justify-content: flex-start; }
.row-right { justify-content: flex-end; }
.avatar-side { position: relative; width: 45px; height: 45px; flex-shrink: 0; margin-top: 5px; }
.mini-ava { width: 100%; height: 100%; border-radius: 50%; border: 3px solid #0a0a0a; object-fit: cover; background: transparent; position: relative; z-index: 2; }
.visitor-ava { width: 100%; height: 100%; border-radius: 50%; border: 3px solid #0a0a0a; background-color: transparent; display: flex; align-items: center; justify-content: center; font-family: 'Lora', serif; font-weight: 800; font-size: 1.2rem; color: #0a0a0a; }
.chat-bubble { position: relative; max-width: 80%; padding: 12px 18px; border: 2px solid #0a0a0a; font-size: 0.95rem; line-height: 1.5; }
.chat-bubble:hover { transform: translateY(-2px); }
.chat-name { position: absolute; top: -14px; font-family: 'Lora', serif; font-weight: 800; font-size: 0.8rem; padding: 2px 8px; border: 2px solid #0a0a0a; border-radius: 6px; text-transform: uppercase; letter-spacing: 1px; z-index: 2; }
.visitor { background-color: transparent; text-align: right; border-radius: 12px 0 12px 12px; }
.visitor .chat-name { right: 8px; background-color: #fdfaf5; color: #0a0a0a; }
.alaska { background-color: transparent; color: #0a0a0a; border-radius: 0 12px 12px 12px; }
.alaska p { text-align: left; }
.alaska .chat-name { left: 8px; background-color: #0a0a0a; color: #fffdf9; }

.welcome-screen { padding: 0 0 30px 0; }
.hero-avatar { width: 160px; height: 160px; border-radius: 50%; overflow: hidden; border: 4px solid #0a0a0a; margin-bottom: 20px; background: transparent; }
.hero-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.welcome-title { font-size: 1.4rem; font-weight: 800;}
.welcome-subtitle { font-size: 0.9rem; font-weight: 700;}

.chat-input-area { margin-top: 30px; display: flex; gap: 10px; background: transparent; padding: 5px; border: 3px solid #0a0a0a; border-radius: 12px; box-shadow: inset 1px 1px 4px rgba(0,0,0,0.1); }
.chat-input-area input { flex: 1; border: none; background: transparent; font-size: 0.95rem; color: #0a0a0a; padding: 10px; }
.chat-input-area input:focus { outline: none; }
.send-icon-btn { background: transparent; color: #0a0a0a; border: 2px solid #0a0a0a; border-radius: 8px; width: 40px; height: 40px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.send-icon-btn:hover { background-color: rgba(10,10,10,0.05); color: #d24f3b;}
.send-icon-btn:active { transform: translateY(2px); }
.send-icon-btn svg { width: 18px; height: 18px; }

/* =========================================
   ANIMASI TYPING INDICATOR (3 TITIK)
   ========================================= */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 10px 15px;
    align-items: center;
    width: fit-content;
    margin-bottom: 10px; 
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: #0a0a0a;
    border-radius: 50%; 
    display: inline-block;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
.typing-indicator span:nth-child(3) { animation-delay: 0s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

.vn-choices-container { border-top: 1px dashed rgba(10, 10, 10, 0.3); }
.pill-choice-btn { border: 2px solid #0a0a0a; background-color: transparent; color: #0a0a0a; padding: 12px 18px; font-size: 0.95rem; font-weight: 800; border-radius: 30px; }
.pill-choice-btn:hover { background-color: rgba(10, 10, 10, 0.05); color: #d24f3b; transform: translateY(-2px); }

/* =========================================
   FIX ANTI-GEPENG (Mencegah elemen teriris/pipih)
   ========================================= */
.chat-row, .typing-indicator, .typing-indicator span {
    flex-shrink: 0 !important;
}

.typing-indicator { min-height: 35px; }

/* GUESTBOOK */
.guestbook-panel { padding: 40px 0; }
.guestbook-subtitle { font-size: 0.9rem; font-weight: 700; margin-bottom: 20px;}
.primary-btn { background-color: transparent; color: #0a0a0a; padding: 12px 24px; border-radius: 8px; border: 3px solid #0a0a0a; font-weight: 800; font-size: 0.95rem; box-shadow: 4px 4px 0px rgba(10,10,10,0.1); margin-top: 20px; }
.primary-btn:hover { background-color: rgba(10,10,10,0.05); border-color: #d24f3b; color: #d24f3b; transform: translateY(-2px); box-shadow: 6px 6px 0px rgba(10,10,10,0.1); }
.modern-form textarea { width: 100%; min-height: 120px; padding: 14px; border-radius: 8px; border: 3px solid #0a0a0a; background-color: transparent; font-size: 0.95rem; color: #0a0a0a; resize: vertical; }
.modern-form textarea:focus { outline: none; border-color: #d24f3b; box-shadow: 0 0 10px rgba(210, 79, 59, 0.1); }

/* =========================================
   FIX 1: MENCEGAH BUBBLE PERTAMA BOTAK/TERPOTONG
   ========================================= */
.chat-container > :first-child {
    margin-top: 25px !important; 
}

/* =========================================
   FIX 2: MERAPIKAN JARAK TOMBOL PILIHAN (CHOICES)
   ========================================= */
.vn-choices-container {
    margin-top: 15px !important; 
    padding-top: 20px !important; 
    border-top: 2px dashed rgba(10, 10, 10, 0.3) !important;
    display: flex;
    flex-wrap: wrap; 
    gap: 15px;
    justify-content: center;
    flex-shrink: 0 !important; 
}

.pill-choice-btn {
    flex: 1; 
    min-width: 140px; 
    white-space: normal !important; 
    line-height: 1.4 !important; 
    height: auto !important; 
    padding: 12px 18px !important;
}

/* =========================================
   LAYOUT DESKTOP: ABSOLUTE FIX & PERFECT SCROLL CHAT
   ========================================= */
@media (min-width: 1024px) {
    body {
        height: 100vh;
        overflow: hidden; 
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .container.retro-page {
        max-width: 1100px !important; 
        width: 95vw; 
        height: 94vh; 
        max-height: 800px; 
        margin: 0 !important; 
        padding: 40px !important; 
        display: flex;
        flex-direction: column;
        align-items: flex-end; 
        justify-content: flex-start; 
        position: relative; 
    }

    .meet-artist-canvas {
        position: absolute !important;
        top: 50% !important;
        left: 27% !important; 
        width: 800px !important;
        height: 800px !important;
        transform: translate(-50%, -50%) scale(0.55) !important;
        margin: 0 !important; 
    }

    .dialog-panel {
        width: 48% !important; 
        padding: 0 !important;
        margin: 0 !important; 
        padding-left: 10px !important; 
        flex-grow: 1; 
        display: flex;
        flex-direction: column;
        min-height: 0; 
    }

    .guestbook-panel {
        width: 48% !important; 
        padding-left: 10px !important;
        margin: 0 !important;
        padding-top: 15px !important; 
        padding-bottom: 0 !important;
        flex-shrink: 0; 
    }

    .printed-header, .header-subtitle, .welcome-screen, .chat-input-area, .vn-choices-container {
        flex-shrink: 0; 
    }

    .chat-container {
        flex-grow: 1; 
        min-height: 0; 
        overflow-y: auto;
        max-height: none !important; 
        padding: 15px 15px 15px 5px !important; 
    }

    .printed-header { font-size: 2.2rem !important; margin-bottom: 0; }
    .header-subtitle { margin-bottom: 10px; }
    .welcome-screen { padding: 0 0 10px 0 !important; }
    .hero-avatar { width: 90px !important; height: 90px !important; margin-bottom: 10px !important; }
    .chat-input-area { margin-top: 10px !important; }
    .modern-form textarea { min-height: 80px !important; padding: 10px !important; }
    .primary-btn { margin-top: 10px !important; }
    
    .paper-divider { display: none; }

    /* PERBAIKAN FINAL: CHAT FLOW & MINI BUTTONS */
    .chat-container {
        padding-top: 40px !important; 
        gap: 25px !important;
        justify-content: flex-start; 
    }

    .vn-choices-container {
        padding-top: 10px !important;
        margin-top: 5px !important;
        gap: 8px !important;
    }

    .pill-choice-btn {
        font-size: 0.8rem !important; 
        padding: 6px 12px !important; 
        min-width: 120px !important;
        border-width: 2px !important;
        border-radius: 20px !important;
    }

    .chat-input-area {
        margin-bottom: 5px !important;
        flex-shrink: 0 !important;
    }

    .chat-row {
        flex-shrink: 0 !important;
        margin-bottom: 10px;
    }
}

/* =========================================
   RESPONSIVE TABLET / IPAD
   ========================================= */
@media (max-width: 1023px) and (min-width: 551px) {
    .meet-artist-canvas {
        transform-origin: top center;
        transform: scale(0.85); 
        margin-top: 40px !important;
        margin-bottom: -150px !important; 
    }
}

/* =========================================
   RESPONSIVE SMARTPHONE (HP)
   ========================================= */
@media (max-width: 550px) {
    .container { padding: 40px 15px; margin: 30px auto;}
    
    .meet-artist-canvas {
        transform-origin: top center;
        transform: scale(0.38); 
        margin-top: 30px !important; 
        margin-bottom: -450px !important; 
    }

    .printed-header { font-size: 2.2rem !important; }
    .avatar-side { width: 32px; height: 32px; }
    .visitor-ava { font-size: 1rem; }
    .chat-row { gap: 10px; }
    .chat-bubble { max-width: 90%; font-size: 0.85rem; padding: 10px 14px; }
    .chat-name { font-size: 0.7rem; top: -14px; }
    .chat-input-area { gap: 5px; padding: 8px; }
    .chat-input-area input { font-size: 0.85rem; }
    .pill-choice-btn { padding: 10px 14px; font-size: 0.85rem; }
    .primary-btn { font-size: 0.85rem; padding: 10px 20px; }
}

/* =========================================
   THE GRAND LIBRARY (TRUE 3D BOX MODEL)
   ========================================= */
.book-stack {
    display: flex !important;
    flex-direction: column !important;
    gap: 60px !important; 
    max-width: 750px !important;
    margin: 60px auto !important;
}

.book-item {
    position: relative;
    height: 70px;
    transform-style: preserve-3d; 
    z-index: 1;
}

.book-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.3s ease-out; 
    transform-origin: center center -150px !important;
}

/* --- 1. TULANG BUKU DEPAN (SPINE) --- */
.book-spine {
    position: absolute;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 20px;
    color: #fffdf9;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    transform: translateZ(0); 
    
    border: none !important;
    border-radius: 2px !important; 
    
    /* =========================================
       PREMIUM STYLE: EFEK LEKUKAN ENGSEL (HINGE GROOVE)
       ========================================= */
    box-shadow: 
        /* 1. Pantulan cahaya halus di ujung paling atas */
        inset 0 1px 1px rgba(255, 255, 255, 0.15), 
        
        /* 2. LEKUKAN ATAS: Membuat ilusi parit/cekungan 6px dari atas */
        inset 0 6px 5px -4px rgba(0, 0, 0, 0.6), 
        
        /* 3. LEKUKAN BAWAH: Membuat ilusi parit/cekungan 6px dari bawah */
        inset 0 -6px 5px -4px rgba(0, 0, 0, 0.6) !important;
        
    transform-style: preserve-3d !important;
}

/* --- 2. SAMPUL ATAS (TOP COVER) --- */
.book-top {
    display: block !important; 
    position: absolute;
    width: 100% !important;
    height: 300px !important; 
    top: -300px !important;
    left: 0 !important;
    
    /* PREMIUM STYLE: Hilangkan border hitam */
    border: none !important;
    
    /* Highlight halus di lipatan engsel */
    box-shadow: inset 0 -2px 4px rgba(255,255,255,0.1) !important;
    transform-origin: bottom;
    transform: rotateX(90deg);
    overflow: hidden; 
    backface-visibility: hidden !important; 
}

.book-top::before {
    content: '';
    position: absolute;
    top: 0 !important;
    left: 0 !important;
    width: 300px !important;
    padding-top: 100% !important; 
    background-image: inherit; 
    background-size: 100% 100% !important; 
    background-position: center;
    transform-origin: top left !important;
    transform: translateY(300px) rotate(-90deg) !important;
    filter: brightness(0.85); 
    backface-visibility: hidden !important;
}

/* --- 3. SAMPUL BAWAH (BOTTOM COVER) --- */
.book-spine::before {
    content: '';
    position: absolute;
    width: 100% !important;
    height: 300px !important;
    bottom: 0 !important;
    left: 0 !important;
    background-color: inherit; 
    background-image: none !important; 
    
    /* PREMIUM STYLE: Hilangkan border hitam */
    border: none !important; 
    
    transform-origin: bottom;
    transform: rotateX(90deg);
    filter: brightness(0.35); 
    box-shadow: none !important; 
}

/* --- 4. TEPIAN KERTAS KANAN (RIGHT PAGE EDGE) --- */
.book-spine::after {
    content: '';
    position: absolute;
    width: 292px !important;
    height: calc(100% - 8px) !important; 
    top: 4px !important; 
    right: 4px !important; 
    background-color: #f4ebd8; 
    background-image: repeating-linear-gradient(to bottom, rgba(0,0,0,0.06) 0px, rgba(0,0,0,0.06) 2px, transparent 2px, transparent 4px);
    border-radius: 3px !important; 
    border: 1px solid rgba(0,0,0,0.4) !important;
    border-left: 3px solid rgba(0,0,0,0.7) !important; 
    border-right: 8px solid rgba(15, 15, 15, 0.95) !important;
    transform-origin: right;
    transform: rotateY(-90deg) !important;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1) !important;
}

/* --- 5. TEPIAN KERTAS KIRI (LEFT PAGE EDGE) --- */
.book-inner::before {
    content: '';
    position: absolute;
    width: 292px !important; 
    height: calc(100% - 8px) !important; 
    left: 4px !important;
    top: 4px !important;
    background-color: #f4ebd8; 
    background-image: repeating-linear-gradient(to bottom, rgba(0,0,0,0.06) 0px, rgba(0,0,0,0.06) 2px, transparent 2px, transparent 4px);
    border: 1px solid rgba(0,0,0,0.4);
    border-right: 3px solid rgba(0,0,0,0.7); 
    border-left: 8px solid rgba(15, 15, 15, 0.95) !important;
    transform-origin: left;
    transform: rotateY(90deg) !important;
    box-shadow: inset -5px 0 10px rgba(0,0,0,0.1);
}

/* --- WARNA DASAR & COVER MASING-MASING BUKU --- */
.book-1 .book-spine, .book-1 .book-top { background-color: #9b1c1c; }
.book-2 .book-spine, .book-2 .book-top { background-color: #8b0000; }
.book-3 .book-spine, .book-3 .book-top { background-color: #111111; }
.book-4 .book-spine, .book-4 .book-top { background-color: #5c3a3a; }
.book-5 .book-spine, .book-5 .book-top { background-color: #1d3e33; }

.book-1 .book-top { background-image: url('assets/malam_seribu.jpg'); }
.book-2 .book-top { background-image: url('assets/sihir_perempuan.jpg'); }
.book-3 .book-top { background-image: url('assets/dorian.jpg'); }
.book-4 .book-top { background-image: url('assets/korpus_uterus.jpg'); }
.book-5 .book-top { background-image: url('assets/duri.jpg'); }

/* --- FORMAT TEKS TULANG BUKU --- */
.book-spine .author { font-family: 'Lora', serif; font-style: italic; font-size: 0.95rem; text-align: left; }
.book-spine .title { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 1.15rem; text-align: center; letter-spacing: 0.5px; }
.book-spine .genre { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 0.75rem; text-align: center; justify-self: end; border: 1px solid rgba(255,255,255,0.3); padding: 4px 15px; border-radius: 4px; letter-spacing: 1px; background-color: rgba(0,0,0,0.2); text-transform: uppercase; }

/* --- EFEK HOVER (Ditarik Keluar) --- */
.book-item:hover { z-index: 10; }
.book-item:hover .book-inner { transform: translateZ(40px); cursor: pointer; }