/* ============================================================
   GALI DISAWER - Application stylesheet
   Mobile-first app UI. Royal blue theme per reference design.
   ============================================================ */

:root {
    --primary: #2563eb;
    --primary-600: #2158d6;
    --primary-dark: #1e40af;
    --primary-deep: #16337e;
    --primary-soft: #eff6ff;
    --primary-soft-2: #dbeafe;
    --grad-header: linear-gradient(135deg, #1e40af 0%, #2563eb 60%, #3b82f6 100%);
    --grad-splash: linear-gradient(160deg, #16337e 0%, #1e40af 45%, #2563eb 100%);
    --bg: #f1f5f9;
    --bg-soft: #f8fafc;
    --card: #ffffff;
    --border: #e2e8f0;
    --border-soft: #eef2f7;
    --text: #0f172a;
    --text-2: #334155;
    --muted: #64748b;
    --muted-2: #94a3b8;
    --gold: #f5b301;
    --gold-soft: #fef3d7;
    --win: #16a34a;
    --win-soft: #dcfce7;
    --loss: #dc2626;
    --loss-soft: #fee2e2;
    --pending: #f59e0b;
    --pending-soft: #fef3c7;
    --info: #0ea5e9;
    --info-soft: #e0f2fe;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .05);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, .09);
    --shadow-lg: 0 10px 28px rgba(15, 23, 42, .16);
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-pill: 999px;
    --header-h: 58px;
    --nav-h: 62px;
    --font: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---------------- reset / base ---------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.45;
    color: var(--text);
    background: #dfe7f3;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, h4, p { margin: 0; }
.ic { flex: none; vertical-align: -0.18em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* desktop: center the phone-like app frame */
@media (min-width: 520px) {
    body.app-body, body.auth-body, body.error-body {
        background:
            radial-gradient(1200px 600px at 15% -10%, rgba(37, 99, 235, .18), transparent 60%),
            radial-gradient(1000px 500px at 110% 110%, rgba(30, 64, 175, .15), transparent 60%),
            #e6edf7;
    }
}

/* ---------------- app frame ---------------- */
.app-frame {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    background: var(--bg);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, .04), 0 24px 60px rgba(15, 23, 42, .18);
}
@media (min-width: 520px) { .app-frame { min-height: 100vh; } }

.app-main {
    flex: 1 1 auto;
    width: 100%;
    padding: 14px 14px calc(var(--nav-h) + 26px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-padding-bottom: calc(var(--nav-h) + 28px + env(safe-area-inset-bottom, 0px));
}
/* Keep scrolled-into-view interactive elements clear of the fixed bottom nav
   (and the floating slip bar) so they are always tappable. */
.app-main button, .app-main a, .app-main input, .app-main select, .app-main textarea {
    scroll-margin-bottom: calc(var(--nav-h) + 28px + env(safe-area-inset-bottom, 0px));
}
body.has-slip .app-main { scroll-padding-bottom: calc(var(--nav-h) + 104px + env(safe-area-inset-bottom, 0px)); }
body.has-slip .app-main button, body.has-slip .app-main a, body.has-slip .app-main input,
body.has-slip .app-main select, body.has-slip .app-main textarea {
    scroll-margin-bottom: calc(var(--nav-h) + 104px + env(safe-area-inset-bottom, 0px));
}

/* ---------------- headers ---------------- */
.app-header {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    height: var(--header-h);
    padding: 0 12px;
    padding-top: env(safe-area-inset-top, 0px);
    background: var(--grad-header);
    color: #fff;
    box-shadow: 0 2px 10px rgba(22, 51, 126, .35);
}
.header-sub .hd-title {
    flex: 1;
    text-align: center;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.header-main { justify-content: flex-start; }
.hd-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    cursor: pointer;
    position: relative;
    transition: background .15s ease;
}
.hd-icon-btn:active { background: rgba(255, 255, 255, .16); }
.hd-spacer { pointer-events: none; }
.hd-brand {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 auto;
    color: #fff;
    line-height: 1;
}
.brand-word { display: flex; flex-direction: column; align-items: flex-start; }
.brand-word-top { font-size: 15px; font-weight: 800; letter-spacing: 2.5px; }
.brand-word-bottom {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 4.1px;
    color: #bfdbff;
    margin-top: 1px;
}
.badge-dot {
    position: absolute;
    top: 4px; right: 3px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: var(--r-pill);
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary-dark);
}

/* ---------------- splash ---------------- */
.splash {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--grad-splash);
    overflow: hidden;
    transition: opacity .45s ease, visibility .45s ease;
}
.splash.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.splash::before, .splash::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(46px);
    background: rgba(59, 130, 246, .38);
}
.splash::before { width: 320px; height: 320px; top: -90px; left: -110px; }
.splash::after { width: 380px; height: 380px; bottom: -130px; right: -130px; }
.splash-inner { position: relative; text-align: center; color: #fff; padding: 40px; }
.splash-logo { filter: drop-shadow(0 8px 22px rgba(245, 179, 1, .45)); }
.splash-brand {
    margin-top: 16px;
    font-size: 44px;
    font-weight: 800;
    letter-spacing: 6px;
    text-shadow: 0 4px 18px rgba(0, 0, 0, .35);
}
.splash-brand span { display: block; font-size: 24px; letter-spacing: 11px; color: #cfe0ff; margin-top: 2px; }
.splash-tagline { margin-top: 14px; font-size: 13px; color: #bfd8ff; letter-spacing: .4px; }
.splash-loader {
    margin: 26px auto 0;
    width: 130px;
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .22);
    overflow: hidden;
}
.splash-loader span {
    display: block;
    height: 100%;
    width: 46%;
    border-radius: 4px;
    background: linear-gradient(90deg, #fff, #9ec2ff);
    animation: splashSlide 1.1s ease-in-out infinite;
}
@keyframes splashSlide {
    0% { transform: translateX(-110%); }
    100% { transform: translateX(300%); }
}
.splash-loading { margin-top: 12px; font-size: 12.5px; color: #a8c8ff; letter-spacing: 2px; }
.splash-ball {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, #6ea8ff, #2563eb 58%, #1a3fae);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .38), inset 0 -6px 14px rgba(0, 0, 0, .25);
    animation: floatBall 5s ease-in-out infinite;
}
.splash-ball span { font-size: 26px; }
.sb-1 { width: 64px; height: 64px; left: 9%; top: 20%; transform: rotate(-8deg); }
.sb-2 { width: 46px; height: 46px; right: 12%; top: 30%; animation-delay: 1.2s; }
.sb-3 { width: 56px; height: 56px; right: 18%; bottom: 16%; animation-delay: 2.1s; }
.splash-ball span { font-size: 22px; }
.sb-1 span { font-size: 26px; }
@keyframes floatBall {
    0%, 100% { transform: translateY(0) rotate(-6deg); }
    50% { transform: translateY(-16px) rotate(7deg); }
}
@media (prefers-reduced-motion: reduce) {
    .splash-loader span, .splash-ball { animation: none; }
}

/* ---------------- bottom navigation ---------------- */
.bottom-nav {
    position: sticky;
    bottom: 0;
    z-index: 45;
    margin-top: auto;
    background: #fff;
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -6px 20px rgba(15, 23, 42, .07);
}
.bottom-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: var(--nav-h);
}
.bn-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--muted-2);
    font-size: 10.5px;
    font-weight: 600;
    transition: color .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.bn-item .ic { width: 23px; height: 23px; }
.bn-item.active { color: var(--primary); }
.bn-item.active .ic { filter: drop-shadow(0 3px 8px rgba(37, 99, 235, .45)); }

/* ---------------- sections & cards ---------------- */
.section { display: flex; flex-direction: column; gap: 12px; }
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2px;
}
.section-head h2 { font-size: 16px; font-weight: 700; color: var(--text-2); }
.section-date { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 500; }
.card {
    background: var(--card);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-soft);
    padding: 16px;
}
.muted { color: var(--muted); }
.small { font-size: 12px; }
.text-win { color: var(--win); }
.text-loss { color: var(--loss); }
.text-pending { color: var(--pending); }
.text-open { color: var(--win); }
.text-closed { color: var(--loss); }

/* ---------------- pills / badges / chips ---------------- */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: var(--r-pill);
    padding: 5px 16px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}
.pill-primary { background: var(--primary); color: #fff; box-shadow: 0 3px 10px rgba(37, 99, 235, .35); }
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: var(--r-pill);
    padding: 4px 10px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .3px;
    line-height: 1.2;
    text-transform: uppercase;
}
.badge-open { background: var(--win-soft); color: #15803d; }
.badge-closed { background: var(--loss-soft); color: #b91c1c; }
.badge-info { background: var(--info-soft); color: #0369a1; }
.badge-muted { background: var(--bg); color: var(--muted); }
.badge-gold { background: var(--gold-soft); color: #92600a; }
.st-pending { background: var(--pending-soft); color: #92400e; }
.st-win { background: var(--win-soft); color: #15803d; }
.st-loss { background: var(--loss-soft); color: #b91c1c; }
.st-cancelled { background: var(--bg); color: var(--muted); }
.st-refunded { background: var(--info-soft); color: #0369a1; }
.st-deposit { background: var(--primary-soft-2); color: var(--primary-dark); }
.st-withdrawal { background: var(--gold-soft); color: #92600a; }
.st-bet { background: var(--primary-soft); color: var(--primary-dark); }
.st-winning { background: var(--win-soft); color: #15803d; }
.st-referral { background: #f3e8ff; color: #7e22ce; }
.st-adjustment { background: var(--bg); color: var(--text-2); }

/* segmented control */
.seg-control {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 4px;
    background: #e2e8f0;
    border-radius: 10px;
    padding: 4px;
}
.seg-item {
    border: none;
    border-radius: 8px;
    padding: 9px 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all .15s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.seg-item.active { background: var(--primary); color: #fff; box-shadow: 0 3px 10px rgba(37, 99, 235, .35); }
.seg-control.seg-sm .seg-item { padding: 7px 8px; font-size: 12.5px; }

/* Scrollable segmented control for many tabs (market lists): labels never
   clip; overflow is swiped horizontally like native apps. */
.seg-control.seg-scroll {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
}
.seg-control.seg-scroll::-webkit-scrollbar { display: none; }
.seg-control.seg-scroll .seg-item {
    flex: 0 0 auto;
    white-space: nowrap;
    min-width: 76px;
    text-align: center;
    scroll-snap-align: start;
}

/* chips */
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-2);
    border-radius: var(--r-pill);
    padding: 7px 18px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
}
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip-sm { padding: 5px 14px; font-size: 11.5px; }

/* ---------------- buttons ---------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: var(--r-md);
    padding: 12px 20px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: transform .12s ease, box-shadow .15s ease, background .15s ease, opacity .15s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 5px 16px rgba(37, 99, 235, .38); }
.btn-primary:hover { background: var(--primary-600); }
.btn-outline { background: #fff; color: var(--text-2); border: 1.5px solid var(--border); box-shadow: none; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-outline-danger { background: #fef2f2; color: var(--loss); border: 1.5px solid #fecaca; }
.btn-outline-danger:hover { background: var(--loss-soft); }
.btn-gold { background: linear-gradient(135deg, #f5b301, #e19a00); color: #4a3200; box-shadow: 0 5px 16px rgba(245, 179, 1, .4); }
.btn-lg { padding: 15px 22px; font-size: 15.5px; border-radius: 14px; }
.btn-sm { padding: 8px 14px; font-size: 12.5px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.loading { opacity: .6; pointer-events: none; }
.btn .spinner { width: 17px; height: 17px; }

/* spinner */
.spinner {
    width: 20px; height: 20px;
    border: 2.5px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: inline-block;
}
.spinner.dark { border-color: rgba(37, 99, 235, .2); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- forms ---------------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-naked { margin-top: 4px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-ic { position: absolute; left: 13px; color: var(--muted-2); pointer-events: none; }
.input-wrap input, .input-wrap select {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    background: #fff;
    padding: 12px 14px 12px 42px;
    font-family: inherit;
    font-size: 14.5px;
    color: var(--text);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
    appearance: none;
}
.input-wrap input:focus, .input-wrap select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3.5px rgba(37, 99, 235, .13);
}
.input-wrap input::placeholder { color: var(--muted-2); }
.pw-toggle {
    position: absolute; right: 6px;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; color: var(--muted-2); cursor: pointer;
    border-radius: 8px;
}
.form-row-between { display: flex; align-items: center; justify-content: space-between; }
.link { color: var(--primary); font-size: 13px; font-weight: 600; }
.link-btn { background: none; border: none; color: var(--primary); font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }

/* alerts */
.alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border-radius: var(--r-md);
    padding: 12px 14px;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.45;
}
.alert .ic { margin-top: 1px; }
.alert-danger { background: var(--loss-soft); color: #991b1b; }
.alert-success { background: var(--win-soft); color: #166534; }
.alert-info { background: var(--info-soft); color: #075985; }
.alert-warning { background: var(--pending-soft); color: #92400e; }

/* ---------------- empty states ---------------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 34px 18px;
    color: var(--muted-2);
    text-align: center;
}
.empty-state p { font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.empty-state .btn { margin-top: 8px; }

/* Betting closed notice (result published / outside window) */
.closed-notice {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 34px 18px;
    text-align: center;
}
.closed-notice .ic { color: var(--muted-2); }
.closed-notice h3 { font-size: 16px; font-weight: 800; color: var(--text); }
.closed-notice p { font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.closed-notice .btn { margin-top: 10px; }

/* ============================================================ DASHBOARD */
.result-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.result-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 16px 12px 13px;
    position: relative;
    overflow: hidden;
}
.result-card::after {
    content: "";
    position: absolute; inset: 0 0 auto 0; height: 3px;
    background: var(--grad-header);
}
.rc-number {
    font-size: 40px;
    font-weight: 900;
    background: var(--grad-header);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 2px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.rc-number.rc-wait {
    background: none;
    -webkit-text-fill-color: var(--muted-2);
    color: var(--muted-2);
    letter-spacing: 6px;
}
.rc-time { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--text-2); }
.rc-sub { font-size: 11px; color: var(--muted); }
.result-card-empty { align-items: center; justify-content: center; color: var(--muted-2); gap: 10px; }

.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 13px 6px 11px;
    background: var(--card);
    border-radius: var(--r-md);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-sm);
    color: var(--text-2);
    transition: transform .12s ease, box-shadow .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.quick-item:active { transform: scale(.97); }
.quick-ic {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--primary-soft-2);
}
.quick-label { font-size: 11px; font-weight: 600; color: #475569; }

/* banner slider */
.banner-slider { position: relative; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-md); }
.banner-slide { position: relative; display: none; aspect-ratio: 2.35 / 1; }
.banner-slide.active { display: block; animation: fadeIn .5s ease; }
.banner-slide img { width: 100%; height: 100%; object-fit: cover; }
.banner-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center;
    padding: 18px 20px;
    background: linear-gradient(90deg, rgba(13, 30, 79, .88) 0%, rgba(19, 42, 105, .55) 48%, rgba(19, 42, 105, .05) 100%);
}
.banner-text { display: flex; flex-direction: column; gap: 3px; color: #fff; }
.banner-kicker {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase;
    color: var(--gold);
}
.banner-title { font-size: 19px; font-weight: 800; line-height: 1.15; }
.banner-sub { font-size: 12px; color: #c3d6ff; margin-top: 3px; }
.banner-dots {
    position: absolute; bottom: 9px; left: 0; right: 0;
    display: flex; justify-content: center; gap: 5px;
}
.banner-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .45); transition: all .2s ease; }
.banner-dot.active { background: #fff; width: 16px; border-radius: 3px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.notice-bar {
    display: flex; align-items: center; gap: 11px;
    color: var(--primary-dark);
    padding: 12px 14px;
}
.notice-bar .ic { color: var(--primary); }
.notice-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.notice-text strong { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notice-text span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.wallet-strip { display: flex; align-items: center; justify-content: space-between; padding: 13px 15px; }
.ws-info { display: flex; flex-direction: column; gap: 2px; }
.ws-amount { font-size: 21px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }

/* ============================================================ LIVE RESULT */
.result-hero { text-align: center; padding: 20px 16px 18px; position: relative; overflow: hidden; }
.result-hero::before {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, var(--primary-soft) 0%, rgba(239, 246, 255, 0) 70%);
}
.rh-top { position: relative; display: flex; align-items: center; justify-content: space-between; }
.rh-date { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 500; }
.rh-number {
    position: relative;
    font-size: 56px;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: 4px;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 4px 16px rgba(37, 99, 235, .18);
}
.rh-number.rh-wait { color: var(--muted-2); letter-spacing: 10px; }
.rh-panna { position: relative; display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.rh-status { position: relative; margin-top: 8px; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; }
.rh-done { color: var(--win); }
.rh-pending { color: var(--pending); }

.date-nav { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; }
.dn-btn {
    width: 40px; height: 40px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text-2);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all .15s ease;
}
.dn-btn:hover { border-color: var(--primary); color: var(--primary); }
.dn-btn.disabled { opacity: .35; pointer-events: none; }
.dn-center { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.dn-date { font-size: 14.5px; font-weight: 700; color: var(--text-2); }
.dn-day { font-size: 11px; color: var(--muted); }

.table-card { padding: 14px; }
.tc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; gap: 8px; }
.tc-head h3 { font-size: 14.5px; font-weight: 700; color: var(--text); }
.tw-list { display: flex; flex-direction: column; }
.tw-row {
    display: grid;
    grid-template-columns: 108px 1fr 74px;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    transition: background .12s ease;
}
.tw-row:nth-child(odd) { background: var(--bg-soft); }
.tw-row.selected { background: var(--primary-soft); box-shadow: inset 0 0 0 1.5px var(--primary-soft-2); }
.tw-time {
    background: var(--primary);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    text-align: center;
    border-radius: 7px;
    padding: 7px 4px;
    letter-spacing: .3px;
    font-variant-numeric: tabular-nums;
}
.tw-market { font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.tw-result { font-size: 17px; font-weight: 800; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.tw-result.wait { color: var(--muted-2); font-size: 11.5px; letter-spacing: 1.5px; font-weight: 700; }

/* ============================================================ CHART */
.chart-table { display: flex; flex-direction: column; max-height: 420px; overflow-y: auto; }
.ct-row {
    display: grid;
    grid-template-columns: 1.1fr .8fr .8fr .8fr;
    text-align: center;
    padding: 8px 6px;
    font-size: 13px;
    color: var(--text-2);
    border-bottom: 1px solid var(--border-soft);
    font-variant-numeric: tabular-nums;
}
.ct-row:last-child { border-bottom: none; }
.ct-head-row { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; position: sticky; top: 0; background: #fff; z-index: 2; }
.ct-jodi { font-weight: 800; color: var(--primary-dark); font-size: 14.5px; }
.ct-muted { color: var(--muted-2); }

.freq-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.freq-cell {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 9px 6px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: linear-gradient(180deg, rgba(37, 99, 235, calc(var(--heat, 0) * .14)) 0%, #fff 100%);
    transition: transform .12s ease;
}
.freq-cell:hover { transform: translateY(-2px); }
.freq-digit { font-size: 11px; font-weight: 700; color: var(--muted); }
.freq-count { font-size: 17px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.freq-bar { width: 100%; height: 4px; border-radius: 4px; background: var(--bg); overflow: hidden; margin-top: 3px; }
.freq-bar span { display: block; height: 100%; border-radius: 4px; background: var(--primary); transition: width .4s ease; }

.jodi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; max-height: 460px; overflow-y: auto; padding-right: 2px; }
@media (min-width: 420px) { .jodi-grid { grid-template-columns: repeat(6, 1fr); } }
.jodi-cell {
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 7px 2px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    background: #fff;
}
.jodi-cell.hot { background: var(--primary-soft); border-color: var(--primary-soft-2); }
.jodi-cell.zero { opacity: .45; }
.jodi-key { font-size: 14px; font-weight: 800; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.jodi-count { font-size: 10.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }

.panna-list { display: flex; flex-direction: column; max-height: 430px; overflow-y: auto; }
.panna-row {
    display: grid;
    grid-template-columns: 30px 1fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 9px 8px;
    border-bottom: 1px solid var(--border-soft);
}
.panna-row:last-child { border-bottom: none; }
.panna-rank {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--bg);
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.panna-key { font-size: 16px; font-weight: 800; color: var(--primary-dark); letter-spacing: 2px; font-variant-numeric: tabular-nums; }
.panna-family { font-size: 10px; font-weight: 700; color: var(--muted); background: var(--bg); padding: 3px 8px; border-radius: var(--r-pill); letter-spacing: .4px; }
.panna-count { font-size: 13px; font-weight: 800; color: var(--text-2); font-variant-numeric: tabular-nums; }
.panna-note { margin-top: 10px; text-align: center; }

/* ============================================================ BETTING PAGES */
.bet-info { display: flex; flex-direction: column; gap: 8px; padding: 13px 15px; }
.bi-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.bi-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.bi-item .ic { color: var(--primary); }

.digit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.digit-grid .pick-btn:last-child { grid-column: 2; }
.pick-btn {
    border: 2px solid var(--border);
    border-radius: 14px;
    background: #fff;
    color: var(--text);
    font-family: inherit;
    font-size: 24px;
    font-weight: 800;
    padding: 18px 8px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
    transition: all .13s ease;
    -webkit-tap-highlight-color: transparent;
    font-variant-numeric: tabular-nums;
}
.pick-btn:hover { border-color: var(--primary-soft-2); }
.pick-btn:active { transform: scale(.96); }
.pick-btn.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 6px 18px rgba(37, 99, 235, .45);
}
.jodi-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
@media (min-width: 420px) { .jodi-picker { grid-template-columns: repeat(6, 1fr); } }
.pick-jodi { font-size: 17px; padding: 12px 2px; border-radius: 10px; border-width: 1.5px; }
.panna-family { margin-bottom: 12px; }
.panna-family:last-child { margin-bottom: 0; }
.pf-title { font-size: 12.5px; font-weight: 700; color: var(--text-2); margin: 10px 0 8px; display: flex; align-items: center; gap: 6px; }
.panna-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; max-height: 300px; overflow-y: auto; padding: 2px; }
@media (min-width: 420px) { .panna-picker { grid-template-columns: repeat(5, 1fr); } }
.pick-panna { font-size: 14.5px; padding: 10px 2px; border-radius: 9px; border-width: 1.5px; letter-spacing: 1px; }

.amount-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.amount-chip {
    border: 1.5px solid var(--border);
    background: #fff;
    color: #475569;
    border-radius: 10px;
    padding: 10px 18px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all .13s ease;
    font-variant-numeric: tabular-nums;
}
.amount-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(37, 99, 235, .35); }

/* bet slip */
.slip-bar {
    position: fixed;
    left: 50%;
    transform: translateX(-50%) translateY(calc(100% + 120px));
    visibility: hidden;
    bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom, 0px));
    width: calc(100% - 28px);
    max-width: 452px;
    z-index: 60;
    background: var(--primary-dark);
    color: #fff;
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 14px 38px rgba(22, 51, 126, .5);
    cursor: pointer;
    transition: transform .28s cubic-bezier(.34, 1.4, .64, 1), visibility 0s .28s;
    border: none;
    font-family: inherit;
    text-align: left;
}
.slip-bar.show {
    transform: translateX(-50%) translateY(0);
    visibility: visible;
    transition: transform .28s cubic-bezier(.34, 1.4, .64, 1), visibility 0s 0s;
}
/* When the floating slip bar is visible, push page content up so the bar
   never overlaps the amount chips / inputs near the bottom. */
body.has-slip .app-main { padding-bottom: calc(var(--nav-h) + 104px + env(safe-area-inset-bottom, 0px)); }
.slip-bar-info { display: flex; flex-direction: column; gap: 1px; }
.slip-bar-title { font-size: 13px; font-weight: 700; }
.slip-bar-total { font-size: 15px; font-weight: 800; }
.slip-bar-open { display: inline-flex; align-items: center; gap: 6px; background: #fff; color: var(--primary-dark); border-radius: 10px; padding: 9px 14px; font-size: 13px; font-weight: 800; }

.slip-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(15, 23, 42, .55); opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s; }
.slip-backdrop.show { opacity: 1; visibility: visible; }
.slip-drawer {
    position: fixed;
    left: 50%; bottom: 0;
    transform: translateX(-50%) translateY(105%);
    width: 100%;
    max-width: 480px;
    max-height: 78vh;
    z-index: 75;
    background: var(--bg);
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    transition: transform .3s cubic-bezier(.32, .9, .5, 1);
    box-shadow: 0 -12px 40px rgba(15, 23, 42, .3);
}
.slip-drawer.show { transform: translateX(-50%) translateY(0); }
.slip-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px 12px;
    background: var(--grad-header);
    color: #fff;
    border-radius: 20px 20px 0 0;
}
.slip-head h3 { font-size: 15.5px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.slip-body { overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 9px; }
.slip-foot { padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); background: #fff; border-radius: 0; display: flex; flex-direction: column; gap: 10px; }
.slip-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 11px 12px;
    box-shadow: var(--shadow-sm);
}
.sr-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sr-top { display: flex; align-items: center; gap: 6px; }
.sr-market { font-size: 10.5px; background: var(--primary); color: #fff; padding: 3px 8px; border-radius: var(--r-pill); font-weight: 700; }
.sr-type { font-size: 12px; color: var(--muted); font-weight: 600; }
.sr-sel { font-size: 15px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.sr-payout { font-size: 11px; color: var(--win); font-weight: 700; }
.sr-amt { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.sr-amt input {
    width: 86px;
    border: 1.5px solid var(--border);
    border-radius: 9px;
    padding: 7px 9px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    text-align: right;
    color: var(--text);
    outline: none;
}
.sr-amt input:focus { border-color: var(--primary); }
.sr-remove {
    width: 30px; height: 30px;
    border-radius: 9px;
    border: none;
    background: var(--loss-soft);
    color: var(--loss);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    flex: none;
}
.slip-summary { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; }
.slip-total { font-size: 19px; font-weight: 800; }
.slip-bal { color: var(--muted); font-weight: 600; }

/* ============================================================ MY BETS */
.bet-card { display: flex; flex-direction: column; gap: 11px; }
.bc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bc-status { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: var(--r-pill); }
.bc-title { font-size: 15.5px; font-weight: 700; color: var(--text); }
.bc-title strong { color: var(--primary-dark); letter-spacing: .5px; }
.bc-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 12px; }
.bc-meta-item { display: flex; flex-direction: column; gap: 1px; }
.bc-meta-item .muted { font-size: 11px; }
.bc-meta-item strong { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.bc-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ============================================================ PROFILE */
.profile-head { display: flex; align-items: center; gap: 15px; padding: 18px 16px; }
.avatar {
    width: 58px; height: 58px;
    border-radius: 50%;
    background: var(--grad-header);
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    flex: none;
    border: 3px solid #fff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, .4);
    text-transform: uppercase;
}
.avatar-lg { width: 66px; height: 66px; font-size: 26px; }
.avatar-sm { width: 42px; height: 42px; font-size: 16px; border-width: 2px; }
.avatar-xs { width: 32px; height: 32px; font-size: 13px; border-width: 2px; }
.ph-info { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.ph-name { font-size: 18px; font-weight: 800; }
.ph-id { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.ph-info .badge { margin-top: 3px; }

.wallet-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 16px;
    border-left: 5px solid var(--gold);
}
.wc-info { display: flex; flex-direction: column; gap: 2px; }
.wc-amount { font-size: 25px; font-weight: 800; font-variant-numeric: tabular-nums; }

.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-box { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 13px 8px; }
.stat-box strong { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }

.menu-list { padding: 4px 0; display: flex; flex-direction: column; }
.menu-item {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 13px 16px;
    color: var(--text-2);
    border-bottom: 1px solid var(--border-soft);
    transition: background .12s ease;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:hover { background: var(--bg-soft); }
.menu-list-flat { padding: 0; }
.mi-ic {
    width: 36px; height: 36px;
    border-radius: 11px;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    flex: none;
}
.mi-ic-danger { background: var(--loss-soft); color: var(--loss); }
.mi-ic-inner { width: 100%; height: 100%; border-radius: 11px; display: flex; align-items: center; justify-content: center; }
.mi-label { flex: 1; font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.menu-danger .mi-label { color: var(--loss); }
.mi-arrow { color: var(--muted-2); }
.menu-item .badge { flex: none; }

/* bottom sheet */
.sheet-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(15, 23, 42, .5); opacity: 1; transition: opacity .25s ease, visibility .25s; }
.sheet-backdrop[hidden] { display: block; opacity: 0; visibility: hidden; }
.sheet {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%) translateY(105%);
    width: 100%;
    max-width: 480px;
    max-height: 86vh;
    background: var(--bg);
    border-radius: 20px 20px 0 0;
    z-index: 85;
    display: flex;
    flex-direction: column;
    transition: transform .3s cubic-bezier(.32, .9, .5, 1);
    box-shadow: 0 -12px 40px rgba(15, 23, 42, .3);
}
.sheet.open { transform: translateX(-50%) translateY(0); }
.sheet-handle { width: 42px; height: 4.5px; border-radius: 3px; background: #cbd5e1; margin: 9px auto 0; }
.sheet-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px;
    color: var(--text);
    border-bottom: 1px solid var(--border-soft);
}
.sheet-head .hd-icon-btn { color: var(--muted); }
.sheet-head h3 { font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.sheet-body { overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.info-card { display: flex; flex-direction: column; gap: 9px; }
.ic-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.app-foot-note { text-align: center; color: var(--muted-2); font-size: 11.5px; padding: 8px 0 4px; }

/* ============================================================ WALLET */
.wallet-hero {
    position: relative;
    border-radius: var(--r-lg);
    padding: 20px 18px;
    background: var(--grad-header);
    color: #fff;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(30, 64, 175, .35);
}
.wallet-hero::after {
    content: ""; position: absolute; right: -40px; top: -40px;
    width: 170px; height: 170px; border-radius: 50%;
    background: rgba(255, 255, 255, .09);
}
.wallet-hero::before {
    content: ""; position: absolute; right: 30px; bottom: -60px;
    width: 130px; height: 130px; border-radius: 50%;
    background: rgba(255, 255, 255, .07);
}
.wallet-hero-top { display: flex; flex-direction: column; gap: 3px; position: relative; z-index: 1; }
.wallet-hero-top .muted { color: #c7d9ff; }
.wallet-hero-top strong { font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; text-shadow: 0 3px 12px rgba(0, 0, 0, .25); }
.wallet-hero-ic { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: rgba(255, 255, 255, .9); z-index: 1; }
.wallet-panel { display: flex; flex-direction: column; gap: 12px; }
.upi-box { background: var(--primary-soft); border: 1px dashed var(--primary-soft-2); border-radius: var(--r-md); padding: 13px 14px; display: flex; flex-direction: column; gap: 8px; }
.upi-head { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--primary-dark); }
.upi-id-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.upi-id-row strong { font-size: 16.5px; color: var(--primary-dark); letter-spacing: .3px; word-break: break-all; }
.req-row { display: flex; align-items: center; gap: 11px; padding: 10px 2px; border-bottom: 1px solid var(--border-soft); }
.req-row:last-child { border-bottom: none; }
.req-ic {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--bg);
    color: var(--muted);
    display: flex; align-items: center; justify-content: center;
    flex: none;
}
.req-ic.n-winning { background: var(--win-soft); color: var(--win); }
.req-ic.n-bet { background: var(--primary-soft); color: var(--primary); }
.req-ic.n-deposit, .req-ic.n-st-deposit { background: var(--primary-soft); color: var(--primary-dark); }
.req-ic.n-withdrawal, .req-ic.n-st-withdrawal { background: var(--gold-soft); color: #92600a; }
.req-ic.n-referral { background: #f3e8ff; color: #7e22ce; }
.req-ic.n-refund { background: var(--info-soft); color: var(--info); }
.req-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.req-body strong { font-size: 13.5px; }
.req-body .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.req-right { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }

/* ============================================================ NOTIFICATIONS */
.notif-list { display: flex; flex-direction: column; gap: 9px; max-height: 65vh; overflow-y: auto; padding: 2px; }
.notif-item { display: flex; gap: 12px; padding: 13px 14px; align-items: flex-start; position: relative; }
.notif-item.unread { border-left: 4px solid var(--primary); background: #f8faff; }
.notif-ic {
    width: 38px; height: 38px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex: none;
    background: var(--primary-soft);
    color: var(--primary);
}
.notif-ic.n-warning { background: var(--pending-soft); color: var(--pending); }
.notif-ic.n-success { background: var(--win-soft); color: var(--win); }
.notif-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif-title { font-size: 14px; font-weight: 700; }
.notif-msg { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.notif-time { font-size: 11px; color: var(--muted-2); margin-top: 2px; }
.notif-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); flex: none; margin-top: 6px; }

/* ============================================================ REFER / HELP */
.refer-hero { text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; padding: 22px 18px; }
.refer-ic {
    width: 64px; height: 64px; border-radius: 20px;
    background: var(--gold-soft); color: #b7800c;
    display: flex; align-items: center; justify-content: center;
}
.refer-hero h2 { font-size: 20px; font-weight: 800; }
.refer-hero p { font-size: 13px; color: var(--muted); max-width: 330px; }
.refer-code-box { width: 100%; background: var(--bg-soft); border: 1px solid var(--border-soft); border-radius: var(--r-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 7px; text-align: left; }
.refer-code-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.refer-code-row strong { font-size: 21px; letter-spacing: 3px; color: var(--primary-dark); font-weight: 800; }
.refer-link { font-size: 12px; color: var(--text-2); word-break: break-all; }

.help-hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 18px; }
.help-ic { width: 62px; height: 62px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.help-hero h2 { font-size: 19px; font-weight: 800; }
.help-hero p { font-size: 13px; color: var(--muted); }
.faq-list { display: flex; flex-direction: column; }
.faq-item { border-bottom: 1px solid var(--border-soft); }
.faq-item:last-child { border-bottom: none; }
.faq-item summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 2px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-2);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item[open] .faq-arrow { transform: rotate(180deg); color: var(--primary); }
.faq-arrow { transition: transform .2s ease; color: var(--muted-2); flex: none; }
.faq-body { padding: 0 2px 13px; font-size: 13px; color: var(--muted); line-height: 1.6; }
.notice-card { display: flex; gap: 12px; padding: 13px 15px; align-items: flex-start; color: var(--pending); }
.notice-card .ic { margin-top: 2px; }
.notice-card strong { color: #92400e; font-size: 13.5px; }

/* ============================================================ AUTH PAGES */
.auth-body { display: flex; min-height: 100vh; }
.auth-wrap {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: 34px 20px 28px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    align-self: center;
}
.auth-hero { text-align: center; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 12px; }
.auth-logo { filter: drop-shadow(0 8px 20px rgba(245, 179, 1, .5)); }
.auth-brand { font-size: 30px; font-weight: 800; letter-spacing: 5px; text-shadow: 0 4px 16px rgba(0, 0, 0, .35); }
.auth-brand span { display: block; font-size: 16px; letter-spacing: 8px; color: #bfd8ff; }
.auth-tagline { font-size: 12px; color: #c7d9ff; letter-spacing: .4px; }
.auth-body { background: var(--grad-splash); }
.auth-card { padding: 22px 20px; border-radius: var(--r-lg); }
.auth-head { margin-bottom: 18px; }
.auth-head h2 { font-size: 21px; font-weight: 800; }
.auth-head p { font-size: 13px; color: var(--muted); margin-top: 3px; }
.auth-alt { text-align: center; font-size: 13.5px; color: #dce8ff; }
.auth-alt a { color: #fff; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.auth-foot { text-align: center; font-size: 11.5px; color: #9db9e8; line-height: 1.7; }

/* ============================================================ MISC */
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 4px 0; }
.page-btn {
    width: 38px; height: 38px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: #fff;
    color: var(--text-2);
    display: inline-flex; align-items: center; justify-content: center;
}
.page-btn:hover:not(.disabled) { border-color: var(--primary); color: var(--primary); }
.page-btn.disabled { opacity: .4; }
.page-info { font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* toast */
.toast-root {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 14px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    width: calc(100% - 28px);
    max-width: 452px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #101d3a;
    color: #fff;
    border-radius: 13px;
    padding: 13px 15px;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.45;
    box-shadow: 0 12px 34px rgba(15, 23, 42, .4);
    animation: toastIn .3s cubic-bezier(.34, 1.3, .64, 1);
    pointer-events: auto;
}
.toast.out { animation: toastOut .25s ease forwards; }
.toast .ic { margin-top: 1px; flex: none; }
.toast-success .ic { color: #4ade80; }
.toast-error .ic { color: #f87171; }
.toast-info .ic { color: #7dd3fc; }
.toast a { color: #93c5fd; font-weight: 700; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px) scale(.97); } }

/* modal */
.modal-root { position: fixed; inset: 0; z-index: 250; display: none; align-items: center; justify-content: center; padding: 22px; }
.modal-root.show { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .6); animation: fadeIn .2s ease; }
.modal {
    position: relative;
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: 18px;
    padding: 22px 20px 18px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: modalIn .28s cubic-bezier(.34, 1.3, .64, 1);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.95); } to { opacity: 1; transform: none; } }
.modal-ic {
    width: 58px; height: 58px;
    border-radius: 50%;
    margin: 0 auto 13px;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-soft);
    color: var(--primary);
}
.modal-ic.danger { background: var(--loss-soft); color: var(--loss); }
.modal-ic.success { background: var(--win-soft); color: var(--win); }
.modal h3 { font-size: 17px; font-weight: 800; margin-bottom: 6px; }
.modal p { font-size: 13.5px; color: var(--muted); line-height: 1.55; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; }

/* drawer (side menu) */
.drawer-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(15, 23, 42, .5); opacity: 1; }
.drawer-backdrop[hidden] { display: none; }
.drawer {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 82%;
    max-width: 320px;
    z-index: 95;
    background: #fff;
    transform: translateX(-102%);
    transition: transform .3s cubic-bezier(.32, .9, .5, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 8px 0 30px rgba(15, 23, 42, .2);
}
.drawer.open { transform: translateX(0); }
.drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px;
    background: var(--grad-header);
    color: #fff;
}
.drawer-user { display: flex; align-items: center; gap: 11px; min-width: 0; }
.drawer-name { font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-sub { font-size: 11.5px; color: #c7d9ff; }
.drawer-head .hd-icon-btn { color: #fff; }
.drawer-nav { flex: 1; overflow-y: auto; padding: 10px 8px; }
.drawer-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.drawer-nav a {
    display: flex; align-items: center; gap: 13px;
    padding: 11px 12px;
    border-radius: 11px;
    color: var(--text-2);
    font-size: 14px;
    font-weight: 600;
    transition: background .12s ease;
}
.drawer-nav a:hover, .drawer-nav a:active { background: var(--primary-soft); color: var(--primary-dark); }
.drawer-nav .ic { color: var(--primary); }
.drawer-foot { padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border-soft); }

/* page loading bar */
.nav-loading {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 3px;
    z-index: 400;
    background: rgba(37, 99, 235, .15);
    opacity: 0;
    transition: opacity .2s ease;
    pointer-events: none;
}
.nav-loading.show { opacity: 1; }
.nav-loading span {
    display: block; height: 100%; width: 40%;
    background: linear-gradient(90deg, #2563eb, #60a5fa);
    border-radius: 3px;
    animation: navSlide 1s ease-in-out infinite;
}
@keyframes navSlide { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }

/* error page */
.error-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }
.error-wrap { max-width: 380px; width: calc(100% - 40px); text-align: center; display: flex; flex-direction: column; gap: 12px; padding: 30px 24px; }
.error-ic { color: var(--primary); }
.error-wrap h1 { font-size: 20px; font-weight: 800; }
.error-wrap p { color: var(--muted); font-size: 14px; }

/* scrollbars */
.tw-list::-webkit-scrollbar, .chart-table::-webkit-scrollbar, .jodi-grid::-webkit-scrollbar,
.panna-list::-webkit-scrollbar, .panna-picker::-webkit-scrollbar, .notif-list::-webkit-scrollbar,
.slip-body::-webkit-scrollbar, .sheet-body::-webkit-scrollbar, .drawer-nav::-webkit-scrollbar {
    width: 5px;
}
.tw-list::-webkit-scrollbar-thumb, .chart-table::-webkit-scrollbar-thumb, .jodi-grid::-webkit-scrollbar-thumb,
.panna-list::-webkit-scrollbar-thumb, .panna-picker::-webkit-scrollbar-thumb, .notif-list::-webkit-scrollbar-thumb,
.slip-body::-webkit-scrollbar-thumb, .sheet-body::-webkit-scrollbar-thumb, .drawer-nav::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
}

/* utilities */
.gap-8 { gap: 8px; }
.mt-8 { margin-top: 8px; }
.text-center { text-align: center; }
.fw-800 { font-weight: 800; }

@media (max-width: 359px) {
    .digit-grid { grid-template-columns: repeat(3, 1fr); }
    .quick-grid { grid-template-columns: repeat(3, 1fr); }
    .banner-title { font-size: 16px; }
}
