:root {
    --brand: #2563eb;
    --accent: #10b981;
    --dark: #0f172a;
    --muted: #64748b;
    --bg: #f8fafc;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { 
    font-family: 'Plus Jakarta Sans', sans-serif; 
    background: var(--bg); 
    color: var(--dark); 
    scroll-behavior: smooth;
    line-height: 1.6;
}

/* --- Navigation --- */
nav { 
    background: rgba(255,255,255,0.9); 
    backdrop-filter: blur(10px); 
    position: fixed; 
    width: 100%; 
    top: 0; 
    z-index: 1000; 
    padding: 15px 0; 
    border-bottom: 1px solid #e2e8f0; 
}
.nav-container { 
    max-width: 1100px; 
    margin: auto; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 0 20px; 
}
.logo { font-weight: 800; font-size: 1.5rem; }
.logo span { color: var(--brand); }
.nav-links a { 
    text-decoration: none; 
    color: var(--dark); 
    font-weight: 700; 
    margin-left: 20px; 
    font-size: 0.9rem; 
    transition: 0.3s; 
}
.nav-links a:hover { color: var(--brand); }

/* --- Hero Section --- */
.hero { 
    padding: 160px 20px 80px; 
    text-align: center; 
    background: radial-gradient(circle at top right, #dbeafe, #f8fafc); 
}
.ark-badge { 
    display: inline-block; 
    background: #e0e7ff; 
    color: var(--brand); 
    padding: 8px 16px; 
    border-radius: 50px; 
    font-weight: 800; 
    font-size: 0.7rem; 
    margin-bottom: 20px; 
    letter-spacing: 1px; 
}
.hero h1 { font-size: 4rem; font-weight: 800; margin-bottom: 20px; }
.hero-desc { max-width: 650px; margin: 0 auto 30px; color: var(--muted); }

/* --- Buttons --- */
.hero-btns { display: flex; gap: 15px; justify-content: center; }
.btn-main { background: var(--dark); color: white; padding: 16px 32px; border-radius: 12px; text-decoration: none; font-weight: 800; display: inline-block; transition: 0.3s; }
.btn-sub { background: white; color: var(--dark); padding: 16px 32px; border-radius: 12px; text-decoration: none; font-weight: 800; border: 2px solid #e2e8f0; display: inline-block; transition: 0.3s; }
.btn-main:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
.btn-sub:hover { background: #f1f5f9; }

.btn-prime { 
    background: var(--brand); 
    color: white; 
    border: none; 
    padding: 15px; 
    border-radius: 10px; 
    font-weight: 800; 
    cursor: pointer; 
    width: 100%; 
    transition: 0.3s; 
}
.btn-prime:hover { background: #1e40af; transform: scale(1.02); }
.btn-prime:disabled { background: #cbd5e1; cursor: not-allowed; transform: none; }

/* --- Containers & General --- */
.container { max-width: 1000px; margin: auto; padding: 20px; }
section { padding: 80px 0; }
.text-center { text-align: center; }
.step-label { color: var(--brand); font-weight: 800; font-size: 0.8rem; text-transform: uppercase; margin-bottom: 10px; display: block; }

/* --- BMI Section --- */
.glass-card { background: white; padding: 40px; border-radius: 30px; box-shadow: 0 20px 40px rgba(0,0,0,0.03); }
.bmi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 30px; }
.input-box { margin-bottom: 15px; text-align: left; }
.input-box label { font-weight: 700; font-size: 0.85rem; color: var(--muted); display: block; margin-bottom: 5px; }
.input-box input { width: 100%; padding: 12px; border-radius: 10px; border: 2px solid #f1f5f9; font-weight: 700; outline: none; transition: 0.3s; }
.input-box input:focus { border-color: var(--brand); }

.bmi-history-container { background: #f8fafc; padding: 20px; border-radius: 20px; }
.history-title { font-weight: 800; font-size: 0.9rem; margin-bottom: 10px; color: var(--dark); }
.history-list { max-height: 250px; overflow-y: auto; padding-right: 5px; }
.history-item { 
    background: white; 
    padding: 12px; 
    border-radius: 12px; 
    margin-bottom: 10px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    border-left: 4px solid var(--brand); 
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.history-item strong { color: var(--brand); }
.history-item span:last-child { font-size: 0.75rem; color: var(--muted); font-weight: 600; }

/* --- Resilience Section (Game Dashboard) --- */
.challenge-box { background: white; padding: 40px; border-radius: 30px; box-shadow: 0 20px 40px rgba(0,0,0,0.03); }

/* XP & Rank Cards */
.xp-badge-container { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 20px; 
    margin-bottom: 30px; 
}
.xp-card, .rank-card { 
    background: #f8fafc; 
    padding: 20px; 
    border-radius: 20px; 
    border: 2px solid #f1f5f9; 
    transition: 0.3s; 
    text-align: center;
}
.xp-card:hover, .rank-card:hover { border-color: var(--brand); transform: translateY(-5px); }
.xp-label { display: block; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; color: var(--muted); letter-spacing: 1px; margin-bottom: 5px; }
.xp-card h2 { color: var(--brand); font-size: 2.2rem; margin: 0; }
.xp-card h2 small { font-size: 0.9rem; color: var(--muted); }
.rank-card h3 { color: var(--dark); font-size: 1.3rem; font-weight: 800; margin: 5px 0 0; }

/* Tabs Misi */
.tabs-scroll-container { width: 100%; overflow-x: auto; padding-bottom: 15px; margin-bottom: 25px; }
.tabs-wrapper { display: flex; gap: 10px; justify-content: center; min-width: max-content; }
.t-btn { padding: 10px 20px; border-radius: 12px; border: none; background: #f1f5f9; font-weight: 700; cursor: pointer; white-space: nowrap; transition: 0.3s; }
.t-btn.active { background: var(--brand); color: white; box-shadow: 0 4px 10px rgba(37,99,235,0.2); }

/* Mission Card */
.main-mission-card { 
    background: #f8fafc; 
    padding: 40px; 
    border-radius: 25px; 
    text-align: center; 
    max-width: 600px; 
    margin: 0 auto; 
    border: 1px solid #e2e8f0; 
}
.big-emoji { font-size: 4rem; margin-bottom: 15px; }
.m-desc { color: var(--muted); margin: 10px 0 25px; font-size: 0.95rem; }
.progress-area { margin-bottom: 25px; }
.p-bar-bg { background: #e2e8f0; height: 14px; border-radius: 10px; overflow: hidden; margin-bottom: 10px; }
.p-bar-fill { background: var(--accent); height: 100%; width: 0%; transition: 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
.p-stats { font-weight: 800; color: var(--dark); font-size: 1.1rem; }

.mission-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.btn-link { background: none; border: none; color: var(--muted); text-decoration: underline; cursor: pointer; font-weight: 600; font-size: 0.85rem; }
.btn-link:hover { color: var(--brand); }

/* --- Knowledge Hub --- */
.knowledge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 30px; }
.k-card { background: white; padding: 30px; border-radius: 24px; border: 1px solid #f1f5f9; transition: 0.3s; cursor: pointer; position: relative; overflow: hidden; }
.k-card:hover { transform: translateY(-10px); box-shadow: 0 15px 30px rgba(0,0,0,0.05); border-color: var(--brand); }
.k-badge { background: #e0e7ff; color: var(--brand); font-size: 0.7rem; font-weight: 800; padding: 4px 10px; border-radius: 6px; margin-bottom: 15px; display: inline-block; }
.k-card h3 { margin-bottom: 10px; font-size: 1.2rem; }
.k-card p { font-size: 0.9rem; color: var(--muted); }
.k-more { color: var(--brand); font-weight: 800; font-size: 0.8rem; margin-top: 20px; display: block; }

/* --- Modals --- */
.modal { 
    display: none; 
    position: fixed; 
    z-index: 2000; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(15, 23, 42, 0.8); 
    backdrop-filter: blur(8px);
    align-items: center; 
    justify-content: center; 
}
.modal-content { 
    background: white; 
    padding: 40px; 
    border-radius: 30px; 
    max-width: 650px; 
    width: 90%;
    position: relative; 
    max-height: 85vh;
    overflow-y: auto;
    animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes modalPop { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
.close { position: absolute; right: 25px; top: 20px; cursor: pointer; font-size: 1.8rem; font-weight: bold; color: var(--muted); transition: 0.2s; }
.close:hover { color: var(--dark); }

.modal h2 { margin-bottom: 20px; color: var(--dark); font-size: 1.8rem; }
.ref-box { background: #f1f5f9; padding: 20px; border-radius: 15px; margin-top: 25px; font-size: 0.8rem; text-align: left; border-left: 4px solid var(--brand); }
.ref-box strong { display: block; margin-bottom: 10px; font-size: 0.9rem; }
.ref-box ul { padding-left: 20px; }
.ref-box li { margin-bottom: 8px; }
.ref-box a { color: var(--brand); text-decoration: none; font-weight: 700; }
.ref-box a:hover { text-decoration: underline; }

/* --- Footer --- */
footer { padding: 80px 20px 40px; background: white; border-top: 1px solid #e2e8f0; }
.f-hr { margin: 30px 0; border: 0; border-top: 1px solid #f1f5f9; }
.copyright { font-size: 0.85rem; color: var(--muted); font-weight: 600; }

/* --- Media Queries --- */
@media (max-width: 900px) {
    .knowledge-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2.8rem; }
    .bmi-grid, .knowledge-grid { grid-template-columns: 1fr; }
    .xp-badge-container { grid-template-columns: 1fr; }
    .tabs-wrapper { justify-content: flex-start; }
    .hero-btns { flex-direction: column; padding: 0 40px; }
}