/* ==========================================================================
   1. WAKY PRO UI CORE DESIGN & RESET
   ========================================================================== */
body {
    background-color: #0b0f14;
    color: #ffffff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 10px;
    transition: background 0.5s ease;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

.room-container {
    width: 100%;
    max-width: 480px;
    background: #0f1722;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    border: 1px solid #1a2635;
    box-shadow: 0px 10px 25px rgba(0,0,0,0.5);
    transition: all 0.5s ease;
    position: relative; /* Menjaga konteks internal agar layout tidak rusak */
}

/* --- TEMA DEKORASI DYNAMIC ROOM STYLE --- */
body.theme-cyber { background-color: #05070f !important; }
.room-container.theme-cyber {
    background: linear-gradient(145deg, #0f1123, #1a0b2e) !important;
    border: 2px solid #00f0ff !important;
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.3) !important;
}

body.theme-gold { background-color: #100c02 !important; }
.room-container.theme-gold {
    background: linear-gradient(145deg, #2a1f0a, #150f03) !important;
    border: 2px solid #d4af37 !important;
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.3) !important;
}

body.theme-ocean { background-color: #020b14 !important; }
.room-container.theme-ocean {
    background: linear-gradient(145deg, #071b29, #0c1622) !important;
    border: 2px solid #007aff !important;
    box-shadow: 0 0 25px rgba(0, 122, 255, 0.3) !important;
}

/* --- HEADER & TOP LAYOUT --- */
.room-header {
    background: linear-gradient(135deg, #162335, #0f1722);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1a2635;
}
.clickable-info {
    font-size: 12px;
    color: #3498db;
    cursor: pointer;
    margin-top: 4px;
}

.waky-top-stats-bar {
    background: #111a24;
    padding: 10px 15px;
    border-bottom: 1px solid #1e2d3e;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}
.waky-active-count {
    font-size: 13px;
    font-weight: bold;
    color: #2ecc71;
    display: flex;
    align-items: center;
    gap: 5px;
}
.waky-active-list {
    font-size: 11px;
    color: #a0aec0;
    background: #090f15;
    padding: 6px;
    border-radius: 6px;
    max-height: 50px;
    overflow-y: auto;
    line-height: 1.4;
    word-break: break-all;
}
.btn-share-room {
    background: #3498db;
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
}

/* ==========================================================================
   2. LIVE CHAIRS (KURSI LIVE AREA)
   ========================================================================== */
.seats-container {
    padding: 15px;
    background: #121d2c;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}
.seat-row-top {
    display: flex;
    justify-content: center;
    width: 100%;
}
.seat-grid-three {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    width: 100%;
    justify-items: center;
}
.seat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 75px;
    text-align: center;
    cursor: pointer;
    position: relative;
}
.avatar-ring {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: #1a2a40;
    border: 2px solid #34495e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}
.seat-box.main-host-seat .avatar-ring {
    border-color: #e74c3c;
    background: #2c1a1a;
    width: 65px;
    height: 65px;
    font-size: 26px;
}
.seat-box.occupied .avatar-ring {
    border-color: #2ecc71;
    background: #143d23;
}
.seat-box.speaking .avatar-ring {
    border-color: #2ecc71;
    box-shadow: 0 0 15px #2ecc71;
    animation: pulse-voice 0.6s infinite alternate;
}
@keyframes pulse-voice {
    0% { transform: scale(1); }
    100% { transform: scale(1.08); }
}
.seat-number {
    position: absolute;
    bottom: 18px;
    right: 5px;
    background: #007aff;
    font-size: 9px;
    padding: 2px 5px;
    border-radius: 10px;
    font-weight: bold;
    z-index: 2;
}
.seat-name {
    font-size: 11px;
    margin-top: 5px;
    color: #bdc3c7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    font-weight: 500;
}

.mic-control-dock {
    display: flex;
    justify-content: space-around;
    background: #162231;
    padding: 10px;
    border-bottom: 1px solid #24354a;
}
.mic-btn {
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}
.mic-btn.active { background: #2ecc71; animation: green-glow 1s infinite alternate; }
.mic-btn.off { background: #e74c3c; }
@keyframes green-glow { 0% { box-shadow: 0 0 5px #2ecc71; } 100% { box-shadow: 0 0 15px #2ecc71; } }

/* ==========================================================================
   3. LUDO BOARD & ENGINE GAME LAYOUT
   ========================================================================== */
.ludo-wrapper {
    background: #162437;
    padding: 12px;
    margin: 8px;
    border-radius: 12px;
    border: 1px solid #223752;
}
.ludo-header-bar {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 8px;
    background: #0b0f14;
    padding: 6px 10px;
    border-radius: 6px;
}
.ludo-actions {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    justify-content: center;
}
.ludo-actions button {
    padding: 6px 12px;
    font-size: 12px;
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    font-weight: bold;
}
#btn-ludo-join { background: #3498db; }
#btn-ludo-roll { background: #2ecc71; }

#full-ludo-grid {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    max-width: 320px;
    margin: 0 auto;
    aspect-ratio: 1;
    border: 2px solid #333;
    background-color: #fff;
}
.l-cell {
    border: 0.5px solid #ddd;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.l-red-zone { background-color: #ff4d4d !important; }
.l-blue-zone { background-color: #3333ff !important; }
.l-green-zone { background-color: #00cc44 !important; }
.l-yellow-zone { background-color: #ffff33 !important; }
.l-center-zone { background-color: #f0f0f0 !important; }

.ludo-token {
    width: 75%;
    height: 75%;
    border-radius: 50%;
    border: 1px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
    z-index: 5;
    position: absolute;
}
.tk-red { background: red; } .tk-blue { background: blue; } .tk-green { background: green; } .tk-yellow { background: gold; }

/* ==========================================================================
   4. CHAT DASHBOARD & STREAM MESSAGES
   ========================================================================== */
.chat-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: #0b0f14;
    margin: 8px;
    border-radius: 12px;
    height: 200px;
    border: 1px solid #1a2635;
}
#chat-box {
    flex-grow: 1;
    padding: 10px;
    overflow-y: auto;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}
.chat-msg-line {
    background: rgba(255,255,255,0.03);
    padding: 5px 8px;
    border-radius: 6px;
    border-left: 3px solid #3498db;
}
.chat-system-line {
    background: rgba(230, 126, 34, 0.15);
    padding: 5px 8px;
    border-radius: 6px;
    border-left: 3px solid #e67e22;
    color: #f39c12;
    font-weight: bold;
}
.vn-player-bubble {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #1e375a, #12223a);
    padding: 8px 12px;
    border-radius: 12px;
    margin: 4px 0;
    max-width: 85%;
    border: 1px solid #294a77;
}
.vn-play-btn {
    background: #007aff;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.chat-input-area {
    padding: 10px;
    background: #121d2c;
    border-top: 1px solid #1a2635;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.input-row {
    display: flex;
    gap: 8px;
    width: 100%;
}
.input-row input {
    flex-grow: 1;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #223752;
    background: #0b0f14;
    color: #fff;
    font-size: 13px;
}
.btn-send {
    background: #007aff;
    border: none;
    padding: 0 16px;
    border-radius: 8px;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}
.voice-note-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1a2a40;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px dashed #34495e;
}
.btn-vn {
    background: #e74c3c;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
}

/* ==========================================================================
   5. ROOM SETTINGS & ADMIN CONTROLS
   ========================================================================== */
.panel-room-settings {
    background: linear-gradient(180deg, #162437, #0e1724);
    padding: 15px;
    border-top: 2px solid #007aff;
    margin-top: auto;
    text-align: left;
}
.panel-title {
    font-size: 14px;
    font-weight: bold;
    color: #007aff;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}
.setting-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.setting-item label { font-size: 11px; color: #a0aec0; }
.setting-item input, .setting-item select, .setting-item textarea {
    background: #0b0f14;
    border: 1px solid #233549;
    padding: 8px;
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    width: 100%;
    resize: none;
}
.btn-blue {
    background: #007aff;
    color: white;
    border: none;
    padding: 11px;
    font-size: 13px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    width: 100%;
}
.panel-admin-host {
    background: #2c1d11;
    padding: 10px;
    margin: 8px;
    border-radius: 8px;
    border-left: 4px solid #e67e22;
    font-size: 12px;
    text-align: left;
}

/* --- MODAL INFORMASI OVERLAY --- */
.modal-overlay {
    position: fixed;
    top:0; left:0; right:0; bottom:0;
    background: rgba(0,0,0,0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    padding: 20px;
}
.modal-content {
    background: #16222f;
    padding: 20px;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    border: 1px solid #233549;
}
.info-table {
    width: 100%;
    font-size: 12px;
    border-collapse: collapse;
    margin: 15px 0;
}
.info-table th, .info-table td {
    padding: 8px;
    border-bottom: 1px solid #233549;
    text-align: left;
}
.close-btn { float: right; cursor: pointer; font-size: 20px; }

/* ==========================================================================
   6. PREMIUM FULLSCREEN ENTRANCE DRIVE ANIMASI (WAKY PRO STYLE)
   ========================================================================== */
.entrance-container {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    z-index: 999999 !important; /* Ditinggikan agar mutlak di atas seluruh elemen room & game */
    pointer-events: none;
    display: none; /* Akan diubah ke 'display: flex' lewat script di index.php saat aktif */
    flex-direction: column;
    justify-content: center; 
    align-items: center;
    overflow: hidden;
    background: rgba(7, 10, 15, 0.75) !important; /* Backdrop gelap transparan yang mengaburkan elemen belakang */
    backdrop-filter: blur(4px);
}

.car-image-3d {
    width: 340px; /* Ukuran kendaraan dioptimalkan agar terlihat megah */
    height: auto;
    opacity: 0;
    filter: drop-shadow(0 15px 30px rgba(255, 69, 0, 0.65)); /* Efek pendaran siluet api */
    transform: translateY(100vh) scale(0.1);
}

/* Trigger class dari JavaScript */
.car-image-3d.animate-car {
    animation: carDriveForwardFull 3.8s cubic-bezier(0.25, 1, 0.3, 1) forwards;
}

@keyframes carDriveForwardFull {
    0% { transform: translateY(80vh) scale(0.1) rotate(0deg); opacity: 0; }
    20% { transform: translateY(12vh) scale(1.0) rotate(-3deg); opacity: 1; }
    45% { transform: translateY(0vh) scale(1.6) rotate(3deg); opacity: 1; }
    70% { transform: translateY(-20vh) scale(2.4) rotate(0deg); opacity: 0.9; }
    100% { transform: translateY(-110vh) scale(4.5); opacity: 0; }
}

.entrance-text {
    position: absolute; 
    bottom: 12%; 
    background: linear-gradient(90deg, #ff4500, #ff8c00); /* Tema gradasi api jingga */
    color: #ffffff;
    padding: 14px 45px; 
    border-radius: 50px; 
    font-weight: 900; 
    font-size: 16px;
    box-shadow: 0 10px 30px rgba(255, 69, 0, 0.5);
    border: 2px solid #fff;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0;
    text-align: center;
    text-shadow: 0 2px 5px rgba(0,0,0,0.7);
    white-space: nowrap;
}

/* Trigger class dari JavaScript */
.animate-text {
    animation: textFadeInUpWaky 3.8s ease-in-out forwards;
}

@keyframes textFadeInUpWaky {
    0% { opacity: 0; transform: translateY(40px); }
    15%, 85% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-30px); }
}
