/* =========================
   POLYSOKO UI v3 — CLEAN + STRUCTURED
========================= */

:root {
    --bg: #070b10;
    --card: rgba(18, 24, 33, 0.72);
    --card-2: rgba(15, 20, 27, 0.6);

    --accent: #1d9bf0;
    --accent-dark: #0d6efd;

    --text: #e6edf3;
    --text-dim: #8b98a5;

    --border: rgba(31, 42, 55, 0.5);

    --yes: #00d084;
    --no: #ff4d4f33;

    --glow: rgba(29, 155, 240, 0.22);

    --glass-blur: 14px;
    --glass-border: rgba(255,255,255,0.06);

    --radius: 16px;
    --grad-green: linear-gradient(135deg, #00ff88, #00c96b);
--grad-red: linear-gradient(135deg, #ff4d4f, #d9363e);

--glow-green: 0 0 15px rgba(0,255,136,0.3);
--glow-red: 0 0 15px rgba(255,77,79,0.3);

--grad-blue: linear-gradient(135deg, #1d9bf0, #0d6efd);
}

/* =========================
   AUTH PAGES (LOGIN/REGISTER/RESET)
========================= */

.auth-page {
    background: radial-gradient(circle at center, #0d1117 0%, #070b10 100%) !important;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    font-family: 'Inter', sans-serif;
}

.login-experience {
    width: min(980px, 100%);
    min-height: 100vh;
    display: block;
    padding: 24px;
}

.login-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.login-brand {
    text-align: center;
    color: #e6edf3;
}

.login-brand img {
    width: 86px;
    height: 86px;
    border-radius: 18px;
    object-fit: cover;
    background: #fff;
    border: 1px solid rgba(255,255,255,0.18);
    margin-bottom: 12px;
}

.login-brand h1 {
    font-size: clamp(1.45rem, 3vw, 2.2rem);
    line-height: 1.1;
    color: #00ff88;
    margin: 0;
    animation: sloganBubble 2.8s ease-in-out infinite;
    text-shadow: 0 0 18px rgba(0, 255, 136, 0.35);
}

.auth-launcher {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 10020;
    min-height: 42px;
    border: 1px solid rgba(0, 255, 136, 0.38);
    border-radius: 8px;
    background: #00ff88;
    color: #050505;
    padding: 0 14px;
    font-size: 0.86rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
}

.auth-card-hidden {
    display: none !important;
}

@keyframes sloganBubble {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-4px) scale(1.025);
    }
}

.live-market-window {
    min-width: 0;
    width: min(100%, 760px);
    overflow: auto;
    border: 1px solid rgba(0, 255, 136, 0.18);
    border-radius: 8px;
    background: rgba(8, 13, 18, 0.88);
    padding: 18px;
}

.live-market-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.live-market-header h2 {
    margin: 0;
    color: #e6edf3;
    font-size: 1.25rem;
}

.guest-categories {
    padding-left: 0;
    padding-right: 0;
}

.guest-trending {
    margin-bottom: 12px;
}

.guest-market-list .market-card {
    cursor: pointer;
}

@media (max-width: 860px) {
    .auth-page {
        align-items: flex-start;
    }

    .login-experience {
        padding: 72px 16px 16px;
    }

    .live-market-window {
        max-height: none;
    }
}

.auth-card {
    background: #1a1b23;
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 255, 136, 0.05);
    padding: 40px 30px;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
}

.shake-highlight {
    animation: authShake 0.4s ease-in-out;
    border-color: #00ff88 !important;
    box-shadow: 0 0 40px rgba(0, 255, 136, 0.4) !important;
}
@keyframes authShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

.auth-card h2 {
    color: #00ff88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.8rem;
}

.auth-card input {
    margin-bottom: 15px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid #2d2e3a;
    background: #0b0c10;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.auth-card input:focus {
    border-color: #00ff88;
    box-shadow: 0 0 12px rgba(0, 255, 136, 0.15);
}

/* Auth card buttons (login & register) */
.btn-login,
.btn-reg,
.auth-card button {
    background: var(--grad-green);
    color: black;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-login:hover,
.btn-reg:hover,
.auth-card button:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-green);
}

.link-text { color: #8b98a5; cursor: pointer; text-align: center; margin-top: 15px; font-size: 0.9rem; }
.link-text span { color: #00ff88; font-weight: bold; }

/* =========================
   RESET
========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
}

/* =========================
   TOP HEADER (POLYSOKO FIXED)
========================= */

.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(7, 11, 16, 0.92);
    backdrop-filter: blur(18px);
    z-index: 100;
    width: 100%;
    box-sizing: border-box;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* HEADER SEARCH BAR */
.header-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 10px;
    z-index: 101;
}

.header-icon-btn {
    width: 42px;
    min-width: 42px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 255, 136, 0.28);
    border-radius: 8px;
    background: rgba(7, 11, 16, 0.88);
    color: #e6edf3;
    font-size: 0.76rem;
    font-weight: 800;
    cursor: pointer;
}

#headerSearch {
    width: 0;
    max-width: min(240px, 52vw);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 12px;
    padding: 0;
    color: white;
    font-size: 0.85rem;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.header-search-wrap.active #headerSearch {
    width: min(240px, 52vw);
    padding: 8px 12px;
    opacity: 1;
    pointer-events: auto;
}

#headerSearch:focus {
    border-color: #00ff88;
    background: rgba(0, 255, 136, 0.05);
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    opacity: 0.5;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 1px;
}

.assistant-chat-wrap {
    position: relative;
    margin-left: 6px;
}

.assistant-toggle {
    background: #00d1ff;
    border-color: #00d1ff;
    color: #020405;
    font-size: 1rem;
}

.assistant-panel {
    display: none;
    position: absolute;
    right: 0;
    top: 46px;
    width: min(380px, 92vw);
    background: #090d12;
    border: 1px solid rgba(0, 209, 255, 0.28);
    border-radius: 8px;
    z-index: 10010;
    color: #dce7f3;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}

@media (max-width: 560px) {
    .assistant-panel {
        position: fixed;
        left: 12px;
        right: 12px;
        top: 72px;
        width: auto;
    }

    .header-search-wrap.active {
        position: absolute;
        right: 12px;
        left: 12px;
        top: 60px;
        background: #070b10;
        padding: 8px;
        border: 1px solid rgba(0, 255, 136, 0.18);
        border-radius: 8px;
    }

    .header-search-wrap.active #headerSearch {
        width: 100%;
        max-width: none;
    }
}

.assistant-panel.active {
    display: block;
}

.assistant-head,
.assistant-tools,
.assistant-composer {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.assistant-head {
    justify-content: space-between;
}

.assistant-head strong {
    display: block;
    font-size: 0.95rem;
}

.assistant-head span {
    display: block;
    color: #8b98a5;
    font-size: 0.72rem;
    margin-top: 2px;
}

.assistant-engine-label {
    flex: 1;
    color: #00ff88;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.assistant-tools select,
.assistant-composer textarea {
    flex: 1;
    background: #0f141b;
    border: 1px solid #26313d;
    color: #fff;
    border-radius: 8px;
    padding: 9px 10px;
}

.assistant-mini-btn,
.assistant-composer button {
    border: 0;
    border-radius: 8px;
    padding: 9px 11px;
    cursor: pointer;
    font-weight: 800;
}

.assistant-mini-btn {
    background: #1b2430;
    color: #dce7f3;
}

.assistant-composer {
    border-bottom: 0;
}

.assistant-composer textarea {
    min-height: 38px;
    max-height: 92px;
    resize: vertical;
}

.assistant-composer button {
    background: #00d1ff;
    color: #020405;
}

.assistant-messages {
    height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px;
    background: #05080d;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scroll-behavior: smooth;
}

.assistant-messages::-webkit-scrollbar {
    width: 4px;
}
.assistant-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 209, 255, 0.25);
    border-radius: 999px;
}

.assistant-msg {
    max-width: 88%;
    margin-bottom: 0;
    padding: 6px 10px;
    border-radius: 14px;
    font-size: 0.72rem;
    line-height: 1.3;
    white-space: pre-wrap;
    word-break: break-word;
    animation: bubbleIn 0.2s ease-out;
}

@keyframes bubbleIn {
    from { opacity: 0; transform: translateY(6px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.assistant-msg-user {
    margin-left: auto;
    background: linear-gradient(135deg, #0f4238, #0a3530);
    color: #d4fff0;
    border-bottom-right-radius: 4px;
    border: 1px solid rgba(0, 255, 136, 0.15);
}

.assistant-msg-bot {
    margin-right: auto;
    background: linear-gradient(135deg, #111a25, #0d1520);
    color: #c8d6e5;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(0, 209, 255, 0.1);
}

.assistant-msg-error {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.25);
    color: #ffb7b7;
    font-size: 0.68rem;
    border-radius: 10px;
}

.assistant-msg-waiting {
    opacity: 0.5;
    font-style: italic;
    font-size: 0.68rem;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    object-fit: cover;
    background: #fff;
    border: 1px solid rgba(255,255,255,0.18);
}

/* PROFILE ICON (FIXED CLICK AREA) */
.profile-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    padding: 8px 12px;
    font-size: 0;

    border-radius: 10px;

    background: var(--card);
    border: 1px solid var(--border);

    color: var(--text);

    cursor: pointer;

    z-index: 10001;
}

.profile-trigger span {
    font-size: 0.85rem;
}

.admin-dashboard-chip {
    position: absolute;
    right: 18px;
    bottom: 18px;
    min-width: 78px;
    height: 38px;
    border: 1px solid rgba(0, 255, 136, 0.45);
    border-radius: 8px;
    background: #00ff88;
    color: #050505;
    font-size: 0.78rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(0, 255, 136, 0.18);
}

.admin-floating-btn {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 100050;
    min-width: 84px;
    height: 42px;
    border: 1px solid rgba(0, 255, 136, 0.45);
    border-radius: 8px;
    background: #00ff88;
    color: #050505;
    font-size: 0.8rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.2);
    background: #111;
}

/* =========================
   SIDEBAR (AUTOHIDE FIXED)
========================= */

#sidebar {
    position: fixed;
    top: 70px;
    left: 0;

    width: 260px;
    height: calc(100vh - 70px);

    background: var(--card);
    backdrop-filter: blur(var(--glass-blur));

    border-right: 1px solid var(--glass-border);

    transform: translateX(-100%);
    transition: 0.25s ease;

    z-index: 1002;

    overflow-y: auto;
}

#sidebar.active {
    transform: translateX(0);
}

/* overlay MUST exist or clicks break */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(6px);

    display: none;
    z-index: 1001;
}

.sidebar-overlay.active {
    display: block;
}

/* =========================
   MAIN LAYOUT
========================= */

main {
    margin-top: 70px;
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    background: transparent;
}

.dashboard-main {
    width: 100%;
    max-width: 100%;
    margin: 82px 0 0;
    padding: 12px;
}

.top-dashboard-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    width: 100%;
}

.balance-admin-row-wrapper {
    display: block;
    width: 100%;
    order: 2;
}

.greeting-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    order: 1;
    min-height: 92px;
    padding: 18px;
    justify-content: center;
    background: linear-gradient(135deg, rgba(18, 24, 33, 0.92), rgba(8, 13, 18, 0.82));
    border: 1px solid rgba(0, 255, 136, 0.14);
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
}

.greeting-text {
    font-size: 22px;
    font-weight: 600;
    opacity: 1;
    transform: translateY(15px);
}

.greeting-meta {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 4px;
    opacity: 1;
    transform: translateY(10px);
}

/* Row for Balance + Admin Button */
.balance-admin-container {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 12px;
    order: 2;
    width: 100%;
}

/* 🔥 Smooth entry */
.greeting-show .greeting-text {
    animation: fadeUp 0.6s ease forwards;
}

.greeting-show .greeting-meta {
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.2s;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* BALANCE */
.balance-card-dark {
    flex: 1 1 320px;
    min-width: 0;
    min-height: 78px;
    background: linear-gradient(135deg, #00ff88, #00c96b);
    border: 1px solid rgba(0, 255, 136, 0.4);
    border-radius: 8px;
    padding: 12px 14px;
    color: #020806;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    box-shadow: 0 8px 22px rgba(0, 255, 136, 0.18);
    position: relative;
    overflow: hidden;
}

.balance-copy {
    min-width: 0;
}

.balance-label {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(0, 0, 0, 0.66);
}

.balance-value {
    margin-top: 3px;
    font-size: clamp(1.28rem, 5vw, 1.8rem);
    font-weight: 900;
    line-height: 1;
    color: #020806;
    white-space: nowrap;
}

.balance-unit {
    font-size: 0.82rem;
    font-weight: 800;
}

.balance-actions {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}

.balance-action-btn {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    border: none;
    background: rgba(0, 0, 0, 0.14);
    color: #020806;
    font-size: 0.78rem;
    font-weight: 850;
    cursor: pointer;
}

.balance-action-btn:hover {
    background: rgba(0, 0, 0, 0.22);
}

.wallet-modal {
    position: fixed;
    inset: 0;
    z-index: 100002;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(5px);
}

.wallet-panel {
    width: min(390px, 100%);
    background: #121821;
    border: 1px solid rgba(0, 255, 136, 0.18);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.wallet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.wallet-header h3 {
    margin: 0;
    color: #e6edf3;
    font-size: 1rem;
}

.wallet-close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #8b98a5;
    cursor: pointer;
    font-size: 1rem;
}

.wallet-balance-card {
    flex: none;
    width: 100%;
    min-height: 118px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    padding: 18px;
}

.wallet-balance-card .balance-value {
    font-size: 2rem;
}

.wallet-balance-card .balance-actions {
    width: 100%;
    margin-top: 12px;
}

.wallet-balance-card .balance-action-btn {
    flex: 1;
}

/* HISTORY CARD (FIXED VISIBILITY) */
.history-card {
    order: 3;
    width: 100%;
    min-height: 46px;
    background: rgba(29, 155, 240, 0.08);
    border: 1px solid rgba(29,155,240,0.35);
    border-radius: 8px;
    padding: 0 18px;
    backdrop-filter: blur(var(--glass-blur));
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #00ff88;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.75rem;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.history-card:hover {
    background: rgba(0, 255, 136, 0.08);
    border-color: rgba(0, 255, 136, 0.45);
    transform: translateY(-1px);
}

.history-card-icon {
    font-size: 0.95rem;
    line-height: 1;
}

/* Special Admin Button styling */
#dashAdminBtn {
    position: static !important;
    flex-shrink: 0;
    width: 58px !important;
    height: 58px !important;
    align-self: center;
    aspect-ratio: 1 / 1;
    margin-left: 10px;
    border-radius: 18px !important;
}

.history-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 360px;
    height: 500px;
    max-height: 80vh;
    background: var(--card);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    backdrop-filter: blur(14px);
    box-shadow: 0 30px 80px rgba(0,0,0,0.6);
    display: none;
    z-index: 9999;
}

.history-container.active {
    display: flex;
}
.history-window {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.history-header {
    display: flex;
    gap: 6px;
    padding: 10px;
    border-bottom: 1px solid var(--glass-border);
}

.hist-tab {
    flex: 1;
    font-size: 12px;
    padding: 6px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    color: var(--text);
    cursor: pointer;
}

.hist-tab.active {
    background: var(--accent);
    color: white;
}

.bet-scroll-area {
    padding: 10px;
    overflow-y: auto;
    flex: 1;
}
.category-section {
    margin-top: 10px;
    margin-bottom: 10px;
}

.category-bar {
    display: flex;
    gap: 10px;

    overflow-x: auto;
    padding: 10px 0;
}
/* Container for the category row */
.category-filter-row {
    display: flex;
    gap: 10px;
    padding: 15px 5px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none; /* Firefox */
}

.category-filter-row::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Base Pill Style */
.pill {
    background: #1a1b23;
    color: #9ca3af;
    border: 1px solid #3f3f46;
    padding: 10px 20px;
    border-radius: 50px; /* Fully rounded pills */
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Hover State */
.pill:hover {
    background: #27272a;
    border-color: #71717a;
    color: white;
}

/* Active/Selected State */
.pill.active {
    background: #00ff88; /* Neon Green matched to your brand */
    color: #000;
    border-color: #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.sports-page {
    width: 100%;
}

.sports-page-header {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.sports-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.sports-category-card {
    min-height: 86px;
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 8px;
    background: #111820;
    color: #e6edf3;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 16px;
    text-align: left;
}

.sports-category-card span {
    font-size: 0.95rem;
    font-weight: 800;
}

.sports-category-card small {
    color: #8b98a5;
    margin-top: 6px;
}

.sports-category-card:hover {
    border-color: #00ff88;
    background: #14211f;
}

.sports-category-card.active {
    border-color: #00ff88;
    background: rgba(0, 255, 136, 0.12);
    box-shadow: 0 0 0 1px rgba(0, 255, 136, 0.15);
}

.tab-btn {
    padding: 10px 14px;

    border-radius: 14px;

    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);

    color: var(--text);

    white-space: nowrap;
    cursor: pointer;

    transition: 0.2s;
}

.tab-btn.active {
    background: var(--accent);
    border-color: var(--accent);
}


.trending-horizontal-scroll {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;

    gap: 12px;

    overflow-x: auto;
    overflow-y: hidden;

    padding: 8px 4px;

    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;

    scrollbar-width: none;
}

.trending-horizontal-scroll::-webkit-scrollbar {
    display: none;
}

/* CARD */
.ongoing-card {
    min-width: 220px;
    flex: 0 0 auto;

    background: var(--card);
    border: 1px solid var(--glass-border);
    border-radius: 14px;

    padding: 12px;

    scroll-snap-align: start;

    transition: 0.2s ease;
}

.ongoing-card:hover {
    transform: scale(1.03);
    border-color: var(--accent);
    box-shadow: 0 10px 30px rgba(29,155,240,0.2);
}
#marketsList {
    display: flex;
    flex-direction: column;
    gap: 16px; /* Space between the cards */
    padding-bottom: 50px;
}

/* The Section Label (US, GLOBAL, etc.) */
.section-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-dim);
    letter-spacing: 1.5px;
    padding-left: 5px;
    border-left: 3px solid var(--accent);
    margin-bottom: 8px;
}

/* The Card itself */
.market-card {
    width: 100%;
    background: var(--card);
    border-left: none;  /* Remove side borders for a cleaner mobile look */
    border-right: none; 
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-radius: 0; /* Square edges often look better for edge-to-edge mobile rows */
    padding: 16px 20px;
    margin-bottom: 8px; /* Space between rows */
    box-sizing: border-box;
    cursor: pointer;
}

@media (max-width: 760px) {
    .dashboard-main {
        margin-top: 82px;
        padding: 10px;
    }

    .top-dashboard-row {
        gap: 10px;
    }

    .greeting-wrapper {
        flex: 1 0 auto;
        min-height: 86px;
        padding: 16px;
    }

    .balance-card-dark {
        flex: 1;
        min-height: 72px;
        padding: 10px 12px;
    }

    .balance-actions {
        gap: 6px;
    }

    .balance-action-btn {
        min-height: 34px;
        padding: 0 10px;
        font-size: 0.72rem;
    }
}

.market-card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}
.main-content-wrapper {
    display: flex;
    flex-direction: row-reverse; /* Swaps the order: History on one side, Markets on the other */
    gap: 20px;
    padding: 0 20px;
    align-items: flex-start;
}

/* Container for your markets */
.markets-container {
    flex: 1; /* Takes up remaining space */
}

.market-card:hover {
    border-color: var(--accent);
}
.markets-vertical-stack {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 12px; /* optional breathing space */
}
/* =========================
   BET BUTTONS
========================= */
.betting-row {
    display: grid;
    grid-template-columns: 70px 1fr 1fr; /* Fixed width for input, split buttons */
    gap: 12px;
    margin-top: 15px;
    align-items: stretch;
}

.bet-amount {
    width: 100%;
    background: #ffffff;
    color: #000000;
    border: none;
    border-radius: 8px;
    padding: 10px 5px;
    font-weight: 900;
    text-align: center;
    font-size: 1rem;
}
.bet-card {
    background: #111827; /* Dark background matching your theme */
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    transition: transform 0.2s;
}

.bet-card:active {
    transform: scale(0.98);
}

.empty-state, .loading-state {
    text-align: center;
    padding: 40px 20px;
    color: #4b5563;
    font-style: italic;
}
/* Reusing your Betting Buttons from the last response */
.bet-btn {
    height: 44px;
    border-radius: 10px;
    border: none;
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
}

.btn-yes { background: var(--grad-green); color: white; box-shadow: var(--glow-green); }
.btn-no { background: var(--grad-red); color: white; box-shadow: var(--glow-red); }
/* =========================
   MODAL
========================= */

/* =========================
   ENHANCED RICH MODAL
========================= */

.modal-rich {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: flex-start;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(12px);
    padding: 20px 16px;
    overflow-y: auto;
    animation: fadeIn 0.3s ease-out;
}

.modal-rich.active {
    display: flex;
}

.modal-container {
    width: min(750px, 95vw);
    background: linear-gradient(135deg, rgba(18, 24, 33, 0.95) 0%, rgba(10, 15, 22, 0.98) 100%);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 20px;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.7),
        0 0 1px rgba(0, 255, 136, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    margin-top: 40px;
    margin-bottom: 40px;
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(0, 255, 136, 0.1);
    background: rgba(0, 255, 136, 0.05);
}

.modal-header-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #00ff88;
    letter-spacing: 0.3px;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.2);
}

.modal-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #888;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.modal-close-btn:hover {
    background: rgba(255, 77, 79, 0.3);
    border-color: #ff4d4f;
    color: #ff4d4f;
    transform: scale(1.05);
}

.modal-body-content {
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px;
    color: #e6edf3;
    font-size: 0.95rem;
    line-height: 1.6;
}

.modal-body-content::-webkit-scrollbar {
    width: 8px;
}

.modal-body-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.modal-body-content::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 136, 0.3);
    border-radius: 10px;
}

.modal-body-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 136, 0.5);
}

#richModal {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(12px);
    padding: 20px;
    overflow-y: auto;
}

/* News-specific modal enhancement */
.news-modal-content {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .modal-rich {
        padding: 12px 10px;
    }
    
    .modal-container {
        width: 100%;
        margin-top: 20px;
        margin-bottom: 20px;
        border-radius: 16px;
    }
    
    .modal-header-bar {
        padding: 14px 18px;
        font-size: 0.95rem;
    }
    
    .modal-body-content {
        padding: 18px;
        max-height: 75vh;
    }
}

.market-media {
    display: block;
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 16px;
    background: #050505;
}

.market-media-video {
    position: relative;
    aspect-ratio: 16 / 9;
    max-height: none;
    overflow: hidden;
}

.market-media-video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.market-live-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: 8px;
    margin: 14px 0;
}

.market-live-panel > div {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
}

.market-live-panel span {
    display: block;
    color: #71767b;
    font-size: 0.68rem;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.market-live-panel strong {
    color: white;
    font-size: 0.82rem;
}

.resolution-panel {
    background: rgba(255,255,255,0.035);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
}

.resolution-panel span {
    display: block;
    color: #71767b;
    font-size: 0.68rem;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.resolution-panel strong {
    color: white;
    font-size: 0.9rem;
}

.resolution-panel p {
    color: #cbd5e1;
    margin: 10px 0 6px;
    line-height: 1.45;
}

.resolution-panel small {
    color: #71767b;
}

/* =========================
   ACCOUNT OVERLAY
========================= */

.account-container {
    position: fixed;
    inset: 0;

    display: none;
    justify-content: center;
    align-items: center;

    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);

    z-index: 8000;
}

.account-container.active {
    display: flex;
}

/* =========================
   PROFILE CARD (MUST BE ABOVE HISTORY)
========================= */

.account-card {
    position: relative;
    z-index: 8001;
}

/* =========================
   LIVE DOT
========================= */

.live-dot {
    color: var(--accent);
}
.avatar-wrapper {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 0 auto;
}

.avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
    cursor: pointer;
}

/* ✏️ Edit button */
.avatar-edit {
    position: absolute;
    bottom: 0;
    right: 0;

    background: var(--accent);
    color: white;

    border-radius: 50%;
    padding: 6px;
    cursor: pointer;
    font-size: 12px;
}

/* Save / Cancel */
.avatar-actions {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);

    display: none;
    gap: 8px;
    margin-top: 8px;
}

.avatar-actions.active {
    display: flex;
}

.save-btn {
    background: var(--grad-blue);
    border: none;
    padding: 5px 10px;
    border-radius: 8px;
    color: white;
    cursor: pointer;
}

.cancel-btn {
    background: transparent;
    border: 1px solid var(--border);
    padding: 5px 10px;
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
}

.avatar-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 100060;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.86);
    padding: 24px;
}

.avatar-preview-card {
    width: min(92vw, 380px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.avatar-preview-card img {
    width: min(76vw, 320px);
    height: min(76vw, 320px);
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #00ff88;
    background: #111;
}

.avatar-preview-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.profile-field {
    font-size: 13px;
    color: var(--text-dim);
    margin: 4px 0;
}

.profile-edit-section {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-edit-section input {
    padding: 8px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: var(--card);
    color: var(--text);
}

.save-profile-btn {
    padding: 10px;
    border-radius: 10px;
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
}
/* Container for the Predictions sub-buttons */
.predictions-nav {
    -ms-overflow-style: none; /* Hide scrollbar for IE/Edge */
    scrollbar-width: none;    /* Hide scrollbar for Firefox */
}

.predictions-nav::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari */
}

/* Individual sub-tabs (Active, Won, Lost, etc) */
.sub-tab {
    background: #1f2029;
    color: #9ca3af;
    border: 1px solid #3f3f46;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.7rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.sub-tab.active {
    background: #00ff88;
    color: #000;
    font-weight: bold;
    border-color: #00ff88;
}

/* Prediction List constraints */
#predictions-list-view, #transaction-list-view {
    padding-bottom: 20px;
}
/* The main container for your history/transactions */
#bet-container {
    max-height: 450px; /* Adjust based on your modal height */
    overflow-y: auto;  /* Enables vertical scrolling */
    overflow-x: hidden;/* Prevents horizontal shifting */
    padding-right: 5px; /* Space for the scrollbar */
}

#bet-container::-webkit-scrollbar {
    width: 5px;
}

#bet-container::-webkit-scrollbar-track {
    background: #1a1b23;
}

#bet-container::-webkit-scrollbar-thumb {
    background: #3f3f46;
    border-radius: 10px;
}
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 6000;
}

.modal-content {
    background: #1a1b23;
    border: 1px solid #3f3f46;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    padding: 20px;
}

.premium-input {
    width: 100%;
    background: #0b0c10;
    border: 1px solid #3f3f46;
    padding: 12px;
    border-radius: 8px;
    color: white;
    margin: 15px 0;
    font-size: 1rem;
}

.premium-action-btn {
    width: 100%;
    background: #00ff88;
    color: black;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}
/* Ensure the modal is ALWAYS on top of the Profile/Account Center */
#withdrawModal {
    z-index: 99999 !important;
}

/* Matching the style of your other action buttons */
.account-actions .action-btn {
    flex: 1;
    padding: 12px;
    background: #1a1b23;
    border: 1px solid #3f3f46;
    border-radius: 10px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: #070b10; /* FORCE DARK BLUE */
    color: var(--text);
}
.team-abbr {
    width:30px; height:30px; background:#111; border-radius:4px;
    display:flex; align-items:center; justify-content:center;
    font-size:0.7rem; font-weight:bold; border: 1px solid #333; color: #888;
}

/* Compact header actions */
.mobile-header {
    gap: 8px;
}

.header-left {
    min-width: 0;
    flex: 1 1 auto;
}

.header-balance-btn,
.header-history-btn,
.notification-trigger,
#dashAdminBtn {
    position: relative;
    width: 42px;
    max-width: 42px;
    min-width: 42px;
    height: 38px;
    min-height: 38px;
    max-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 255, 136, 0.28);
    border-radius: 8px;
    background: rgba(7, 11, 16, 0.88);
    color: #e6edf3;
    font-size: 1rem;
    cursor: pointer;
    margin: 0;
    box-shadow: none;
    flex: 0 0 42px;
}

.header-balance-btn {
    border-color: rgba(0, 255, 136, 0.42);
    color: #00ff88;
}

.header-history-btn {
    border-color: rgba(29, 155, 240, 0.42);
    color: #8fcfff;
}

.header-balance-btn:hover,
.header-history-btn:hover,
.notification-trigger:hover,
.header-icon-btn:hover {
    background: rgba(0, 255, 136, 0.08);
}

#noteBadge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    font-size: 0.6rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

@media (max-width: 560px) {
    .mobile-header {
        padding: 12px 10px;
        gap: 6px;
    }

    .logo {
        font-size: 0;
    }

    .brand-mark {
        width: 30px;
        height: 30px;
    }

    .header-icon-btn,
    .header-balance-btn,
    .header-history-btn,
    .notification-trigger,
    #dashAdminBtn {
        width: 36px;
        max-width: 36px;
        min-width: 36px;
        height: 34px;
        min-height: 34px;
        max-height: 34px;
        flex-basis: 36px;
    }

    .profile-trigger {
        padding: 6px 8px;
    }

    .profile-trigger span {
        display: none;
    }
}
