:root {
    color-scheme: dark;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

.code-font {
    font-family: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-variant-ligatures: none;
}

/* ---------- Scrollbar Kustom ---------- */
* {
    scrollbar-width: thin;
    scrollbar-color: #334155 #0f172a;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* ---------- Fokus Keyboard yang Jelas ---------- */
button:focus-visible,
input:focus-visible,
summary:focus-visible {
    outline: 2px solid #818cf8;
    outline-offset: 2px;
}

kbd {
    font-family: 'Fira Code', ui-monospace, monospace;
    font-size: 10px;
    padding: 2px 6px;
    border: 1px solid #334155;
    border-bottom-width: 2px;
    border-radius: 5px;
    background: #0f172a;
    color: #94a3b8;
}

/* ---------- Teks Materi & Kode Tersemat ---------- */
.lesson b {
    color: #f1f5f9;
}

.lesson code {
    font-family: 'Fira Code', ui-monospace, monospace;
    font-size: 0.85em;
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.14);
    padding: 0.1rem 0.2rem;
    border-radius: 0.35rem;
}

/* ---------- Kotak "Alat bantu yang dipakai di soal" ---------- */
.tools-box {
    margin-bottom: 1.5rem;
    padding: 1rem 1.15rem 1.1rem;
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-left: 4px solid #f59e0b;
    border-radius: 0.75rem;
    background: rgba(245, 158, 11, 0.06);
}

.tools-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fcd34d;
}

.tools-sub {
    margin: 0.3rem 0 0.75rem;
    font-size: 0.75rem;
    color: #94a3b8;
}

.tools-list {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tools-list li {
    position: relative;
    padding-left: 1.15rem;
    font-size: 0.9rem;
    line-height: 1.65;
    color: #cbd5e1;
}

.tools-list li::before {
    content: "";
    position: absolute;
    left: 0.15rem;
    top: 0.72em;
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: #f59e0b;
}

.tools-box code {
    color: #fde68a;
    background: rgba(245, 158, 11, 0.14);
}

.code-block {
    white-space: pre;
    tab-size: 4;
}

.code-block code {
    font-family: inherit;
}

/* ---------- Editor dengan Nomor Baris ---------- */
.editor-wrap {
    display: flex;
    background: #020617;
    border: 1px solid #1e293b;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: border-color 0.15s ease;
}

.editor-wrap:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.3);
}

#line-numbers,
#code-hl,
#code-input {
    font-family: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-variant-ligatures: none;
    font-size: 14px;
    line-height: 22px;
}

#line-numbers {
    flex: none;
    min-width: 2.75rem;
    padding: 0.75rem 0.6rem 1.75rem 0.75rem;
    text-align: right;
    white-space: pre;
    overflow: hidden;
    user-select: none;
    color: #475569;
    background: #090d16;
    border-right: 1px solid #1e293b;
}

#code-input {
    flex: 1;
    min-width: 0;
    min-height: 10rem;
    padding: 0.75rem 1rem;
    color: #e2e8f0;
    background: transparent;
    border: 0;
    outline: none;
    resize: vertical;
    white-space: pre;
    overflow: auto;
    tab-size: 4;
}

#line-numbers .ln {
    display: block;
}

#line-numbers .ln-err {
    margin: 0 -0.6rem 0 -0.75rem;
    padding: 0 0.6rem 0 0.75rem;
    color: #fda4af;
    font-weight: 700;
    background: rgba(244, 63, 94, 0.2);
    box-shadow: inset 3px 0 0 #f43f5e;
}

#code-input::placeholder {
    color: #475569;
}

/* ---------- Sidebar Versi Mobile (Overlay Layar Penuh) ---------- */
@media (max-width: 1023px) {
    #sidebar {
        display: none;
    }

    #sidebar.mobile-open {
        display: flex;
        position: fixed;
        inset: 0;
        z-index: 60;
        border-radius: 0;
        border: 0;
        background-color: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(8px);
    }
}

/* ---------- Toast Notifikasi ---------- */
#toast-root {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: min(92vw, 22rem);
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    padding: 0.65rem 0.9rem;
    border-radius: 0.75rem;
    border: 1px solid #334155;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    animation: toast-in 0.25s ease-out;
    transition: opacity 0.3s, transform 0.3s;
}

.toast-success { border-color: rgba(16, 185, 129, 0.5); color: #6ee7b7; }
.toast-xp      { border-color: rgba(245, 158, 11, 0.5); color: #fcd34d; }
.toast-warn    { border-color: rgba(244, 63, 94, 0.5);  color: #fda4af; }
.toast-out     { opacity: 0; transform: translateY(8px); }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

/* ---------- Dialog Tamat / Selesai ---------- */
.finish-dialog {
    margin: auto;
    max-width: 26rem;
    width: calc(100% - 2rem);
    padding: 1.75rem;
    color: #e2e8f0;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 1rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.finish-dialog::backdrop {
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(3px);
}

/* ---------- Aksesibilitas Gerakan ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
/* ---------- Login & Akun (cloud.js) ---------- */
#auth-root:empty, #auth-root.modal:empty { display: none; }
#auth-root {
    --ink: #020617; --panel: #0b1224; --line: #1e293b; --line2: #334155;
    --txt: #e2e8f0; --mute: #94a3b8; --ind: #6366f1; --cy: #22d3ee;
    --ok: #34d399; --bad: #fb7185; --amb: #fbbf24;
    position: fixed; inset: 0; z-index: 90; overflow-y: auto;
    background: var(--ink); color: var(--txt);
}
#auth-root.modal {
    display: grid; place-items: center; padding: 1rem;
    background: rgba(2, 6, 23, 0.85); backdrop-filter: blur(6px);
}

/* Kerangka dua kolom */
.auth-shell { min-height: 100%; display: grid; grid-template-columns: 1fr; }
@media (min-width: 900px) {
    .auth-shell { min-height: 100dvh; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
}

/* Panel merek */
.auth-brand {
    display: flex; flex-direction: column; gap: 1rem;
    padding: 1.5rem 1.25rem 1.25rem; background: var(--panel); border-bottom: 1px solid var(--line);
}
.auth-brand-top { display: flex; flex-direction: column; gap: 1rem; }
.auth-logo { display: flex; align-items: center; gap: 0.65rem; font-weight: 800; font-size: 1.05rem; }
.auth-logo-mark {
    width: 2.25rem; height: 2.25rem; display: grid; place-items: center;
    border-radius: 0.65rem; background: #1e1b4b; border: 1px solid #3730a3;
}
.auth-headline { margin: 0; font-size: 1.35rem; line-height: 1.3; font-weight: 800; letter-spacing: -0.02em; max-width: 28rem; }
.auth-sub { display: none; margin: 0; color: var(--mute); font-size: 0.95rem; line-height: 1.65; max-width: 28rem; }
.auth-term, .auth-facts { display: none; }

@media (min-width: 900px) {
    .auth-brand { justify-content: space-between; gap: 2.5rem; padding: 3rem 3.5rem; border-bottom: 0; border-right: 1px solid var(--line); }
    .auth-headline { font-size: 2.25rem; }
    .auth-sub { display: block; }
    .auth-term { display: block; max-width: 30rem; border: 1px solid var(--line); border-radius: 0.9rem; background: var(--ink); overflow: hidden; }
    .auth-facts { display: flex; gap: 2.25rem; margin: 0; padding: 0; list-style: none; }
}
.auth-term-bar {
    display: flex; align-items: center; gap: 0.4rem; padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--line); color: #64748b;
    font: 0.75rem 'Fira Code', ui-monospace, monospace;
}
.auth-term-bar i { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: #334155; }
.auth-term-bar span { margin-left: 0.5rem; }
.auth-term-body {
    margin: 0; padding: 1.1rem 1.25rem; min-height: 11.5rem; white-space: pre; overflow-x: auto;
    font: 0.9rem/1.75 'Fira Code', ui-monospace, monospace; font-variant-ligatures: none; color: var(--txt);
}
.auth-term-body .k { color: #c4b5fd; }
.auth-term-body .s { color: #fcd34d; }
.auth-term-body .b { color: #67e8f9; }
.auth-term-body .o { color: var(--ok); }
.auth-caret {
    display: inline-block; width: 0.55em; height: 1.1em; margin-left: 1px; vertical-align: text-bottom;
    background: var(--cy); animation: auth-blink 1s steps(2, start) infinite;
}
@keyframes auth-blink { to { visibility: hidden; } }
.auth-facts li { display: flex; flex-direction: column; }
.auth-facts strong { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.auth-facts span { color: var(--mute); font-size: 0.85rem; }

/* Panel formulir */
.auth-form-wrap { position: relative; display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem 2.5rem; }
.auth-form { width: 100%; max-width: 22rem; }
.auth-title { margin: 0; font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.auth-lead { margin: 0.4rem 0 0; color: var(--mute); font-size: 0.9rem; line-height: 1.6; }
.auth-close {
    position: absolute; top: 1rem; right: 1rem; width: 2.25rem; height: 2.25rem; border-radius: 0.65rem;
    border: 1px solid var(--line); background: transparent; color: var(--mute); cursor: pointer;
}
.auth-close:hover { background: #0f172a; color: var(--txt); }

.auth-tabs {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.25rem; margin: 1.4rem 0 1.25rem;
    padding: 0.25rem; border: 1px solid var(--line); border-radius: 0.85rem; background: #0f172a;
}
.auth-tab {
    padding: 0.55rem; border: 0; border-radius: 0.6rem; background: transparent;
    color: var(--mute); font-family: inherit; font-weight: 600; font-size: 0.875rem; cursor: pointer; transition: background 0.15s, color 0.15s;
}
.auth-tab:hover { color: var(--txt); }
.auth-tab.on { background: var(--line); color: #fff; }

.auth-formel { margin-top: 1.25rem; }
.auth-tabs + .auth-formel { margin-top: 0; }
.auth-field { margin-bottom: 0.95rem; }
.auth-label-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.35rem; }
.auth-label-row label { font-size: 0.8rem; font-weight: 600; color: var(--mute); }
.auth-input {
    width: 100%; padding: 0.75rem 0.9rem; border-radius: 0.75rem; border: 1px solid var(--line);
    background: var(--ink); color: var(--txt); font-size: 0.95rem; transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-input::placeholder { color: #475569; }
.auth-input:focus { outline: none; border-color: var(--ind); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22); }
.auth-pw { position: relative; }
.auth-pw .auth-input { padding-right: 6rem; }
.auth-toggle {
    position: absolute; top: 50%; right: 0.4rem; transform: translateY(-50%); padding: 0.35rem 0.6rem;
    border: 0; border-radius: 0.5rem; background: transparent; color: var(--mute); font-size: 0.75rem; font-weight: 600; cursor: pointer;
}
.auth-toggle:hover { color: var(--txt); background: #0f172a; }

.auth-link { padding: 0; border: 0; background: none; color: #a5b4fc; font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.auth-link:hover { text-decoration: underline; }
.auth-back { display: block; margin: 1rem auto 0; }

.auth-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.3rem; margin-top: 0.55rem; }
.auth-meter i { height: 0.25rem; border-radius: 99px; background: var(--line); transition: background 0.2s; }
.auth-meter[data-l="1"] i:nth-child(-n+1) { background: var(--bad); }
.auth-meter[data-l="2"] i:nth-child(-n+2) { background: var(--amb); }
.auth-meter[data-l="3"] i:nth-child(-n+3), .auth-meter[data-l="4"] i { background: var(--ok); }
.auth-hint { margin: 0.4rem 0 0; font-size: 0.75rem; color: #64748b; }

.auth-btn {
    position: relative; display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    width: 100%; margin-top: 0.4rem; padding: 0.85rem; border: 0; border-radius: 0.75rem;
    background: linear-gradient(90deg, #4f46e5, #06b6d4); color: #fff; font-weight: 700; font-size: 0.9rem;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.25); cursor: pointer; transition: filter 0.15s, transform 0.1s;
}
.auth-btn:hover:not(:disabled) { filter: brightness(1.1); }
.auth-btn:active:not(:disabled) { transform: scale(0.98); }
.auth-btn:disabled { opacity: 0.7; cursor: wait; }
.auth-spin { display: none; width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; animation: auth-spin 0.7s linear infinite; }
.auth-btn.busy .auth-spin { display: inline-block; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

.auth-msg { margin-top: 0.9rem; padding: 0.65rem 0.8rem; border: 1px solid transparent; border-radius: 0.7rem; font-size: 0.85rem; line-height: 1.5; }
.auth-msg:empty { display: none; }
.auth-msg.bad { background: rgba(244, 63, 94, 0.1); border-color: rgba(244, 63, 94, 0.35); color: #fda4af; }
.auth-msg.ok { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.35); color: #6ee7b7; }
.auth-msg .auth-link { display: block; margin-top: 0.4rem; color: inherit; }

.auth-or { display: flex; align-items: center; gap: 0.75rem; margin: 1.3rem 0 0.9rem; color: #64748b; font-size: 0.8rem; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-ghost {
    width: 100%; padding: 0.75rem; border: 1px solid var(--line2); border-radius: 0.75rem;
    background: transparent; color: var(--txt); font-weight: 600; font-size: 0.875rem; cursor: pointer;
}
.auth-ghost:hover { background: #0f172a; }
.auth-ghost.danger { margin-top: 0.6rem; border-color: rgba(244, 63, 94, 0.4); color: #fda4af; }
.auth-ghost.danger:hover { background: rgba(244, 63, 94, 0.1); }
.auth-note { margin: 0.7rem 0 0; font-size: 0.75rem; line-height: 1.55; color: #64748b; text-align: center; }

/* Menu akun */
.auth-card { width: 100%; max-width: 22rem; padding: 1.5rem; border: 1px solid var(--line2); border-radius: 1rem; background: #0f172a; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6); }
.auth-acc-head { display: flex; align-items: center; gap: 0.85rem; }
.auth-avatar { flex: none; width: 3rem; height: 3rem; display: grid; place-items: center; border-radius: 50%; background: #1e1b4b; border: 1px solid #3730a3; color: #c7d2fe; font-weight: 800; font-size: 1.2rem; }
.auth-acc-who { display: flex; flex-direction: column; min-width: 0; }
.auth-acc-who strong { font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-acc-who span { font-size: 0.8rem; color: var(--mute); }
.auth-acc-status { display: flex; align-items: center; gap: 0.5rem; margin: 1.1rem 0 1rem; padding: 0.6rem 0.8rem; border: 1px solid var(--line); border-radius: 0.7rem; background: var(--ink); font-size: 0.85rem; color: var(--mute); }
.auth-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #64748b; }
.auth-dot.synced { background: var(--ok); }
.auth-dot.sync { background: var(--amb); }
.auth-dot.error { background: var(--bad); }

/* ---------- Tombol login Google / GitHub ---------- */
.auth-social { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.auth-oauth {
    display: flex; align-items: center; justify-content: center; gap: 0.55rem;
    padding: 0.7rem 0.5rem; border: 1px solid var(--line2); border-radius: 0.75rem;
    background: #0f172a; color: var(--txt); font-family: inherit; font-weight: 600; font-size: 0.875rem;
    cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.auth-oauth:hover:not(:disabled) { background: #162036; border-color: #475569; }
.auth-oauth:disabled { opacity: 0.6; cursor: wait; }
.auth-ico { display: grid; place-items: center; width: 1.1rem; height: 1.1rem; }
.auth-ico svg { width: 100%; height: 100%; }
.auth-or + .auth-formel { margin-top: 0; }

/* Latar menu akun: seluruh layar, sehingga klik di luar kartu menutup menu */
.auth-modal-back { position: fixed; inset: 0; display: grid; place-items: center; padding: 1rem; }

/* ================= LOGIN: tampilan baru ================= */
#auth-root { background: #020617; }

/* Panel kiri */
.auth-brand {
    position: relative; overflow: hidden; isolation: isolate;
    background: linear-gradient(135deg, #0b1224 0%, #0f1b3d 55%, #1a1446 100%);
}
.auth-brand > * { position: relative; z-index: 1; }
.auth-grid {
    position: absolute !important; inset: 0; z-index: 0 !important; opacity: .5;
    background-image: linear-gradient(rgba(148,163,184,.07) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(148,163,184,.07) 1px, transparent 1px);
    background-size: 36px 36px;
    -webkit-mask-image: radial-gradient(circle at 30% 40%, #000 20%, transparent 75%);
            mask-image: radial-gradient(circle at 30% 40%, #000 20%, transparent 75%);
}
.auth-orb { position: absolute !important; z-index: 0 !important; border-radius: 50%; filter: blur(70px); opacity: .55; animation: auth-float 14s ease-in-out infinite; }
.auth-orb.o1 { width: 22rem; height: 22rem; background: #6366f1; top: -6rem; left: -6rem; }
.auth-orb.o2 { width: 20rem; height: 20rem; background: #06b6d4; bottom: -7rem; right: -5rem; animation-delay: -7s; }
@keyframes auth-float { 50% { transform: translate(40px, 30px) scale(1.12); } }

.auth-headline {
    background: linear-gradient(90deg, #fff, #a5b4fc 60%, #67e8f9);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-logo-mark { animation: auth-wiggle 4s ease-in-out infinite; box-shadow: 0 0 24px rgba(99,102,241,.5); }
@keyframes auth-wiggle { 0%, 90%, 100% { transform: rotate(0); } 94% { transform: rotate(-12deg); } 97% { transform: rotate(10deg); } }

/* Editor hidup */
.auth-term {
    position: relative; overflow: visible !important;
    background: rgba(2,6,23,.78); backdrop-filter: blur(10px);
    border: 1px solid rgba(99,102,241,.35) !important;
    box-shadow: 0 30px 70px rgba(79,70,229,.28), inset 0 1px 0 rgba(255,255,255,.06);
    animation: auth-bob 6s ease-in-out infinite;
}
@keyframes auth-bob { 50% { transform: translateY(-8px); } }
.auth-term-bar { border-radius: .9rem .9rem 0 0; }
.auth-term-bar i:nth-child(1) { background: #f43f5e; }
.auth-term-bar i:nth-child(2) { background: #f59e0b; }
.auth-term-bar i:nth-child(3) { background: #10b981; }
.auth-run {
    margin-left: auto; padding: .15rem .6rem; border-radius: 99px; font-weight: 600;
    color: #6ee7b7; background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.3);
    transition: all .2s;
}
.auth-term.running .auth-run { color: #022c22; background: #34d399; box-shadow: 0 0 16px #34d399; animation: auth-pulse .6s ease-in-out infinite alternate; }
@keyframes auth-pulse { to { transform: scale(1.08); } }

.auth-term-body { counter-reset: ln; min-height: 15rem !important; }
.auth-term-body .l { display: block; min-height: 1.75em; }
.auth-term-body .l::before {
    counter-increment: ln; content: counter(ln); display: inline-block;
    width: 1.4em; margin-right: 1rem; text-align: right; color: #334155;
}
.auth-term-body .c { color: #64748b; font-style: italic; }
.auth-term-body .n { color: #fb923c; }
.auth-term-body .o-box { display: block; margin-top: .9rem; padding-top: .7rem; border-top: 1px dashed #1e293b; }
.auth-term-body .o { display: block; color: var(--ok); animation: auth-in .3s ease-out; }
@keyframes auth-in { from { opacity: 0; transform: translateX(-8px); } }

.auth-chip {
    position: absolute; padding: .3rem .7rem; border-radius: 99px; font-size: .75rem; font-weight: 700;
    background: rgba(15,23,42,.9); border: 1px solid #334155; color: #fcd34d;
    box-shadow: 0 8px 24px rgba(0,0,0,.4); animation: auth-bob 5s ease-in-out infinite;
}
.auth-chip.c1 { top: -1rem; right: -.75rem; }
.auth-chip.c2 { bottom: -1rem; left: -.75rem; color: #67e8f9; animation-delay: -2.5s; }

/* Panel kanan: kartu kaca */
.auth-form-wrap {
    background: radial-gradient(ellipse at 70% 0%, rgba(99,102,241,.18), transparent 55%),
                radial-gradient(ellipse at 10% 100%, rgba(34,211,238,.12), transparent 50%), #020617;
}
.auth-form {
    padding: 1.75rem 1.5rem; border-radius: 1.25rem;
    background: rgba(15,23,42,.6); backdrop-filter: blur(14px);
    border: 1px solid rgba(51,65,85,.7);
    box-shadow: 0 25px 60px rgba(0,0,0,.45), 0 0 0 1px rgba(99,102,241,.08);
    animation: auth-rise .5s ease-out;
}
@keyframes auth-rise { from { opacity: 0; transform: translateY(16px); } }
.auth-title { background: linear-gradient(90deg, #fff, #c7d2fe); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-input:hover { border-color: #334155; }
.auth-input:focus { border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99,102,241,.25), 0 0 20px rgba(99,102,241,.15); }
.auth-btn { overflow: hidden; }
.auth-btn::after {
    content: ""; position: absolute; inset: 0; transform: translateX(-120%);
    background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35), transparent 70%);
    animation: auth-shine 3.5s ease-in-out infinite;
}
@keyframes auth-shine { 55%, 100% { transform: translateX(120%); } }
.auth-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(99,102,241,.4); }
.auth-oauth:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.35); }
.auth-oauth { transition: transform .15s, background .15s, border-color .15s, box-shadow .15s; }

@media (prefers-reduced-motion: reduce) {
    .auth-orb, .auth-term, .auth-chip, .auth-logo-mark, .auth-btn::after { animation: none !important; }
}

/* ---------- Editor: overlay pewarnaan sintaks ---------- */
.editor-body { position: relative; flex: 1; min-width: 0; }
.hl-clip { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
#code-hl { position: absolute; top: 0; left: 0; margin: 0; min-width: 100%; padding: 0.75rem 1rem; white-space: pre; tab-size: 4; color: #e2e8f0; background: transparent; will-change: transform; }
.hl-errband { display: none; position: absolute; left: 0; right: 0; height: 22px; background: rgba(244, 63, 94, 0.16); box-shadow: inset 3px 0 0 #f43f5e; }
.editor-wrap.hl-on #code-input { position: relative; z-index: 1; display: block; width: 100%; color: transparent; caret-color: #e2e8f0; }
.editor-wrap.hl-on #code-input::selection { color: transparent; background: rgba(99, 102, 241, 0.4); }
.hl-k { color: #c4b5fd; }
.hl-s { color: #fcd34d; }
.hl-b { color: #67e8f9; }
.hl-c { color: #64748b; font-style: italic; }
.hl-n { color: #fb923c; }
.hl-d { color: #f0abfc; }

/* ---------- Bilah simbol (HP) + tombol Jalankan/Periksa menempel di bawah layar ---------- */
.symbol-bar { display: flex; gap: 0.4rem; overflow-x: auto; padding-bottom: 0.25rem; }
.symbol-bar button { flex: none; min-width: 2.5rem; height: 2.25rem; padding: 0 0.6rem; border-radius: 0.5rem; border: 1px solid #334155; background: #0f172a; color: #e2e8f0; font: 600 0.9rem 'Fira Code', ui-monospace, monospace; }
.symbol-bar button:active { background: #334155; }
.run-bar { position: sticky; bottom: 0; z-index: 30; margin: 0 -0.5rem; padding: 0.5rem 0.5rem calc(0.5rem + env(safe-area-inset-bottom, 0px)); background: rgba(15, 23, 42, 0.96); backdrop-filter: blur(8px); border-top: 1px solid #1e293b; }
@media (min-width: 768px) {
    .symbol-bar { display: none; }
    .run-bar { position: static; margin: 0; padding: 0; background: none; backdrop-filter: none; border: 0; }
}

/* ---------- Saran kode ---------- */
.ac-pop { position: absolute; z-index: 5; min-width: 9rem; max-width: 18rem; padding: 0.2rem; background: #0f172a; border: 1px solid #334155; border-radius: 0.5rem; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); font: 13px/1.4 'Fira Code', ui-monospace, monospace; }
.ac-pop[hidden] { display: none; }
.ac-item { padding: 0.2rem 0.5rem; border-radius: 0.35rem; color: #cbd5e1; cursor: pointer; }
.ac-item.on { background: #4338ca; color: #fff; }

/* ---------- Login: jeda animasi saat tab tidak aktif ---------- */
#auth-root.paused *, #auth-root.paused *::before, #auth-root.paused *::after { animation-play-state: paused !important; }

/* ---------- Materi & Contoh: judul bagian, daftar poin, kotak peringatan ---------- */
.lesson .sec {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.6rem;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #a5b4fc;
}
.lesson .sec::before {
    content: "";
    width: 0.25rem;
    height: 0.95rem;
    border-radius: 2px;
    background: #6366f1;
}
.lesson > .sec:first-child { padding-top: 0; }
.lesson .sec-warn { color: #fcd34d; }
.lesson .sec-warn::before { background: #f59e0b; }
#level-desc p, #example-notes p { margin: 0; }
.lesson ul.pts { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.lesson ul.pts li { position: relative; padding-left: 1.15rem; line-height: 1.7; }
.lesson ul.pts li::before {
    content: "";
    position: absolute;
    left: 0.15rem;
    top: 0.75em;
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: #6366f1;
}
.lesson ul.pts.warn {
    padding: 0.8rem 0.95rem;
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 0.75rem;
    background: rgba(245, 158, 11, 0.05);
}
.lesson ul.pts.warn li::before { background: #f59e0b; }

/* ---------- Tab Contoh: tampilan kode seperti editor ---------- */
.ex-wrap { border: 1px solid #1e293b; border-radius: 0.75rem; overflow: hidden; background: #020617; }
.ex-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.8rem;
    background: #090d16;
    border-bottom: 1px solid #1e293b;
    font: 600 0.75rem 'Fira Code', ui-monospace, monospace;
    color: #94a3b8;
}
.ex-dots { display: flex; gap: 0.3rem; }
.ex-dots i { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: #334155; }
.ex-dots i:nth-child(1) { background: rgba(244, 63, 94, 0.8); }
.ex-dots i:nth-child(2) { background: rgba(245, 158, 11, 0.8); }
.ex-dots i:nth-child(3) { background: rgba(16, 185, 129, 0.8); }
.ex-body { display: flex; }
#example-ln, #level-example {
    font-family: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-variant-ligatures: none;
    font-size: 14px;
    line-height: 22px;
}
#example-ln {
    flex: none;
    min-width: 2.75rem;
    padding: 0.75rem 0.6rem 0.75rem 0.75rem;
    text-align: right;
    white-space: pre;
    user-select: none;
    color: #475569;
    background: #090d16;
    border-right: 1px solid #1e293b;
}
#level-example { flex: 1; min-width: 0; margin: 0; padding: 0.75rem 1rem; color: #e2e8f0; overflow-x: auto; white-space: pre; tab-size: 4; }
#example-notes { display: grid; gap: 0.6rem; margin-top: 1.25rem; font-size: 0.875rem; line-height: 1.7; color: #cbd5e1; }

/* ---------- Keterbacaan materi, alat bantu, dan soal (pemformat di app.js) ---------- */
.lesson { font-size: 0.95rem; line-height: 1.75; }
.lesson p { max-width: 68ch; }
.lesson .sec {
    margin-top: 0.6rem;
    padding: 0 0 0.35rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.22);
    font-size: 0.95rem;
    letter-spacing: 0;
    text-transform: none;
    color: #c7d2fe;
}
.lesson .sec-warn { border-bottom-color: rgba(245, 158, 11, 0.28); color: #fde68a; }
.lesson > .sec:first-child { margin-top: 0; }
.lesson ul.pts { gap: 0.6rem; }
.lesson ul.pts li { line-height: 1.75; color: #cbd5e1; }
.lesson ul.pts li .lead { color: #f1f5f9; font-weight: 700; }
.lesson ul.pts.warn li .lead { color: #fde68a; }

.tools-list { gap: 0; }
.tools-list li { padding: 0.5rem 0 0.5rem 1.15rem; border-bottom: 1px solid rgba(245, 158, 11, 0.12); }
.tools-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.tools-list li::before { top: 1.05em; }
.tools-sub { margin-bottom: 0.5rem; }

.task-body { display: grid; gap: 0.5rem; line-height: 1.7; }
.task-body .task-line { margin: 0; max-width: 72ch; }
.task-body .task-line:first-child { font-weight: 600; color: #f1f5f9; }
.task-body .task-out { padding-left: 0.75rem; border-left: 3px solid rgba(34, 211, 238, 0.45); color: #cffafe; }
.task-body .task-label { color: #fda4af; }
.task-body code {
    font-family: 'Fira Code', ui-monospace, monospace;
    font-size: 0.85em;
    color: #67e8f9;
    background: rgba(34, 211, 238, 0.1);
    padding: 0.1rem 0.35rem;
    border-radius: 0.35rem;
    overflow-wrap: anywhere;
}

.lesson ul.pts li .sub { display: block; margin-top: 0.25rem; color: #b6c2d4; }
.lesson ul.pts li .sub .lead { color: #e2e8f0; }

/* ---------- Kode inline: rapatkan jarak ke tanda baca di sebelahnya ---------- */
.lesson code, .tools-box code, .task-body code { margin: 0 0.05rem; }

/* ---------- Perbaikan: prasyarat, catatan contoh ---------- */
.lesson p.prereq { padding: 0.55rem 0.8rem; border-left: 3px solid #22d3ee; background: rgba(34, 211, 238, 0.07); border-radius: 0.4rem; font-size: 0.85rem; color: #cffafe; }
.ex-note { padding: 0.6rem 0.8rem; border: 1px solid rgba(245, 158, 11, 0.3); border-left: 4px solid #f59e0b; border-radius: 0.6rem; background: rgba(245, 158, 11, 0.06); color: #fde68a; font-size: 0.85rem; }

/* ---------- Papan peringkat (cloud.js) ---------- */
.lb-card { position: relative; max-width: 30rem; max-height: calc(100dvh - 2rem); overflow-y: auto; }
.lb-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.lb-title { margin: 0; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; }
.lb-x { width: 2rem; height: 2rem; border: 1px solid var(--line); border-radius: 0.6rem; background: transparent; color: var(--mute); cursor: pointer; }
.lb-x:hover { background: #162036; color: var(--txt); }
.lb-card .auth-tabs { margin: 1rem 0; }
.lb-body { min-height: 9rem; }

.lb-podium { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 0.5rem; margin-bottom: 0.9rem; }
.lb-pod { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; padding: 0.7rem 0.4rem; border: 1px solid var(--line); border-radius: 0.8rem; background: var(--ink); text-align: center; min-width: 0; }
.lb-pod.p1 { padding-block: 1.1rem; border-color: rgba(251, 191, 36, 0.55); background: rgba(251, 191, 36, 0.07); }
.lb-pod.me { box-shadow: 0 0 0 2px var(--ind); }
.lb-medal { font-size: 1.6rem; line-height: 1; }
.lb-pod.p1 .lb-medal { font-size: 2rem; }
.lb-pname { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.85rem; }
.lb-pts { color: var(--mute); font-size: 0.75rem; font-variant-numeric: tabular-nums; }

.lb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; }
.lb-row { display: grid; grid-template-columns: 2.6rem 1fr auto; align-items: center; gap: 0.6rem; padding: 0.5rem 0.65rem; border-radius: 0.65rem; }
.lb-row.me { background: rgba(99, 102, 241, 0.16); box-shadow: inset 3px 0 0 var(--ind); }
.lb-rank { color: var(--mute); font-variant-numeric: tabular-nums; font-weight: 700; }
.lb-mid { display: grid; gap: 0.3rem; min-width: 0; }
.lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9rem; }
.lb-bar { display: block; height: 0.25rem; border-radius: 99px; background: var(--line); overflow: hidden; }
.lb-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6366f1, #22d3ee); }
.lb-score { color: var(--mute); font-size: 0.8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lb-row.me .lb-score { color: var(--txt); }
.lb-gap { text-align: center; color: #475569; line-height: 1; }
.lb-skel { height: 2.4rem; background: linear-gradient(90deg, #0f172a, #1a2540, #0f172a); background-size: 200% 100%; animation: lb-shimmer 1.4s linear infinite; }
@keyframes lb-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .lb-skel { animation: none; } }

.lb-empty { display: grid; gap: 0.4rem; justify-items: center; padding: 1.6rem 1rem; text-align: center; color: var(--mute); font-size: 0.85rem; line-height: 1.5; }
.lb-empty strong { color: var(--txt); }
.lb-empty .auth-ghost { width: auto; margin-top: 0.4rem; padding-inline: 1.2rem; }

.lb-me { margin: 0.9rem 0 0; padding: 0.6rem 0.8rem; border: 1px solid var(--line); border-radius: 0.7rem; background: var(--ink); font-size: 0.85rem; }
.lb-settings { margin-top: 0.75rem; border: 1px solid var(--line); border-radius: 0.7rem; }
.lb-settings summary { padding: 0.6rem 0.8rem; cursor: pointer; font-size: 0.85rem; font-weight: 600; color: var(--mute); }
.lb-settings summary:hover { color: var(--txt); }
.lb-form { display: grid; gap: 0.6rem; padding: 0 0.8rem 0.8rem; }
.lb-form label { font-size: 0.8rem; font-weight: 600; color: var(--mute); }
.lb-switch { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; color: var(--txt) !important; }
.lb-switch input { width: 1rem; height: 1rem; accent-color: var(--ind); }
.lb-msg { margin: 0; min-height: 1.1em; font-size: 0.8rem; color: var(--bad); }
.lb-note { margin: 0.75rem 0 0; font-size: 0.72rem; line-height: 1.5; color: #64748b; }


/* ---------- Menu Profil (cloud.js) ---------- */
.pf-body { display: grid; gap: 1.1rem; margin-top: 1.1rem; }
.pf-sec { display: grid; gap: 0.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.pf-body > .pf-sec:first-child, .pf-body > div:first-child > .pf-sec { border-top: 0; padding-top: 0; }
.pf-h { margin: 0; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #a5b4fc; }
.pf-hint { margin: 0; font-size: 0.8rem; line-height: 1.55; color: var(--mute); }
.pf-list { list-style: none; margin: 0.25rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.pf-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.7rem; padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: 0.75rem; background: var(--ink); }
.pf-rowtxt { display: flex; flex-direction: column; min-width: 0; }
.pf-rowtxt strong { font-size: 0.875rem; }
.pf-rowtxt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.75rem; color: var(--mute); }
.pf-btn { width: auto; margin: 0; padding: 0.45rem 0.9rem; font-size: 0.8rem; box-shadow: none; }
.pf-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.pf-emailform { display: grid; gap: 0.5rem; margin-top: 0.25rem; }
.pf-emailform[hidden] { display: none; }
.pf-msg { margin: 0.9rem 0 0; min-height: 1.1em; font-size: 0.82rem; }
.pf-msg.ok { color: var(--ok); }
.pf-msg.bad { color: var(--bad); }

/* =====================================================================
   RESPONSIF: HP (Android), tablet, dan PC
   Catatan: tailwind.css adalah build statis, jadi penyesuaian ditulis di sini.
   ===================================================================== */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 6rem; }
body { overflow-x: clip; padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
button, summary, select, label, [role="tab"] { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
#level-title { scroll-margin-top: 7rem; overflow-wrap: anywhere; }
.app-header { padding-top: env(safe-area-inset-top); }
#header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.lesson, #level-task, #example-notes { overflow-wrap: anywhere; }
.auth-shell { min-height: 100dvh; }
#auth-root.modal { padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left)); }
.auth-form-wrap { padding-bottom: calc(2.5rem + env(safe-area-inset-bottom)); }
.finish-dialog { max-height: calc(100dvh - 2rem); overflow-y: auto; }
footer { padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)); }

/* ---------- Layar sempit & tablet: level tampil sebagai overlay/laci ---------- */
@media (max-width: 1023px) {
    #sidebar.mobile-open {
        height: 100dvh;
        padding: calc(1rem + env(safe-area-inset-top)) calc(1rem + env(safe-area-inset-right)) calc(1rem + env(safe-area-inset-bottom)) calc(1rem + env(safe-area-inset-left));
        overscroll-behavior: contain;
    }
    #level-list { overscroll-behavior: contain; }
    #level-list button { min-height: 3.25rem; }
}
/* Tablet: laci di kiri, sisanya digelapkan (ketuk di luar laci untuk menutup) */
@media (min-width: 640px) and (max-width: 1023px) {
    #sidebar.mobile-open {
        inset: 0 auto 0 0;
        width: min(26rem, 88vw);
        border-right: 1px solid #334155;
        box-shadow: 0 0 0 100vmax rgba(2, 6, 23, 0.72);
    }
    #main-pane { max-width: 56rem; width: 100%; margin-inline: auto; }
}

/* ---------- HP (Android): header ringkas, kartu rapat, tombol besar ---------- */
@media (max-width: 639px) {
    .hdr-inner { padding: 0.5rem 0.75rem; gap: 0.5rem; }
    .hdr-inner > div:first-child { order: 1; min-width: 0; }
    #header-actions { order: 2; margin-left: auto; }
    .stats-box { order: 3; width: 100%; justify-content: space-between; gap: 0.25rem; padding: 0.4rem 0.65rem; border-radius: 0.85rem; }
    .stats-box .w-px, .stats-box .uppercase { display: none; }
    .stats-box p { font-size: 0.72rem; }
    /* Profil, Peringkat, Keluar sudah ada di menu akun */
    #btn-profile, #btn-leaderboard, #btn-logout { display: none; }
    #btn-account { max-width: 10.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    #app-main { padding: 0.65rem; gap: 0.75rem; }
    #main-pane { gap: 0.75rem; }
    #main-pane > div { padding: 0.95rem; border-radius: 1rem; }
    #level-title { font-size: 1.3rem; line-height: 1.3; }
    #bg-level-watermark { font-size: 5rem; }
    [role="tablist"] [data-tab] { flex: 1 1 0; text-align: center; padding: 0.65rem 0.3rem; font-size: 0.8rem; }
    .lesson { font-size: 0.92rem; }
    #level-example, #example-ln, #line-numbers, #code-input, #code-hl { font-size: 13px; }
    #code-input { min-height: 12rem; }
    #code-output { max-height: 45vh; }
    #stdin-input, #level-search, #track-select, .auth-input, .lb-form input, #code-output input { font-size: 16px; }

    /* Jalankan | Petunjuk | Periksa sejajar satu baris */
    #run-bar > .justify-between { flex-wrap: nowrap; gap: 0.5rem; padding-top: 0.25rem; }
    #run-bar > .justify-between > div { display: contents; }
    #run-bar #btn-run, #run-bar #btn-check { flex: 1 1 0; justify-content: center; }
    #run-bar button { white-space: nowrap; font-size: 0.78rem; padding: 0.7rem 0.55rem; gap: 0.3rem; }

    #toast-root { left: 0.75rem; right: 0.75rem; max-width: none; align-items: center; bottom: calc(env(safe-area-inset-bottom) + 7.5rem); }
    .finish-dialog { padding: 1.1rem; }
    .lb-card, .auth-card { padding: 1.1rem; }
}
/* HP landscape: tinggi layar kecil, jangan biarkan header menempel */
@media (max-height: 500px) and (orientation: landscape) {
    .app-header { position: static; }
    .run-bar { position: static; }
}

/* ---------- Layar sentuh: target ketuk minimal ~44px ---------- */
@media (pointer: coarse) {
    .run-bar button, .symbol-bar button, #btn-menu, #btn-close-sidebar, #btn-account, #btn-profile, #btn-leaderboard, #btn-logout,
    #btn-prev-task, #btn-next-task, #btn-run-example, #btn-copy-example, #btn-use-example, #btn-clear, #engine-status,
    #sidebar button, #sidebar select, [role="tab"], .auth-btn, .auth-ghost, .auth-oauth, .auth-tab { min-height: 44px; }
    #task-dots button { min-width: 40px; height: 40px; }
    .symbol-bar button { min-width: 2.75rem; }
    #sidebar label { min-height: 36px; }
}

/* ---------- PC lebar ---------- */
@media (min-width: 1280px) {
    #sidebar { grid-column: span 3 / span 3; }
    #main-pane { grid-column: span 9 / span 9; }
    #code-input { min-height: 14rem; }
    .lesson { font-size: 1rem; }
}
@media (min-width: 1536px) {
    .max-w-7xl { max-width: 96rem; }
    #app-main { gap: 2rem; }
}

/* =====================================================================
   HP: header ringkas & tidak menutupi soal/editor
   ===================================================================== */
@media (max-width: 639px) {
    /* Header ikut tergulung; backdrop-filter dimatikan agar tombol fixed di dalamnya tidak terjebak */
    #app-header {
        position: static !important;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        box-shadow: none;
    }
    .hdr-inner { padding: 0.4rem 0.6rem; gap: 0.35rem; }

    /* Tombol Level melayang kecil di pojok kiri atas, selalu terjangkau */
    #btn-menu {
        position: fixed;
        top: calc(env(safe-area-inset-top, 0px) + 0.4rem);
        left: calc(env(safe-area-inset-left, 0px) + 0.4rem);
        z-index: 55;
        min-height: 36px;
        padding: 0.3rem 0.65rem;
        font-size: 0.72rem;
        border: 1px solid #334155;
        background: rgba(15, 23, 42, 0.92);
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    }
    /* Beri ruang judul agar tidak tertimpa tombol melayang */
    .hdr-inner > div:first-child > div:last-child { padding-left: 4.6rem; }
    #tagline { display: none; }

    /* Statistik: satu baris tipis */
    .stats-box { padding: 0.25rem 0.5rem; border-radius: 0.65rem; gap: 0.15rem; }
    .stats-box > div { gap: 0.3rem; }
    .stats-box > div > span { font-size: 0.8rem; }
    .stats-box p { font-size: 0.68rem; line-height: 1.1; }
    .stats-box .h-6 { height: 1rem; }

    /* Jarak ke judul soal saat pindah level/soal jadi kecil (header sudah tidak menempel) */
    html { scroll-padding-top: 0.5rem; }
    #level-title { scroll-margin-top: 0.5rem; font-size: 1.15rem; }

    /* Kartu & editor lebih lega untuk membaca soal */
    #app-main { padding: 0.5rem; gap: 0.6rem; }
    #main-pane { gap: 0.6rem; }
    #main-pane > div { padding: 0.8rem; }
    #bg-level-watermark { font-size: 3.5rem; }

    /* Bar bawah (simbol + Jalankan/Periksa) dibuat tipis */
    .symbol-bar { gap: 0.3rem; padding-bottom: 0.15rem; }
    .symbol-bar button { height: 2rem; min-width: 2.2rem; padding: 0 0.45rem; font-size: 0.82rem; }
    .run-bar { padding: 0.35rem 0.5rem calc(0.35rem + env(safe-area-inset-bottom, 0px)); }
    #run-bar button { padding: 0.55rem 0.5rem; font-size: 0.75rem; }
    #run-bar > .justify-between { padding-top: 0.15rem; }

    /* Editor cukup tinggi, output tidak terlalu besar */
    #code-input { min-height: 9rem; }
    #code-output { max-height: 32vh; min-height: 90px; }

    /* Toast di atas bar bawah yang sekarang lebih tipis */
    #toast-root { bottom: calc(env(safe-area-inset-bottom, 0px) + 5.5rem); }
}
