/* =====================================================================
   TEMA "HERO MADRASAH — DUNIA BLOK"  ·  SPMB MA Matholi'ul Anwar
   Gaya game blok (voxel): avatar kotak, baseplate berpaku, tombol 3D,
   palet hijau. Semua warna lewat CSS variables (+ mode gelap).
   ===================================================================== */

:root {
    /* Palet hijau */
    --g-50: #F0FDF4;
    --g-100: #DCFCE7;
    --g-200: #BBF7D0;
    --g-300: #86EFAC;
    --g-400: #4ADE80;
    --g-500: #22C55E;
    --g-600: #16A34A;
    --g-700: #15803D;
    --g-800: #166534;
    --g-900: #14532D;
    --g-950: #052E16;
    --lime: #A3E635;
    --lime-deep: #65A30D;
    --teal: #0D9488;
    --emerald: #059669;

    /* Aksen status (dipakai seperlunya) */
    --gold: #FACC15;
    --red: #EF4444;
    --red-deep: #B91C1C;
    --sky: #38BDF8;

    /* Permukaan & teks */
    --paper: #ECFDF3;
    --paper-2: #DCFCE7;
    --surface: #FFFFFF;
    --surface-2: #F0FDF4;
    --text: #052E16;
    --text-muted: #4B6B57;
    --line: #0B2A18;
    --shadow-c: #0B2A18;
    --stud: rgba(22, 163, 74, .10);
    --stud-hi: rgba(255, 255, 255, .75);
    --sidebar-bg: #052E16;
    --sidebar-text: #DCFCE7;

    /* Bentuk */
    --bw: 2.5px;
    --radius: 18px;
    --radius-sm: 12px;
    --lift: 0 6px 0 var(--shadow-c);
    --lift-sm: 0 4px 0 var(--shadow-c);
    --lift-lg: 0 9px 0 var(--shadow-c);

    --font-display: 'Fredoka', 'Nunito', system-ui, sans-serif;
    --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --sidebar-w: 272px;
    --topbar-h: 72px;
}

/* Mode gelap: "Malam di Dunia Blok" */
[data-theme="dark"] {
    --paper: #04170D;
    --paper-2: #072112;
    --surface: #0B2817;
    --surface-2: #0F331E;
    --text: #E7FBEE;
    --text-muted: #93B9A1;
    --line: #000000;
    --shadow-c: #000000;
    --stud: rgba(163, 230, 53, .06);
    --stud-hi: rgba(255, 255, 255, .06);
    --sidebar-bg: #020D07;
    color-scheme: dark;
}

/* ---------- Dasar ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--paper);
    color: var(--text);
    font-size: .95rem;
    font-weight: 600;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--g-700); font-weight: 800; }
[data-theme="dark"] a { color: var(--lime); }
::selection { background: var(--lime); color: var(--g-950); }

.font-display, .hero-title, .section-title, .page-title,
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); }

.font-display, .hero-title, .section-title, .page-title { font-weight: 700; letter-spacing: -.01em; line-height: 1.02; }

.text-muted { color: var(--text-muted) !important; }
.text-ink { color: var(--text) !important; }
.text-hero { color: var(--g-600) !important; }
.text-lime { color: var(--lime) !important; }
.text-gold { color: var(--gold) !important; }
.text-danger-hero { color: var(--red) !important; }
[data-theme="dark"] .text-hero { color: var(--g-400) !important; }

/* ---------- Latar ---------- */
/* Baseplate berpaku */
.bg-studs {
    background-color: var(--paper);
    background-image:
        radial-gradient(circle at 50% 42%, var(--stud-hi) 0 3px, transparent 3.5px),
        radial-gradient(circle, var(--stud) 0 8px, transparent 8.5px);
    background-size: 30px 30px;
}

/* Dunia hijau: gradasi + grid blok */
.bg-world,
.comic-card.bg-world {
    background:
        linear-gradient(rgba(255, 255, 255, .07) 2px, transparent 2px) 0 0 / 48px 48px,
        linear-gradient(90deg, rgba(255, 255, 255, .07) 2px, transparent 2px) 0 0 / 48px 48px,
        radial-gradient(ellipse at 70% 30%, rgba(163, 230, 53, .35), transparent 55%),
        linear-gradient(180deg, var(--g-700) 0%, var(--g-600) 55%, var(--g-500) 100%);
    color: #fff;
}

.bg-surface { background-color: var(--surface) !important; }
.bg-paper { background-color: var(--paper) !important; }
.bg-green { background-color: var(--g-600) !important; color: #fff; }
.bg-lime { background-color: var(--lime) !important; color: var(--g-950); }
.bg-dark-green { background-color: var(--g-950) !important; color: #fff; }

/* ---------- Kartu blok ---------- */
.comic-card {
    background: var(--surface);
    border: var(--bw) solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--lift);
    position: relative;
}
.comic-card.hoverable { transition: transform .15s ease, box-shadow .15s ease; }
.comic-card.hoverable:hover { transform: translateY(-4px); box-shadow: 0 10px 0 var(--shadow-c); }

.comic-card .card-head {
    padding: 1rem 1.25rem;
    border-bottom: 2px solid color-mix(in srgb, var(--line) 12%, transparent);
    display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
}
.comic-card .card-head h5, .comic-card .card-head h6 { margin: 0; font-weight: 700; }
.comic-card .card-body { padding: 1.25rem; }

/* Label tab di atas kartu */
.comic-panel-label {
    position: absolute;
    top: -15px; left: 18px;
    background: var(--g-600);
    color: #fff;
    border: 2px solid var(--line);
    border-radius: 10px;
    padding: .12rem .7rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: .9rem;
    box-shadow: 0 3px 0 var(--shadow-c);
}

/* Balon chat (gaya game) */
.speech {
    position: relative;
    background: #fff;
    color: var(--g-950);
    border-radius: 14px;
    padding: .6rem .95rem;
    font-weight: 800;
    font-size: .9rem;
    box-shadow: 0 4px 14px rgba(5, 46, 22, .25);
    display: inline-block;
    line-height: 1.3;
}
.speech::after {
    content: "";
    position: absolute;
    left: 50%; bottom: -9px;
    transform: translateX(-50%);
    border-width: 10px 9px 0;
    border-style: solid;
    border-color: #fff transparent transparent;
}

/* Name tag di atas kepala avatar */
.nametag {
    display: inline-flex; align-items: center; gap: .35rem;
    background: rgba(5, 46, 22, .72);
    color: #fff;
    border-radius: 8px;
    padding: .18rem .6rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: .95rem;
    white-space: nowrap;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .4);
}
.nametag .lv { background: var(--lime); color: var(--g-950); border-radius: 5px; padding: 0 .35rem; font-size: .75rem; font-weight: 700; text-shadow: none; }

/* Teks efek game (+XP, LEVEL UP!) */
.sfx {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 2rem;
    color: var(--lime);
    -webkit-text-stroke: 2px var(--g-950);
    paint-order: stroke fill;
    text-shadow: 0 4px 0 var(--g-950);
    display: inline-block;
    transform: rotate(-4deg);
    line-height: 1;
}
.sfx.gold { color: var(--gold); }
.sfx.white { color: #fff; }
.sfx.red { color: #FCA5A5; }

/* Lencana */
.badge-hero {
    display: inline-flex; align-items: center; gap: .35rem;
    border: 2px solid var(--line);
    border-radius: 999px;
    padding: .28rem .8rem;
    font-weight: 800;
    font-size: .78rem;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 3px 0 var(--shadow-c);
}
.badge-hero.green { background: var(--g-600); color: #fff; }
.badge-hero.lime { background: var(--lime); color: var(--g-950); }
.badge-hero.dark { background: var(--g-950); color: var(--lime); }
.badge-hero.gold { background: var(--gold); color: var(--g-950); }
.badge-hero.red { background: var(--red); color: #fff; }

/* Pill status (tabel) */
.pill { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 800; border: 2px solid var(--line); white-space: nowrap; }
.pill-wait { background: #FEF9C3; color: #854D0E; }
.pill-ok { background: var(--g-200); color: var(--g-900); }
.pill-no { background: #FEE2E2; color: #991B1B; }
.pill-info { background: #E0F2FE; color: #075985; }
.pill-muted { background: var(--surface-2); color: var(--text-muted); }

/* ---------- Tombol game 3D ---------- */
.btn-hero {
    --b-bg: var(--g-600);
    --b-fg: #fff;
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    background: var(--b-bg);
    color: var(--b-fg);
    border: var(--bw) solid var(--line);
    border-radius: 14px;
    padding: .62rem 1.2rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    box-shadow: var(--lift-sm), inset 0 -4px 0 rgba(0, 0, 0, .14), inset 0 3px 0 rgba(255, 255, 255, .25);
    transition: transform .1s ease, box-shadow .1s ease, filter .1s;
    text-decoration: none;
    cursor: pointer;
    line-height: 1.2;
}
.btn-hero:hover { color: var(--b-fg); transform: translateY(-2px); box-shadow: 0 6px 0 var(--shadow-c), inset 0 -4px 0 rgba(0, 0, 0, .14), inset 0 3px 0 rgba(255, 255, 255, .25); filter: brightness(1.05); }
.btn-hero:active { transform: translateY(4px); box-shadow: 0 0 0 var(--shadow-c), inset 0 -2px 0 rgba(0, 0, 0, .14); }
.btn-hero:disabled, .btn-hero.disabled { opacity: .6; pointer-events: none; }
.btn-hero:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }

.btn-hero.lime { --b-bg: var(--lime); --b-fg: var(--g-950); }
.btn-hero.white { --b-bg: #fff; --b-fg: var(--g-950); }
.btn-hero.ghost { --b-bg: var(--surface); --b-fg: var(--text); }
.btn-hero.dark { --b-bg: var(--g-950); --b-fg: var(--lime); }
.btn-hero.red { --b-bg: var(--red); --b-fg: #fff; }
.btn-hero.lg { padding: .85rem 1.55rem; font-size: 1.12rem; border-radius: 16px; }
.btn-hero.sm { padding: .32rem .72rem; font-size: .85rem; border-width: 2px; border-radius: 10px; box-shadow: 0 3px 0 var(--shadow-c); }
.btn-hero.icon { padding: .45rem; width: 42px; height: 42px; }
.btn-hero.sm.icon { width: 34px; height: 34px; padding: .25rem; }

.btn-check:checked + .btn-hero { --b-bg: var(--lime); --b-fg: var(--g-950); }
.btn-check:focus-visible + .btn-hero { outline: 3px solid var(--lime); outline-offset: 3px; }

.btn { font-weight: 800; border-radius: 10px; }

/* ---------- Form ---------- */
.form-label { font-weight: 800; font-size: .85rem; margin-bottom: .35rem; }
.form-control, .form-select {
    border: 2px solid var(--line);
    border-radius: var(--radius-sm);
    padding: .65rem .9rem;
    background-color: var(--surface);
    color: var(--text);
    font-weight: 700;
    box-shadow: inset 0 3px 0 rgba(5, 46, 22, .06);
}
.form-control::placeholder { color: var(--text-muted); font-weight: 600; opacity: .8; }
.form-control:focus, .form-select:focus {
    border-color: var(--g-600);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--lime) 55%, transparent);
    background-color: var(--surface);
    color: var(--text);
}
.form-control.is-invalid { border-color: var(--red); }
/* Isian baca-saja (diisi otomatis / dikelola panitia): dibedakan jelas dari isian yang bisa diketik */
.form-control.isian-kunci {
    background-color: color-mix(in srgb, var(--text-muted) 10%, var(--surface));
    border-style: dashed;
    border-color: color-mix(in srgb, var(--line) 45%, transparent);
    color: var(--text-muted);
    cursor: default;
}
.form-control.isian-kunci:focus { box-shadow: none; border-color: color-mix(in srgb, var(--line) 45%, transparent); background-color: color-mix(in srgb, var(--text-muted) 10%, var(--surface)); }
.input-group-text { border: 2px solid var(--line); background: var(--g-600); color: #fff; font-weight: 800; border-radius: var(--radius-sm); }
.form-check-input { border: 2px solid var(--line); width: 1.15em; height: 1.15em; }
.form-check-input:checked { background-color: var(--g-600); border-color: var(--line); }

input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }

/* ---------- Animasi ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

@keyframes float-y { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes cube-float { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-16px) rotate(8deg); } }
@keyframes wave { 0%, 100% { transform: rotate(-150deg); } 50% { transform: rotate(-178deg); } }
@keyframes pop-in { 0% { transform: scale(.5) rotate(-4deg); opacity: 0; } 70% { transform: scale(1.1) rotate(-4deg); opacity: 1; } 100% { transform: scale(1) rotate(-4deg); } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes xp-up { 0% { transform: translateY(8px); opacity: 0; } 20% { opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(-26px); opacity: 0; } }

/* ---------- Animasi karakter (semua avatar bergerak) ----------
   --d = jeda acak per karakter (diset di atribut style SVG) agar tidak serempak */
.avatar-svg .av-body { animation: av-bob 2.8s ease-in-out infinite; animation-delay: var(--d, 0s); }
.avatar-svg .av-shadow { transform-box: fill-box; transform-origin: center; animation: av-shadow 2.8s ease-in-out infinite; animation-delay: var(--d, 0s); }
.avatar-svg .av-head { transform-box: view-box; transform-origin: 100px 118px; animation: av-nod 3.6s ease-in-out infinite; animation-delay: var(--d, 0s); }
.avatar-svg .av-eyes { transform-box: fill-box; transform-origin: center; animation: av-blink 4.6s infinite; animation-delay: var(--d, 0s); }
.avatar-svg .av-arm-l { transform-box: view-box; transform-origin: 53px 128px; animation: av-sway-l 2.8s ease-in-out infinite; animation-delay: var(--d, 0s); }
.avatar-svg .av-arm-r { transform-box: view-box; transform-origin: 147px 128px; animation: av-sway-r 2.8s ease-in-out infinite; animation-delay: var(--d, 0s); }
.avatar-svg .av-wave { transform-box: view-box; transform-origin: 147px 128px; animation: wave 1.8s ease-in-out infinite; animation-delay: var(--d, 0s); }
.avatar-svg .av-cape { transform-box: view-box; transform-origin: 103px 122px; animation: av-cape 2.2s ease-in-out infinite; animation-delay: var(--d, 0s); }
.avatar-svg .av-skirt { transform-box: view-box; transform-origin: 101px 206px; animation: av-skirt 2.8s ease-in-out infinite; animation-delay: var(--d, 0s); }
.avatar-svg .av-pulse { animation: av-pulse 1.2s ease-in-out infinite; }
.avatar-svg .av-blink { animation: av-cursor 1s steps(1) infinite; }
.avatar-svg .av-twinkle { transform-box: fill-box; transform-origin: center; animation: av-twinkle 1.6s ease-in-out infinite; }
.avatar-svg .av-bubble { transform-box: fill-box; transform-origin: center; animation: av-bubble 2s ease-in infinite; }
.avatar-svg .av-bubble.b2 { animation-duration: 2.6s; animation-delay: -1s; }
.avatar-svg .av-flash { animation: av-flash 3.2s ease-out infinite; }

@keyframes av-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes av-shadow { 0%, 100% { transform: scaleX(1); opacity: 1; } 50% { transform: scaleX(.9); opacity: .75; } }
@keyframes av-nod { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
@keyframes av-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes av-sway-l { 0%, 100% { transform: rotate(3deg); } 50% { transform: rotate(-3deg); } }
@keyframes av-sway-r { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes av-cape { 0%, 100% { transform: skewX(-3deg) scaleX(1); } 50% { transform: skewX(3deg) scaleX(1.05); } }
@keyframes av-skirt { 0%, 100% { transform: skewX(-1.6deg); } 50% { transform: skewX(1.6deg); } }
@keyframes av-pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes av-cursor { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes av-twinkle { 0%, 100% { transform: scale(1) rotate(0deg); } 50% { transform: scale(1.25) rotate(15deg); } }
@keyframes av-bubble { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(-16px); opacity: 0; } }
@keyframes av-flash { 0%, 85%, 100% { opacity: 0; } 88% { opacity: .95; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .avatar-svg .av-wave { transform: rotate(-160deg); }
    .reveal { opacity: 1; transform: none; }
}

/* =====================================================================
   PANGGUNG AVATAR
   ===================================================================== */
.stage { position: relative; max-width: 460px; margin: 0 auto; padding-top: 3.2rem; }
.stage .glow { position: absolute; inset: 8% 6% 18%; border-radius: 50%; background: radial-gradient(circle, rgba(163, 230, 53, .55), transparent 65%); z-index: 0; }
.stage .avatar-wrap { position: relative; z-index: 2; width: 66%; margin: 0 auto -17%; animation: float-y 4s ease-in-out infinite; }
.stage .avatar-svg { width: 100%; height: auto; display: block; }
.stage .avatar-swap { transition: opacity .5s ease; opacity: 0; position: absolute; inset: 0; }
.stage .avatar-swap.show { opacity: 1; position: relative; }
.stage .platform { position: relative; z-index: 1; width: 92%; display: block; margin: 0 auto; filter: drop-shadow(0 10px 0 rgba(5, 46, 22, .25)); }
.stage .nametag { position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 3; }
.stage .speech { position: absolute; z-index: 3; top: 2.2rem; right: -2%; max-width: 210px; animation: float-y 5s ease-in-out infinite; }
.stage .sfx { position: absolute; left: 0; top: 34%; z-index: 3; font-size: 2.4rem; animation: pop-in .8s ease both .4s; }

/* Kubus melayang */
.float-cube { position: absolute; width: 56px; opacity: .9; animation: cube-float 6s ease-in-out infinite; pointer-events: none; z-index: 0; }
.float-cube.c2 { width: 38px; animation-duration: 7.5s; animation-delay: -2s; }
.float-cube.c3 { width: 28px; animation-duration: 5s; animation-delay: -1s; opacity: .7; }

/* =====================================================================
   HALAMAN PUBLIK
   ===================================================================== */
.site-nav { position: sticky; top: 0; z-index: 1030; background: var(--surface); border-bottom: var(--bw) solid var(--line); box-shadow: 0 4px 0 rgba(5, 46, 22, .08); }
.site-nav .container { display: flex; align-items: center; gap: 1rem; min-height: 72px; }

.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); }
.brand img { width: 44px; height: 44px; object-fit: contain; }
.brand .brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; line-height: .95; color: var(--g-700); }
[data-theme="dark"] .brand .brand-name { color: var(--lime); }
.brand .brand-sub { font-size: .68rem; font-weight: 800; color: var(--text-muted); letter-spacing: .06em; text-transform: uppercase; }

.site-menu { display: flex; gap: .25rem; margin: 0 auto; list-style: none; padding: 0; }
.site-menu a { display: block; padding: .5rem .85rem; border-radius: 12px; font-family: var(--font-display); font-weight: 600; color: var(--text); text-decoration: none; }
.site-menu a:hover, .site-menu a.active { background: var(--g-100); color: var(--g-800); }
[data-theme="dark"] .site-menu a:hover, [data-theme="dark"] .site-menu a.active { background: var(--surface-2); color: var(--lime); }

.nav-burger { display: none; }
@media (max-width: 991.98px) {
    .site-menu, .site-nav .nav-actions .hide-mobile { display: none; }
    .nav-burger { display: inline-flex; margin-left: auto; }
}

.offcanvas { background: var(--paper); color: var(--text); }
.mobile-drawer .drawer-link {
    display: flex; align-items: center; gap: .75rem;
    padding: .85rem 1rem; margin-bottom: .6rem;
    border: 2px solid var(--line); border-radius: 14px;
    font-family: var(--font-display); font-weight: 600;
    color: var(--text); text-decoration: none;
    background: var(--surface); box-shadow: var(--lift-sm);
}

/* Hero */
.hero { position: relative; overflow: hidden; border-bottom: var(--bw) solid var(--line); padding: 3.5rem 0 4.5rem; }
.hero .container { position: relative; z-index: 1; }
.hero-title {
    font-size: clamp(2.8rem, 7vw, 5.4rem);
    color: #fff;
    -webkit-text-stroke: 3px var(--g-950);
    paint-order: stroke fill;
    text-shadow: 0 7px 0 var(--g-950);
    margin: 1rem 0;
}
.hero-title .hl { color: var(--lime); }
.hero-sub { font-size: 1.12rem; font-weight: 700; color: #F0FDF4; max-width: 34rem; }

.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; max-width: 520px; }
.hero-stats .comic-card { padding: .7rem; text-align: center; }
.hero-stats strong { font-family: var(--font-display); font-size: 1.55rem; display: block; line-height: 1; color: var(--g-700); }
[data-theme="dark"] .hero-stats strong { color: var(--lime); }
.hero-stats span { font-size: .72rem; font-weight: 800; text-transform: uppercase; color: var(--text-muted); }

/* Pita berjalan */
.ticker { background: var(--g-950); color: #fff; border-bottom: var(--bw) solid var(--line); overflow: hidden; white-space: nowrap; padding: .75rem 0; }
.ticker-track { display: inline-flex; gap: 2.5rem; animation: marquee 32s linear infinite; padding-left: 2.5rem; }
.ticker-track span { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; }
.ticker-track i { color: var(--lime); }

/* Section */
.section { padding: 5rem 0; position: relative; }
.section-alt { background: var(--paper-2); border-top: var(--bw) solid var(--line); border-bottom: var(--bw) solid var(--line); }
.section-eyebrow { margin-bottom: .75rem; }
.section-title { font-size: clamp(2rem, 4.6vw, 3.2rem); color: var(--text); margin-bottom: .75rem; }
.section-title .hl { color: var(--g-600); }
[data-theme="dark"] .section-title .hl { color: var(--lime); }
.section-lead { font-size: 1.05rem; color: var(--text-muted); max-width: 42rem; margin: 0 auto; }

/* Kartu pilih karakter (kelas) */
.char-card { overflow: hidden; height: 100%; display: flex; flex-direction: column; }
.char-card .char-stage { position: relative; padding: 1.2rem 1rem 0; border-bottom: var(--bw) solid var(--line); border-radius: 15px 15px 0 0; overflow: hidden; }
.char-card .char-stage .avatar-svg { width: 46%; display: block; margin: 0 auto; position: relative; z-index: 1; }
.char-card .char-stage .platform { width: 74%; display: block; margin: -13% auto -8px; }
.char-card .char-stage .nametag { position: absolute; top: .7rem; left: .7rem; z-index: 2; }
.char-card .char-body { padding: 1.15rem 1.25rem 1.3rem; flex: 1; display: flex; flex-direction: column; }
.char-card .char-name { font-size: 1.45rem; margin: 0 0 .15rem; }
.char-card .char-role { font-weight: 800; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.char-card p { margin: .7rem 0 1rem; color: var(--text-muted); flex: 1; }
.char-card .stat-row { display: flex; align-items: center; gap: .5rem; font-size: .78rem; font-weight: 800; margin-bottom: .3rem; }
.char-card .stat-row .bar { flex: 1; height: 10px; border-radius: 99px; background: var(--surface-2); border: 2px solid var(--line); overflow: hidden; }
.char-card .stat-row .bar i { display: block; height: 100%; background: var(--g-500); }

/* Misi (quest) */
.mission { display: grid; gap: 1.25rem; grid-template-columns: repeat(var(--n-langkah, 5), 1fr); }
.mission-step { padding: 1.5rem 1.1rem 1.2rem; text-align: center; }
.mission-step .num {
    width: 50px; height: 50px; margin: -44px auto .75rem;
    border-radius: 14px; border: 2px solid var(--line);
    background: var(--lime); color: var(--g-950);
    display: grid; place-items: center;
    font-family: var(--font-display); font-weight: 700; font-size: 1.5rem;
    box-shadow: var(--lift-sm);
}
.mission-step i { font-size: 2rem; color: var(--g-600); }
.mission-step h6 { font-weight: 700; margin: .5rem 0 .25rem; font-size: 1.05rem; }
.mission-step p { font-size: .85rem; color: var(--text-muted); margin: 0 0 .6rem; }
.xp-chip { display: inline-block; background: var(--g-100); color: var(--g-800); border: 2px solid var(--line); border-radius: 8px; font-family: var(--font-display); font-weight: 700; font-size: .8rem; padding: 0 .45rem; }
[data-theme="dark"] .xp-chip { background: var(--surface-2); color: var(--lime); }
@media (max-width: 991.98px) { .mission { grid-template-columns: repeat(2, 1fr); row-gap: 2.5rem; } }
@media (max-width: 575.98px) { .mission { grid-template-columns: 1fr; } }

/* Timeline */
.timeline { display: grid; gap: 1rem; }
.timeline-item { display: grid; grid-template-columns: 150px 1fr; gap: 1rem; align-items: stretch; }
.timeline-date {
    background: var(--g-600); color: #fff;
    border: 2px solid var(--line); border-radius: 14px;
    padding: .75rem; text-align: center;
    font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
    display: grid; place-items: center;
    box-shadow: var(--lift-sm), inset 0 -4px 0 rgba(0, 0, 0, .14);
}
.timeline-item:nth-child(even) .timeline-date { background: var(--lime); color: var(--g-950); }
.timeline-body { padding: .9rem 1.1rem; }
.timeline-body h6 { font-weight: 700; margin: 0 0 .2rem; font-size: 1rem; }
.timeline-body p, .timeline-body ul { margin: 0; color: var(--text-muted); font-size: .88rem; }
@media (max-width: 575.98px) { .timeline-item { grid-template-columns: 1fr; gap: .4rem; } }

/* Alumni (kartu pemain) */
.alumni-card { padding: 1.5rem; height: 100%; display: flex; flex-direction: column; }
.alumni-card .quote { font-size: .92rem; flex: 1; }
.alumni-card .who { display: flex; align-items: center; gap: .9rem; margin-top: 1.25rem; }
.alumni-card .who img { width: 62px; height: 62px; border-radius: 14px; object-fit: cover; border: 2px solid var(--line); background: var(--g-200); box-shadow: var(--lift-sm); }
.alumni-card .who h6 { margin: 0; font-weight: 700; }
.alumni-card .who small { color: var(--text-muted); font-weight: 700; }

.cta-band { border-top: var(--bw) solid var(--line); border-bottom: var(--bw) solid var(--line); padding: 4rem 0; position: relative; overflow: hidden; }

/* Footer */
.site-footer { background: var(--g-950); color: var(--g-200); padding: 3.5rem 0 1.5rem; }
.site-footer a { color: #fff; text-decoration: none; font-weight: 700; }
.site-footer a:hover { color: var(--lime); }
.site-footer h6 { color: var(--lime); font-weight: 700; font-size: 1.2rem; }
.site-footer .socials a { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 2px solid var(--g-300); border-radius: 12px; margin-right: .4rem; transition: .15s; }
.site-footer .socials a:hover { background: var(--lime); color: var(--g-950); border-color: var(--lime); }
.site-footer .footer-logo { max-width: 260px; }

/* =====================================================================
   AUTH
   ===================================================================== */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-art { position: relative; overflow: hidden; border-right: var(--bw) solid var(--line); display: flex; flex-direction: column; justify-content: space-between; padding: 2.5rem; }
.auth-art .brand .brand-name, .auth-art .brand .brand-sub { color: #fff; }
.auth-art .stage { width: min(400px, 88%); }
.auth-art .hero-title { font-size: clamp(2.3rem, 3.8vw, 3.6rem); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; min-width: 0; }
.auth-card { width: 100%; max-width: 460px; padding: 2rem; }
.auth-card .auth-title { font-family: var(--font-display); font-weight: 700; font-size: 2.3rem; margin: 0; line-height: 1.05; }

@media (max-width: 420px) {
    .auth-form { padding: 1.5rem .75rem; }
    .auth-card { padding: 1.5rem 1.1rem; }
    .g-recaptcha { transform: scale(.86); transform-origin: 0 0; height: 68px; }
}
@media (max-width: 991.98px) {
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-art { display: none; }
}

.result-card { max-width: 560px; margin: 0 auto; padding: 2.5rem 2rem; text-align: center; }
.result-card .sfx { font-size: 3.4rem; margin-bottom: .5rem; }
.result-card .avatar-svg { width: 120px; display: block; margin: 0 auto .5rem; }

/* =====================================================================
   PANEL (Siswa & Admin)
   ===================================================================== */
.sidebar {
    position: fixed; inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    border-right: var(--bw) solid var(--line);
    z-index: 1040;
    display: flex; flex-direction: column;
    transition: transform .25s ease;
}
.sidebar .sb-brand { display: flex; align-items: center; gap: .7rem; padding: 1.1rem 1.25rem; color: #fff; text-decoration: none; border-bottom: 2px solid rgba(255, 255, 255, .08); }
.sidebar .sb-brand img { width: 42px; height: 42px; object-fit: contain; background: #fff; border-radius: 12px; padding: 3px; border: 2px solid var(--lime); }
.sidebar .sb-brand .t1 { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--lime); line-height: .95; }
.sidebar .sb-brand .t2 { font-size: .68rem; font-weight: 800; letter-spacing: .07em; opacity: .7; text-transform: uppercase; }
.sidebar .sb-scroll { overflow-y: auto; flex: 1; padding: 1rem .9rem 1.5rem; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent; }
.sb-label { font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .5; padding: .9rem .75rem .4rem; }
.sb-link {
    display: flex; align-items: center; gap: .75rem;
    padding: .6rem .8rem; margin-bottom: .25rem;
    border-radius: 12px;
    color: var(--sidebar-text); text-decoration: none;
    font-weight: 700; font-size: .92rem;
    border: 2px solid transparent;
    transition: background .12s;
}
.sb-link i { font-size: 1.15rem; width: 1.3rem; text-align: center; }
.sb-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sb-link.active { background: var(--lime); color: var(--g-950); border-color: #000; box-shadow: 0 4px 0 #000, inset 0 -3px 0 rgba(0, 0, 0, .12); }
.sb-foot { padding: 1rem; border-top: 2px solid rgba(255, 255, 255, .08); }

.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 1030;
    height: var(--topbar-h);
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: var(--bw) solid var(--line);
    display: flex; align-items: center; gap: .75rem;
    padding: 0 1.5rem;
}
.topbar .tb-title { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; display: flex; align-items: center; gap: .5rem; min-width: 0; }
.topbar .tb-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .tb-actions { margin-left: auto; display: flex; align-items: center; gap: .6rem; }

.avatar {
    width: 40px; height: 40px;
    border-radius: 12px; border: 2px solid var(--line);
    object-fit: cover; background: var(--g-200);
    display: inline-grid; place-items: center; overflow: hidden;
    font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: var(--g-900);
    flex-shrink: 0;
}
.avatar .avatar-svg { width: 100%; height: 100%; }
.user-chip {
    display: flex; align-items: center; gap: .55rem;
    padding: .25rem .6rem .25rem .25rem;
    border: 2px solid var(--line) !important; border-radius: 14px;
    background: var(--surface); color: var(--text);
    font-weight: 800; font-size: .85rem;
    box-shadow: 0 3px 0 var(--shadow-c);
}
.user-chip .avatar { width: 32px; height: 32px; border-radius: 10px; font-size: 1rem; }

.samaran-bar { background: repeating-linear-gradient(-45deg, var(--lime) 0 14px, var(--g-950) 14px 28px); border-bottom: var(--bw) solid var(--line); padding: .35rem 1.5rem; }
.samaran-bar .inner { background: var(--g-950); color: var(--lime); display: inline-flex; gap: .75rem; align-items: center; padding: .3rem .8rem; border-radius: 10px; font-weight: 800; font-size: .85rem; }
.samaran-bar a { color: #fff; }

.content { padding: 1.75rem 1.5rem 2.5rem; flex: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.page-title { font-size: clamp(1.9rem, 3.2vw, 2.6rem); margin: 0; color: var(--text); }
.page-title .hl { color: var(--g-600); }
[data-theme="dark"] .page-title .hl { color: var(--lime); }
.page-sub { color: var(--text-muted); font-weight: 700; margin: .35rem 0 0; }
.app-footer { padding: 1rem 1.5rem; border-top: 2px solid color-mix(in srgb, var(--line) 12%, transparent); font-size: .8rem; color: var(--text-muted); font-weight: 700; }

.sidebar-backdrop { display: none; }
@media (max-width: 1199.98px) {
    .sidebar { transform: translateX(-105%); }
    body.sb-open .sidebar { transform: none; }
    body.sb-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(2, 13, 7, .6); z-index: 1035; }
    .main { margin-left: 0; }
    .topbar { padding: 0 1rem; }
    .content { padding: 1.25rem 1rem 2rem; }
}

/* Kartu statistik */
.stat-card { padding: 1.15rem 1.25rem; display: flex; align-items: center; gap: 1rem; height: 100%; }
.stat-card > div:last-child { min-width: 0; }
.stat-card .stat-icon {
    width: 56px; height: 56px; border-radius: 16px;
    border: 2px solid var(--line);
    display: grid; place-items: center;
    font-size: 1.55rem; flex-shrink: 0;
    box-shadow: var(--lift-sm), inset 0 -4px 0 rgba(0, 0, 0, .14);
}
.stat-card .stat-label { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.stat-card .stat-value { font-family: var(--font-display); font-weight: 700; font-size: 2.1rem; line-height: 1; }
.stat-card .stat-unit { font-size: .78rem; font-weight: 800; color: var(--text-muted); margin-left: .25rem; font-family: var(--font-body); }
.ic-green { background: var(--g-600); color: #fff; }
.ic-lime { background: var(--lime); color: var(--g-950); }
.ic-mint { background: var(--g-200); color: var(--g-900); }
.ic-teal { background: var(--teal); color: #fff; }
.ic-dark { background: var(--g-950); color: var(--lime); }
.ic-gold { background: var(--gold); color: var(--g-950); }
@media (max-width: 575.98px) {
    .stat-card { flex-direction: column; align-items: flex-start; gap: .6rem; padding: .9rem; }
    .stat-card .stat-icon { width: 46px; height: 46px; font-size: 1.3rem; border-radius: 13px; }
    .stat-card .stat-value { font-size: 1.7rem; overflow-wrap: anywhere; }
}

/* HUD pemain (dashboard siswa) */
.player-hud { padding: 1.5rem; overflow: hidden; }
.player-hud .hud-avatar { width: 100%; max-width: 185px; margin: 0 auto; position: relative; }
.player-hud .hud-avatar .avatar-svg { width: 74%; display: block; margin: 0 auto -15%; position: relative; z-index: 1; animation: float-y 4s ease-in-out infinite; }
.player-hud .hud-avatar .platform { width: 100%; display: block; }
.player-hud .hud-avatar .avatar-svg.emblem { width: 62%; margin-bottom: -4%; }

/* Daftar materi di kartu kelas */
.skill-list { list-style: none; padding: 0; margin: 0 0 .8rem; display: grid; gap: .3rem; }
.skill-list li { display: flex; align-items: center; gap: .45rem; font-weight: 700; font-size: .85rem; }
.skill-list li i { color: var(--g-600); }
[data-theme="dark"] .skill-list li i { color: var(--lime); }
.dtm-banner { padding: 1.25rem 1.4rem; display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.dtm-banner .stat-icon { width: 60px; height: 60px; border-radius: 16px; border: 2px solid #000; display: grid; place-items: center; font-size: 1.7rem; flex-shrink: 0; box-shadow: 0 4px 0 #000; }
.player-hud .hud-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.9rem, 3.6vw, 2.8rem); line-height: 1.05; margin: .4rem 0; color: #fff; -webkit-text-stroke: 2px var(--g-950); paint-order: stroke fill; text-shadow: 0 5px 0 var(--g-950); }
.level-badge {
    display: inline-grid; place-items: center;
    width: 64px; height: 64px;
    background: var(--lime); color: var(--g-950);
    border: 2.5px solid var(--line); border-radius: 18px;
    font-family: var(--font-display); font-weight: 700; line-height: 1;
    box-shadow: var(--lift-sm), inset 0 -5px 0 rgba(0, 0, 0, .14);
    transform: rotate(-6deg);
}
.level-badge small { font-size: .65rem; display: block; }
.level-badge b { font-size: 1.7rem; }
.xp-bar { position: relative; height: 26px; border-radius: 99px; background: var(--g-950); border: 2.5px solid var(--line); overflow: hidden; box-shadow: var(--lift-sm); }
.xp-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(180deg, #D9F99D, var(--lime) 45%, var(--lime-deep)); border-right: 2px solid var(--line); transition: width 1s ease; }
.xp-bar span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: .85rem; color: #fff; text-shadow: 0 1px 0 #000, 0 0 4px #000; }
.xp-float { position: absolute; right: 1rem; top: .5rem; animation: xp-up 2.6s ease-out 1s both; }

/* Daftar misi */
.quest { display: flex; align-items: center; gap: .85rem; padding: .75rem .9rem; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); text-decoration: none; box-shadow: var(--lift-sm); transition: transform .12s; }
.quest:hover { transform: translateY(-2px); color: var(--text); }
.quest .q-ic { width: 42px; height: 42px; border-radius: 12px; border: 2px solid var(--line); display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0; background: var(--surface-2); color: var(--text-muted); }
.quest .q-name { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; line-height: 1.15; }
.quest .q-sub { font-size: .75rem; color: var(--text-muted); font-weight: 700; }
.quest .q-right { margin-left: auto; text-align: right; }
.quest.done { background: var(--g-100); }
.quest.done .q-ic { background: var(--g-600); color: #fff; }
.quest.now { background: color-mix(in srgb, var(--lime) 35%, var(--surface)); }
.quest.now .q-ic { background: var(--lime); color: var(--g-950); }
[data-theme="dark"] .quest.done { background: #0E3A22; }

/* Koleksi lencana */
.badge-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .6rem; }
@media (max-width: 575.98px) { .badge-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.badge-slot { aspect-ratio: 1; border: 2px solid var(--line); border-radius: 16px; display: grid; place-items: center; text-align: center; padding: .3rem; background: var(--surface-2); box-shadow: var(--lift-sm); }
.badge-slot i { font-size: 1.6rem; }
.badge-slot small { display: block; overflow-wrap: anywhere; font-size: .6rem; font-weight: 800; line-height: 1.1; margin-top: .15rem; }
.badge-slot.got { background: var(--g-600); color: #fff; }
.badge-slot.got i { color: var(--lime); }
.badge-slot.locked { color: var(--text-muted); opacity: .6; border-style: dashed; box-shadow: none; }

/* Info list */
.info-list { list-style: none; padding: 0; margin: 0; }
.info-list li { display: flex; gap: 1rem; padding: .55rem 0; border-bottom: 2px solid color-mix(in srgb, var(--line) 8%, transparent); }
.info-list li:last-child { border-bottom: 0; }
.info-list .k { width: 40%; color: var(--text-muted); font-weight: 700; font-size: .85rem; }
.info-list .v { flex: 1; font-weight: 800; }

.nav-comic { gap: .5rem; flex-wrap: wrap; }
.nav-comic .nav-link { border: 2px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font-family: var(--font-display); font-weight: 600; padding: .45rem .9rem; box-shadow: 0 3px 0 var(--shadow-c); }
.nav-comic .nav-link.active { background: var(--g-600); color: #fff; }

.empty-state { text-align: center; padding: 2.5rem 1rem; }
.empty-state .sfx { font-size: 2.4rem; }
.empty-state p { color: var(--text-muted); font-weight: 700; }

/* ---------- Bootstrap overrides ---------- */
.card { background: var(--surface); color: var(--text); border: var(--bw) solid var(--line); border-radius: var(--radius); box-shadow: var(--lift); }
.modal-content { background: var(--surface); color: var(--text); border: var(--bw) solid var(--line); border-radius: var(--radius); box-shadow: var(--lift-lg); }
.modal-header { border-bottom: 2px solid color-mix(in srgb, var(--line) 12%, transparent); }
.modal-header .modal-title { font-weight: 700; font-size: 1.4rem; }
.modal-footer { border-top: 2px solid color-mix(in srgb, var(--line) 12%, transparent); }
.dropdown-menu { border: 2px solid var(--line); border-radius: 14px; box-shadow: var(--lift-sm); background: var(--surface); padding: .4rem; }
.dropdown-item { border-radius: 9px; font-weight: 700; color: var(--text); padding: .5rem .75rem; }
.dropdown-item:hover { background: var(--g-100); color: var(--g-900); }
.alert { border: 2px solid var(--line); border-radius: 14px; font-weight: 700; box-shadow: var(--lift-sm); }
.progress { border: 2px solid var(--line); border-radius: 999px; height: 16px; background: var(--surface-2); }
.progress-bar { background: var(--g-500); }

.table { --bs-table-bg: transparent; --bs-table-color: var(--text); color: var(--text); margin-bottom: 0; }
.table > thead th { background: var(--g-800); color: #fff; font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 800; border: 0; padding: .8rem .75rem; white-space: nowrap; }
.table > thead th:first-child { border-top-left-radius: 10px; }
.table > thead th:last-child { border-top-right-radius: 10px; }
.table > tbody td { border-bottom: 1.5px solid color-mix(in srgb, var(--line) 10%, transparent); padding: .7rem .75rem; vertical-align: middle; font-weight: 600; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: color-mix(in srgb, var(--lime) 18%, transparent); }

div.dataTables_wrapper div.dataTables_filter input,
div.dataTables_wrapper div.dataTables_length select { border: 2px solid var(--line); border-radius: 10px; background-color: var(--surface); color: var(--text); font-weight: 700; padding: .35rem .7rem; }
div.dataTables_wrapper div.dataTables_info { font-weight: 700; color: var(--text-muted); font-size: .82rem; }
.page-link { border: 2px solid var(--line) !important; color: var(--text); background: var(--surface); font-weight: 800; margin: 0 2px; border-radius: 9px !important; }
.page-item.active .page-link { background: var(--g-600); color: #fff; }
.page-item.disabled .page-link { background: var(--surface-2); color: var(--text-muted); opacity: .6; }
table.dataTable { border-collapse: separate !important; border-spacing: 0; }
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before { background-color: var(--g-600); border: 2px solid var(--line); box-shadow: none; }

.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple { border: 2px solid var(--line) !important; border-radius: var(--radius-sm) !important; min-height: 46px; background: var(--surface); display: flex; align-items: center; }
.select2-container--default .select2-selection--single .select2-selection__rendered { color: var(--text); font-weight: 700; line-height: 1.3; padding-left: .9rem; padding-right: 2rem; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 100%; right: 8px; }
.select2-dropdown { border: 2px solid var(--line) !important; border-radius: 12px !important; overflow: hidden; background: var(--surface); color: var(--text); box-shadow: var(--lift-sm); }
.select2-search--dropdown .select2-search__field { border: 2px solid var(--line) !important; border-radius: 8px; padding: .4rem .6rem; background: var(--surface); color: var(--text); }
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background: var(--g-600); color: #fff; }
.select2-results__option { font-weight: 700; font-size: .88rem; }

.swal2-popup.swal-hero { border: var(--bw) solid var(--line); border-radius: 22px; box-shadow: var(--lift-lg); background: var(--surface); color: var(--text); }
.swal2-popup.swal-hero .swal2-title { font-family: var(--font-display); font-weight: 700; font-size: 1.8rem; color: var(--text); }
.swal2-popup.swal-hero .swal2-html-container { color: var(--text-muted); font-weight: 700; }

@media print {
    .sidebar, .topbar, .app-footer, .no-print { display: none !important; }
    .main { margin: 0; }
    .comic-card, .card { box-shadow: none; }
}

section[id] { scroll-margin-top: 84px; }

/* =====================================================================
   HALAMAN SEGERA DIBUKA & PODIUM PRESTASI
   ===================================================================== */
.soon { padding: 2rem 0 2.2rem; min-height: calc(100vh - 72px); display: flex; align-items: center; }
.soon > .container-fluid { width: 100%; }
.soon > .float-cube { top: 8%; left: 30%; }
.soon > .float-cube.c2 { top: 10%; left: auto; right: 28%; }
.soon > .float-cube.c3 { top: 88%; left: 4%; }

/* Tata letak: karakter kiri | konten | karakter kanan */
.soon-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 640px) minmax(0, 1fr); gap: 1.5rem; align-items: end; }
.soon-center { align-self: center; position: relative; z-index: 2; }
.soon-title { font-size: clamp(2.4rem, 4.6vw, 4.2rem); margin: .6rem 0 .8rem; }
.soon-side { position: relative; z-index: 1; max-width: 420px; width: 100%; }
.soon-side.left { justify-self: end; }
.soon-side.right { justify-self: start; }
@media (max-width: 991.98px) {
    .soon { min-height: 0; }
    .soon-grid { grid-template-columns: 1fr 1fr; grid-template-areas: "c c" "l r"; gap: 2.2rem 1rem; }
    .soon-center { grid-area: c; }
    .soon-side.left { grid-area: l; }
    .soon-side.right { grid-area: r; }
}

.countdown { display: inline-grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.cd-tile {
    background: #fff; color: var(--g-950);
    border: var(--bw) solid var(--line); border-radius: 18px;
    padding: .7rem .5rem .55rem; min-width: 92px;
    box-shadow: var(--lift), inset 0 -5px 0 rgba(0, 0, 0, .08);
}
.cd-tile b { display: block; font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 6vw, 3.2rem); line-height: 1; color: var(--g-700); }
.cd-tile span { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
@media (max-width: 420px) { .countdown { gap: .45rem; } .cd-tile { min-width: 0; padding: .55rem .3rem; } }

.world-loading { max-width: 520px; color: #fff; text-align: left; }

.squad { display: flex; justify-content: center; align-items: flex-end; margin: 0 auto; position: relative; z-index: 2; padding-top: 1.8rem; }
.squad-member { position: relative; width: 31%; margin: 0 -2% -7%; }
.squad-member.lead { width: 38%; z-index: 2; }
.squad-member .avatar-svg { width: 100%; display: block; }
.squad-member .nametag { position: absolute; top: -1.6rem; left: 50%; transform: translateX(-50%); font-size: .75rem; }
.squad-platform { display: block; width: 100%; margin: 0 auto; position: relative; z-index: 1; filter: drop-shadow(0 10px 0 rgba(5, 46, 22, .25)); }
@media (max-width: 575.98px) { .squad-member .nametag { display: none; } }

/* Podium juara */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: .5rem; max-width: 460px; margin: 0 auto; }
.podium-col { flex: 1; display: flex; flex-direction: column; align-items: center; }
.podium-col .avatar-svg { width: 92%; display: block; margin-bottom: -6%; position: relative; z-index: 1; }
.podium-step {
    width: 100%; border: var(--bw) solid var(--line); border-radius: 14px 14px 6px 6px;
    display: grid; place-items: center;
    font-family: var(--font-display); font-weight: 700; font-size: 2.2rem; color: #fff;
    box-shadow: var(--lift), inset 0 6px 0 rgba(255, 255, 255, .25), inset 0 -6px 0 rgba(0, 0, 0, .15);
    -webkit-text-stroke: 1.5px var(--g-950); paint-order: stroke fill;
}
.podium-step.p1 { height: 120px; background: var(--gold); }
.podium-step.p2 { height: 88px; background: var(--g-300); }
.podium-step.p3 { height: 64px; background: var(--lime); }
.podium-col .nametag { margin-bottom: .3rem; font-size: .8rem; }

/* =====================================================================
   TAHAP 2 — MODUL SISWA
   ===================================================================== */
.min-w-0 { min-width: 0; }
.text-warning-hero { color: #B45309 !important; }
[data-theme=dark] .text-warning-hero { color: #FCD34D !important; }

/* Formulir: tab quest */
.form-total { padding: .75rem 1rem; min-width: 240px; }
.quest-tabs { display: flex; gap: .5rem; padding: 1rem; flex-wrap: wrap; border-bottom: 2px solid color-mix(in srgb, var(--line) 12%, transparent); }
.quest-tabs .nav-link { display: flex; align-items: center; gap: .5rem; white-space: nowrap; border: 2px solid var(--line); border-radius: 14px; background: var(--surface-2); color: var(--text); font-weight: 800; padding: .55rem .85rem; box-shadow: var(--lift-sm); }
@media (max-width: 767.98px) { .quest-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; padding-bottom: .9rem; } }
.quest-tabs .nav-link.active { background: var(--g-600); color: #fff; }
.qt-num { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface); color: var(--text); border: 2px solid var(--line); font-size: .8rem; }
.quest-tabs .nav-link.active .qt-num { background: var(--lime); color: var(--g-950); }
.qt-pct { font-size: .7rem; padding: .1rem .45rem; border-radius: 999px; background: #FEF9C3; color: #854D0E; border: 2px solid var(--line); }
.qt-pct.done { background: var(--lime); color: var(--g-950); }
.form-sec { font-weight: 800; color: var(--g-700); margin: 1.75rem 0 .9rem; padding-bottom: .4rem; border-bottom: 2px dashed color-mix(in srgb, var(--line) 18%, transparent); }
[data-theme=dark] .form-sec { color: var(--lime); }
.tab-pane > form > .form-sec:first-child, .tab-pane > .form-sec:first-of-type { margin-top: .25rem; }
.form-aksi { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; margin: 1.75rem -1.25rem -1.25rem; padding: .85rem 1.25rem; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(6px); border-top: 2px solid color-mix(in srgb, var(--line) 12%, transparent); border-radius: 0 0 var(--radius) var(--radius); }
.form-aksi .form-status { margin-right: auto; }
.kartu-bantuan { border: 2px solid color-mix(in srgb, var(--line) 25%, transparent); border-radius: 14px; padding: .8rem 1rem; transition: border-color .15s, background .15s; }
.kartu-bantuan.on { border-color: var(--g-600); background: color-mix(in srgb, var(--lime) 10%, transparent); }
.btn-check:checked + .btn-hero.white { background: var(--g-600); color: #fff; }

/* Dokumen */
.dok-list { display: grid; gap: .6rem; }
.dok-item { display: flex; align-items: center; gap: .75rem; padding: .7rem .85rem; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--lift-sm); }
.dok-ic { font-size: 1.6rem; color: var(--g-600); }
.drop-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; text-align: center; padding: 1.5rem 1rem; border: 3px dashed color-mix(in srgb, var(--line) 35%, transparent); border-radius: 16px; cursor: pointer; font-weight: 700; background: var(--surface-2); position: relative; }
.drop-zone:hover, .drop-zone:focus-within { border-color: var(--g-600); }
.drop-zone > i { font-size: 2.2rem; color: var(--g-600); }
.drop-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Program kelas */
.pil-slot { display: flex; align-items: flex-end; gap: .75rem; }
.pil-no { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 1.3rem; background: var(--g-600); color: #fff; border: 2px solid var(--line); box-shadow: var(--lift-sm); }
.pil-rules li { color: var(--text-muted); padding: .1rem 0; }
.pil-rules li i { color: var(--red); }
.pil-rules li.ok { color: var(--text); }
.pil-rules li.ok i { color: var(--g-600); }
.prog-card { display: flex; align-items: center; gap: .85rem; padding: .85rem; transition: transform .15s, box-shadow .15s, background .15s; }
.prog-card.picked { background: color-mix(in srgb, var(--lime) 16%, var(--surface)); border-color: var(--g-700); }
.prog-av { flex: 0 0 auto; width: 64px; height: 64px; border-radius: 16px; background: var(--g-100); border: 2px solid var(--line); overflow: hidden; display: grid; place-items: center; }
.prog-av svg { width: 100%; height: 100%; }
.prog-rank { margin-top: .35rem; }

/* Pembayaran */
.pay-way { display: flex; gap: .8rem; align-items: flex-start; margin-bottom: .9rem; }
.pay-ic { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; border: 2px solid var(--line); }

/* Seragam */
.seragam-av { max-width: 210px; margin: 0 auto; }
.seragam-hero .platform { max-width: 260px; margin: -14px auto 0; display: block; }
.size-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.size-tile { display: flex; flex-direction: column; align-items: center; padding: .8rem .4rem; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--lift-sm); cursor: pointer; transition: transform .12s; }
.size-tile b { font-family: 'Fredoka', sans-serif; font-size: 1.6rem; line-height: 1; }
.size-tile span { font-size: .72rem; font-weight: 700; color: var(--text-muted); }
.size-tile:hover { transform: translateY(-2px); }
.btn-check:checked + .size-tile { background: var(--g-600); color: #fff; }
.btn-check:checked + .size-tile span { color: var(--g-100); }
.btn-check:disabled + .size-tile { cursor: not-allowed; opacity: .55; }
.btn-check:disabled:checked + .size-tile { opacity: 1; }
details > summary { cursor: pointer; }

/* Tiket tes tulis */
.ticket { padding: 0; overflow: hidden; }
.ticket-head { padding: 1.4rem 1.5rem; background: linear-gradient(135deg, var(--g-700), var(--g-900)); color: #fff; border-bottom: 3px dashed rgba(255, 255, 255, .45); }
.ticket-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: color-mix(in srgb, var(--line) 12%, transparent); }
.ticket-grid > div { background: var(--surface); padding: .9rem 1.25rem; display: flex; flex-direction: column; }
.ticket-grid > div.wide { grid-column: 1 / -1; }
.ticket-grid span { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.ticket-grid b { font-family: 'Fredoka', sans-serif; font-size: 1.3rem; }
.ticket-foot { padding: .9rem 1.25rem; font-weight: 800; background: color-mix(in srgb, var(--lime) 22%, var(--surface)); }

/* Peta jadwal */
.quest-map { list-style: none; padding: 0; margin: 0; position: relative; }
.quest-map::before { content: ""; position: absolute; left: 23px; top: 10px; bottom: 10px; border-left: 4px dotted color-mix(in srgb, var(--g-600) 55%, transparent); }
.qm-item { position: relative; display: flex; gap: 1rem; padding: .55rem 0; }
.qm-node { flex: 0 0 auto; z-index: 1; width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; font-size: 1.3rem; background: var(--lime); color: var(--g-950); border: 2px solid var(--line); box-shadow: var(--lift-sm); }
.qm-item:nth-child(even) .qm-node { background: var(--g-600); color: #fff; }
.qm-body { flex: 1; padding: .7rem 1rem; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--lift-sm); }

/* Reward */
.ticket-reward { background: linear-gradient(135deg, #FEF9C3, #FFFFFF 55%); color: var(--g-950); }
[data-theme=dark] .ticket-reward { background: linear-gradient(135deg, #422006, var(--surface) 60%); color: var(--text); }

@media (max-width: 575.98px) {
    .form-total { min-width: 0; width: 100%; }
    .form-aksi { flex-wrap: nowrap; }
    .form-aksi .form-status { font-size: 0 !important; }
    .form-aksi .form-status i { font-size: 1.1rem; }
    .quest-tabs .qt-text { font-size: .85rem; }
    .size-grid { grid-template-columns: repeat(2, 1fr); }
    .dok-item { flex-wrap: wrap; }
    .dok-item > .flex-grow-1 { flex-basis: calc(100% - 3rem); }
    .ticket-grid b { font-size: 1.1rem; }
}

/* =====================================================================
   NAVIGASI BAWAH SISWA (HP & tablet) + HUD ringkas
   ===================================================================== */
@media (min-width: 576px) { .d-sm-inline-grid { display: inline-grid !important; } }
.tb-logo img { width: 38px; height: 38px; object-fit: contain; background: #fff; border-radius: 11px; padding: 3px; border: 2px solid var(--line); box-shadow: var(--lift-sm); }

.bnav {
    position: fixed; left: .6rem; right: .6rem; bottom: calc(.6rem + env(safe-area-inset-bottom));
    z-index: 1030; display: grid; grid-template-columns: repeat(5, 1fr); gap: .2rem;
    padding: .35rem; background: var(--sidebar-bg); border: var(--bw) solid var(--line);
    border-radius: 20px; box-shadow: 0 6px 0 var(--line), 0 10px 24px rgba(0, 0, 0, .25);
}
.bnav-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem;
    padding: .45rem .2rem .4rem; border: 0; border-radius: 14px; background: transparent;
    color: rgba(255, 255, 255, .78); text-decoration: none; font-weight: 800; font-size: .68rem; line-height: 1.1;
    transition: background .15s, color .15s, transform .15s;
}
.bnav-item i { font-size: 1.3rem; line-height: 1; }
.bnav-item:hover { color: #fff; }
.bnav-item.active { background: var(--lime); color: var(--g-950); transform: translateY(-3px); box-shadow: 0 3px 0 var(--g-950); }
.bnav-sheet { height: auto !important; max-height: 75vh; border-radius: 22px 22px 0 0; border: var(--bw) solid var(--line); border-bottom: 0; background: var(--surface); color: var(--text); }
.bnav-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.bnav-tile {
    display: flex; flex-direction: column; align-items: center; gap: .35rem; text-align: center;
    padding: .9rem .4rem; border: 2px solid var(--line); border-radius: 16px; background: var(--surface-2);
    color: var(--text); text-decoration: none; font-weight: 800; font-size: .78rem; box-shadow: var(--lift-sm);
}
.bnav-tile i { font-size: 1.5rem; color: var(--g-600); }
.bnav-tile.active { background: var(--g-600); color: #fff; }
.bnav-tile.active i { color: var(--lime); }
@media (max-width: 1199.98px) {
    body.has-bnav .main { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
    body.has-bnav .form-aksi { bottom: calc(80px + env(safe-area-inset-bottom)); }
}

/* HUD dashboard: avatar kecil di samping teks pada layar sempit */
.hud-progress { margin-top: 0; }
@media (max-width: 767.98px) {
    .player-hud { padding: 1rem; }
    .player-hud .hud-avatar { max-width: 120px; }
    .player-hud .hud-title { font-size: 1.45rem; -webkit-text-stroke: 1.5px var(--g-950); text-shadow: 0 3px 0 var(--g-950); margin: 0 0 .25rem; }
    .player-hud .hud-title + div { font-size: .82rem; }
    .player-hud .hud-cta { width: 100%; justify-content: center; }
    .player-hud .xp-float { display: none; }
}

/* Seragam: avatar tidak memenuhi layar HP */
@media (max-width: 991.98px) {
    .seragam-hero { padding: 1rem !important; display: flex; align-items: center; gap: 1rem; text-align: left !important; }
    .seragam-stage { flex: 0 0 96px; }
    .seragam-stage .nametag { display: none; }
    .seragam-av { max-width: 96px; }
    .seragam-hero .platform { max-width: 96px; margin-top: -6px; }
    .seragam-info { margin-top: 0 !important; }
}

/* ---------- Kalender (flatpickr) mengikuti tema ---------- */
.flatpickr-calendar { border: 2px solid var(--line); border-radius: 14px; box-shadow: var(--lift-sm), 0 10px 24px rgba(0,0,0,.12); font-family: var(--font-body); }
.flatpickr-calendar.arrowTop::before, .flatpickr-calendar.arrowTop::after { display: none; }
.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange,
.flatpickr-day.selected:hover, .flatpickr-day.startRange:hover, .flatpickr-day.endRange:hover { background: var(--g-600); border-color: var(--g-600); color: #fff; font-weight: 800; }
.flatpickr-day.inRange { background: var(--g-100); border-color: var(--g-100); box-shadow: -5px 0 0 var(--g-100), 5px 0 0 var(--g-100); color: var(--g-900); }
.flatpickr-day.today { border-color: var(--lime); }
.flatpickr-day:hover { background: var(--g-100); border-color: var(--g-100); }
.flatpickr-months .flatpickr-month, .flatpickr-current-month .flatpickr-monthDropdown-months { font-family: var(--font-display); font-weight: 600; }
.flatpickr-time input:hover, .flatpickr-time input:focus { background: var(--g-100); }
[data-theme="dark"] .flatpickr-calendar { background: var(--surface); color: var(--text); }

/* Dropdown: item aktif mengikuti warna tema (bukan biru bawaan Bootstrap) */
.dropdown-item.active, .dropdown-item:active { background: var(--g-600, #16A34A); color: #fff; }
