/* =====================================================================
   Arisan Online - Tema Hi-Tech Blue on Clean White (mobile-first)
   ===================================================================== */
:root {
    --navy: #0a1f44;
    --navy-2: #12306b;
    --blue: #0066ff;
    --blue-2: #1a8cff;
    --cyan: #00c2ff;
    --ice: #f3f8ff;
    --line: #e1eaf7;
    --text: #17233d;
    --muted: #6b7a99;
    --topbar-h: 54px;
    --radius: 16px;
    --shadow: 0 6px 24px rgba(10, 31, 68, .07);
    --shadow-lg: 0 14px 40px rgba(0, 102, 255, .16);

    --bs-primary: var(--blue);
    --bs-primary-rgb: 0, 102, 255;
    --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --bs-body-color: var(--text);
    --bs-link-color: var(--blue);
    --bs-link-hover-color: var(--navy-2);
}

html { scroll-padding-top: calc(var(--topbar-h) + 12px); }
body {
    background: #fff;
    background-image: radial-gradient(1200px 400px at 90% -10%, rgba(0, 194, 255, .10), transparent 60%),
                      radial-gradient(900px 380px at -10% 0%, rgba(0, 102, 255, .07), transparent 60%);
    background-repeat: no-repeat;
    color: var(--text);
    padding-top: var(--topbar-h);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-tap-highlight-color: transparent;
}
.app-main { flex: 1 0 auto; }
.app-container { padding-top: 1.25rem; padding-bottom: 2.5rem; }
.text-muted-2 { color: var(--muted); }
.text-gradient {
    background: linear-gradient(90deg, var(--blue), var(--cyan));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Top Slim Menu ---------- */
.topbar {
    min-height: var(--topbar-h);
    padding: 0;
    background: rgba(255, 255, 255, .88);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 2px 14px rgba(10, 31, 68, .04);
}
.topbar::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
    background: linear-gradient(90deg, var(--navy), var(--blue), var(--cyan));
    opacity: .85;
}
.topbar .container { min-height: var(--topbar-h); }
.topbar .navbar-brand { padding: 0; margin-right: .5rem; }
.topbar .navbar-brand img { height: 34px; width: auto; display: block; }
.topbar .nav-link {
    color: var(--navy-2); font-weight: 500; font-size: .92rem;
    padding: .55rem .8rem; border-radius: 10px; display: flex; align-items: center; gap: .4rem;
    transition: background .2s, color .2s;
}
.topbar .nav-link:hover { background: var(--ice); color: var(--blue); }
.topbar .nav-link.active { background: rgba(0, 102, 255, .1); color: var(--blue); font-weight: 600; }
.nav-user { font-size: .85rem; color: var(--navy-2); font-weight: 500; display: inline-flex; gap: .35rem; align-items: center; padding: .25rem 0; }

/* Hamburger -> X */
.hamburger {
    border: 0; width: 44px; height: 44px; padding: 0; position: relative;
    border-radius: 12px; background: transparent;
}
.hamburger:focus { box-shadow: 0 0 0 3px rgba(0, 102, 255, .25); }
.hamburger span {
    position: absolute; left: 11px; right: 11px; height: 2px; border-radius: 2px;
    background: var(--navy); transition: transform .28s ease, opacity .2s ease, top .28s ease;
}
.hamburger span:nth-child(1) { top: 15px; }
.hamburger span:nth-child(2) { top: 21px; }
.hamburger span:nth-child(3) { top: 27px; }
.hamburger[aria-expanded="true"] span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { top: 21px; transform: rotate(-45deg); }

@media (max-width: 767.98px) {
    .topbar .navbar-collapse {
        background: #fff; margin: 0 -12px; padding: .5rem 12px .75rem;
        border-top: 1px solid var(--line); box-shadow: 0 16px 30px rgba(10, 31, 68, .1);
        max-height: calc(100vh - var(--topbar-h)); overflow-y: auto;
    }
    .topbar .nav-link { padding: .8rem .9rem; font-size: 1rem; } /* area sentuh besar */
    .topbar .btn { padding: .65rem 1rem; }
}

/* ---------- Buttons ---------- */
.btn { border-radius: 10px; font-weight: 600; }
.btn-primary {
    --bs-btn-bg: var(--blue); --bs-btn-border-color: var(--blue);
    --bs-btn-hover-bg: #0052d4; --bs-btn-hover-border-color: #0052d4;
    --bs-btn-active-bg: #0047b8; --bs-btn-active-border-color: #0047b8;
    box-shadow: 0 4px 14px rgba(0, 102, 255, .28);
}
.btn-outline-primary {
    --bs-btn-color: var(--blue); --bs-btn-border-color: rgba(0, 102, 255, .45);
    --bs-btn-hover-bg: var(--blue); --bs-btn-hover-border-color: var(--blue);
}
.btn-navy { --bs-btn-bg: var(--navy); --bs-btn-color: #fff; --bs-btn-border-color: var(--navy); --bs-btn-hover-bg: var(--navy-2); --bs-btn-hover-border-color: var(--navy-2); --bs-btn-hover-color: #fff; }
.btn-lg { padding: .8rem 1.4rem; }

/* ---------- Cards ---------- */
.card {
    border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); background: #fff;
}
.card-header { background: transparent; border-bottom: 1px solid var(--line); font-weight: 600; padding: .9rem 1.1rem; }
.card-body { padding: 1.1rem; }
.card-accent { border-top: 3px solid var(--blue); }
.card-hover { transition: transform .2s ease, box-shadow .2s ease; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.page-title { font-weight: 800; color: var(--navy); letter-spacing: -.02em; }

/* ---------- Hero ---------- */
.hero {
    position: relative; overflow: hidden; border-radius: 24px; color: #fff;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 55%, var(--blue) 120%);
    padding: 2.2rem 1.4rem; box-shadow: var(--shadow-lg);
}
.hero::before {
    content: ''; position: absolute; inset: 0; opacity: .5;
    background-image: linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
    background-size: 32px 32px;
    -webkit-mask-image: radial-gradient(circle at 80% 20%, #000, transparent 70%);
    mask-image: radial-gradient(circle at 80% 20%, #000, transparent 70%);
}
.hero::after {
    content: ''; position: absolute; width: 320px; height: 320px; right: -80px; top: -90px; border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 194, 255, .55), transparent 65%);
}
.hero > * { position: relative; z-index: 1; }
.hero h1 { font-weight: 800; letter-spacing: -.03em; font-size: clamp(1.7rem, 5vw, 2.8rem); }
.hero .lead { color: rgba(255, 255, 255, .82); font-size: 1.02rem; }
.hero .btn-light { color: var(--navy); }
@media (min-width: 768px) { .hero { padding: 3.2rem 3rem; } }

.slug-box { background: #fff; border-radius: 14px; padding: .35rem; display: flex; gap: .35rem; align-items: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.slug-box .prefix { padding-left: .7rem; color: var(--muted); font-size: .85rem; white-space: nowrap; }
.slug-box input { border: 0; box-shadow: none !important; flex: 1; min-width: 0; padding-left: .2rem; }

.feature-icon {
    width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 1.3rem; color: #fff;
    background: linear-gradient(135deg, var(--blue), var(--cyan)); box-shadow: 0 6px 16px rgba(0, 102, 255, .3);
}

/* ---------- Stat tiles ---------- */
.stat {
    border-radius: 14px; padding: .9rem 1rem; background: var(--ice); border: 1px solid var(--line); height: 100%;
}
.stat .label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.stat .value { font-size: 1.2rem; font-weight: 800; color: var(--navy); line-height: 1.25; word-break: break-word; }

/* ---------- Forms ---------- */
.form-control, .form-select { border-radius: 10px; border-color: #cfdcf0; padding: .65rem .85rem; }
.form-control:focus, .form-select:focus { border-color: var(--blue); box-shadow: 0 0 0 .22rem rgba(0, 102, 255, .15); }
.form-label { font-weight: 600; font-size: .88rem; color: var(--navy-2); }
.input-group-text { background: var(--ice); border-color: #cfdcf0; color: var(--navy-2); }
.auth-wrap { max-width: 440px; margin: 1.5rem auto; }
.auth-card .brand-ico { width: 54px; height: 54px; font-size: 1.6rem; }

/* ---------- Tables / badges ---------- */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .75rem .8rem; vertical-align: middle; }
.table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; border-bottom-color: var(--line); white-space: nowrap; background: var(--ice); }
.badge { font-weight: 600; padding: .4em .65em; border-radius: 8px; }
.badge-paid { background: rgba(16, 185, 129, .12); color: #047857; }
.badge-unpaid { background: rgba(239, 68, 68, .1); color: #b91c1c; }
.badge-won { background: rgba(0, 102, 255, .12); color: var(--blue); }
.badge-notwon { background: #eef2f9; color: var(--muted); }
.badge-pending { background: rgba(245, 158, 11, .14); color: #b45309; }
.badge-done { background: rgba(0, 102, 255, .12); color: var(--blue); }

.pay-toggle { min-width: 118px; }
.pay-toggle.is-paid { background: #10b981; border-color: #10b981; color: #fff; }
.pay-toggle.is-unpaid { background: #fff; border-color: #fca5a5; color: #b91c1c; }
.pay-toggle[disabled] { opacity: .6; }

.avatar {
    width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
    font-weight: 700; font-size: .8rem; color: #fff; background: linear-gradient(135deg, var(--navy-2), var(--blue));
}
.order-chip { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: 8px; background: var(--ice); color: var(--navy-2); font-weight: 700; font-size: .82rem; border: 1px solid var(--line); }

.nav-pills-tech .nav-link { color: var(--navy-2); border-radius: 10px; font-weight: 600; }
.nav-pills-tech .nav-link.active { background: var(--navy); color: #fff; }
.tabs-scroll { overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tabs-scroll::-webkit-scrollbar { display: none; }

.progress { height: 8px; border-radius: 8px; background: #e6eefb; }
.progress-bar { background: linear-gradient(90deg, var(--blue), var(--cyan)); }

/* ---------- PIN gate ---------- */
.pin-input { letter-spacing: .6em; text-align: center; font-size: 1.6rem; font-weight: 700; }

/* ---------- Randomizer ---------- */
.draw-stage { text-align: center; }
.wheel-wrap { position: relative; width: min(92vw, 420px); aspect-ratio: 1; margin: 0 auto; }
.wheel-wrap canvas { width: 100%; height: 100%; display: block; touch-action: manipulation; filter: drop-shadow(0 14px 28px rgba(0, 102, 255, .25)); }
.wheel-pointer {
    position: absolute; top: -6px; left: 50%; transform: translateX(-50%); z-index: 2;
    width: 0; height: 0; border-left: 15px solid transparent; border-right: 15px solid transparent; border-top: 30px solid var(--navy);
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .3));
}
.wheel-hub {
    position: absolute; top: 50%; left: 50%; width: 64px; height: 64px; transform: translate(-50%, -50%); border-radius: 50%;
    background: #fff; border: 4px solid var(--navy); display: grid; place-items: center; z-index: 2;
    font-weight: 800; color: var(--navy); font-size: .8rem; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); cursor: pointer; user-select: none;
}
.wheel-hub[aria-disabled="true"] { cursor: not-allowed; opacity: .7; }
.shuffle-card {
    min-height: 120px; border-radius: 18px; display: grid; place-items: center; padding: 1.2rem;
    background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff; font-weight: 800; font-size: clamp(1.4rem, 6vw, 2.2rem);
    box-shadow: var(--shadow-lg); word-break: break-word;
}
.candidate-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .7rem; background: var(--ice); border: 1px solid var(--line); border-radius: 999px; font-size: .85rem; font-weight: 500; margin: .15rem; }
.winner-pop { animation: pop .5s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 2000; }

.modal-content { border-radius: 20px; border: 0; box-shadow: 0 24px 60px rgba(10, 31, 68, .3); }
.modal-header.tech { background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff; border-radius: 20px 20px 0 0; }

/* ---------- Footer ---------- */
.app-footer { flex-shrink: 0; border-top: 1px solid var(--line); background: #fff; padding: 1rem 0; font-size: .82rem; color: var(--navy-2); text-align: center; }

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
