:root {
    --primary-color: #FFC300; /* Kuning Emas, untuk Judul Utama */
    --secondary-color: #FF5733; /* Oranye Merah, untuk Aksen Timer */
    --background-dark: #1A1A2E; /* Biru Gelap, untuk overlay konten */
    --text-light: #F0F0F0;
    --text-accent: #00bcd4; /* Biru terang untuk beberapa aksen dan glow */
    --button-bg: linear-gradient(135deg, #00BCD4, #00897B); /* Gradien biru-tosca */
    --button-hover-bg: linear-gradient(135deg, #00E5FF, #00C853);
    --border-glow: #00e5ff;
    --incorrect-red: #D32F2F;
}
/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%; 
    overflow: auto;
}

body {
    background-color: #111111; 
    color: var(--text-light);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 0; 
}

.main-wrapper {
    position: relative;
    width: 100vw; 
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible; 
}

/* Page Transitions */
.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw; 
    min-height: 100vh; 
    height: auto; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: transparent; 
    padding: 0; 
    text-align: center;
    transition: transform 0.8s ease-in-out, opacity 0.8s ease-in-out;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
}

.page.hidden {
    transform: translateX(100vw);
    opacity: 0;
    pointer-events: none;
}

.page.active {
    transform: translateX(0);
    opacity: 1;
    pointer-events: all;
}


/* --- 1. Cover Page Styles (Background Koloseum/Gambar 9818c1.jpg) --- */
#cover-page {
    height: 100vh; 
    width: 100vw;
    position: relative;
    background-image: url('../img/background.webp'); 
    background-color: #000000;
}

/* Tambahkan overlay gelap di atas background cover page */
#cover-page::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); 
    z-index: 1;
}

.cover-text-overlay {
    /* Box abu-abu konten */
    background: rgba(0, 0, 0, 0.6); 
    border-radius: 15px;
    padding: 5vh;
    max-width: 90vw;
    width: 700px; 
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
    position: relative;
    border: 2px solid var(--border-glow); 
    box-shadow: 0 0 20px var(--border-glow);
    z-index: 2; /* Di atas overlay */
}

.cover-background-img {
    /* Ini seharusnya untuk gambar background COLOSSEUM di Gambar 1.
       Jika Gambar 1 itu background utuh, maka ini tidak perlu.
       Jika Anda ingin gambar latar khusus untuk cover,
       pastikan path gambarnya benar.
       Untuk saat ini, saya akan berasumsi background dari body cukup.
    */
    display: none; /* Sembunyikan jika background body sudah cukup */
}

.top-logo-placeholder {
    font-family: 'Oswald', sans-serif;
    font-size: clamp(1.5em, 3vw, 2.5em);
    font-weight: 700;
    color: #CCCCCC;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.main-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(3em, 8vw, 6em); 
    font-weight: 900;
    color: var(--primary-color);
    text-shadow: 0 0 15px var(--primary-color), 0 0 25px rgba(255, 195, 0, 0.7);
    letter-spacing: 5px;
    margin: 0;
    line-height: 1;
}

.subtitle-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--text-accent);
    padding: 10px 20px;
    border-radius: 5px;
    margin: 15px 0;
}

.subtitle {
    font-size: clamp(1em, 1.5vw, 1.2em);
    font-weight: 400;
    color: var(--text-light);
    text-transform: uppercase;
}

.smart-battle-text {
    font-family: 'Oswald', sans-serif;
    font-size: clamp(1.2em, 2.5vw, 1.8em);
    font-weight: 700;
    color: var(--text-accent);
    text-shadow: 0 0 8px var(--text-accent);
    margin-top: 10px;
    letter-spacing: 2px;
}


/* --- 2. Rules Page Styles (Background Hutan Berkabut) --- */
#rules-page {
    /* Background Khusus Rules Page */
    background-image: url('../img/background.webp'); 
    background-color: #101010; 
    position: relative; 
}

/* Tambahkan overlay gelap di atas background image rules page */
#rules-page::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

/* Kontainer untuk seluruh konten Rules Page (Judul, Daftar, Tombol) */
.rules-content-wrapper {
    position: relative; 
    z-index: 2; /* Di atas overlay */
    background: rgba(36, 36, 64, 0.7); 
    border: 2px solid var(--text-accent);
    box-shadow: 0 0 25px var(--text-accent);
    width: 90vw;
    max-width: 900px;
    height: auto;
    min-height: 70vh;
    padding: 50px;
    border-radius: 15px; 
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}


.rules-header {
    margin-bottom: 30px;
}

.rules-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2em, 4vw, 3em);
    font-weight: 900;
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-color);
}

.rules-subtitle {
    font-size: clamp(1em, 2vw, 1.5em);
    font-weight: 700;
    color: var(--text-light);
    margin-top: 10px;
}

.rules-content {
    text-align: left;
    max-width: 700px;
    margin-bottom: 40px;
    padding: 0 20px;
    width: 100%;
    background: rgba(0, 0, 0, 0.4); 
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.rules-content ol {
    list-style: none;
    counter-reset: rule-counter;
}

.rules-content ol li {
    font-size: clamp(1em, 1.5vw, 1.2em);
    margin-bottom: 15px;
    position: relative;
    padding-left: 40px;
    line-height: 1.5;
}

.rules-content ol li::before {
    counter-increment: rule-counter;
    content: counter(rule-counter) ".";
    position: absolute;
    left: 0;
    top: 0;
    font-size: 1.5em;
    font-weight: 900;
    color: var(--text-accent);
    text-shadow: 0 0 5px var(--text-accent);
}


/* --- 3. Game Page Styles (Trivia Blitz - Background Nebula/Gelap) --- */
#game-page {
    /* Background Khusus Game Page */
    background-image: url('../img/background-game.webp');
    background-color: #1A1A2E;
    position: relative;
}

/* Overlay untuk game page */
#game-page::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

#game-page .game-container {
    /* Box utama game */
    background: rgba(36, 36, 64, 0.9); 
    padding: 50px;
    border-radius: 15px; 
    z-index: 2;
}

#game-page .header {
    margin-bottom: 20px;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 10px;
}

#game-page #game-title {
    font-size: clamp(2.5em, 5vw, 4em);
    font-weight: 900;
    color: var(--primary-color);
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
}

#game-page #question-counter {
    font-size: clamp(1em, 2vw, 1.3em);
    margin-top: 5px;
}

/* Timer Area */
#game-page .timer-area {
    position: relative;
    width: 60%;
    max-width: 500px;
    margin: 20px auto;
    background: #333355;
    border-radius: 10px;
    overflow: hidden;
    height: 8vh; 
    min-height: 60px;
}

#game-page #timer-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    transition: width 0.1s linear;
    z-index: 1;
}

#game-page #timer-display {
    position: relative;
    font-size: clamp(3em, 7vw, 5em);
    font-weight: 900;
    color: var(--text-light);
    text-shadow: 0 0 10px rgba(255, 195, 0, 0.7);
    line-height: 8vh;
    min-height: 60px;
    z-index: 2;
}


/* Content Area */
#game-page .content-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 30px 0;
}

#game-page #question-box {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid var(--border-glow);
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 20px;
    min-height: 15vh;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px var(--border-glow);
}

#game-page #current-question {
    font-size: clamp(1.8em, 3.5vw, 2.5em);
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-light);
}

/* Jawaban */
#game-page #answer-box {
    background: var(--background-dark);
    border: 2px dashed var(--secondary-color);
    padding: 15px;
    border-radius: 8px;
    transition: opacity 0.5s;
    margin-top: 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

#game-page .answer-label {
    font-weight: 700;
    color: var(--secondary-color);
    display: block;
    margin-bottom: 5px;
}

#game-page #correct-answer-text {
    font-size: clamp(2em, 4vw, 3em);
    font-weight: 900;
    color: var(--primary-color);
}

/* Kontrol Tombol Umum (Untuk Semua Halaman) */
.main-btn {
    padding: 15px 35px;
    font-size: clamp(1.2em, 2vw, 1.8em);
    font-weight: 900;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
    text-transform: uppercase;
    color: var(--text-light);
    background: var(--button-bg);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.main-btn:hover:not(:disabled) {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    background: var(--button-hover-bg);
}

.main-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(70%);
}

#game-page .controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

#game-page .controls button {
    padding: 15px 30px;
    font-size: clamp(1em, 2vw, 1.3em);
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    text-transform: uppercase;
    color: var(--text-light);
    background-color: #555577; 
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

#game-page .controls button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    background-color: #777799;
}

#game-page #show-answer-btn {
    background-color: var(--secondary-color);
}
#game-page #show-answer-btn:hover:not(:disabled) {
    background-color: #FF7755;
}

#game-page #next-question-btn {
    background-color: var(--primary-color);
    color: var(--background-dark);
}
#game-page #next-question-btn:hover:not(:disabled) {
    background-color: #FFD700;
}

/* --- 4. Finish Page Styles --- */
#finish-page {
    /* Background Khusus untuk Finish Page (bisa sama dengan cover/game) */
    background-image: url('../img/background.webp');
    background-color: #1A1A2E;
    position: relative;
}

/* Overlay untuk finish page */
#finish-page::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.finish-content-overlay {
    position: relative; 
    z-index: 2;
    background: rgba(36, 36, 64, 0.9);
    border: 3px solid var(--primary-color);
    box-shadow: 0 0 40px var(--primary-color);
    width: 80vw;
    max-width: 650px;
    padding: 70px 40px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    align-items: center;
}

.finish-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(3em, 6vw, 5em);
    font-weight: 900;
    color: var(--text-accent);
    text-shadow: 0 0 15px var(--text-accent);
    line-height: 1;
}

.finish-subtitle {
    font-size: clamp(1.5em, 3vw, 2.5em);
    font-weight: 700;
    color: var(--primary-color);
    margin-top: -15px;
}

.finish-message {
    font-size: clamp(1em, 1.8vw, 1.5em);
    color: var(--text-light);
    margin-top: 10px;
}

.finish-message-winner {
    font-size: clamp(1.2em, 2vw, 1.7em);
    font-weight: 700;
    color: var(--secondary-color);
}


/* Utility Class */
.hidden {
    display: none !important;
}

/* Animasi Timer Habis */
.timer-area.time-up #timer-display {
    color: var(--incorrect-red);
    animation: flash 1s infinite;
}

@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ============================================== */
/* === MEDIA QUERIES UNTUK TAMPILAN RESPONSIVE === */
/* ============================================== */

/* --- 1. Tablet dan Layar Kecil (Max Width: 992px) --- */
@media (max-width: 992px) {
    
    /* Global Container */
    .cover-text-overlay,
    .rules-content-wrapper,
    #game-page .game-container,
    .finish-content-overlay {
        width: 95vw; /* Lebarkan sedikit di tablet */
        max-width: none;
        padding: 40px 30px;
    }

    /* Cover Page */
    .main-title {
        font-size: clamp(3em, 10vw, 5em); /* Izinkan judul lebih besar di mobile/tablet */
    }

    /* Rules Page */
    .rules-content-wrapper {
        min-height: 80vh; /* Tambahkan tinggi minimal */
    }

    .rules-content ol li {
        padding-left: 35px; /* Kurangi padding untuk nomor */
        font-size: 1.1em;
    }
    
    .rules-content ol li::before {
        font-size: 1.3em;
    }
}


/* --- 2. Mobile / Ponsel (Max Width: 600px) --- */
@media (max-width: 600px) {

    /* Base Styles */
    body {
        /* Hapus overflow hidden untuk debugging, jika ada konten terpotong */
        overflow-y: auto;
    }

    /* Cover Page */
    .cover-text-overlay {
        padding: 30px 20px;
        min-height: 70vh;
        gap: 10px;
    }
    
    .main-title {
        font-size: clamp(2.5em, 12vw, 4em); /* Pastikan judul sangat responsif */
        letter-spacing: 3px;
    }
    
    .top-logo-placeholder {
        font-size: 1.2em;
    }
    
    .subtitle-box {
        padding: 8px 15px;
        margin: 10px 0;
    }
    
    .main-btn {
        padding: 12px 25px;
        font-size: 1.1em;
    }

    /* Rules Page */
    .rules-content-wrapper {
        padding: 30px 20px;
    }
    
    .rules-title {
        font-size: 2em;
    }

    .rules-content {
        padding: 15px;
    }

    .rules-content ol li {
        font-size: 1em;
        margin-bottom: 10px;
        padding-left: 30px;
    }
    
    .rules-content ol li::before {
        font-size: 1.2em;
    }

    /* Game Page */
    #game-page .game-container {
        padding: 3vh 3vw;
        /* KUNCI: Kurangi tinggi agar tombol terlihat */
        height: auto; /* Biarkan tinggi menyesuaikan konten */
        min-height: 95vh; /* Pastikan ia tetap terlihat besar */
        
        /* Tambahkan padding di bagian bawah agar tombol tidak menempel */
        padding-bottom: 50px; 
    }

    /* Timer Area */
    #game-page .timer-area {
        width: 80%; /* Lebih lebar di mobile */
        height: 7vh; 
        min-height: 50px;
    }

    #game-page #timer-display {
        font-size: 3em;
        line-height: 7vh;
        min-height: 50px;
    }
    
    #game-page #current-question {
        font-size: 1.5em; /* Kecilkan ukuran font soal */
    }
    
    /* Controls Button */
    #game-page .controls {
        flex-direction: column; 
        gap: 10px;
        /* Tambahkan margin atas untuk menjauhkan dari answer box */
        margin-top: 20px; 
    }

    #game-page .controls button {
        padding: 12px 20px;
        font-size: 1em;
    }

    /* Finish Page */
    .finish-content-overlay {
        padding: 40px 20px;
    }
    
    .finish-title {
        font-size: 3em;
    }
    
    .finish-subtitle {
        font-size: 1.5em;
    }
}