/* ==========================================================================
   StarClass — Universitas Ciputra Jakarta
   Arah desain: mobile-first, ruang kaca (spatial glassmorphism) transparan,
   dengan oranye kampus sebagai sumber cahaya utama.
   ========================================================================== */

:root {
    /* Oranye Ciputra — ramp brand */
    --uc-200: #ffd2ad;
    --uc-300: #ffb47a;
    --uc-400: #ff8c3f;
    --uc-500: #ff6b2c;
    --uc-600: #ef4f13;
    --uc-700: #b93808;

    /* Warna pendukung (dimakai agar oranye tetap dominan) */
    --honey: #ffc24b;
    --sage: #58d29a;
    --flare: #f2564b;
    --sky: #5fc4ef;

    /* Latar: bumi hangat, bukan biru gelap */
    --ground-0: #100a06;
    --ground-1: #17100b;
    --ground-2: #1f1610;

    /* Teks di atas kaca */
    --chalk: #f8f1ea;
    --chalk-2: #cfbcb0;
    --chalk-3: #96806f;

    /* Token kaca */
    --glass-fill: linear-gradient(158deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .026));
    --glass-fill-strong: linear-gradient(158deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .045));
    --glass-line: rgba(255, 255, 255, .09);
    --glass-line-hot: rgba(255, 140, 63, .45);
    --glass-blur: blur(26px) saturate(165%);
    --lift: 0 26px 60px -30px rgba(0, 0, 0, .9);
    --edge-light: inset 0 1px 0 rgba(255, 255, 255, .14);

    /* Skala radius */
    --r-xl: 30px;
    --r-lg: 22px;
    --r-md: 16px;

    /* Metrik navigasi bawah */
    --nav-h: 62px;
    --nav-safe: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));

    /* Alias lama (dipakai style inline warisan) */
    --primary: var(--uc-500);
    --secondary: var(--honey);
    --accent: var(--uc-400);
    --glass-bg: rgba(31, 22, 16, .74);
    --glass-border: var(--glass-line);
}

* {
    -webkit-tap-highlight-color: transparent;
}

:focus-visible {
    outline: 3px solid var(--uc-300);
    outline-offset: 3px;
}

body.maintenance-active .app-bar {
    top: 32px;
}

#maintenance-banner {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 250;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Manrope', ui-sans-serif, sans-serif;
    background-color: var(--ground-0);
    color: var(--chalk);
    margin: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Tipografi: display untuk judul & angka bintang, mono untuk data kampus */
h1,
h2,
h3,
.display {
    font-family: 'Bricolage Grotesque', 'Manrope', sans-serif;
    letter-spacing: -.022em;
}

.font-mono,
code,
kbd {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    letter-spacing: .02em;
}

.eyebrow {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--chalk-3);
}

/* ==========================================================================
   Latar spatial: cahaya oranye + butiran halus, bukan langit biru
   ========================================================================== */
.stars-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background:
        radial-gradient(78% 52% at 12% -6%, rgba(255, 107, 44, .30) 0%, transparent 62%),
        radial-gradient(60% 45% at 96% 12%, rgba(255, 194, 75, .16) 0%, transparent 60%),
        radial-gradient(90% 60% at 50% 108%, rgba(239, 79, 19, .20) 0%, transparent 66%),
        linear-gradient(178deg, var(--ground-1) 0%, var(--ground-0) 58%, #0b0704 100%);
}

/* Butiran film agar permukaan kaca punya tekstur */
.stars-bg::after {
    content: '';
    position: absolute;
    inset: -20%;
    opacity: .32;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3e%3cfilter id='n'%3e%3cfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3e%3c/filter%3e%3crect width='140' height='140' filter='url(%23n)' opacity='.42'/%3e%3c/svg%3e");
    animation: grain 9s steps(6) infinite;
}

@keyframes grain {

    0%,
    100% {
        transform: translate(0, 0);
    }

    33% {
        transform: translate(-3%, 2%);
    }

    66% {
        transform: translate(2%, -3%);
    }
}

/* Bintang debu kampus (dibangkitkan generateStars) */
.star {
    position: absolute;
    background: var(--uc-200);
    border-radius: 50%;
    opacity: 0;
    animation: twinkle var(--duration) infinite ease-in-out;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: .18;
        transform: scale(.8);
    }

    50% {
        opacity: .7;
        transform: scale(1.25);
    }
}

.snowflake {
    position: fixed;
    top: -8vh;
    z-index: 5;
    color: rgba(255, 255, 255, .55);
    pointer-events: none;
    animation: snow-fall linear forwards;
}

@keyframes snow-fall {
    to {
        transform: translateY(112vh) rotate(320deg);
        opacity: .1;
    }
}

/* ==========================================================================
   Permukaan kaca
   ========================================================================== */
.glass {
    background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02));
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-line);
}

.glass-card {
    background: var(--glass-fill), var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-line);
    border-radius: var(--r-xl);
    box-shadow: var(--lift), var(--edge-light);
    transition: border-color .28s ease, box-shadow .28s ease, transform .28s cubic-bezier(.22, 1, .36, 1);
}

/* Sentuhan hanya di pointers halus — di HP hover tidak berarti */
@media (hover:hover) and (pointer:fine) {
    .glass-card:hover {
        border-color: var(--glass-line-hot);
        box-shadow: var(--lift), var(--edge-light), 0 0 34px -12px rgba(255, 107, 44, .4);
    }
}

/* Kedalaman: makin tinggi makin buram & melebar */
.depth-1 {
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .06);
}

.depth-2 {
    border-radius: var(--r-lg);
    background: var(--glass-fill);
    backdrop-filter: blur(14px) saturate(150%);
    -webkit-backdrop-filter: blur(14px) saturate(150%);
    border: 1px solid var(--glass-line);
}

.panel {
    background: rgba(255, 255, 255, .045);
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: var(--r-lg);
}

/* Kartu bintang (hero) — satu-satunya permukaan yang menyala penuh */
.star-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--r-xl);
    padding: 1.25rem 1.25rem 1.35rem;
    background:
        radial-gradient(120% 90% at 8% 0%, rgba(255, 107, 44, .42) 0%, transparent 58%),
        var(--glass-fill-strong);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(255, 160, 92, .38);
    box-shadow: 0 30px 70px -34px rgba(255, 107, 44, .55), var(--edge-light);
}

/* Foto gedung kampus di layar tamu: di kanan, teks tetap bersih di kiri */
.campus-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('assets/uc-campus.jpg') center 22% / cover no-repeat;
    opacity: .3;
    filter: grayscale(.3) contrast(1.05);
    -webkit-mask-image: linear-gradient(90deg, transparent 26%, rgba(0, 0, 0, .45) 58%, #000 86%);
    mask-image: linear-gradient(90deg, transparent 26%, rgba(0, 0, 0, .45) 58%, #000 86%);
    pointer-events: none;
}

.star-hero::after {
    content: '';
    position: absolute;
    inset: auto -30% -60% -30%;
    height: 140px;
    background: radial-gradient(50% 100% at 50% 100%, rgba(255, 194, 75, .28), transparent 70%);
    pointer-events: none;
}

.star-value {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    font-size: clamp(2.9rem, 15vw, 4.2rem);
    line-height: .88;
    letter-spacing: -.045em;
    color: var(--honey);
    text-shadow: 0 0 34px rgba(255, 194, 75, .35);
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Bilah atas
   ========================================================================== */
.app-bar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .85rem;
    padding-top: calc(.55rem + env(safe-area-inset-top, 0px));
    background: linear-gradient(180deg, rgba(16, 10, 6, .88), rgba(16, 10, 6, .55));
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .18), rgba(255, 255, 255, .03));
    box-shadow: 0 10px 26px -12px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .22);
}

.brand-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.sheet-emblem {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .9);
}

.icon-btn {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    color: var(--chalk-2);
    border: 1px solid transparent;
    transition: color .18s, background .18s, border-color .18s;
}

.icon-btn:hover {
    color: var(--chalk);
    background: rgba(255, 255, 255, .07);
}

/* ==========================================================================
   Navigasi bawah
   ========================================================================== */
.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    height: var(--nav-safe);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: linear-gradient(180deg, rgba(23, 16, 11, .72), rgba(16, 10, 6, .94));
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-top: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 -18px 44px -22px rgba(0, 0, 0, .9);
}

.nav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: var(--nav-h);
    padding: 0 2px;
    color: var(--chalk-3);
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .01em;
    transition: color .2s ease;
}

.nav-item .nav-glyph {
    display: grid;
    place-items: center;
    width: 42px;
    height: 27px;
    border-radius: 999px;
    transition: background .22s ease, transform .22s cubic-bezier(.22, 1, .36, 1);
}

.nav-item[aria-current="page"] {
    color: var(--uc-300);
}

.nav-item[aria-current="page"] .nav-glyph {
    background: rgba(255, 107, 44, .16);
    transform: translateY(-1px);
}

.nav-item:focus-visible {
    outline: 2px solid var(--uc-400);
    outline-offset: -4px;
}

/* FAB tengah: saldo bintang yang bisa ditekan */
.nav-fab {
    position: relative;
    display: grid;
    place-items: center;
    height: var(--nav-h);
}

.fab-orb {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    width: 56px;
    height: 56px;
    margin-top: -26px;
    border-radius: 20px;
    color: #2b1206;
    background: linear-gradient(155deg, var(--uc-300), var(--uc-500) 55%, var(--uc-600));
    box-shadow:
        0 18px 36px -14px rgba(255, 107, 44, .75),
        inset 0 1px 0 rgba(255, 255, 255, .55);
    transition: transform .2s cubic-bezier(.22, 1, .36, 1), box-shadow .2s ease;
}

.fab-orb:active {
    transform: scale(.94);
}

.fab-value {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    font-size: 1.05rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.fab-label {
    font-size: .52rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    opacity: .78;
}

/* Denyut saat bintang bertambah */
.fab-orb.is-pulsing {
    animation: orb-pop .9s cubic-bezier(.22, 1, .36, 1);
}

@keyframes orb-pop {
    0% {
        transform: scale(1);
    }

    38% {
        transform: scale(1.16);
        box-shadow: 0 22px 50px -12px rgba(255, 140, 63, .95), inset 0 1px 0 rgba(255, 255, 255, .6);
    }

    100% {
        transform: scale(1);
    }
}

/* Layar lebar: navigasi menjadi dock mengambang di tengah bawah */
@media (min-width:900px) {
    .bottom-nav {
        left: 50%;
        right: auto;
        bottom: 16px;
        transform: translateX(-50%);
        width: min(560px, calc(100vw - 2.5rem));
        height: var(--nav-h);
        padding-bottom: 0;
        border: 1px solid rgba(255, 255, 255, .09);
        border-top: 1px solid rgba(255, 255, 255, .09);
        border-radius: var(--r-lg);
        box-shadow: 0 22px 50px -20px rgba(0, 0, 0, .9);
    }

    .nav-fab {
        align-self: center;
    }

    .nav-fab .fab-orb {
        margin-top: -14px;
    }
}

/* ==========================================================================
   View mobile-first
   ========================================================================== */
.view {
    display: none;
    animation: view-in .32s cubic-bezier(.22, 1, .36, 1);
}

.view.is-active {
    display: block;
}

@keyframes view-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* Konten tidak pernah tertutup bilah navigasi */
main.app-main {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 1rem .9rem calc(var(--nav-safe) + 2rem);
}

@media (min-width:768px) {
    main.app-main {
        padding: 1.75rem 1.5rem calc(var(--nav-h) + 4rem);
    }
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ==========================================================================
   Sheet (modal versi mobile): naik dari bawah, ada gagang pegangan
   ========================================================================== */
.sheet-card {
    width: 100%;
    max-width: none;
    max-height: 90vh;
    border-radius: 30px 30px 0 0;
    border-bottom: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: sheet-up .34s cubic-bezier(.22, 1, .36, 1);
}

/* Gagang pegangan menandai bahwa panel bisa digeser turun */
.sheet-card::before {
    content: '';
    display: block;
    width: 42px;
    height: 4px;
    margin: -.35rem auto 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .22);
}

@keyframes sheet-up {
    from {
        transform: translateY(24px);
        opacity: .4;
    }

    to {
        transform: none;
        opacity: 1;
    }
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(8, 5, 3, .72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    z-index: 101;
}

.modal-open {
    overflow: hidden;
}

/* Layar lebar: kembalikan perilaku dialog melayang */
@media (min-width:768px) {
    .modal-overlay {
        align-items: center;
        padding: 1.25rem;
    }

    .sheet-card {
        width: auto;
        max-width: 42rem;
        margin: 0 auto;
        border-radius: var(--r-xl);
        border-bottom: 1px solid var(--glass-line);
        animation: dialog-in .3s cubic-bezier(.22, 1, .36, 1);
    }

    .sheet-card::before {
        display: none;
    }
}

@keyframes dialog-in {
    from {
        transform: translateY(8px) scale(.98);
        opacity: .5;
    }

    to {
        transform: none;
        opacity: 1;
    }
}

/* ==========================================================================
   Form
   ========================================================================== */
.glass-input,
.glass-select {
    background: rgba(10, 6, 4, .55);
    border: 1px solid rgba(255, 255, 255, .11);
    color: var(--chalk);
    border-radius: var(--r-md);
    outline: none;
    transition: border-color .18s, box-shadow .18s, background .18s;
}

.glass-input::placeholder {
    color: rgba(150, 128, 111, .85);
}

.glass-input:focus,
.glass-select:focus {
    border-color: var(--uc-400);
    box-shadow: 0 0 0 3px rgba(255, 107, 44, .22);
    background: rgba(10, 6, 4, .75);
}

.glass-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23ff8c3f' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right .6rem center;
    background-repeat: no-repeat;
    background-size: 1.4em 1.4em;
    padding-right: 2.2rem;
}

/* Kontrol bentuk bawaan ikut oranye */
input[type=checkbox] {
    accent-color: var(--uc-500);
}

:where(button, a, input, select, textarea):focus-visible {
    outline: 2px solid var(--uc-400);
    outline-offset: 2px;
}

/* ==========================================================================
   Panggung juara
   ========================================================================== */
.podium-base {
    position: relative;
    display: flex;
    justify-content: center;
    padding-top: 1rem;
    overflow: hidden;
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, .1);
    transition: transform .4s cubic-bezier(.22, 1, .36, 1);
}

/* Juara 1: oranye kampus, bukan emas generik */
.podium-1 {
    background: linear-gradient(180deg, rgba(255, 107, 44, .26) 0%, rgba(255, 107, 44, .05) 100%);
    border-top: 3px solid var(--uc-500);
    box-shadow: 0 0 54px rgba(255, 107, 44, .28), inset 0 0 22px rgba(255, 140, 63, .12);
}

.podium-2 {
    background: linear-gradient(180deg, rgba(207, 188, 176, .16) 0%, rgba(207, 188, 176, .04) 100%);
    border-top: 3px solid rgba(207, 188, 176, .8);
    box-shadow: 0 0 30px rgba(207, 188, 176, .14), inset 0 0 16px rgba(207, 188, 176, .07);
}

.podium-3 {
    background: linear-gradient(180deg, rgba(255, 194, 75, .16) 0%, rgba(255, 194, 75, .04) 100%);
    border-top: 3px solid var(--honey);
    box-shadow: 0 0 30px rgba(255, 194, 75, .14), inset 0 0 16px rgba(255, 194, 75, .07);
}

.spotlight {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 84%;
    height: 100px;
    background: radial-gradient(ellipse at bottom, rgba(255, 214, 178, .16) 0%, transparent 72%);
    pointer-events: none;
    z-index: 0;
}

/* Karakter podium */
.float {
    animation: float 6s ease-in-out infinite;
}

.float-delayed {
    animation: float 6s ease-in-out 3s infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-13px);
    }
}

@keyframes pulse-gold {

    0%,
    100% {
        filter: drop-shadow(0 0 14px rgba(255, 107, 44, .55));
    }

    50% {
        filter: drop-shadow(0 0 26px rgba(255, 140, 63, .9));
    }
}

.crown-anim {
    animation: float 4s ease-in-out infinite, shine-crown 3s infinite;
}

@keyframes shine-crown {

    0%,
    100% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(1.28);
    }
}

.fade-in-item {
    opacity: 0;
    transform: translateY(14px);
    animation: fadeIn .5s cubic-bezier(.22, 1, .36, 1) forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: none;
    }
}

.character-jump {
    animation: jump 2.4s ease-in-out infinite;
}

@keyframes jump {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    30% {
        transform: translateY(-16px) scale(1.04);
    }

    50% {
        transform: translateY(-24px) scale(1.08) rotate(-4deg);
    }

    70% {
        transform: translateY(-16px) scale(1.04);
    }
}

.character-clap {
    animation: clap 3s ease-in-out infinite;
}

@keyframes clap {

    0%,
    100% {
        transform: scale(1) rotate(0);
    }

    10%,
    30% {
        transform: scale(1.08) rotate(-3deg);
    }

    20%,
    40% {
        transform: scale(1.08) rotate(3deg);
    }
}

.character-wobble {
    animation: wobble 4s ease-in-out infinite;
}

@keyframes wobble {

    0%,
    100% {
        transform: rotate(0);
    }

    25% {
        transform: rotate(-2deg);
    }

    75% {
        transform: rotate(2deg);
    }
}

.confetti {
    position: absolute;
    width: 7px;
    height: 7px;
    opacity: 0;
    background: linear-gradient(45deg, var(--honey), var(--uc-500));
    animation: confetti-fall 3s ease-out infinite;
}

.confetti:nth-child(2n) {
    background: linear-gradient(45deg, var(--uc-300), var(--uc-600));
}

.confetti:nth-child(3n) {
    background: linear-gradient(45deg, #fff, var(--uc-200));
}

.confetti:nth-child(4n) {
    background: linear-gradient(45deg, var(--honey), #e29a1c);
}

@keyframes confetti-fall {
    0% {
        top: -10%;
        opacity: 1;
        transform: translateX(0) rotate(0);
    }

    100% {
        top: 100%;
        opacity: 0;
        transform: translateX(var(--x-offset, 50px)) rotate(720deg);
    }
}

.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 10px rgba(255, 214, 178, .9);
    animation: sparkle-twinkle 2s ease-in-out infinite;
}

@keyframes sparkle-twinkle {

    0%,
    100% {
        opacity: 0;
        transform: scale(0);
    }

    50% {
        opacity: 1;
        transform: scale(1.5);
    }
}

.shake-anim {
    animation: shake .5s ease-in-out infinite;
}

@keyframes shake {

    0%,
    100% {
        transform: rotate(0);
    }

    25% {
        transform: rotate(-6deg);
    }

    75% {
        transform: rotate(6deg);
    }
}

/* ==========================================================================
   Boss battle & StarBot
   ========================================================================== */
.raid-bar-container {
    position: relative;
    height: 26px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(10, 6, 4, .7);
    border: 1px solid rgba(255, 255, 255, .09);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, .6);
}

.raid-bar-fill {
    position: relative;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--uc-600), var(--honey));
    transition: width 1s ease-out;
}

.raid-bar-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent);
    transform: skewX(-20deg) translateX(-150%);
    animation: shine 3s infinite;
}

@keyframes shine {
    100% {
        transform: skewX(-20deg) translateX(250%);
    }
}

.animate-shine {
    animation: shine 3s ease-in-out infinite;
}

.boss-character {
    display: inline-block;
    transform-origin: center bottom;
}

.boss-idle {
    animation: boss-idle-float 3s ease-in-out infinite;
}

@keyframes boss-idle-float {

    0%,
    100% {
        transform: translateY(0) rotate(0);
    }

    50% {
        transform: translateY(-9px) rotate(2deg);
    }
}

.boss-shake {
    animation: boss-shake-anim .5s ease-in-out infinite;
}

@keyframes boss-shake-anim {

    0%,
    100% {
        transform: translateX(0) rotate(0);
    }

    25% {
        transform: translateX(-5px) rotate(-3deg);
    }

    75% {
        transform: translateX(5px) rotate(3deg);
    }
}

.boss-defeated-anim {
    animation: boss-defeated-fall 1s ease-out forwards;
}

@keyframes boss-defeated-fall {
    0% {
        transform: translateY(0) rotate(0);
        opacity: 1;
    }

    100% {
        transform: translateY(20px) rotate(15deg);
        opacity: .5;
    }
}

.boss-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    opacity: .6;
    background: radial-gradient(circle, var(--uc-400), var(--flare));
    animation: boss-particle-float 4s ease-in-out infinite;
}

@keyframes boss-particle-float {

    0% {
        transform: translateY(100%) scale(0);
        opacity: 0;
    }

    50% {
        transform: translateY(0) scale(1);
        opacity: .8;
    }
}

.boss-enraged {
    animation: boss-enraged-pulse 1s ease-in-out infinite;
}

@keyframes boss-enraged-pulse {

    0%,
    100% {
        box-shadow: 0 0 30px rgba(255, 107, 44, .2);
    }

    50% {
        box-shadow: 0 0 52px rgba(255, 107, 44, .45), 0 0 80px rgba(242, 86, 75, .2);
    }
}

.boss-defeated {
    opacity: .8;
    filter: grayscale(.3);
}

/* Garip StarBot */
@keyframes scan {
    0% {
        top: 0;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        top: 100%;
        opacity: 0;
    }
}

.scan-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--sky);
    box-shadow: 0 0 10px var(--sky), 0 0 22px var(--sky);
    animation: scan 2s linear infinite;
    z-index: 10;
}

/* ==========================================================================
   Bingkai kosmetik
   ========================================================================== */
.frame-gold {
    border: 3px solid var(--honey);
    box-shadow: 0 0 15px var(--honey), inset 0 0 10px rgba(255, 194, 75, .5);
}

.frame-diamond {
    border: 3px solid #9fe6ff;
    box-shadow: 0 0 15px #9fe6ff, inset 0 0 10px rgba(159, 230, 255, .5);
}

.frame-fire {
    border: 3px solid var(--uc-500);
    box-shadow: 0 0 15px var(--uc-500), inset 0 0 10px rgba(255, 107, 44, .5);
}

.frame-lightning {
    border: 3px solid #ffe066;
    box-shadow: 0 0 15px #ffe066, inset 0 0 10px rgba(255, 224, 102, .5);
}

.frame-ice {
    border: 3px solid #bfeef7;
    box-shadow: 0 0 15px #bfeef7, inset 0 0 10px rgba(191, 238, 247, .5);
}

.frame-neon {
    border: 3px solid var(--sky);
    box-shadow: 0 0 15px var(--sky), inset 0 0 10px rgba(95, 196, 239, .5);
}

.frame-mythic {
    border: 3px solid #d8a5ff;
    box-shadow: 0 0 20px #d8a5ff, inset 0 0 15px rgba(216, 165, 255, .5);
    animation: border-pulse 2s infinite;
}

@keyframes border-pulse {

    0%,
    100% {
        box-shadow: 0 0 10px #d8a5ff;
        border-color: #d8a5ff;
    }

    50% {
        box-shadow: 0 0 25px var(--uc-400);
        border-color: var(--uc-400);
    }
}

.frame-rainbow {
    border: 3px solid transparent;
    background-clip: padding-box;
    box-shadow: 0 0 15px rgba(255, 140, 63, .5);
    animation: rainbow-hue 6s linear infinite;
}

@keyframes rainbow-hue {

    0%,
    100% {
        border-color: var(--uc-500);
    }

    25% {
        border-color: var(--honey);
    }

    50% {
        border-color: var(--sage);
    }

    75% {
        border-color: var(--sky);
    }
}

/* ==========================================================================
   Pita pengumuman, takarir, notifikasi
   ========================================================================== */
.announcement-bar {
    display: flex;
    align-items: center;
    height: 34px;
    padding: 0 .75rem;
    overflow: hidden;
    white-space: nowrap;
    background: linear-gradient(90deg, rgba(255, 107, 44, .2), rgba(255, 194, 75, .08));
    border-bottom: 1px solid rgba(255, 140, 63, .22);
}

.announcement-content {
    display: inline-block;
    padding-left: 100%;
    font-size: .78rem;
    font-weight: 600;
    color: var(--uc-200);
    animation: marquee 22s linear infinite;
}

@keyframes marquee {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(-100%, 0);
    }
}

.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 140, 63, .5) transparent;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 140, 63, .45);
    border-radius: 999px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 140, 63, .7);
}

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

::-webkit-scrollbar-track {
    background: var(--ground-0);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 107, 44, .35);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 107, 44, .6);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.97);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.toast-anim {
    animation: toast-in .26s cubic-bezier(.22, 1, .36, 1);
}

/* ==========================================================================
   Gerbang status pendaftaran menempuh penuh layar, di atas navigasi
   ========================================================================== */
#enrollment-gate {
    z-index: 120;
    padding: 1rem;
    padding-bottom: calc(var(--nav-h) + 1rem);
    background:
        radial-gradient(70% 40% at 20% 0%, rgba(255, 107, 44, .22), transparent 60%),
        rgba(10, 6, 4, .96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

@media (min-width:768px) {
    #enrollment-gate {
        padding-bottom: 1rem;
    }
}

/* Tabel admin boleh digeser mendatar di layar sempit */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* FAB tanpa tugas: redam agar oranye hanya menyala saat ada aksi */
.fab-orb.is-quiet {
    background: linear-gradient(155deg, #4c3a2e, #2e2017);
    color: var(--chalk-2);
    box-shadow: 0 14px 28px -16px rgba(0, 0, 0, .85), inset 0 1px 0 rgba(255, 255, 255, .14);
}

/* Gerbang pendaftaran menutupi aplikasi, bilah-bilah chrome ikut turun */
body.gate-open .bottom-nav,
body.gate-open .app-bar {
    display: none;
}

/* ==========================================================================
   Aksesibilitas gerak
   ========================================================================== */
@media (prefers-reduced-motion:reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }

    .stars-bg::after {
        animation: none;
    }

    .fade-in-item {
        opacity: 1;
        transform: none;
    }
}
/* Kelas utilitas harus menang atas gaya lembar kaca. */
.modal-overlay.hidden,
#enrollment-gate.hidden,
.view:not(.is-active) {
    display: none !important;
}

#enrollment-gate.hidden {
    pointer-events: none !important;
}

/* Di ponsel, kontrol bilah atas pindah ke FAB orb dan layar Profil. */
@media (max-width: 767px) {
    body:not(.is-guest) #auth-container,
    #admin-controls {
        display: none;
    }
}

/* Status server selalu eksplisit: online, gangguan, atau offline. */
.connection-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 999px;
    color: #a7b1c2;
    background: rgba(0,0,0,.22);
    font-size: 9px;
    line-height: 1;
    white-space: nowrap;
}
.connection-status span { width: 6px; height: 6px; border-radius: 50%; background: #34d399; }
.connection-status.is-degraded span { background: #fbbf24; }
.connection-status.is-degraded { color: #fde68a; }
.connection-status.is-offline span { background: #fb7185; }
.connection-status.is-offline { color: #fecdd3; }
@media (max-width: 480px) { .connection-status b { display: none; } .connection-status { padding: 6px; } }
.snowflake { position: fixed; top: -10px; color: #fff; font-size: 1em; text-shadow: 0 0 5px #000; z-index: 9999; pointer-events: none; animation: snowfall linear infinite; }
@keyframes snowfall { to { transform: translateY(100vh); } }


/* ==========================================================================
   Ruang kelas 3D (classroom3d.js)
   ========================================================================== */
.classroom3d {
    position: relative;
    margin-top: 16px;
    height: clamp(300px, 54vw, 500px);
    border-radius: var(--r-xl);
    overflow: hidden;
    border: 1px solid var(--glass-line);
    background:
        radial-gradient(120% 90% at 70% 0%, rgba(255, 140, 63, .22), transparent 60%),
        radial-gradient(90% 80% at 10% 100%, rgba(255, 194, 75, .10), transparent 65%),
        var(--ground-2);
    box-shadow: var(--lift), var(--edge-light);
    opacity: 0;
    transition: opacity .8s ease;
}
.classroom3d.is-ready { opacity: 1; }
.classroom3d[hidden] { display: none; }
.c3d-stage, .c3d-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.c3d-badge {
    position: absolute; top: 12px; left: 12px; display: flex; align-items: center; gap: 7px;
    padding: 6px 12px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .04em;
    color: var(--chalk); background: rgba(23, 16, 11, .62); border: 1px solid var(--glass-line);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); pointer-events: none;
}
.c3d-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--flare); box-shadow: 0 0 0 0 rgba(242, 86, 75, .7); animation: c3d-pulse 1.8s infinite; }
@keyframes c3d-pulse { 70% { box-shadow: 0 0 0 9px rgba(242, 86, 75, 0); } 100% { box-shadow: 0 0 0 0 rgba(242, 86, 75, 0); } }
.c3d-toggle {
    position: absolute; top: 10px; right: 12px; width: 34px; height: 34px; border-radius: 50%;
    font-size: 11px; font-weight: 800; color: var(--chalk); background: rgba(23, 16, 11, .62);
    border: 1px solid var(--glass-line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    transition: transform .15s, border-color .2s;
}
.c3d-toggle:hover { border-color: var(--glass-line-hot); }
.c3d-toggle:active { transform: scale(.92); }
.c3d-ticker {
    position: absolute; left: 12px; right: 12px; bottom: 12px; margin: 0; width: fit-content; max-width: calc(100% - 24px);
    padding: 8px 14px; border-radius: 14px; font-size: 12px; font-weight: 700; color: var(--chalk);
    background: rgba(23, 16, 11, .66); border: 1px solid var(--glass-line);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); pointer-events: none; opacity: 0;
}
.c3d-ticker:empty { display: none; }
.c3d-ticker.is-in { animation: c3d-ticker 5.5s ease both; }
@keyframes c3d-ticker {
    0% { opacity: 0; transform: translateY(8px); }
    8%, 85% { opacity: 1; transform: none; }
    100% { opacity: 0; transform: translateY(-4px); }
}
@media (prefers-reduced-motion: reduce) {
    .classroom3d { transition: none; }
    .c3d-dot { animation: none; }
    .c3d-ticker.is-in { animation: none; opacity: 1; }
}
@media (max-width: 600px) { .classroom3d { height: 390px; } .c3d-ticker { font-size: 11px; } }
