/* ============================================================
   THEME: AURORA GALAXY (dark, moving, eye-friendly)
   ------------------------------------------------------------
   Latar belakang gelap dengan aurora/orbs bercahaya yang bergerak
   pelan + taburan bintang statis tipis di belakangnya, supaya
   tampilan tidak monoton bagi penonton TAPI tetap nyaman dilihat
   lama: gerakan lambat, tidak ada flashing/strobing, warna hangat
   dan lembut (bukan neon menyilaukan).

   Di-load PALING TERAKHIR agar menang dari style.css/quiz.css/
   leaderboard.css/animations.css tanpa perlu menulis ulang semuanya.
   ============================================================ */

/* ---------- Variabel yang dikontrol slider (lihat js/aurora-controls.js) ----------
   --aurora-brightness : 0 - 1.8   (dikalikan ke opacity dasar tiap blob)
   --aurora-speed      : 0.2 - 5.0 (pembagi durasi animasi - makin besar = makin cepat)
*/
:root {
    --aurora-brightness: 0.6;
    --aurora-speed: 2.84;
}

/* ---------- Lapisan latar Aurora Galaxy (signature element) ---------- */
.aurora-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background: #0a0716;
}

/* Taburan bintang statis tipis - kesan "galaxy", tidak bergerak
   (supaya tidak menambah beban gerakan berlebih di layar). */
.aurora-bg .star-field {
    position: absolute;
    inset: 0;
    opacity: 0.5;
    background-image:
        radial-gradient(1.5px 1.5px at 20% 30%, rgba(255,255,255,0.9) 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 70% 15%, rgba(255,255,255,0.7) 50%, transparent 51%),
        radial-gradient(1px 1px at 40% 70%, rgba(255,255,255,0.8) 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 85% 60%, rgba(255,255,255,0.6) 50%, transparent 51%),
        radial-gradient(1px 1px at 10% 85%, rgba(255,255,255,0.7) 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 60% 45%, rgba(255,255,255,0.5) 50%, transparent 51%),
        radial-gradient(1px 1px at 92% 90%, rgba(255,255,255,0.8) 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 30% 55%, rgba(255,255,255,0.6) 50%, transparent 51%);
    background-repeat: repeat;
    background-size: 100% 100%;
}

.aurora-bg .blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: calc(0.75 * var(--aurora-brightness));
    will-change: transform;
    transform: translateZ(0);
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-direction: alternate;
}

.aurora-bg .blob--1 {
    width: 58vw;
    height: 58vw;
    top: -15vw;
    left: -10vw;
    background: radial-gradient(circle at 30% 30%, rgba(140, 122, 255, 1) 0%, rgba(140, 122, 255, 0) 70%);
    animation-name: auroraDrift1;
    animation-duration: calc(32s / var(--aurora-speed));
}

.aurora-bg .blob--2 {
    width: 50vw;
    height: 50vw;
    top: 28vh;
    right: -12vw;
    background: radial-gradient(circle at 60% 40%, rgba(72, 240, 190, 0.95) 0%, rgba(72, 240, 190, 0) 70%);
    animation-name: auroraDrift2;
    animation-duration: calc(40s / var(--aurora-speed));
}

.aurora-bg .blob--3 {
    width: 45vw;
    height: 45vw;
    bottom: -14vw;
    left: 16vw;
    background: radial-gradient(circle at 50% 50%, rgba(255, 150, 110, 0.85) 0%, rgba(255, 150, 110, 0) 70%);
    animation-name: auroraDrift3;
    animation-duration: calc(36s / var(--aurora-speed));
}

.aurora-bg .blob--4 {
    width: 36vw;
    height: 36vw;
    bottom: 5vh;
    right: 4vw;
    background: radial-gradient(circle at 50% 50%, rgba(255, 210, 90, 0.7) 0%, rgba(255, 210, 90, 0) 70%);
    animation-name: auroraDrift4;
    animation-duration: calc(45s / var(--aurora-speed));
}

/* Blob ke-5 - sengaja diletakkan di TENGAH layar, supaya panel soal
   (yang posisinya di tengah, jauh dari blob-blob pojok lainnya) tetap
   ikut kebagian warna, bukan cuma pinggir-pinggirnya saja. */
.aurora-bg .blob--5 {
    width: 46vw;
    height: 46vw;
    top: 22vh;
    left: 30vw;
    background: radial-gradient(circle at 50% 50%, rgba(180, 140, 255, 0.55) 0%, rgba(180, 140, 255, 0) 70%);
    animation-name: auroraDrift5;
    animation-duration: calc(38s / var(--aurora-speed));
}

/* Blob 1: menyapu dari KIRI ke KANAN (horizontal) */
@keyframes auroraDrift1 {
    0%   { transform: translate(-15vw, 0) scale(1); }
    50%  { transform: translate(35vw, 10vh) scale(1.15); }
    100% { transform: translate(75vw, -5vh) scale(0.95); }
}
/* Blob 2: menyapu dari BAWAH ke ATAS (vertikal) */
@keyframes auroraDrift2 {
    0%   { transform: translate(0, 35vh) scale(1); }
    50%  { transform: translate(-15vw, -10vh) scale(1.1); }
    100% { transform: translate(-30vw, -55vh) scale(0.9); }
}
/* Blob 3: menyapu dari KANAN ke KIRI (horizontal, arah berlawanan blob 1) */
@keyframes auroraDrift3 {
    0%   { transform: translate(20vw, 0) scale(1); }
    50%  { transform: translate(-30vw, -15vh) scale(1.2); }
    100% { transform: translate(-65vw, 10vh) scale(0.9); }
}
/* Blob 4: menyapu diagonal dari kanan-bawah ke kiri-atas */
@keyframes auroraDrift4 {
    0%   { transform: translate(10vw, 10vh) scale(1); }
    50%  { transform: translate(-20vw, -20vh) scale(1.1); }
    100% { transform: translate(-45vw, -40vh) scale(0.95); }
}
/* Blob 5 (tengah): lintasan melingkar besar, supaya area tengah panel
   soal tetap kebagian gerakan yang jelas, bukan cuma diam berpendar. */
@keyframes auroraDrift5 {
    0%   { transform: translate(0, 0) scale(1); }
    25%  { transform: translate(20vw, -15vh) scale(1.1); }
    50%  { transform: translate(5vw, 20vh) scale(0.95); }
    75%  { transform: translate(-20vw, 5vh) scale(1.08); }
    100% { transform: translate(0, 0) scale(1); }
}

/* Hormati preferensi pengguna yang sensitif terhadap gerakan */
@media (prefers-reduced-motion: reduce) {
    .aurora-bg .blob {
        animation: none !important;
    }
}

/* Panggung kamera memenuhi layar, jadi gumpalan cahaya aurora tidak terlihat sama sekali di belakangnya.
   Tidak perlu digambar ulang tiap frame: ini menghemat banyak tenaga di HP dan laptop sederhana,
   sehingga kamera dan deteksi gerakan berjalan lebih lancar. */
body.cam-stage-active .aurora-bg .blob {
    display: none;
}

/* ---------- Biarkan aurora terlihat menembus panel ---------- */
body,
.container,
.main-content {
    background: transparent !important;
}

/* ---------- Glassmorphism pada semua panel utama ---------- */
.header,
.footer {
    background: rgba(22, 17, 38, 0.52) !important;
    -webkit-backdrop-filter: blur(8px) saturate(130%);
    backdrop-filter: blur(8px) saturate(130%);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 32px rgba(5, 3, 15, 0.4);
    /* Isolasi jadi compositing layer sendiri - mengurangi kalkulasi ulang
       yang tidak perlu setiap frame animasi aurora di belakangnya. */
    transform: translateZ(0);
    will-change: transform;
}

.header,
.footer {
    background: linear-gradient(90deg, rgba(22, 17, 38, 0.45) 0%, rgba(140, 122, 255, 0.22) 100%) !important;
}

button:focus-visible {
    outline: 2px solid #3fe0b0;
    outline-offset: 2px;
}

/* ---------- Slider pengatur Aurora (kecerahan & kecepatan) ---------- */
.footer {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    row-gap: 10px;
}

.aurora-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-left: 16px;
    margin-left: auto;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.aurora-control-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.aurora-control-item label {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.aurora-control-item span {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: #3fe0b0;
    min-width: 26px;
    text-align: right;
}

.aurora-control-item input[type="range"] {
    width: 110px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.aurora-control-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8c7aff, #48f0be);
    box-shadow: 0 0 6px rgba(140, 122, 255, 0.6);
    cursor: pointer;
}

.aurora-control-item input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #8c7aff, #48f0be);
    box-shadow: 0 0 6px rgba(140, 122, 255, 0.6);
    cursor: pointer;
}

@media (max-width: 900px) {
    .aurora-controls {
        margin-left: 0;
        border-left: none;
        padding-left: 0;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;      /* HP tegak: dua slider tidak muat sebaris */
        row-gap: 8px;
    }
}

/* ---------- Fix logo: sebelumnya gradient+clip diterapkan ke SELURUH
   .logo (termasuk emoji ikon), membuat emoji ikut ke-clip jadi tidak
   kelihatan. Sekarang gradient HANYA di teksnya, + shine sweep animasi
   supaya terasa "hidup" seperti GIF, tanpa mengorbankan keterbacaan. ---------- */
.logo {
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: unset !important;
}
.logo-icon {
    -webkit-text-fill-color: initial !important;
    filter: none !important;
}
.logo-text {
    position: relative;
    display: inline-block;
    background: linear-gradient(
        100deg,
        #ff8c69 0%, #ffd27a 20%, #8c7aff 40%, #48f0be 60%, #ff8c69 80%, #ffd27a 100%
    );
    background-size: 250% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: logoShineSweep 6s linear infinite;
}
@keyframes logoShineSweep {
    0%   { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

/* ---------- Category picker trigger di header ---------- */
.category-picker-trigger {
    cursor: pointer;
    border-radius: 8px;
    padding: 4px 8px;
    transition: background 0.2s ease;
}
.category-picker-trigger:hover,
.category-picker-trigger:focus-visible {
    background: rgba(255, 255, 255, 0.08);
}

/* ---------- Modal Picker: overlay + kotak modal ---------- */
.category-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(5, 3, 15, 0.72);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.category-picker-overlay.hidden {
    display: none;
}

.category-picker-modal {
    width: 100%;
    max-width: 720px;
    max-height: 85vh;
    overflow-y: auto;
    background: rgba(22, 17, 38, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    padding: 24px;
}

.category-picker-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.category-picker-modal-header h3 {
    margin: 0;
    font-family: 'Sora', 'Poppins', sans-serif;
}
.category-picker-close {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s ease;
}
.category-picker-close:hover {
    background: rgba(255, 107, 129, 0.3);
}

.category-picker-section {
    margin-bottom: 20px;
}
.category-picker-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}
.category-picker-hint {
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    color: var(--text-muted);
    font-size: 11px;
}

.category-picker-themes,
.category-picker-sets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-chip {
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}
.category-chip:hover:not(.disabled) {
    background: rgba(140, 122, 255, 0.2);
    border-color: rgba(140, 122, 255, 0.5);
}
.category-chip.active {
    background: linear-gradient(135deg, #8c7aff, #48f0be);
    color: #0b0818;
    font-weight: 700;
    border-color: transparent;
}
.category-chip.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---------- Logo DUMADI di header (teks nama permainan tampil di sebelahnya) ---------- */
.logo-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.logo-image {
    height: 46px;
    width: auto;
    max-width: 72px;
    object-fit: contain;
    display: block;
}
