/* ===== Reset ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #060610;
    --bg-2: #0c0c1d;
    --bg-card: rgba(14, 14, 35, 0.75);
    --bg-card-2: rgba(20, 20, 45, 0.6);
    --border: rgba(255, 255, 255, 0.06);
    --border-2: rgba(255, 255, 255, 0.1);
    --text: #eeeef5;
    --text-2: #9494b0;
    --text-3: #55557a;
    --accent: #6c5ce7;
    --accent-2: #a29bfe;
    --hot: #ff6b6b;
    --hot-bg: rgba(255, 107, 107, 0.1);
    --cold: #4ecdc4;
    --cold-bg: rgba(78, 205, 196, 0.1);
    --gold: #feca57;
    --gold-bg: rgba(254, 202, 87, 0.1);
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== BG Effects ===== */
.bg-grid {
    position: fixed;
    inset: 0;
    background-image: linear-gradient(rgba(108, 92, 231, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(108, 92, 231, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

.glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(150px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

.glow-1 {
    width: 600px;
    height: 600px;
    background: rgba(108, 92, 231, 0.08);
    top: -200px;
    right: -200px;
    animation: gFloat 20s ease-in-out infinite;
}

.glow-2 {
    width: 500px;
    height: 500px;
    background: rgba(255, 107, 107, 0.05);
    bottom: -200px;
    left: -200px;
    animation: gFloat 25s ease-in-out infinite reverse;
}

.glow-3 {
    width: 400px;
    height: 400px;
    background: rgba(78, 205, 196, 0.04);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: gFloat 18s ease-in-out infinite;
}

@keyframes gFloat {

    0%,
    100% {
        transform: translate(0, 0)
    }

    33% {
        transform: translate(40px, -40px)
    }

    66% {
        transform: translate(-30px, 30px)
    }
}

/* ===== Layout ===== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px 80px;
    position: relative;
    z-index: 1;
}

/* ===== Header ===== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 36px;
    flex-wrap: wrap;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 0 12px rgba(108, 92, 231, 0.4));
    animation: pulse-icon 3s ease-in-out infinite;
}

@keyframes pulse-icon {

    0%,
    100% {
        transform: scale(1)
    }

    50% {
        transform: scale(1.1)
    }
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: -1px;
}

.accent {
    background: linear-gradient(135deg, var(--accent), var(--hot));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-2);
    font-size: 0.85rem;
    margin-top: 2px;
}

.header-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 8px 18px;
    font-size: 0.8rem;
    color: var(--text-2);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: blink 1.5s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: 0.3
    }
}

/* ===== Loading ===== */
.loading-screen {
    text-align: center;
    padding: 120px 20px;
}

.loader {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
}

.loader-ring {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    animation: spin 1s linear infinite;
}

.loader-ring:nth-child(2) {
    animation-delay: 0.15s;
    border-top-color: var(--hot);
}

.loader-ring:nth-child(3) {
    animation-delay: 0.3s;
    border-top-color: var(--cold);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.loading-sub {
    color: var(--text-3);
    font-size: 0.85rem;
}

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 5px;
    margin-bottom: 28px;
    overflow-x: auto;
}

.tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    background: none;
    color: var(--text-3);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    white-space: nowrap;
}

.tab:hover {
    color: var(--text-2);
    background: rgba(255, 255, 255, 0.03);
}

.tab.active {
    color: var(--text);
    background: var(--accent);
    box-shadow: 0 4px 16px rgba(108, 92, 231, 0.3);
}

.tab-content {
    display: none;
    animation: fadeUp 0.4s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

/* ===== Section Header ===== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
}

.badge {
    background: linear-gradient(135deg, var(--accent), #8b7cf7);
    color: white;
    padding: 5px 16px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
}

.accent-badge {
    background: linear-gradient(135deg, #f093fb, var(--accent));
}

/* ===== Results Table ===== */
.results-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.results-table thead {
    background: rgba(108, 92, 231, 0.1);
}

.results-table th {
    padding: 14px 10px;
    text-align: center;
    font-weight: 600;
    color: var(--accent-2);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.results-table td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
}

.results-table tbody tr {
    transition: background var(--transition);
}

.results-table tbody tr:hover {
    background: rgba(108, 92, 231, 0.05);
}

.results-table .date-cell {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    color: var(--accent-2);
    white-space: nowrap;
}

.results-table .db-cell {
    color: var(--hot);
    font-weight: 700;
    font-size: 0.9rem;
}

.num-separator {
    color: var(--text-3);
    margin: 0 2px;
}

/* ===== Stat Cards ===== */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-card.hot {
    border-color: rgba(255, 107, 107, 0.15);
}

.stat-card.cold {
    border-color: rgba(78, 205, 196, 0.15);
}

.stat-card.streak {
    border-color: rgba(254, 202, 87, 0.15);
}

.stat-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 0.82rem;
    color: var(--text-2);
}

.stat-icon {
    font-size: 1.2rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 4px;
}

.stat-card.hot .stat-value {
    color: var(--hot);
}

.stat-card.cold .stat-value {
    color: var(--cold);
}

.stat-card.streak .stat-value {
    color: var(--gold);
}

.stat-desc {
    color: var(--text-3);
    font-size: 0.75rem;
}

/* ===== Stats Toggle ===== */
.stats-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px;
}

.toggle-btn {
    padding: 7px 16px;
    border: none;
    background: none;
    color: var(--text-3);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 7px;
    transition: all var(--transition);
}

.toggle-btn:hover {
    color: var(--text-2);
}

.toggle-btn.active {
    background: var(--accent);
    color: white;
}

/* ===== Charts ===== */
.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.chart-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.chart-container {
    position: relative;
    height: 320px;
}

.top-bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.text-hot {
    color: var(--hot);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.text-cold {
    color: var(--cold);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.num-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.num-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: var(--bg-card-2);
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

.num-item .num {
    font-weight: 700;
    min-width: 30px;
}

.num-item .count {
    color: var(--text-3);
    font-size: 0.78rem;
}

.num-item .bar {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 12px;
    overflow: hidden;
}

.num-item .bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.8s ease;
}

.num-item.hot .bar-fill {
    background: linear-gradient(90deg, var(--hot), #ff9f9f);
}

.num-item.cold .bar-fill {
    background: linear-gradient(90deg, var(--cold), #7ee8e0);
}

/* ===== Loto Grid ===== */
.loto-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 8px;
}

.loto-cell {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 8px;
    text-align: center;
    transition: all var(--transition);
}

.loto-cell:hover {
    border-color: var(--accent);
}

.loto-head {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--accent-2);
    margin-bottom: 8px;
    font-family: 'JetBrains Mono', monospace;
}

.loto-nums {
    font-size: 0.75rem;
    color: var(--text-2);
    line-height: 1.8;
    font-family: 'JetBrains Mono', monospace;
}

.loto-full-table-wrapper {
    overflow-x: auto;
    max-height: 500px;
    overflow-y: auto;
    border-radius: var(--radius-sm);
}

.loto-full-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.loto-full-table th,
.loto-full-table td {
    padding: 8px 6px;
    text-align: center;
    border: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
}

.loto-full-table thead th {
    background: rgba(108, 92, 231, 0.1);
    color: var(--accent-2);
    position: sticky;
    top: 0;
    z-index: 2;
}

.loto-full-table tbody td:first-child {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    color: var(--accent-2);
    position: sticky;
    left: 0;
    background: var(--bg-2);
    z-index: 1;
}

/* ===== Predictions ===== */
.predict-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(254, 202, 87, 0.06);
    border: 1px solid rgba(254, 202, 87, 0.15);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 24px;
    color: var(--gold);
    font-size: 0.82rem;
    line-height: 1.6;
}

.predict-disclaimer svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.predict-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.predict-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: all var(--transition);
}

.predict-card:hover {
    border-color: rgba(108, 92, 231, 0.3);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.predict-card.main-predict {
    grid-column: 1 / -1;
    border-color: rgba(108, 92, 231, 0.2);
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.08), rgba(255, 107, 107, 0.05));
}

.predict-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.predict-icon {
    font-size: 1.3rem;
}

.predict-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
}

.predict-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.predict-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent), #8b7cf7);
    border-radius: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
    transition: all var(--transition);
}

.predict-num:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.5);
}

.predict-num.hot {
    background: linear-gradient(135deg, var(--hot), #ff9f9f);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.predict-num.cold {
    background: linear-gradient(135deg, var(--cold), #7ee8e0);
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.3);
}

.predict-num.gold {
    background: linear-gradient(135deg, var(--gold), #ffdd59);
    color: #333;
    box-shadow: 0 4px 12px rgba(254, 202, 87, 0.3);
}

.predict-method {
    font-size: 0.75rem;
    color: var(--text-3);
    font-style: italic;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .container {
        padding: 24px 12px 60px;
    }

    .logo h1 {
        font-size: 1.4rem;
    }

    .tabs {
        gap: 2px;
    }

    .tab {
        padding: 10px 8px;
        font-size: 0.75rem;
        gap: 4px;
    }

    .tab svg {
        width: 14px;
        height: 14px;
    }

    .stat-cards {
        grid-template-columns: 1fr;
    }

    .loto-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .predict-grid {
        grid-template-columns: 1fr;
    }

    .top-bottom-grid {
        grid-template-columns: 1fr;
    }

    .results-table {
        font-size: 0.72rem;
    }
}