/* --- Global & Containers --- */
.page-id-8387 header {
    display: none;
}

/* Hilangkan padding dari container bawaan Astra */
/* 1. RESET PADDING TOTAL (Desktop & Mobile) */
body.page-id-8387,
body.page-id-8387 .site,
body.page-id-8387 .site-content,
body.page-id-8387 .ast-container,
body.page-id-8387 #content,
body.page-id-8387 #primary,
body.page-id-8387 #main,
body.page-id-8387 .site-main,
body.page-id-8387 .entry-content,
body.page-id-8387 .ast-plain-container,
body.page-id-8387 .ast-article-post {
    padding: 0 !important;
}

/* 2. KHUSUS DESKTOP: Buat Konten Rata Tengah (Center) */
@media (min-width: 922px) {
    body.page-id-8387 #primary,
    body.page-id-8387 #main,
    body.page-id-8387 .entry-content,
    body.page-id-8387 canvas { /* Tambahkan elemen pembungkus game/canvas kamu di sini */
        margin-left: auto !important;
        margin-right: auto !important;
        display: block !important;
    }
}

/* 3. KHUSUS MOBILE: Rata Kiri-Kanan Penuh (Full Width tanpa Margin) */
@media (max-width: 921px) {
    body.page-id-8387 .site-content,
    body.page-id-8387 .ast-container,
    body.page-id-8387 #primary,
    body.page-id-8387 #main,
    body.page-id-8387 .entry-content {
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

body {
    margin: 0;
    padding: 10px;
    background: #111827; /* Richer dark background */
    box-sizing: border-box;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;

    font-family: 'Outfit', 'Inter', Arial, sans-serif;
}

h1 {
    color: #f3f4f6;
    margin: 10px 0;
    font-size: 1.8rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

canvas {
    background: #111;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    max-width: 100%;
    height: auto;
    aspect-ratio: 700 / 1200;
}

/* Joystick styles */
#joystick-container {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 140px;
    height: 140px;
    z-index: 1000;
    user-select: none;
    touch-action: none;
}

#joystick {
    position: relative;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.joystick-btn {
    position: absolute;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    transition: background 0.1s, transform 0.1s, color 0.1s;
    user-select: none;
    touch-action: none;
}

.joystick-btn:active {
    background: rgba(255, 255, 255, 0.4);
    color: #fff;
    transform: scale(0.9);
}

.joystick-btn.up {
    top: 6px;
    left: calc(50% - 22px);
}

.joystick-btn.down {
    bottom: 6px;
    left: calc(50% - 22px);
}

.joystick-btn.left {
    left: 6px;
    top: calc(50% - 22px);
}

.joystick-btn.right {
    right: 6px;
    top: calc(50% - 22px);
}

.joystick-center {
    position: absolute;
    top: calc(50% - 16px);
    left: calc(50% - 16px);
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    pointer-events: none;
    box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.5);
}

/* Hide joystick on desktops with hover support and precise pointers */
@media (hover: hover) and (pointer: fine) {
    #joystick-container {
        display: none;
    }
}

/* --- Voice UI Controls --- */
#voice-ui-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 2000;
}

.voice-ui-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(17, 24, 39, 0.6); /* Translucent dark */
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: #f3f4f6;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.voice-ui-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 12px 35px 0 rgba(0, 0, 0, 0.4);
}

.voice-ui-btn:active {
    transform: translateY(0) scale(0.95);
}

#close-game-btn {
    background: rgba(239, 68, 68, 0.2); /* Soft red glass */
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

#close-game-btn:hover {
    background: rgba(239, 68, 68, 0.35);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fee2e2;
}

#mic-toggle-btn.muted {
    background: rgba(239, 68, 68, 0.2); /* Muted red */
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

#mic-toggle-btn.unmuted {
    background: rgba(16, 185, 129, 0.2); /* Active green */
    border-color: rgba(16, 185, 129, 0.35);
    color: #a7f3d0;
}

#mic-toggle-btn.unmuted:hover {
    background: rgba(16, 185, 129, 0.35);
    border-color: rgba(16, 185, 129, 0.5);
}

/* Helper Utilities */
.hidden {
    display: none !important;
}

/* Style Tombol Mic ketika Diblokir */
#mic-toggle-btn.blocked {
    background: rgba(239, 68, 68, 0.45); /* Merah transparan lebih terang */
    border-color: rgba(239, 68, 68, 0.8);
    color: #ffffff;
    animation: pulse-red-warning 2s infinite;
}

#mic-toggle-btn.blocked:hover {
    background: rgba(239, 68, 68, 0.6);
    border-color: rgba(239, 68, 68, 1);
}

@keyframes pulse-red-warning {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Style Box Panduan Informasi */
.mic-blocked-popup-box {
    position: absolute;
    right: 64px; /* Muncul di sebelah kiri deretan tombol */
    top: 60px;
    width: 260px;
    background: rgba(17, 24, 39, 0.95);
    border: 2px solid rgba(239, 68, 68, 0.6);
    border-radius: 12px;
    padding: 14px;
    color: #f3f4f6;
    font-size: 13px;
    line-height: 1.5;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 2100;
    animation: fadeInBox 0.25s ease-out;
}

.mic-blocked-popup-box strong {
    color: #fca5a5;
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
}

.mic-blocked-popup-box p {
    margin: 0;
}

@keyframes fadeInBox {
    from { opacity: 0; transform: scale(0.95) translateX(10px); }
    to { opacity: 1; transform: scale(1) translateX(0); }
}

/* --- Floating Zoom Controls --- */
#zoom-controls {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
}

.zoom-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(17, 24, 39, 0.6); /* Translucent dark matching mic/close buttons */
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: #f3f4f6;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    user-select: none;
    touch-action: none;
    outline: none;
}

.zoom-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.zoom-btn:active {
    transform: translateY(0) scale(0.95);
}

