﻿/* ===== HuayPlus234 UI ===== */
:root {
    --primary: #2563eb;
    --primary-strong: #1e3a8a;
    --primary-soft: #dbeafe;
    --primary-mist: #eff8ff;
    --accent: #2dd4bf;
    --accent-strong: #0f9f98;
    --theme-gradient: linear-gradient(135deg, #1e3a8a 0%, #2563eb 44%, #0f9f98 100%);
    --theme-gradient-soft: linear-gradient(135deg, #dbeafe 0%, #e0f2fe 52%, #ccfbf1 100%);
    --ink: #102a43;
    --muted: #61758a;
    --line: rgba(30, 58, 138, 0.11);
    --surface: rgba(255, 255, 255, 0.88);
    --surface-strong: #ffffff;
    --bg: #eef8ff;
    --bg-deep: #dff4f4;
    --danger: #ef4444;
    --success: #16a34a;
    --shadow-sm: 0 10px 30px rgba(16, 67, 121, 0.1);
    --shadow-md: 0 18px 45px rgba(16, 67, 121, 0.15);
    --radius: 18px;
    --radius-lg: 28px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Prompt', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.16), transparent 30%),
        radial-gradient(circle at top right, rgba(45, 212, 191, 0.18), transparent 32%),
        linear-gradient(180deg, #f8fcff 0%, var(--bg) 42%, #e8f7f7 100%);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
}

a { color: inherit; }

.main-content {
    padding-top: 16px;
    padding-bottom: 105px;
    min-height: 100vh;
    max-width: 540px;
    margin: 0 auto;
}

.app-shell {
    max-width: 540px;
    margin: 0 auto;
    position: relative;
}

.navbar-sl {
    background: transparent;
    padding: 14px 0 0;
    box-shadow: none;
}

.navbar-panel {
    background: var(--theme-gradient);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 0 0 26px 26px;
    padding: 12px 14px;
    backdrop-filter: blur(10px);
    box-shadow: 0 16px 36px rgba(30, 64, 175, 0.22);
}

.brand-chip {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255,255,255,0.26), rgba(255,255,255,0.1));
    color: #fff;
    font-size: 20px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.25);
}

.brand-meta {
    color: rgba(255,255,255,0.8);
    font-size: 11px;
    line-height: 1.1;
    letter-spacing: 0.03em;
}

.brand-title {
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    margin-top: 2px;
}

.header-logo {
    display: block;
    height: 60px;
    width: auto;
    max-width: 170px;
    object-fit: contain;
    border-radius: 6px;
}

.balance-badge {
    background: rgba(8, 35, 83, 0.28);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
}

.balance-badge a { color: #fff; }

.header-circle-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(8, 35, 83, 0.24);
    border: 1px solid rgba(255,255,255,0.14);
    text-decoration: none;
}

.guest-header-actions .btn {
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 12px;
    white-space: nowrap;
}

.bottom-nav {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 18px);
    max-width: 520px;
    height: 76px;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(30, 58, 138, 0.1);
    backdrop-filter: blur(14px);
    border-radius: 24px;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    z-index: 1050;
    box-shadow: 0 18px 35px rgba(15, 67, 117, 0.16);
    padding: 0 8px 8px;
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    text-decoration: none;
    color: #657a8d;
    font-size: 10px;
    font-weight: 600;
    gap: 2px;
    flex: 1;
    padding: 6px 0 2px;
    transition: transform 0.2s ease, color 0.2s ease;
}

.bottom-nav .nav-item i { font-size: 20px; }

.bottom-nav .nav-item.active {
    color: var(--primary-strong);
}

.bottom-nav .nav-item.active:not(.center-btn) {
    transform: translateY(-2px);
}

.bottom-nav .nav-item.center-btn {
    position: relative;
    margin-top: -30px;
}

.bottom-nav .center-icon {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    background: linear-gradient(145deg, #071b3c, #0d4f83);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2dd4bf;
    font-size: 24px;
    overflow: hidden;
    border: 2px solid rgba(45, 212, 191, 0.45);
    box-shadow: 0 10px 22px rgba(15, 67, 117, 0.22);
}

.bottom-nav .center-logo {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    object-fit: contain;
    border-radius: 50%;
    padding: 4px;
    transform: none;
}

.bottom-nav .center-btn span {
    color: var(--primary-strong);
    font-weight: 800;
    font-size: 10px;
    margin-top: 4px;
}

.page-stack {
    display: grid;
    gap: 14px;
}

/* Action Pills (3 buttons in a row + full-width results) */
.action-pills {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr) minmax(0, 1fr);
    gap: 10px;
    align-items: stretch;
    width: 100%;
    overflow: hidden;
}

.pill-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 999px;
    padding: 11px 12px;
    min-height: 64px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    white-space: normal;
    position: relative;
    overflow: hidden;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.pill-btn::before {
    content: "";
    position: absolute;
    inset: 1px 1px auto 1px;
    height: 52%;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255,255,255,0.28), rgba(255,255,255,0));
    pointer-events: none;
}

.pill-btn:hover {
    transform: translateY(-2px);
}

.pill-btn:active {
    transform: scale(0.97);
}

.pill-icon {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 16px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
}

.pill-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.05;
    position: relative;
    z-index: 1;
    min-width: 0;
    overflow: hidden;
}

.pill-title {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.01em;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pill-sub {
    font-size: 10px;
    font-weight: 600;
    opacity: 0.9;
    margin-top: 4px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pill-deposit {
    background: linear-gradient(135deg, #0f9f98, #2dd4bf);
    color: #fff;
    box-shadow: 0 10px 24px rgba(15, 159, 152, 0.26);
}

.pill-deposit .pill-icon {
    background: rgba(255,255,255,0.2);
    color: #fff6db;
}

.pill-bet {
    background: linear-gradient(135deg, #2563eb, #38bdf8);
    color: #fff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.26);
}

.pill-bet .pill-icon {
    background: rgba(255,255,255,0.18);
    color: #fff;
}

.pill-withdraw {
    background: linear-gradient(135deg, #1e3a8a, #155e75);
    color: #fff;
    box-shadow: 0 10px 24px rgba(30, 58, 138, 0.28);
}

.pill-withdraw .pill-icon {
    background: rgba(255,255,255,0.18);
    color: #f8fafc;
}

.pill-results-full {
    background: var(--theme-gradient-soft);
    color: #164e63;
    box-shadow: 0 10px 24px rgba(14, 116, 144, 0.16);
    width: 100%;
    padding: 14px 16px;
    justify-content: center;
    border: 1px solid rgba(37, 99, 235, 0.16);
}

.pill-results-full .pill-icon {
    background: var(--theme-gradient);
    color: #fff;
}

.pill-results-full .pill-copy {
    align-items: center;
    text-align: center;
}

.pill-results-full .pill-title {
    font-size: 16px;
}

.bank-brand-logo {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: #fff;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0;
    box-shadow: 0 10px 20px rgba(30, 99, 172, 0.16);
    overflow: hidden;
}

.bank-brand-logo span {
    display: block;
    padding: 0 6px;
    line-height: 1;
    text-align: center;
}

.bank-brand-image-wrap {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: #ffffff;
    box-shadow: 0 10px 20px rgba(30, 99, 172, 0.12);
    overflow: hidden;
}

.bank-brand-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.bank-brand-kbank { background: linear-gradient(135deg, #08a04b, #006a38); }
.bank-brand-ktb { background: linear-gradient(135deg, #24a6ff, #005bbb); }
.bank-brand-scb { background: linear-gradient(135deg, #6f2dbd, #4c1d95); }
.bank-brand-bbl { background: linear-gradient(135deg, #1b4db3, #12367b); }
.bank-brand-bay { background: linear-gradient(135deg, #f7c400, #d9a200); color: #243145; }
.bank-brand-ttb { background: linear-gradient(135deg, #f36f21, #0b4ea2); }
.bank-brand-gsb { background: linear-gradient(135deg, #ff4fa1, #cc2d7a); }
.bank-brand-baac { background: linear-gradient(135deg, #dc2626, #991b1b); }
.bank-brand-uob { background: linear-gradient(135deg, #e11d48, #1d4ed8); }
.bank-brand-cimb { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.bank-brand-lh { background: linear-gradient(135deg, #7c3aed, #4338ca); }
.bank-brand-kkp { background: linear-gradient(135deg, #7c3aed, #2f195f); }
.bank-brand-icbc { background: linear-gradient(135deg, #dc2626, #7f1d1d); }
.bank-brand-default { background: linear-gradient(135deg, #334155, #0f172a); }

@media (max-width: 420px) {
    .action-pills {
        gap: 8px;
    }

    .pill-btn {
        min-height: 60px;
        padding: 10px 7px;
        gap: 5px;
    }

    .pill-icon {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    .pill-title {
        font-size: 13px;
    }

    .pill-sub {
        font-size: 8px;
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid rgba(255,255,255,0.65);
    border-radius: 22px;
    padding: 14px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
}

.stat-card .icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
    color: var(--primary-strong);
    font-size: 18px;
    margin-bottom: 10px;
}

.stat-card .value {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.1;
}

.stat-card .label {
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.quick-actions .btn-action {
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 20px;
    padding: 14px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
    box-shadow: var(--shadow-sm);
}

.quick-actions .btn-action:hover {
    transform: translateY(-2px);
}

.quick-actions .btn-action i {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    background: rgba(255,255,255,0.18);
}

.btn-deposit { background: linear-gradient(135deg, #0f9f98, #2dd4bf); color: #fff; }
.btn-bet { background: linear-gradient(135deg, #2563eb, #38bdf8); color: #fff; }
.btn-withdraw { background: linear-gradient(135deg, #1e3a8a, #155e75); color: #fff; }
.btn-results { background: linear-gradient(135deg, #0284c7, #2dd4bf); color: #fff; }

.promo-card {
    border-radius: 24px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(255,255,255,0.92), rgba(255,255,255,0.76));
    box-shadow: var(--shadow-sm);
}

.carousel,
.carousel-inner,
.carousel-item {
    border-radius: inherit;
}

.promo-fallback {
    aspect-ratio: 2 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.3), transparent 30%),
        var(--theme-gradient);
    padding: 20px;
}

.promo-fallback i {
    font-size: 48px;
    margin-bottom: 8px;
}

.carousel-indicators {
    margin-bottom: 8px;
}

.carousel-indicators button {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.card-sl {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    background: var(--surface-strong);
}

.card-sl .card-header {
    background: var(--theme-gradient);
    color: #fff;
    font-weight: 700;
    border: none;
    padding: 10px 14px;
    font-size: 14px;
}

.form-control,
.form-select,
.input-group-text {
    border-radius: 14px;
    font-size: 14px;
    border-color: rgba(26, 26, 26, 0.12);
    min-height: 46px;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(37, 99, 235, 0.58);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.13);
}

.input-group > .form-control,
.input-group > .form-select {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group > .input-group-text {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    background: #fff;
}

.btn-primary {
    background: var(--theme-gradient);
    border: none;
    font-weight: 700;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
}

.btn-primary:hover { background: linear-gradient(135deg, var(--primary-strong), var(--primary)); }

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.24), transparent 24%),
        radial-gradient(circle at bottom right, rgba(45, 212, 191, 0.2), transparent 32%),
        linear-gradient(160deg, #1e3a8a 0%, #2563eb 24%, #0f9f98 42%, #edf8ff 42%, #e7f7f6 100%);
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 430px;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(255,255,255,0.72);
    border-radius: 30px;
    padding: 30px 22px;
    box-shadow: 0 25px 60px rgba(15, 67, 117, 0.2);
    backdrop-filter: blur(16px);
}

.auth-logo {
    text-align: center;
    margin-bottom: 20px;
}

.auth-logo-mark {
    width: 150px;
    height: 150px;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-logo-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 12px 18px rgba(12, 35, 96, 0.24));
}

.auth-logo i { font-size: 34px; color: #fff; }
.auth-logo h2 { font-weight: 800; color: var(--ink); margin-top: 6px; font-size: 24px; }

.auth-subtitle {
    color: var(--muted);
    font-size: 13px;
    margin-top: 6px;
}

.auth-support-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
}

.auth-support-actions a {
    min-height: 42px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    line-height: 1.1;
    padding: 9px 10px;
}

.auth-forgot-link {
    color: #1e3a8a;
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.18);
}

.auth-line-link {
    color: #fff;
    background: #06c755;
    box-shadow: 0 12px 24px rgba(6, 199, 85, 0.22);
}

.auth-support-actions i {
    font-size: 16px;
}

.alert-sl {
    border-radius: 16px;
    border: none;
    font-size: 13px;
    font-weight: 500;
    padding: 12px 14px;
}

.page-header {
    background: var(--theme-gradient);
    color: #fff;
    padding: 16px 18px;
    border-radius: 22px;
    box-shadow: var(--shadow-sm);
}

.page-header h4 {
    font-weight: 700;
    font-size: 16px;
    margin: 0;
}

.table-sl { font-size: 12px; }
.table-sl th { background: var(--primary); color: #fff; font-weight: 600; white-space: nowrap; font-size: 12px; }
.badge-deposit { background: var(--success); }
.badge-withdraw { background: var(--danger); }
.badge-bet { background: var(--primary); }
.badge-win { background: var(--accent); color: var(--ink); }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: #79b8cc; border-radius: 2px; }

@media (max-width: 380px) {
    .main-content {
        padding-top: 78px;
    }

    .hero-title {
        font-size: 21px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .guest-header-actions .btn {
        padding-inline: 10px;
    }
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
    .main-content { padding-bottom: calc(105px + env(safe-area-inset-bottom)); }
}
