/* =============================================
   GOOGLE FONTS
   ============================================= */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Poppins:wght@400;600;700;800&display=swap');

/* =============================================
   DESIGN TOKENS
   ============================================= */
:root {
    --lime:         #ff6b00;
    --lime-bright:  #ff8b3d;
    --lime-dark:    #cc5600;
    --lime-deep:    #662b00;
    --success:      #ff6b00;
    --danger:       #f43f5e;
    --warning:      #f59e0b;
    --text:         #f8fafc;
    --text-muted:   #94a3b8;
    --text-dim:     #64748b;
    --surface:      rgba(25, 20, 15, 0.7);
    --surface-2:    rgba(35, 25, 20, 0.8);
    --border:       rgba(255, 107, 0, 0.15);
    --border-hover: rgba(255, 107, 0, 0.4);
    --r-xl:         24px;
    --r-lg:         18px;
    --r-md:         12px;
    --r-sm:         8px;
    --shadow-lg:    0 24px 64px rgba(0,0,0,0.6);
    --shadow-lime:  0 0 30px rgba(255,107,0,0.15);
    --transition:   0.25s cubic-bezier(0.4,0,0.2,1);
}

/* =============================================
   RESET
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button { cursor: pointer; border: none; font-family: inherit; }

/* =============================================
   BACKGROUND ORBS
   ============================================= */
body {
    font-family: 'Nunito', sans-serif;
    background: #050d05;
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

.bg-orbs { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.45;
    animation: floatOrb 18s ease-in-out infinite;
}
.orb-1 { width: 420px; height: 420px; background: radial-gradient(circle, #1a4d1a, transparent); top: -10%; left: -10%; animation-duration: 20s; }
.orb-2 { width: 300px; height: 300px; background: radial-gradient(circle, #365314, transparent); bottom: 10%; right: -5%; animation-duration: 25s; animation-delay: -8s; }
.orb-3 { width: 200px; height: 200px; background: radial-gradient(circle, #4a7c59, transparent); top: 50%; left: 50%; animation-duration: 15s; animation-delay: -4s; }

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%       { transform: translate(30px, -20px) scale(1.05); }
    66%       { transform: translate(-20px, 25px) scale(0.97); }
}

/* =============================================
   MAIN CONTAINER
   ============================================= */
.container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 1rem;
    border-radius: 0;
    background: var(--surface);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: none;
    box-shadow: none;
    overflow-y: auto;
    min-height: 100vh;
}

@media (min-width: 600px) {
    .container { padding: 2rem 2.5rem; }
}
@media (min-width: 900px) {
    body { align-items: flex-start; }
    .container { padding: 2.5rem 3rem; }
}

.screen { animation: screenIn 0.35s ease both; }
@keyframes screenIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hidden { display: none !important; }
.mb-1 { margin-bottom: 1rem; }

/* =============================================
   SECTION TITLE
   ============================================= */
.section-title {
    font-family: 'Poppins', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--lime);
    margin-bottom: 0.85rem;
    opacity: 0.8;
}

/* =============================================
   ONBOARDING
   ============================================= */
.onboarding-card { text-align: center; padding: 0.5rem 0; }

.brand-logo {
    position: relative;
    display: inline-block;
    margin-bottom: 0.75rem;
}
.brand-emoji {
    font-size: 4rem;
    display: block;
    filter: drop-shadow(0 0 20px rgba(163,230,53,0.6));
    animation: pulse-glow 3s ease-in-out infinite;
}
@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 0 16px rgba(163,230,53,0.5)); }
    50%       { filter: drop-shadow(0 0 32px rgba(163,230,53,0.9)); }
}

.brand-title {
    font-family: 'Poppins', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--lime), #ffb380);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.35rem;
}

.brand-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-hover), transparent);
    margin: 1.25rem 0;
}

.input-group { margin-bottom: 1rem; text-align: left; }

.input-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--lime);
    margin-bottom: 0.45rem;
    letter-spacing: 0.3px;
}

.input-group input {
    width: 100%;
    padding: 0.85rem 1.1rem;
    border-radius: var(--r-md);
    border: 1.5px solid var(--border);
    background: rgba(0,0,0,0.35);
    color: var(--text);
    font-family: 'Nunito', sans-serif;
    font-size: 0.97rem;
    font-weight: 600;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.input-group input::placeholder { color: rgba(255,255,255,0.2); }
.input-group input:focus {
    border-color: var(--lime);
    background: rgba(0,0,0,0.5);
    box-shadow: 0 0 0 3px rgba(163,230,53,0.12);
}

/* =============================================
   PRIMARY BUTTON
   ============================================= */
.primary-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.95rem 2rem;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--lime-bright), var(--lime));
    color: white;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.3px;
    box-shadow: 0 6px 24px rgba(255,107,0,0.4);
    transition: all var(--transition);
    margin-top: 0.5rem;
}
.primary-btn:hover {
    background: linear-gradient(135deg, var(--lime), var(--lime-dark));
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(255,107,0,0.55);
}
.primary-btn:active { transform: translateY(0); }
.btn-arrow { font-size: 1.1rem; transition: transform var(--transition); }
.primary-btn:hover .btn-arrow { transform: translateX(4px); }

/* =============================================
   PROFILE HEADER
   ============================================= */
.profile-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--surface-2);
    padding: 1.15rem;
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
    margin-bottom: 1.15rem;
}
.profile-main {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}
.profile-stats {
    display: flex;
    align-items: center;
    width: 100%;
    border-top: 1px dashed rgba(255,255,255,0.1);
    padding-top: 0.85rem;
}

.profile-avatar {
    font-size: 2rem;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(163,230,53,0.1);
    border: 2px solid var(--border-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-info { flex: 1; min-width: 0; }
.profile-info h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--lime), #ffb380);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.2;
}
.school-text { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; margin-top: 2px; }

.edit-btn {
    background: transparent;
    font-size: 1.1rem;
    padding: 0.4rem;
    border-radius: var(--r-sm);
    transition: transform var(--transition), opacity var(--transition);
    opacity: 0.65;
    flex-shrink: 0;
}
.edit-btn:hover { opacity: 1; transform: rotate(20deg); }

/* =============================================
   XP BAR
   ============================================= */
.xp-bar-container {
    margin-bottom: 1.5rem;
}
.xp-bar-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}
.xp-label {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--lime);
}
.xp-bar-track {
    height: 8px;
    background: rgba(0,0,0,0.4);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.xp-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--lime-dark), var(--lime));
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 0 8px rgba(163,230,53,0.5);
}

/* =============================================
   CATEGORY CARDS
   ============================================= */
.category-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0;
}

.category-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.1rem 1.25rem;
    text-align: left;
    color: var(--text);
    transition: all var(--transition);
}
.category-card:hover {
    border-color: var(--lime);
    background: rgba(163,230,53,0.06);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(163,230,53,0.15);
}
.cat-icon { font-size: 2.2rem; flex-shrink: 0; }
.cat-info { flex: 1; }
.cat-info h3 { font-family: 'Poppins', sans-serif; font-size: 1rem; font-weight: 700; margin-bottom: 0.2rem; }
.cat-info p { font-size: 0.82rem; color: var(--text-muted); }
.cat-arrow { font-size: 1.5rem; color: var(--lime); opacity: 0.6; transition: transform var(--transition); }
.category-card:hover .cat-arrow { transform: translateX(4px); opacity: 1; }

@media (min-width: 600px) {
    .category-grid { 
        display: grid; 
        grid-template-columns: repeat(3, 1fr); 
        gap: 1rem;
    }
    .category-card { flex-direction: column; text-align: center; padding: 1.5rem 1rem; height: 100%; }
    .cat-arrow { display: none; }
}

/* =============================================
   BACK BUTTON
   ============================================= */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-family: 'Nunito', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.4rem 0.9rem;
    border-radius: 50px;
    margin-bottom: 1rem;
    transition: all var(--transition);
}
.back-btn:hover { color: var(--lime); border-color: var(--lime); }

/* =============================================
   MODE CARDS
   ============================================= */
.mode-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}
@media (min-width: 480px) {
    .mode-grid { grid-template-columns: repeat(3, 1fr); }
}

.mode-card {
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.25rem 0.85rem;
    text-align: center;
    color: var(--text);
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
}
.mode-card:hover {
    border-color: var(--lime);
    background: rgba(163,230,53,0.06);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(163,230,53,0.2);
}
.mode-card.mode-danger { border-color: rgba(220, 38, 38, 0.4); }
.mode-danger .mode-icon { color: var(--danger); text-shadow: 0 0 15px rgba(220, 38, 38, 0.5); }
.mode-danger:hover { background: rgba(220, 38, 38, 0.1); border-color: var(--danger); box-shadow: 0 8px 32px rgba(220, 38, 38, 0.2); }

.game-settings {
    margin-bottom: 1.5rem;
}
.compact-settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    background: transparent;
    border: none;
    padding: 0;
}
.setting-stack {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.compact-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 700;
    text-align: center;
}
.compact-input {
    width: 100%;
    background: rgba(255,107,0,0.05);
    border: 1px solid var(--lime);
    border-radius: var(--r-md);
    padding: 0.6rem;
    color: var(--text);
    font-size: 0.85rem;
    text-align: center;
    transition: all 0.2s ease;
}
.compact-input:focus {
    background: rgba(255,107,0,0.1);
    box-shadow: 0 0 15px rgba(255,107,0,0.2);
    outline: none;
}

.settings-header {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--lime);
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.setting-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.setting-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.setting-input {
    background: var(--surface-2);
    border: 1px solid var(--border-hover);
    color: var(--text);
    padding: 0.3rem 0.5rem;
    border-radius: var(--r-sm);
    font-family: 'Nunito', sans-serif;
    font-size: 0.8rem;
    outline: none;
    cursor: pointer;
    width: 90px;
    text-align: right;
}
.setting-input:focus { border-color: var(--lime); }
.setting-hint {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.8rem;
    opacity: 0.8;
}
.mode-icon { font-size: 2rem; display: block; margin-bottom: 0.5rem; }
.mode-card h3 { font-family: 'Poppins', sans-serif; font-size: 0.92rem; font-weight: 700; margin-bottom: 0.3rem; }
.mode-card p { font-size: 0.75rem; color: var(--text-muted); line-height: 1.4; margin-bottom: 0.5rem; }
.mode-badge {
    display: inline-block;
    background: rgba(163,230,53,0.12);
    border: 1px solid var(--border-hover);
    color: var(--lime);
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.15rem 0.55rem;
    border-radius: 50px;
    letter-spacing: 0.5px;
}
.mode-danger .mode-badge { background: rgba(244,63,94,0.1); border-color: rgba(244,63,94,0.3); color: #fda4af; }

/* =============================================
   GAME HEADER
   ============================================= */
.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.back-btn-sm {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-family: 'Nunito', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.4rem 0.85rem;
    border-radius: 50px;
    transition: all var(--transition);
}
.back-btn-sm:hover { color: var(--lime); border-color: var(--lime); }

.score-display {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 0.4rem 1rem;
    text-align: center;
}
.score-label { display: block; font-size: 0.65rem; font-weight: 800; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }
.score-value { font-family: 'Poppins', sans-serif; font-size: 1.4rem; font-weight: 800; color: var(--lime); }

/* =============================================
   TIMER
   ============================================= */
#timer-container { margin-bottom: 1rem; }
.timer-row {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
    justify-content: flex-end;
}
.timer-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 700; margin-right: auto; }
.timer-value { font-family: 'Poppins', sans-serif; font-size: 1.2rem; font-weight: 800; color: var(--lime); }
.timer-unit { font-size: 0.8rem; color: var(--text-muted); }
.timer-bar-track { height: 6px; background: rgba(0,0,0,0.4); border-radius: 3px; overflow: hidden; }
.timer-bar-fill { height: 100%; width: 100%; background: linear-gradient(90deg, var(--lime-dark), var(--lime)); border-radius: 3px; transition: width 1s linear, background 0.5s; }

/* =============================================
   MEDIA (FLAG & MAP)
   ============================================= */
.media-wrapper {
    width: 100%;
    height: 185px;
    border-radius: var(--r-lg);
    overflow: hidden;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 0.5rem 1rem;
    margin-bottom: 1.1rem;
}
@media (min-width: 600px) { .media-wrapper { height: 230px; } }

.media-flag {
    max-width: 48%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 6px;
    animation: fadeIn 0.4s ease;
    filter: drop-shadow(0 4px 16px rgba(0,0,0,0.4));
}

.media-map {
    max-width: 48%;
    max-height: 90%;
    object-fit: contain;
    animation: fadeIn 0.4s ease 0.1s both;
    /* Ubah SVG hitam menjadi putih agar terlihat di tema gelap */
    filter: invert(1) opacity(0.85) drop-shadow(0 4px 10px rgba(255,255,255,0.2));
}

/* =============================================
   QUESTION BOX
   ============================================= */
.question-box {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 1.1rem;
    text-align: center;
}
.question-text {
    font-family: 'Poppins', sans-serif;
    font-size: 0.97rem;
    font-weight: 600;
    line-height: 1.65;
    color: #e2e8f0;
}
@media (min-width: 600px) { .question-text { font-size: 1.08rem; } }

/* =============================================
   OPTIONS GRID
   ============================================= */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}
.options-grid.pancasila-grid {
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    gap: 0.65rem;
}
@media (min-width: 600px) {
    .options-grid.pancasila-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* =============================================
   OPTION BUTTONS
   ============================================= */
.option-btn {
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    color: var(--text);
    padding: 0.9rem 0.75rem;
    border-radius: var(--r-md);
    font-family: 'Nunito', sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    transition: all var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 52px;
    position: relative;
    overflow: hidden;
}
.option-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(163,230,53,0.08), transparent);
    opacity: 0;
    transition: opacity var(--transition);
}
.option-btn:hover:not(:disabled)::before { opacity: 1; }
.option-btn:hover:not(:disabled) {
    border-color: var(--lime);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(163,230,53,0.2);
}
.option-btn.correct {
    background: rgba(255,107,0,0.2);
    border-color: var(--success);
    box-shadow: 0 0 20px rgba(255,107,0,0.35);
    transform: scale(1.03);
}
.option-btn.wrong {
    background: rgba(244,63,94,0.2);
    border-color: var(--danger);
    animation: shake 0.4s ease;
}
@keyframes shake {
    0%,100% { transform: translateX(0); }
    25%      { transform: translateX(-7px); }
    75%      { transform: translateX(7px); }
}

/* Pancasila icon button */
.option-btn.pancasila-btn {
    flex-direction: column;
    padding: 1rem 0.5rem 0.9rem;
    gap: 0.55rem;
    min-height: 125px;
}
.symbol-emoji {
    font-size: 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 76px;
    height: 76px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 2.5px solid rgba(255,255,255,0.25);
    box-shadow: 0 4px 16px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.08);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.option-btn:hover .symbol-emoji {
    transform: scale(1.1) rotate(4deg);
    box-shadow: 0 6px 24px rgba(0,0,0,0.6), 0 0 16px rgba(163,230,53,0.4);
    border-color: rgba(163,230,53,0.6);
}
.symbol-text {
    font-size: 0.78rem;
    font-weight: 800;
    text-align: center;
    line-height: 1.3;
    color: var(--lime-bright);
    letter-spacing: 0.3px;
}

/* =============================================
   GAMEPLAY HUD & NEW ELEMENTS
   ============================================= */
.badge-label {
    display: inline-block;
    background: rgba(163,230,53,0.15);
    border: 1px solid var(--lime);
    color: var(--lime-bright);
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
    margin-top: 4px;
    letter-spacing: 0.5px;
}

.highscore-box {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.hs-label { font-size: 0.65rem; color: var(--text-muted); font-weight: 800; text-transform: uppercase; }
.hs-value { font-family: 'Poppins', sans-serif; font-size: 1.15rem; color: #fbbf24; font-weight: 800; }

.lives-container {
    display: flex;
    gap: 0.3rem;
    font-size: 1.2rem;
}
.heart { transition: all 0.3s; }
.heart.lost { filter: grayscale(100%) opacity(0.3); transform: scale(0.8); }

.hud-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.streak-indicator {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 0.9rem;
    color: #f97316;
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.3);
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.175,0.885,0.32,1.275);
    transform: scale(0.8);
    opacity: 0;
}
.streak-indicator.active {
    transform: scale(1);
    opacity: 1;
    animation: streakPulse 1s infinite alternate;
}
@keyframes streakPulse {
    from { box-shadow: 0 0 5px rgba(249,115,22,0.2); }
    to { box-shadow: 0 0 15px rgba(249,115,22,0.6); }
}

.powerups-container { display: flex; gap: 0.5rem; }
.powerup-btn {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.4rem 0.8rem;
    border-radius: var(--r-sm);
    transition: all 0.2s;
}
.powerup-btn:hover:not(:disabled) {
    background: rgba(163,230,53,0.1);
    border-color: var(--lime);
    transform: translateY(-2px);
}
.powerup-btn:active:not(:disabled) { transform: translateY(0); }
.powerup-btn.used {
    opacity: 0.4;
    pointer-events: none;
    filter: grayscale(1);
}

@media (max-width: 420px) {
    .options-grid.pancasila-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 0.5rem; }
    .option-btn.pancasila-btn { padding: 0.75rem 0.35rem; min-height: 98px; }
    .symbol-emoji { width: 45px; height: 45px; font-size: 25px; }
    .symbol-text { font-size: 10px; }
    .question-text { font-size: 11px; }
}

/* =============================================
   OVERLAYS
   ============================================= */
.overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 13, 5, 0.92);
    backdrop-filter: blur(14px);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: var(--r-xl);
    z-index: 30;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}
/* Need relative positioning on game-container */
#game-container { position: relative; }

.overlay-card {
    background: var(--surface-2);
    border: 1px solid var(--border-hover);
    border-radius: var(--r-xl);
    padding: 2rem 1.75rem;
    text-align: center;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.6), 0 0 40px rgba(163,230,53,0.08);
    animation: cardIn 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes cardIn {
    from { transform: scale(0.88); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.result-icon { font-size: 3.5rem; margin-bottom: 0.5rem; display: block; animation: bounce 0.5s ease; }
@keyframes bounce {
    0%  { transform: scale(0.5); }
    70% { transform: scale(1.2); }
    100%{ transform: scale(1); }
}

.result-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
}
.result-subtitle { font-size: 0.92rem; color: var(--text-muted); margin-bottom: 0; }
.result-subtitle strong { color: var(--lime-bright); }

/* =============================================
   FACT BOX
   ============================================= */
.fact-box {
    background: rgba(0,0,0,0.35);
    border: 1px solid var(--border);
    border-left: 3px solid var(--lime);
    border-radius: var(--r-md);
    padding: 0.9rem 1rem;
    margin: 1rem 0;
    text-align: left;
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-muted);
}
.fact-box p { margin-bottom: 0.35rem; }
.fact-box p:last-child { margin-bottom: 0; }
.fact-box strong { color: var(--text); }

.xp-gain {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--lime);
    margin-bottom: 0.75rem;
    text-shadow: 0 0 16px rgba(163,230,53,0.6);
    animation: popIn 0.5s cubic-bezier(0.175,0.885,0.32,1.275);
}

/* =============================================
   GAME OVER
   ============================================= */
.final-score-box {
    background: rgba(163,230,53,0.06);
    border: 1px solid var(--border-hover);
    border-radius: var(--r-lg);
    padding: 1rem 2rem;
    margin: 1rem 0;
    display: inline-block;
    min-width: 180px;
}
.final-score-label { display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.25rem; }
.final-score-value {
    font-family: 'Poppins', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    display: block;
    background: linear-gradient(135deg, var(--lime), #ffb380);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.game-over-reason { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 1rem; }

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
    0%   { transform: scale(0.3); opacity: 0; }
    100% { transform: scale(1);   opacity: 1; }
}

.watermark-credit {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    opacity: 0.6;
}

/* =============================================
   NEW FEATURES (ACTION BUTTONS, MODALS, MASCOT)
   ============================================= */
.action-buttons-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.action-btn {
    flex: 1;
    background: rgba(163,230,53,0.1);
    border: 1px solid var(--lime);
    color: var(--lime-bright);
    padding: 0.6rem;
    border-radius: var(--r-md);
    font-weight: 700;
    font-size: 0.85rem;
    transition: all var(--transition);
}
.action-btn:hover { background: rgba(163,230,53,0.2); transform: translateY(-2px); }

/* Leaderboard */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    max-height: 250px;
    overflow-y: auto;
    text-align: left;
}
.lb-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.3);
    padding: 0.5rem 0.8rem;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
}
.lb-rank { font-weight: 900; color: var(--lime); width: 25px; }
.lb-name { flex: 1; font-weight: 700; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-school { font-size: 0.7rem; color: var(--text-muted); display: block; }
.lb-score { font-family: 'Poppins', sans-serif; font-weight: 800; color: #fbbf24; }

/* Stickers */
.stickers-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-height: 250px;
    overflow-y: auto;
    padding: 0.5rem;
}
.sticker-item {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 1rem 0.5rem;
    text-align: center;
    transition: all 0.3s;
}
.sticker-icon { font-size: 2rem; filter: grayscale(1) opacity(0.3); transition: all 0.3s; }
.sticker-name { font-size: 0.65rem; color: var(--text-muted); margin-top: 0.3rem; font-weight: 700; }
.sticker-item.unlocked { border-color: var(--lime); background: rgba(163,230,53,0.1); }
.sticker-item.unlocked .sticker-icon { filter: grayscale(0) opacity(1); transform: scale(1.1); animation: popIn 0.4s ease; }
.sticker-item.unlocked .sticker-name { color: var(--lime-bright); }

/* Mascot */
.mascot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    pointer-events: none;
}
.mascot-char {
    font-size: 3.5rem;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
    transition: all 0.3s;
}
.mascot-happy { animation: mascotJump 0.5s ease; }
.mascot-sad { animation: mascotShake 0.5s ease; }

@keyframes mascotJump {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.1); }
}
@keyframes mascotShake {
    0%, 100% { transform: translateX(0) rotate(0); }
    25% { transform: translateX(-5px) rotate(-10deg); filter: grayscale(0.8); }
    75% { transform: translateX(5px) rotate(10deg); filter: grayscale(0.8); }
}

/* =============================================
   SPLASH COVER
   ============================================= */
.splash-cover {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at center, #1a1512 0%, #050d05 100%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.splash-cover.fade-out {
    opacity: 0;
    visibility: hidden;
}

.splash-content {
    text-align: center;
    animation: slideUpFade 1s ease-out;
}

.splash-icon {
    font-size: 6rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 25px rgba(255,107,0,0.4));
    animation: float 4s ease-in-out infinite;
}

.splash-title {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.splash-title span {
    color: var(--lime);
    background: linear-gradient(135deg, var(--lime-bright), var(--lime));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 3.5rem;
}

.splash-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    color: #a1a1aa;
    margin-bottom: 2.5rem;
    letter-spacing: 0.5px;
}

.splash-btn {
    background: linear-gradient(135deg, var(--lime-bright), var(--lime));
    color: white;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    border: none;
    box-shadow: 0 8px 30px rgba(255,107,0,0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.splash-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 40px rgba(255,107,0,0.7);
}

.splash-btn:active {
    transform: translateY(0) scale(0.98);
}

.splash-watermark {
    position: absolute;
    bottom: 2rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    color: rgba(255,255,255,0.4);
    letter-spacing: 2px;
    animation: fadeIn 2s ease-out 1s both;
}

@keyframes slideUpFade {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* =============================================
   REGISTRATION FORM
   ============================================= */
.registration-card {
    background: rgba(25, 25, 30, 0.7);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255,107,0,0.2);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    width: 90%;
    max-width: 500px;
}

.input-group {
    margin-bottom: 1.5rem;
    width: 100%;
}

.reg-input {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-family: 'Inter', sans-serif;
    color: white;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255,107,0,0.3);
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.reg-input::placeholder {
    color: rgba(255,255,255,0.4);
}

.reg-input:focus {
    border-color: var(--lime);
    box-shadow: 0 0 15px rgba(255,107,0,0.3);
    background: rgba(0, 0, 0, 0.5);
}

.mode-btn {
    flex: 1;
    padding: 0.8rem;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,107,0,0.3);
    color: rgba(255,255,255,0.6);
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s;
}

.mode-btn.active {
    background: rgba(255,107,0,0.2);
    border-color: var(--lime);
    color: white;
}

/* RESPONSIVE MOBILE SPLASH COVER */
@media (max-width: 600px) {
    /* NATIVE APP FULL-SCREEN FEEL */
    body {
        align-items: flex-start; /* So it scrolls from the top */
    }
    .container {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 1rem;
        border-radius: 0;
        border: none;
        min-height: 100vh;
        max-height: none;
        box-shadow: none;
    }
    
    .splash-icon {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
    .splash-title {
        font-size: 18px !important;
        margin-bottom: 0.5rem;
    }
    .splash-subtitle {
        font-size: 9px;
        margin-bottom: 1.2rem !important;
        padding: 0 10px;
    }
    .splash-content {
        padding: 1.5rem 1rem;
        width: 90%;
        max-width: 320px;
    }
    .splash-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .reg-input {
        font-size: 9px;
        padding: 0.8rem 1rem;
    }
    .mode-btn {
        font-size: 10px;
        padding: 0.6rem;
    }
    .splash-watermark {
        font-size: 0.75rem;
    }
    
    /* PROFILE CARD MINIMALIST */
    .profile-header {
        padding: 0.7rem 0;
        gap: 0.6rem;
    }
    .profile-card {
        padding: 8px 12px;
        flex-direction: row;
        align-items: center;
        text-align: left;
    }
    .profile-avatar {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    .profile-info h3 {
        font-size: 9px;
    }
    .school-text {
        font-size: 9px;
        margin-bottom: 2px;
    }
    .badge-label {
        font-size: 9px;
        padding: 2px 5px;
    }
    .app-header { padding: 10px 15px; }
    .header-title { font-size: 11px; }
    .header-subtitle { font-size: 9px; }
    .edit-btn {
        font-size: 0.9rem;
    }
    .high-score-board {
        padding-top: 0.6rem;
    }
    .hs-label {
        font-size: 9px !important;
    }
    .hs-val {
        font-size: 10px !important;
    }
    
    /* GAME AREA COMPACTING */
    .media-wrapper {
        height: 120px;
        margin-bottom: 0.6rem;
        padding: 0.3rem;
    }
    .question-box {
        padding: 0.8rem 1rem;
        margin-bottom: 0.6rem;
    }
    .question-text {
        font-size: 11px;
    }
    .options-grid {
        gap: 0.5rem;
    }
    .option-btn {
        padding: 0.6rem 0.5rem;
        font-size: 13px;
        min-height: 44px;
    }
    
    /* MAIN MENU COMPACTING */
    .category-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.6rem;
    }
    .category-card {
        flex-direction: column;
        text-align: center;
        padding: 0.8rem 0.4rem;
        gap: 0.4rem;
    }
    .cat-info p {
        display: none; /* Hide descriptions */
    }
    .cat-arrow {
        display: none; /* Hide arrows */
    }
    .cat-icon {
        font-size: 24px;
    }
    .cat-info h3 {
        font-size: 10px;
        line-height: 1.3;
    }
    
} /* End of @media (max-width: 600px) */

/* =============================================
   BOTTOM NAVIGATION BAR (GLOBAL NOW)
   ============================================= */
/* MOBILE HIDDEN */
.mobile-hidden {
    display: none !important;
}

/* DESKTOP ONLY HIDE */
.desktop-only {
    display: none !important;
}

.bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 700px;
    background: rgba(25, 25, 30, 0.95);
    border-top: 1px solid rgba(255,255,255,0.05);
    border-left: 1px solid rgba(255,255,255,0.05);
    border-right: 1px solid rgba(255,255,255,0.05);
    border-radius: 20px 20px 0 0;
    justify-content: space-around;
    align-items: center;
    padding: 0.8rem 0.5rem;
    padding-bottom: env(safe-area-inset-bottom, 1rem); /* For iPhone notch */
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
}
.bottom-nav.hidden {
    display: none !important;
}

.nav-item {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.6rem 0.5rem;
    border-radius: 50px;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    flex: 1; /* Make them share space evenly */
}

.nav-icon {
    font-size: 1.4rem;
    filter: grayscale(1) opacity(0.5);
    transition: all 0.3s ease;
}

.nav-item.active {
    background: rgba(249, 115, 22, 0.15); /* Pill shape background */
}

.nav-item.active .nav-icon {
    filter: grayscale(0) opacity(1);
    transform: scale(1.15);
}

/* Make space for the bottom nav in main container */
#main-menu {
    padding-bottom: 6rem !important; 
}

/* Home Empty State Hero */
.home-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2.5rem 1.5rem;
    margin-top: 1.5rem;
    background: rgba(0,0,0,0.15);
    border-radius: var(--r-xl);
    border: 1px dashed rgba(255,107,0,0.3);
    animation: screenIn 0.5s ease both;
}
.hero-icon-wrapper {
    font-size: 4rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
    animation: float 4s ease-in-out infinite;
}
.home-hero h3 {
    font-size: 1.3rem;
    color: var(--lime);
    margin-bottom: 0.5rem;
}
.home-hero p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 90%;
    margin-bottom: 2rem;
}
.arrow-down {
    font-size: 1.5rem;
    animation: bounceDown 2s infinite;
    opacity: 0.8;
}
@keyframes bounceDown {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}
