/* ================================================================
   css/style.css  —  Tampilan Game "Jelajah Bali"
   Edit file ini untuk mengubah warna, ukuran, animasi, dll.
   ================================================================ */

/* ─── Variabel Warna & Efek ────────────────────────────────────── */
:root {
    --primary: #FF9F1C;
    --primary-dark: #E76F51;
    --accent: #2A9D8F;
    --success: #2ecc71;
    --error: #e74c3c;
    --glass: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.18);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background: #0d1117;
    color: #fff;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* ─── Background Layer ─────────────────────────────────────────── */
#bg {
    position: fixed;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: background-image 0.8s ease;
    z-index: 0;
}

#bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(10, 15, 30, 0.62);
    pointer-events: none;
}

/* ─── Layar / Screens ──────────────────────────────────────────── */
.screen {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}

.screen.visible {
    display: flex;
    animation: fadeIn 0.45s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.97);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ─── Panel Kaca (Glassmorphism) ───────────────────────────────── */
.panel {
    background: var(--glass);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    width: 100%;
    max-width: 480px;
    text-align: center;
}

.panel.wide {
    max-width: 820px;
    text-align: left;
}

/* ─── Layar Beranda ────────────────────────────────────────────── */
.badge {
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.title {
    font-size: 3.8rem;
    font-weight: 800;
    letter-spacing: 2px;
    line-height: 1.05;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.title .hl {
    background: linear-gradient(90deg, var(--primary), #FFD166);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: rgba(255, 255, 255, 0.65);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
}

/* ─── Tombol ───────────────────────────────────────────────────── */
.btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    padding: 15px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    border-radius: 50px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 6px 22px rgba(231, 111, 81, 0.45);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(231, 111, 81, 0.65);
}

.btn:active {
    transform: translateY(1px);
}

.btn-back {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    padding: 8px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ─── Top Bar ──────────────────────────────────────────────────── */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
    z-index: 50;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.score-chip {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 7px 18px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.star {
    color: #F1C40F;
}

/* ─── Peta Level ───────────────────────────────────────────────── */
#screen-map {
    justify-content: flex-start;
    padding-top: 90px;
}

.cards-wrap {
    display: flex;
    gap: 1.8rem;
    padding: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 1200px;
    overflow-y: auto;
    max-height: calc(100vh - 110px);
}

.card {
    width: 270px;
    height: 360px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.35s, border-color 0.35s;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(6px);
}

.card:not(.locked):hover {
    transform: translateY(-12px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
    border-color: var(--primary);
}

.card.locked {
    filter: grayscale(1) opacity(0.6);
    cursor: not-allowed;
}

.card-img {
    height: 62%;
    background-size: cover;
    background-position: center;
    position: relative;
}

.card-img::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 55%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
}

.lock-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.65);
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    z-index: 2;
}

.card-body {
    padding: 1.2rem 1.4rem;
}

.card-body h3 {
    font-size: 1.3rem;
    margin-bottom: 4px;
}

.card-body p {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.6);
}

/* ─── Layar Cerita ─────────────────────────────────────────────── */
#screen-story {
    padding-top: 80px;
}

.story-header {
    margin-bottom: 1.4rem;
}

.loc-tag {
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 14px;
    border-radius: 16px;
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 0.7rem;
}

.story-header h2 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
}

.story-body {
    font-size: 1.1rem;
    line-height: 1.85;
    color: rgba(255, 255, 255, 0.88);
    max-height: 46vh;
    overflow-y: auto;
    padding-right: 8px;
    margin-bottom: 1.5rem;
}

.story-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ─── Layar Kuis ───────────────────────────────────────────────── */
.quiz-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1.2rem;
}

.quiz-badge {
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 14px;
    border-radius: 16px;
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.progress-wrap {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    height: 9px;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.4s ease;
    border-radius: 5px;
}

.question-text {
    font-size: 1.7rem;
    font-weight: 600;
    line-height: 1.45;
    margin-bottom: 1.8rem;
}

.q-count {
    display: block;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 8px;
    font-weight: 400;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.opt-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    padding: 16px 22px;
    font-size: 1.05rem;
    font-family: 'Outfit', sans-serif;
    border-radius: 14px;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: background 0.2s, border-color 0.2s, transform 0.18s;
}

.opt-btn::before {
    content: '';
    display: inline-block;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s;
}

.opt-btn:hover {
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(255, 255, 255, 0.45);
    transform: translateX(5px);
}

.opt-btn.correct {
    background: rgba(46, 204, 113, 0.18);
    border-color: var(--success);
}

.opt-btn.correct::before {
    background: var(--success);
    border-color: var(--success);
}

.opt-btn.wrong {
    background: rgba(231, 76, 60, 0.18);
    border-color: var(--error);
}

.opt-btn.wrong::before {
    background: var(--error);
    border-color: var(--error);
}

/* ─── Layar Hasil Akhir ────────────────────────────────────────── */
.trophy {
    font-size: 4rem;
    margin-bottom: 0.5rem;
}

#screen-end h2 {
    font-size: 2rem;
    margin-bottom: 0.4rem;
}

.result-desc {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 1.5rem;
}

.score-final {
    font-size: 5.5rem;
    font-weight: 800;
    color: var(--primary);
    text-shadow: 0 0 20px rgba(255, 159, 28, 0.5);
    line-height: 1;
}

.feedback {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--accent);
    margin: 0.8rem 0 1.8rem;
}

/* ─── Scrollbar ────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 7px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 6px;
}

/* ─── Responsif Mobile ─────────────────────────────────────────── */
@media (max-width: 600px) {
    .title {
        font-size: 2.6rem;
    }

    .question-text {
        font-size: 1.3rem;
    }

    .story-header h2 {
        font-size: 1.6rem;
    }

    .card {
        width: 100%;
        max-width: 320px;
    }
}